Previous 15994 Revisions Next

r4879 Friday 29th May, 2009 at 11:20:26 UTC by Nathan Woods
Updated to MAME 0.131u3 core
[docs]messnew.txt
[src/build]file2str.c verinfo.c
[src/emu]cheat.c devintrf.c devintrf.h info.c inptport.c inptport.h mame.c memory.h uigfx.c validity.c
[src/emu/cpu/arm7]arm7core.c
[src/emu/cpu/h83002]h8_16.c h8_8.c h8disasm.c h8ops.h h8periph.c h8priv.h
[src/emu/cpu/m6800]m6800.c
[src/emu/cpu/m68000]m68kcpu.c m68kcpu.h
[src/emu/cpu/mb88xx]mb88xx.c mb88xx.h
[src/emu/cpu/pdp1]pdp1dasm.c
[src/emu/cpu/powerpc]ppc403.c
[src/emu/cpu/sh4]sh4.c
[src/emu/cpu/tms32025]tms32025.c
[src/emu/cpu/tms34010]34010fld.c
[src/emu/debug]express.c
[src/emu/machine]68681.c ldpr8210.c ldv1000.c ldvp931.c microtch.c rtc65271.c rtc65271.h scsi.c
[src/emu/sound]sound.mak ymf271.c
[src/emu/video]generic.c generic.h tlc34076.c tlc34076.h
[src/mame]mame.mak mamedriv.c
[src/mame/audio]cinemat.c galaga.c invinco.c namco52.c* namco52.h* namco54.c namco54.h namcoc7x.c polepos.c pulsar.c scramble.c snes.c taito_en.c taitosnd.c
[src/mame/drivers]1942.c 20pacgal.c 8080bw.c 86lions.c actfancr.c adp.c aeroboto.c aerofgt.c airbustr.c ajax.c albazg.c aleck64.c ambush.c aquarium.c arabian.c aristmk5.c arkanoid.c artmagic.c ashnojoe.c astrocorp.c astrof.c asuka.c atarifb.c atarisy2.c aztarac.c bagman.c baraduke.c battlnts.c bbusters.c beathead.c berzerk.c bfcobra.c bfm_sc1.c bfm_sc2.c bfmsys85.c bigfghtr.c bishi.c bishjan.c bladestl.c blktiger.c blmbycar.c blockhl.c blockout.c blstroid.c bnstars.c bombjack.c boogwing.c bottom9.c boxer.c btime.c btoads.c buggychl.c bzone.c cabal.c cave.c cheekyms.c chihiro.c chinsan.c chqflag.c combatsc.c commando.c cps1.c cps3.c crgolf.c crimfght.c cubocd32.c dec0.c deco32.c docastle.c dogfgt.c ertictac.c flkatck.c flstory.c galaga.c galaxian.c galpani2.c gaplus.c gberet.c gbusters.c gcpinbal.c gladiatr.c gng.c goindol.c goldstar.c gsword.c gticlub.c gunsmoke.c hexion.c higemaru.c hornet.c hvyunit.c jackal.c jailbrek.c jalmah.c jantotsu.c jpmimpct.c kangaroo.c konamigv.c konamim2.c ksys573.c lastduel.c liberate.c m14.c mappy.c maygayv1.c mazerbla.c mcr.c mcr3.c mcr68.c megadriv.c megasys1.c megatech.c mexico86.c midyunit.c mirage.c mirax.c mitchell.c mlanding.c model2.c model3.c mpu4.c namcos12.c namcos21.c namcos22.c namcos23.c naomi.c nemesis.c ninjakd2.c ninjaw.c nitedrvr.c nmk16.c nycaptor.c opwolf.c pacman.c pandoras.c parodius.c pcat_nit.c pgm.c pingpong.c polepos.c prehisle.c psattack.c quasar.c rabbit.c rainbow.c rohga.c roul.c royalmah.c runaway.c segas16a.c segas16b.c segas18.c senjyo.c seta2.c sf.c simpl156.c skimaxx.c skykid.c solomon.c spbactn.c speedbal.c spy.c sshangha.c ssrj.c stv.c suna8.c superqix.c suprgolf.c surpratk.c system1.c system16.c system18.c taito_z.c taitogn.c taitosj.c thunderx.c tigeroad.c tmnt.c tnzs.c toaplan2.c toypop.c trackfld.c triforce.c tryout.c tumbleb.c tumblep.c twin16.c twinkle.c* wc90.c wc90b.c yiear.c zn.c zodiack.c
[src/mame/etc]jrcrypt.c
[src/mame/includes]arkanoid.h dc.h galaxold.h konamipt.h megasys1.h namcos22.h
[src/mame/layout]connect4.lay polepos.lay
[src/mame/machine]balsente.c dc.c decoprot.c galaxold.c konppc.c mcr.c namco06.c* namco06.h* namco50.c namco50.h namco51.c* namco51.h* namco53.c* namco53.h* namcoio.c namcoio.h namcos2.c psx.c r2crypt.c scramble.c tait8741.c williams.c
[src/mame/video]arkanoid.c artmagic.c bbusters.c cheekyms.c cps1.c dc.c deco32.c gticlub.c hyprduel.c konamiic.c mcatadv.c megasys1.c midtunit.c model1.c n64.c namcos22.c ppu2c0x.c psx.c runaway.c sshangha.c stvvdp2.c system16.c taito_z.c thief.c tryout.c tubep.c tx1.c ygv608.c
[src/mess/drivers]apple3.c c128.c c16.c
[src/mess/includes]apple3.h c128.h
[src/mess/machine]apple3.c

src/build/verinfo.c
r4878r4879
248248
249249   // parse out version string
250250   if (parse_version(buffer, &v.version_major, &v.version_minor, &v.version_build, &v.version_string))
251   {
252      free(buffer);
253      fprintf(stderr, "Error parsing version from '%s'\n", buffer);
251254      return 1;
255   }
252256
253257   if (build == BUILD_MESS)
254258   {
src/build/file2str.c
r4878r4879
6262   buffer = (unsigned char *)malloc(bytes + 1);
6363   if (buffer == NULL)
6464   {
65      fclose(src);
6566      fprintf(stderr, "Out of memory allocating %d byte buffer\n", bytes);
6667      return 1;
6768   }
r4878r4879
7576   dst = fopen(dstfile, "w");
7677   if (dst == NULL)
7778   {
79      free(buffer);
7880      fprintf(stderr, "Unable to open output file '%s'\n", dstfile);
7981      return 1;
8082   }
src/mame/audio/invinco.c
r4878r4879
6868   static int port2State = 0;
6969   const device_config *samples = devtag_get_device(space->machine, "samples");
7070   int bitsChanged;
71   int bitsGoneHigh;
71   //int bitsGoneHigh;
7272   int bitsGoneLow;
7373
7474
7575   bitsChanged  = port2State ^ data;
76   bitsGoneHigh = bitsChanged & data;
76   //bitsGoneHigh = bitsChanged & data;
7777   bitsGoneLow  = bitsChanged & ~data;
7878
7979   port2State = data;
src/mame/audio/pulsar.c
r4878r4879
9090{
9191   const device_config *samples = devtag_get_device(space->machine, "samples");
9292   int bitsChanged;
93   int bitsGoneHigh;
93   //int bitsGoneHigh;
9494   int bitsGoneLow;
9595
9696
9797   bitsChanged  = port1State ^ data;
98   bitsGoneHigh = bitsChanged & data;
98   //bitsGoneHigh = bitsChanged & data;
9999   bitsGoneLow  = bitsChanged & ~data;
100100
101101   port1State = data;
src/mame/audio/snes.c
r4878r4879
243243int                     V;
244244#ifndef NO_ECHO
245245int                     echo_base;
246#endif
247246int                     echol;
248247int                     echor;
248#endif
249249int                     envx;
250250int                     m;
251251int                     outl;
r4878r4879
291291    }
292292outl  = 0;
293293outr  = 0;
294#ifndef NO_ECHO
294295echol = 0;
295296echor = 0;
297#endif
296298for( v = 0, m = 1, V = 0; v < 8; v++, V += 16, m <<= 1 )
297299    {
298300    vp = &voice_state[ v ];
r4878r4879
630632    outr += vr;
631633    if( DSPregs[ 0x4D ] & m )
632634        {
635#ifndef NO_ECHO
633636        echol += vl;
634637        echor += vr;
638#endif
635639        }
636640    }
637641outl = ( outl * ( signed char )DSPregs[ 0x0C ] ) >> 7;
src/mame/audio/cinemat.c
r4878r4879
15181518
15191519static void ctc_interrupt(const device_config *device, int state)
15201520{
1521   cpu_set_input_line(device->machine->cpu[1], 0, state);
1521   cputag_set_input_line(device->machine, "audiocpu", 0, state);
15221522}
15231523
15241524
r4878r4879
16101610
16111611static WRITE8_HANDLER( qb3_sound_w )
16121612{
1613   UINT16 rega = cpu_get_reg(space->machine->cpu[0], CCPU_A);
1613   UINT16 rega = cpu_get_reg(cputag_get_cpu(space->machine, "maincpu"), CCPU_A);
16141614   demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
16151615}
16161616
r4878r4879
16181618static MACHINE_RESET( qb3_sound )
16191619{
16201620   MACHINE_RESET_CALL(demon_sound);
1621   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, qb3_sound_w);
1621   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, qb3_sound_w);
16221622
16231623   /* this patch prevents the sound ROM from eating itself when command $0A is sent */
16241624   /* on a cube rotate */
src/mame/audio/namco52.c
r0r4879
1/***************************************************************************
2
3Namco 52XX
4
5This instance of the Fujitsu MB8843 MCU is programmed to act as a sample player.
6It is used by just two games: Bosconian and Pole Position.
7
8A0-A15 = address to read from sample ROMs
9D0-D7 = data freom sample ROMs
10CMD = command from CPU (sample to play, 0 = none)
11OUT = sound output
12
13      +------+
14 EXTAL|1   42|Vcc
15  XTAL|2   41|CMD3
16/RESET|3   40|CMD2
17  /IRQ|4   39|CMD1
18  n.c.|5   38|CMD0
19  [2] |6   37|A7
20  n.c.|7   36|A6
21  [1] |8   35|A5
22  OUT0|9   34|A4
23  OUT1|10  33|A3
24  OUT2|11  32|A2
25  OUT3|12  31|A1
26    A8|13  30|A0
27    A9|14  29|D7
28   A10|15  28|D6
29   A11|16  27|D5
30[3]A12|17  26|D4
31[3]A13|18  25|D3
32[3]A14|19  24|D2
33[3]A15|20  23|D1
34   GND|21  22|D0
35      +------+
36
37[1] in polepos, GND; in bosco, 4kHz output from a 555 timer
38[2] in polepos, +5V; in bosco, GND
39[3] in polepos, these are true address lines, in bosco they are chip select lines
40    (each one select one of the four ROM chips). Behaviour related to [2]
41
42
43CMD0-CMD3 -> K0-K3
44D0-D3     -> R0-R3
45D4-D7     -> R4-R7
46A0-A3     -> R8-R11
47A4-A7     -> R12-R15
48A8-A11    -> O0-O3
49A12-A15   -> O4-O7
50OUT0-OUT3 -> P0-P3
51/TC       -> [1]
52SI        -> [2]
53
54***************************************************************************/
55
56#include "driver.h"
57#include "namco52.h"
58#include "cpu/mb88xx/mb88xx.h"
59
60typedef struct _namco_52xx_state namco_52xx_state;
61struct _namco_52xx_state
62{
63   const device_config *cpu;
64   const device_config *discrete;
65   int basenode;
66   devcb_resolved_read8 romread;
67   devcb_resolved_read8 si;
68   UINT8 latched_cmd;
69   UINT32 address;
70};
71
72INLINE namco_52xx_state *get_safe_token(const device_config *device)
73{
74   assert(device != NULL);
75   assert(device->token != NULL);
76   assert(device->type == NAMCO_52XX);
77
78   return (namco_52xx_state *)device->token;
79}
80
81
82
83static TIMER_CALLBACK( namco_52xx_latch_callback )
84{
85   namco_52xx_state *state = get_safe_token((const device_config *)ptr);
86   state->latched_cmd = param;
87}
88
89static READ8_HANDLER( namco_52xx_K_r )
90{
91   namco_52xx_state *state = get_safe_token(space->cpu->owner);
92   return state->latched_cmd & 0x0f;
93}
94
95static READ8_HANDLER( namco_52xx_SI_r )
96{
97   namco_52xx_state *state = get_safe_token(space->cpu->owner);
98   return devcb_call_read8(&state->si, 0) ? 1 : 0;
99}
100
101static READ8_HANDLER( namco_52xx_R0_r )
102{
103   namco_52xx_state *state = get_safe_token(space->cpu->owner);
104   return devcb_call_read8(&state->romread, state->address) & 0x0f;
105}
106
107static READ8_HANDLER( namco_52xx_R1_r )
108{
109   namco_52xx_state *state = get_safe_token(space->cpu->owner);
110   return devcb_call_read8(&state->romread, state->address) >> 4;
111}
112
113
114static WRITE8_HANDLER( namco_52xx_P_w )
115{
116   namco_52xx_state *state = get_safe_token(space->cpu->owner);
117   discrete_sound_w(state->discrete, NAMCO_52XX_P_DATA(state->basenode), data & 0x0f);
118}
119
120static WRITE8_HANDLER( namco_52xx_R2_w )
121{
122   namco_52xx_state *state = get_safe_token(space->cpu->owner);
123   state->address = (state->address & 0xfff0) | ((data & 0xf) << 0);
124}
125
126static WRITE8_HANDLER( namco_52xx_R3_w )
127{
128   namco_52xx_state *state = get_safe_token(space->cpu->owner);
129   state->address = (state->address & 0xff0f) | ((data & 0xf) << 4);
130}
131
132static WRITE8_HANDLER( namco_52xx_O_w )
133{
134   namco_52xx_state *state = get_safe_token(space->cpu->owner);
135   if (data & 0x10)
136      state->address = (state->address & 0x0fff) | ((data & 0xf) << 12);
137   else
138      state->address = (state->address & 0xf0ff) | ((data & 0xf) << 8);
139}
140
141
142
143
144static TIMER_CALLBACK( namco_52xx_irq_clear )
145{
146   namco_52xx_state *state = get_safe_token((const device_config *)ptr);
147   cpu_set_input_line(state->cpu, 0, CLEAR_LINE);
148}
149
150WRITE8_DEVICE_HANDLER( namco_52xx_write )
151{
152   namco_52xx_state *state = get_safe_token(device);
153
154   timer_call_after_resynch(device->machine, (void *)device, data, namco_52xx_latch_callback);
155
156   cpu_set_input_line(state->cpu, 0, ASSERT_LINE);
157
158   // The execution time of one instruction is ~4us, so we must make sure to
159   // give the cpu time to poll the /IRQ input before we clear it.
160   // The input clock to the 06XX interface chip is 64H, that is
161   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
162   // asserted for one clock cycle ~= 21us.
163
164   /* the 52xx uses TSTI to check for an interrupt; it also may be handling
165       a timer interrupt, so we need to ensure the IRQ line is held long enough */
166   timer_set(device->machine, ATTOTIME_IN_USEC(5*21), (void *)device, 0, namco_52xx_irq_clear);
167}
168
169
170static TIMER_CALLBACK( external_clock_pulse )
171{
172   namco_52xx_state *state = get_safe_token((const device_config *)ptr);
173   mb88_external_clock_w(state->cpu, 1);
174   mb88_external_clock_w(state->cpu, 0);
175}
176
177
178/***************************************************************************
179    DEVICE INTERFACE
180***************************************************************************/
181
182ADDRESS_MAP_START( namco_52xx_map_io, ADDRESS_SPACE_IO, 8 )
183   AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_52xx_K_r)
184   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_52xx_O_w)
185   AM_RANGE(MB88_PORTP,  MB88_PORTP)  AM_WRITE(namco_52xx_P_w)
186   AM_RANGE(MB88_PORTSI, MB88_PORTSI) AM_READ(namco_52xx_SI_r)
187   AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_52xx_R0_r)
188   AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_READ(namco_52xx_R1_r)
189   AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_WRITE(namco_52xx_R2_w)
190   AM_RANGE(MB88_PORTR3, MB88_PORTR3) AM_WRITE(namco_52xx_R3_w)
191ADDRESS_MAP_END
192
193
194static MACHINE_DRIVER_START( namco_52xx )
195   MDRV_CPU_ADD("mcu", MB8843, DERIVED_CLOCK(1,1))      /* parent clock, internally divided by 6 */
196   MDRV_CPU_IO_MAP(namco_52xx_map_io)
197MACHINE_DRIVER_END
198
199
200ROM_START( namco_52xx )
201   ROM_REGION( 0x400, "mcu", ROMREGION_LOADBYNAME )
202   ROM_LOAD( "52xx.bin",     0x0000, 0x0400, CRC(3257d11e) SHA1(4883b2fdbc99eb7b9906357fcc53915842c2c186) )
203ROM_END
204
205
206/*-------------------------------------------------
207    device start callback
208-------------------------------------------------*/
209
210static DEVICE_START( namco_52xx )
211{
212   namco_52xx_interface *intf = (namco_52xx_interface *)device->static_config;
213   namco_52xx_state *state = get_safe_token(device);
214   astring *tempstring = astring_alloc();
215
216   /* find our CPU */
217   state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
218   assert(state->cpu != NULL);
219   astring_free(tempstring);
220
221   /* find the attached discrete sound device */
222   assert(intf->discrete != NULL);
223   state->discrete = devtag_get_device(device->machine, intf->discrete);
224   assert(state->discrete != NULL);
225   state->basenode = intf->firstnode;
226
227   /* resolve our read/write callbacks */
228   devcb_resolve_read8(&state->romread, &intf->romread, device);
229   devcb_resolve_read8(&state->si, &intf->si, device);
230
231   /* start the external clock */
232   if (intf->extclock != 0)
233      timer_pulse(device->machine, attotime_make(0, intf->extclock), (void *)device, 0, external_clock_pulse);
234}
235
236
237/*-------------------------------------------------
238    device reset callback
239-------------------------------------------------*/
240
241static DEVICE_RESET( namco_52xx )
242{
243//  namco_52xx_state *state = get_safe_token(device);
244}
245
246
247/*-------------------------------------------------
248    device get info callback
249-------------------------------------------------*/
250
251DEVICE_GET_INFO( namco_52xx )
252{
253   switch (state)
254   {
255      /* --- the following bits of info are returned as 64-bit signed integers --- */
256      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(namco_52xx_state);            break;
257      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
258
259      /* --- the following bits of info are returned as pointers --- */
260      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(namco_52xx);         break;
261      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(namco_52xx); break;
262
263      /* --- the following bits of info are returned as pointers to data or functions --- */
264      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(namco_52xx);    break;
265      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(namco_52xx);    break;
266
267      /* --- the following bits of info are returned as NULL-terminated strings --- */
268      case DEVINFO_STR_NAME:               strcpy(info->s, "Namco 52xx");               break;
269      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Namco I/O");               break;
270      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
271      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
272      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
273   }
274}
src/mame/audio/namco54.c
r4878r4879
5252#include "namco54.h"
5353#include "cpu/mb88xx/mb88xx.h"
5454
55typedef struct _namco_54xx_state namco_54xx_state;
56struct _namco_54xx_state
57{
58   const device_config *cpu;
59   const device_config *discrete;
60   int basenode;
61   UINT8 latched_cmd;
62};
5563
56static UINT8 latched_cmd;
64INLINE namco_54xx_state *get_safe_token(const device_config *device)
65{
66   assert(device != NULL);
67   assert(device->token != NULL);
68   assert(device->type == NAMCO_54XX);
5769
70   return (namco_54xx_state *)device->token;
71}
72
73
74
5875static TIMER_CALLBACK( namco_54xx_latch_callback )
5976{
60   latched_cmd = param;
77   namco_54xx_state *state = get_safe_token((const device_config *)ptr);
78   state->latched_cmd = param;
6179}
6280
6381static READ8_HANDLER( namco_54xx_K_r )
6482{
65   return latched_cmd >> 4;
83   namco_54xx_state *state = get_safe_token(space->cpu->owner);
84   return state->latched_cmd >> 4;
6685}
6786
6887static READ8_HANDLER( namco_54xx_R0_r )
6988{
70   return latched_cmd & 0x0f;
89   namco_54xx_state *state = get_safe_token(space->cpu->owner);
90   return state->latched_cmd & 0x0f;
7191}
7292
7393
74static WRITE8_DEVICE_HANDLER( namco_54xx_O_w )
94static WRITE8_HANDLER( namco_54xx_O_w )
7595{
96   namco_54xx_state *state = get_safe_token(space->cpu->owner);
7697   UINT8 out = (data & 0x0f);
7798   if (data & 0x10)
78      discrete_sound_w(device, NAMCO_54XX_1_DATA, out);
99      discrete_sound_w(state->discrete, NAMCO_54XX_1_DATA(state->basenode), out);
79100   else
80      discrete_sound_w(device, NAMCO_54XX_0_DATA, out);
101      discrete_sound_w(state->discrete, NAMCO_54XX_0_DATA(state->basenode), out);
81102}
82103
83static WRITE8_DEVICE_HANDLER( namco_54xx_R1_w )
104static WRITE8_HANDLER( namco_54xx_R1_w )
84105{
106   namco_54xx_state *state = get_safe_token(space->cpu->owner);
85107   UINT8 out = (data & 0x0f);
86108
87   discrete_sound_w(device, NAMCO_54XX_2_DATA, out);
109   discrete_sound_w(state->discrete, NAMCO_54XX_2_DATA(state->basenode), out);
88110}
89111
90112
91113
92ADDRESS_MAP_START( namco_54xx_map_program, ADDRESS_SPACE_PROGRAM, 8 )
93   AM_RANGE(0x000, 0x3ff) AM_ROM
94ADDRESS_MAP_END
95114
96ADDRESS_MAP_START( namco_54xx_map_data, ADDRESS_SPACE_DATA, 8 )
97   AM_RANGE(0x00, 0x3f) AM_RAM
98ADDRESS_MAP_END
115static TIMER_CALLBACK( namco_54xx_irq_clear )
116{
117   namco_54xx_state *state = get_safe_token((const device_config *)ptr);
118   cpu_set_input_line(state->cpu, 0, CLEAR_LINE);
119}
99120
121WRITE8_DEVICE_HANDLER( namco_54xx_write )
122{
123   namco_54xx_state *state = get_safe_token(device);
124
125   timer_call_after_resynch(device->machine, (void *)device, data, namco_54xx_latch_callback);
126
127   cpu_set_input_line(state->cpu, 0, ASSERT_LINE);
128
129   // The execution time of one instruction is ~4us, so we must make sure to
130   // give the cpu time to poll the /IRQ input before we clear it.
131   // The input clock to the 06XX interface chip is 64H, that is
132   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
133   // asserted for one clock cycle ~= 21us.
134   timer_set(device->machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear);
135}
136
137
138/***************************************************************************
139    DEVICE INTERFACE
140***************************************************************************/
141
100142ADDRESS_MAP_START( namco_54xx_map_io, ADDRESS_SPACE_IO, 8 )
101143   AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_54xx_K_r)
102   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_DEVWRITE("discrete", namco_54xx_O_w)
144   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_54xx_O_w)
103145   AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_54xx_R0_r)
104   AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_DEVWRITE("discrete", namco_54xx_R1_w)
146   AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_WRITE(namco_54xx_R1_w)
105147   AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_NOP
106148ADDRESS_MAP_END
107149
108150
151static MACHINE_DRIVER_START( namco_54xx )
152   MDRV_CPU_ADD("mcu", MB8844, DERIVED_CLOCK(1,1))      /* parent clock, internally divided by 6 */
153   MDRV_CPU_IO_MAP(namco_54xx_map_io)
154MACHINE_DRIVER_END
109155
110static TIMER_CALLBACK( namco_54xx_irq_clear )
156
157ROM_START( namco_54xx )
158   ROM_REGION( 0x400, "mcu", ROMREGION_LOADBYNAME )
159   ROM_LOAD( "54xx.bin",     0x0000, 0x0400, CRC(ee7357e0) SHA1(01bdf984a49e8d0cc8761b2cc162fd6434d5afbe) )
160ROM_END
161
162
163/*-------------------------------------------------
164    device start callback
165-------------------------------------------------*/
166
167static DEVICE_START( namco_54xx )
111168{
112   const device_config *device = (const device_config *)ptr;
113   cpu_set_input_line(device, 0, CLEAR_LINE);
169   namco_54xx_config *config = (namco_54xx_config *)device->inline_config;
170   namco_54xx_state *state = get_safe_token(device);
171   astring *tempstring = astring_alloc();
172
173   /* find our CPU */
174   state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
175   assert(state->cpu != NULL);
176   astring_free(tempstring);
177
178   /* find the attached discrete sound device */
179   assert(config->discrete != NULL);
180   state->discrete = devtag_get_device(device->machine, config->discrete);
181   assert(state->discrete != NULL);
182   state->basenode = config->firstnode;
114183}
115184
116void namco_54xx_write(running_machine *machine, UINT8 data)
185
186/*-------------------------------------------------
187    device reset callback
188-------------------------------------------------*/
189
190static DEVICE_RESET( namco_54xx )
117191{
118   const device_config *device = cputag_get_cpu(machine, CPUTAG_54XX);
192//  namco_54xx_state *state = get_safe_token(device);
193}
119194
120   if (device == NULL)
121      return;
122195
123   timer_call_after_resynch(machine, NULL, data, namco_54xx_latch_callback);
196/*-------------------------------------------------
197    device get info callback
198-------------------------------------------------*/
124199
125   cpu_set_input_line(device, 0, ASSERT_LINE);
200DEVICE_GET_INFO( namco_54xx )
201{
202   switch (state)
203   {
204      /* --- the following bits of info are returned as 64-bit signed integers --- */
205      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(namco_54xx_state);            break;
206      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = sizeof(namco_54xx_config);         break;
207      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
126208
127   // The execution time of one instruction is ~4us, so we must make sure to
128   // give the cpu time to poll the /IRQ input before we clear it.
129   // The input clock to the 06XX interface chip is 64H, that is
130   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
131   // asserted for one clock cycle ~= 21us.
132   timer_set(machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear);
209      /* --- the following bits of info are returned as pointers --- */
210      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(namco_54xx);         break;
211      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(namco_54xx); break;
212
213      /* --- the following bits of info are returned as pointers to data or functions --- */
214      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(namco_54xx);    break;
215      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(namco_54xx);    break;
216
217      /* --- the following bits of info are returned as NULL-terminated strings --- */
218      case DEVINFO_STR_NAME:               strcpy(info->s, "Namco 54xx");               break;
219      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Namco I/O");               break;
220      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
221      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
222      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
223   }
133224}
src/mame/audio/namco52.h
r0r4879
1#ifndef NAMCO52_H
2#define NAMCO52_H
3
4#include "sound/discrete.h"
5#include "devcb.h"
6
7
8typedef struct _namco_52xx_interface namco_52xx_interface;
9struct _namco_52xx_interface
10{
11   const char *   discrete;   /* name of the discrete sound device */
12   int            firstnode;   /* index of the first node */
13   attoseconds_t   extclock;   /* external clock period */
14   devcb_read8      romread;   /* ROM read handler */
15   devcb_read8    si;         /* SI (pin 6) read handler */
16};
17
18
19#define MDRV_NAMCO_52XX_ADD(_tag, _clock, _interface) \
20   MDRV_DEVICE_ADD(_tag, NAMCO_52XX, _clock) \
21   MDRV_DEVICE_CONFIG(_interface)
22
23#define MDRV_NAMCO_52XX_REMOVE(_tag) \
24   MDRV_DEVICE_REMOVE(_tag)
25
26
27WRITE8_DEVICE_HANDLER( namco_52xx_write );
28
29
30/* device get info callback */
31#define NAMCO_52XX DEVICE_GET_INFO_NAME(namco_52xx)
32DEVICE_GET_INFO( namco_52xx );
33
34
35/* discrete nodes */
36#define NAMCO_52XX_P_DATA(base)      (base)
37
38
39#endif   /* NAMCO52_H */
src/mame/audio/namco54.h
r4878r4879
33
44#include "sound/discrete.h"
55
6#define CPUTAG_54XX "54xx"
76
8ADDRESS_MAP_EXTERN( namco_54xx_map_program, 8 );
9ADDRESS_MAP_EXTERN( namco_54xx_map_data, 8 );
10ADDRESS_MAP_EXTERN( namco_54xx_map_io, 8 );
7typedef struct _namco_54xx_config namco_54xx_config;
8struct _namco_54xx_config
9{
10   const char *discrete;   /* name of the discrete sound device */
11   int         firstnode;   /* index of the first node */
12};
1113
12void namco_54xx_write(running_machine *machine, UINT8 data);
1314
15#define MDRV_NAMCO_54XX_ADD(_tag, _clock, _discrete, _firstnode) \
16   MDRV_DEVICE_ADD(_tag, NAMCO_54XX, _clock) \
17   MDRV_DEVICE_CONFIG_DATAPTR(namco_54xx_config, discrete, _discrete) \
18   MDRV_DEVICE_CONFIG_DATA32(namco_54xx_config, firstnode, _firstnode)
19
20#define MDRV_NAMCO_54XX_REMOVE(_tag) \
21   MDRV_DEVICE_REMOVE(_tag)
22
23
24WRITE8_DEVICE_HANDLER( namco_54xx_write );
25
26
27/* device get info callback */
28#define NAMCO_54XX DEVICE_GET_INFO_NAME(namco_54xx)
29DEVICE_GET_INFO( namco_54xx );
30
31
1432/* discrete nodes */
15#define NAMCO_54XX_0_DATA      NODE_01
16#define NAMCO_54XX_1_DATA      NODE_02
17#define NAMCO_54XX_2_DATA      NODE_03
18#define NAMCO_52XX_P_DATA      NODE_04
33#define NAMCO_54XX_0_DATA(base)      (NODE_RELATIVE(base, 0))
34#define NAMCO_54XX_1_DATA(base)      (NODE_RELATIVE(base, 1))
35#define NAMCO_54XX_2_DATA(base)      (NODE_RELATIVE(base, 2))
36#define NAMCO_54XX_P_DATA(base)      (NODE_RELATIVE(base, 3))
1937
38
2039#endif   /* NAMCO54_H */
src/mame/audio/taitosnd.c
r4878r4879
4444{
4545   if ( tc0140syt.nmi_req && tc0140syt.nmi_enabled )
4646   {
47      cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
47      cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
4848      tc0140syt.nmi_req = 0;
4949   }
5050}
r4878r4879
9898//#endif
9999         /* this does a hi-lo transition to reset the sound cpu */
100100         if (data)
101            cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
101            cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
102102         else
103103         {
104            cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
104            cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
105105                cpu_spin(space->cpu); /* otherwise no sound in driftout */
106106            }
107107         break;
src/mame/audio/taito_en.c
r4878r4879
7171static TIMER_CALLBACK( taito_en_timer_callback )
7272{
7373   /* Only cause IRQ if the mask is set to allow it */
74   if (m68681_imr&8) {
75      cpu_set_input_line_vector(machine->cpu[1], 6, vector_reg);
76      cpu_set_input_line(machine->cpu[1], 6, ASSERT_LINE);
77      imr_status|=0x8;
74   if (m68681_imr & 0x08)
75   {
76      cpu_set_input_line_vector(cputag_get_cpu(machine, "audiocpu"), 6, vector_reg);
77      cputag_set_input_line(machine, "audiocpu", 6, ASSERT_LINE);
78      imr_status |= 0x08;
7879   }
7980}
8081
r4878r4879
8586
8687READ16_HANDLER(f3_68681_r)
8788{
88   if (offset==0x5) {
89      int ret=imr_status;
90      imr_status=0;
89   if (offset == 0x05)
90   {
91      int ret = imr_status;
92      imr_status = 0;
9193      return ret;
9294   }
9395
94   if (offset==0xe)
96   if (offset == 0x0e)
9597      return 1;
9698
9799   /* IRQ ack */
98   if (offset==0xf) {
99      cpu_set_input_line(space->machine->cpu[1], 6, CLEAR_LINE);
100   if (offset == 0x0f)
101   {
102      cputag_set_input_line(space->machine, "audiocpu", 6, CLEAR_LINE);
100103      return 0;
101104   }
102105
r4878r4879
259262
260263   /* reset CPU to catch any banking of startup vectors */
261264   device_reset(cputag_get_cpu(machine, "audiocpu"));
262   //cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE);
265   //cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
263266}
264267
265268const es5505_interface es5505_taito_f3_config =
r4878r4879
268271   "ensoniq.0",   /* Bank 1: All games seem to use this */
269272   NULL /* irq */
270273};
271
272
273
274
275
src/mame/audio/namcoc7x.c
r4878r4879
8888   memset(pROM, 0, 4);
8989
9090   // install speedup cheat
91   for (cpu = machine->cpu[0]; cpu != NULL; cpu = cpu->typenext)
91   for (cpu = cputag_get_cpu(machine, "maincpu"); cpu != NULL; cpu = cpu->typenext)
9292      if (cpu_get_type(cpu) == CPU_M37702)
9393         memory_install_readwrite16_handler(cpu_get_address_space(cpu, ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w);
9494}
src/mame/audio/scramble.c
r4878r4879
7878   return frogger_timer[(cputag_get_total_cycles(device->machine, "audiocpu")/512) % 10];
7979}
8080
81
8281WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
8382{
8483   /* the complement of bit 3 is connected to the flip-flop's clock */
r4878r4879
8988   sound_global_enable(~data & 0x10);
9089}
9190
92WRITE8_HANDLER( sfx_sh_irqtrigger_w )
93{
94   /* bit 1 is connected to the flip-flop's clock */
95   TTL7474_clock_w(3, data & 0x01);
96   TTL7474_update(space->machine, 3);
97}
98
9991WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
10092{
10193   /* the complement of bit 3 is connected to the flip-flop's clock */
r4878r4879
110102   TTL7474_update(space->machine, 2);
111103}
112104
113
114105static IRQ_CALLBACK(scramble_sh_irq_callback)
115106{
116107   /* interrupt acknowledge clears the flip-flop --
r4878r4879
125116   return 0xff;
126117}
127118
128static IRQ_CALLBACK(sfx_sh_irq_callback)
129{
130   /* interrupt acknowledge clears the flip-flop --
131       we need to pulse the CLR line because MAME's core never clears this
132       line, only asserts it */
133   TTL7474_clear_w(3, 0);
134   TTL7474_update(device->machine, 3);
135
136   TTL7474_clear_w(3, 1);
137   TTL7474_update(device->machine, 3);
138
139   return 0xff;
140}
141
142
143119static void scramble_sh_7474_callback(running_machine *machine)
144120{
145121   /* the Q bar is connected to the Z80's INT line.  But since INT is complemented, */
146122   /* we need to complement Q bar */
147   cpu_set_input_line(machine->cpu[1], 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE);
123   cputag_set_input_line(machine, "audiocpu", 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE);
148124}
149125
150static void sfx_sh_7474_callback(running_machine *machine)
151{
152   /* the Q bar is connected to the Z80's INT line.  But since INT is complemented, */
153   /* we need to complement Q bar */
154   cpu_set_input_line(machine->cpu[2], 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE);
155}
156
157126WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
158127{
159   cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE);
128   cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
160129}
161130
162131READ8_DEVICE_HANDLER( hotshock_soundlatch_r )
163132{
164   cpu_set_input_line(device->machine->cpu[1], 0, CLEAR_LINE);
165   return soundlatch_r(cpu_get_address_space(device->machine->cpu[1], ADDRESS_SPACE_PROGRAM),0);
133   cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
134   return soundlatch_r(cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM),0);
166135}
167136
168137static void filter_w(const device_config *device, int data)
r4878r4879
196165   filter_w(devtag_get_device(space->machine, "filter.0.2"), (offset >> 10) & 3);
197166}
198167
199
200168static const struct TTL7474_interface scramble_sh_7474_intf =
201169{
202170   scramble_sh_7474_callback
203171};
204172
205static const struct TTL7474_interface sfx_sh_7474_intf =
206{
207   sfx_sh_7474_callback
208};
209
210
211173void scramble_sh_init(running_machine *machine)
212174{
213   cpu_set_irq_callback(machine->cpu[1], scramble_sh_irq_callback);
175   cpu_set_irq_callback(cputag_get_cpu(machine, "audiocpu"), scramble_sh_irq_callback);
214176
215177   TTL7474_config(machine, 2, &scramble_sh_7474_intf);
216178
r4878r4879
218180   TTL7474_d_w(2, 1);
219181}
220182
221void sfx_sh_init(running_machine *machine)
222{
223   cpu_set_irq_callback(machine->cpu[2], sfx_sh_irq_callback);
224183
225   TTL7474_config(machine, 3, &sfx_sh_7474_intf);
226
227   /* PR is always 0, D is always 1 */
228   TTL7474_d_w(3, 1);
229}
230
231
232184/***************************************************************************
233185    AD2083 TMS5110 implementation (still wrong!)
234186
src/mame/audio/galaga.c
r4878r4879
44****************************************************************************/
55
66#include "driver.h"
7#include "namco52.h"
78#include "namco54.h"
89#include "galaga.h"
910
r4878r4879
129130   /************************************************
130131     * Input register mapping
131132     ************************************************/
132   DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA)
133   DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA)
134   DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA)
135   DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA)
133   DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA(NODE_01))
134   DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA(NODE_01))
135   DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA(NODE_01))
136   DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA(NODE_04))
136137
137138   /************************************************
138139     * CHANL1 sound
139140     ************************************************/
140141   DISCRETE_DAC_R1(NODE_20,
141142               1,         /* ENAB */
142               NAMCO_54XX_2_DATA,
143               NAMCO_54XX_2_DATA(NODE_01),
143144               4,         /* 4V - unmeasured*/
144145               &bosco_54xx_dac)
145146   DISCRETE_OP_AMP_FILTER(BOSCO_CHANL1_SND,
r4878r4879
153154     ************************************************/
154155   DISCRETE_DAC_R1(NODE_30,
155156               1,         /* ENAB */
156               NAMCO_54XX_1_DATA,
157               NAMCO_54XX_1_DATA(NODE_01),
157158               4,         /* 4V - unmeasured*/
158159               &bosco_54xx_dac)
159160   DISCRETE_OP_AMP_FILTER(BOSCO_CHANL2_SND,
r4878r4879
167168     ************************************************/
168169   DISCRETE_DAC_R1(NODE_40,
169170               1,         /* ENAB */
170               NAMCO_54XX_0_DATA,
171               NAMCO_54XX_0_DATA(NODE_01),
171172               4,         /* 4V - unmeasured*/
172173               &bosco_54xx_dac)
173174   DISCRETE_OP_AMP_FILTER(BOSCO_CHANL3_SND,
r4878r4879
179180   /************************************************
180181     * CHANL4 sound
181182     ************************************************/
182   /* disabled until 52XX is emulated */
183183   /* this circuit was simulated in SPICE and an equivalent filter circuit generated */
184184   DISCRETE_DAC_R1(NODE_50,
185               0,         /* ENAB */
186               NAMCO_52XX_P_DATA,
185               1,         /* ENAB */
186               NAMCO_52XX_P_DATA(NODE_04),
187187               4,         /* 4V - unmeasured*/
188188               &bosco_52xx_dac)
189189   DISCRETE_FILTER2(NODE_51,
190               0,         /* ENAB */
190               1,         /* ENAB */
191191               NODE_50,   /* INP0 */
192192               80,         /* FREQ */
193193               1.0 / 0.3,   /* DAMP */
194194               DISC_FILTER_HIGHPASS)
195195   DISCRETE_FILTER2(NODE_52,
196               0,         /* ENAB */
196               1,         /* ENAB */
197197               NODE_51,   /* INP0 */
198198               2400,      /* FREQ */
199199               1.0 / 0.9,   /* DAMP */
r4878r4879
314314   /************************************************
315315     * Input register mapping
316316     ************************************************/
317   DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA)
318   DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA)
319   DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA)
317   DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA(NODE_01))
318   DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA(NODE_01))
319   DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA(NODE_01))
320320
321321   /************************************************
322322     * CHANL1 sound
323323     ************************************************/
324324   DISCRETE_DAC_R1(NODE_20,
325325               1,         /* ENAB */
326               NAMCO_54XX_2_DATA,
326               NAMCO_54XX_2_DATA(NODE_01),
327327               4,         /* 4V - unmeasured*/
328328               &galaga_54xx_dac)
329329   DISCRETE_OP_AMP_FILTER(GALAGA_CHANL1_SND,
r4878r4879
337337     ************************************************/
338338   DISCRETE_DAC_R1(NODE_30,
339339               1,         /* ENAB */
340               NAMCO_54XX_1_DATA,
340               NAMCO_54XX_1_DATA(NODE_01),
341341               4,         /* 4V - unmeasured*/
342342               &galaga_54xx_dac)
343343   DISCRETE_OP_AMP_FILTER(GALAGA_CHANL2_SND,
r4878r4879
351351     ************************************************/
352352   DISCRETE_DAC_R1(NODE_40,
353353               1,         /* ENAB */
354               NAMCO_54XX_0_DATA,
354               NAMCO_54XX_0_DATA(NODE_01),
355355               4,         /* 4V - unmeasured*/
356356               &galaga_54xx_dac)
357357   DISCRETE_OP_AMP_FILTER(GALAGA_CHANL3_SND,
src/mame/audio/polepos.c
r4878r4879
66#include "streams.h"
77#include "sound/filter.h"
88#include "machine/rescap.h"
9#include "namco52.h"
910#include "namco54.h"
1011#include "polepos.h"
1112
r4878r4879
250251   /************************************************
251252     * Input register mapping
252253     ************************************************/
253   DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA)
254   DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA)
255   DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA)
256   DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA)
254   DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA(NODE_01))
255   DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA(NODE_01))
256   DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA(NODE_01))
257   DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA(NODE_04))
257258
258259   /************************************************
259260     * CHANL1 sound
260261     ************************************************/
261262   DISCRETE_DAC_R1(NODE_20,
262263               1,         /* ENAB */
263               NAMCO_54XX_2_DATA,
264               NAMCO_54XX_2_DATA(NODE_01),
264265               4,         /* 4V - unmeasured*/
265266               &polepos_54xx_dac)
266267   DISCRETE_OP_AMP_FILTER(NODE_21,
r4878r4879
278279     ************************************************/
279280   DISCRETE_DAC_R1(NODE_30,
280281               1,         /* ENAB */
281               NAMCO_54XX_1_DATA,
282               NAMCO_54XX_1_DATA(NODE_01),
282283               4,         /* 4V - unmeasured*/
283284               &polepos_54xx_dac)
284285   DISCRETE_OP_AMP_FILTER(NODE_31,
r4878r4879
296297     ************************************************/
297298   DISCRETE_DAC_R1(NODE_40,
298299               1,         /* ENAB */
299               NAMCO_54XX_0_DATA,
300               NAMCO_54XX_0_DATA(NODE_01),
300301               4,         /* 4V - unmeasured*/
301302               &polepos_54xx_dac)
302303   DISCRETE_OP_AMP_FILTER(NODE_41,
r4878r4879
312313   /************************************************
313314     * CHANL4 sound
314315     ************************************************/
315   /* disabled until 52XX is emulated */
316316   /* this circuit was simulated in SPICE and an equivalent filter circuit generated */
317317   DISCRETE_DAC_R1(NODE_50,
318               0,         /* ENAB */
319               NAMCO_52XX_P_DATA,
318               1,         /* ENAB */
319               NAMCO_52XX_P_DATA(NODE_04),
320320               4,         /* 4V - unmeasured*/
321321               &polepos_52xx_dac)
322322   /* fake it so 0 is now vRef */
323323   DISCRETE_ADDER2(NODE_51,
324               0,         /* ENAB */
324               1,         /* ENAB */
325325               NODE_50, -POLEPOS_VREF)
326326   DISCRETE_FILTER2(NODE_52,
327               0,         /* ENAB */
327               1,         /* ENAB */
328328               NODE_51,   /* INP0 */
329329               100,      /* FREQ */
330330               1.0 / 0.3,   /* DAMP */
331331               DISC_FILTER_HIGHPASS)
332332   DISCRETE_FILTER2(NODE_53,
333               0,         /* ENAB */
333               1,         /* ENAB */
334334               NODE_52,   /* INP0 */
335335               1200,      /* FREQ */
336336               1.0 / 0.8,   /* DAMP */
r4878r4879
340340               0.5         /* overall filter GAIN */)
341341   /* clamp to the maximum of the op-amp shifted by vRef */
342342   DISCRETE_CLAMP(POLEPOS_CHANL4_SND,
343               0,         /* ENAB */
343               1,         /* ENAB */
344344               NODE_54,   /* IN0 */
345345               0,         /* MIN */
346346               5.0 - OP_AMP_VP_RAIL_OFFSET - POLEPOS_VREF,   /* MAX */
r4878r4879
352352   DISCRETE_OUTPUT(POLEPOS_CHANL1_SND, 32767/2)
353353   DISCRETE_OUTPUT(POLEPOS_CHANL2_SND, 32767/2)
354354   DISCRETE_OUTPUT(POLEPOS_CHANL3_SND, 32767/2)
355//  DISCRETE_OUTPUT(POLEPOS_CHANL4_SND, 32767/2)
355   DISCRETE_OUTPUT(POLEPOS_CHANL4_SND, 32767/2)
356356DISCRETE_SOUND_END
src/mame/machine/konppc.c
r4878r4879
143143
144144WRITE32_HANDLER( cgboard_dsp_comm_w_ppc )
145145{
146   int dsp = (cgboard_id == 0) ? 2 : 3;
146   const char *dsptag = (cgboard_id == 0) ? "dsp" : "dsp2";
147147//  mame_printf_debug("dsp_cmd_w: (board %d) %08X, %08X, %08X at %08X\n", cgboard_id, data, offset, mem_mask, cpu_get_pc(space->cpu));
148148
149149   if (cgboard_id < MAX_CG_BOARDS)
r4878r4879
160160            pci_bridge_enable[cgboard_id] = (data & 0x20000000) ? 1 : 0;
161161
162162            if (data & 0x10000000)
163               cpu_set_input_line(space->machine->cpu[dsp], INPUT_LINE_RESET, CLEAR_LINE);
163               cputag_set_input_line(space->machine, dsptag, INPUT_LINE_RESET, CLEAR_LINE);
164164            else
165               cpu_set_input_line(space->machine->cpu[dsp], INPUT_LINE_RESET, ASSERT_LINE);
165               cputag_set_input_line(space->machine, dsptag, INPUT_LINE_RESET, ASSERT_LINE);
166166
167167            if (data & 0x02000000)
168               cpu_set_input_line(space->machine->cpu[dsp], INPUT_LINE_IRQ0, ASSERT_LINE);
168               cputag_set_input_line(space->machine, dsptag, INPUT_LINE_IRQ0, ASSERT_LINE);
169169
170170            if (data & 0x04000000)
171               cpu_set_input_line(space->machine->cpu[dsp], INPUT_LINE_IRQ1, ASSERT_LINE);
171               cputag_set_input_line(space->machine, dsptag, INPUT_LINE_IRQ1, ASSERT_LINE);
172172         }
173173
174174         if (ACCESSING_BITS_0_7)
r4878r4879
223223      case CGBOARD_TYPE_ZR107:
224224      case CGBOARD_TYPE_GTICLUB:
225225      {
226         //cpu_set_input_line(machine->cpu[2], SHARC_INPUT_FLAG0, ASSERT_LINE);
227         sharc_set_flag_input(space->machine->cpu[2], 0, ASSERT_LINE);
226         //cputag_set_input_line(machine, "dsp", SHARC_INPUT_FLAG0, ASSERT_LINE);
227         sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 0, ASSERT_LINE);
228228
229229         if (offset == 1)
230230         {
231231            if (data & 0x03)
232               cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_IRQ2, ASSERT_LINE);
232               cputag_set_input_line(space->machine, "dsp", INPUT_LINE_IRQ2, ASSERT_LINE);
233233         }
234234         break;
235235      }
r4878r4879
237237      case CGBOARD_TYPE_NWKTR:
238238      case CGBOARD_TYPE_HANGPLT:
239239      {
240         const char *dsptag = (board == 0) ? "dsp" : "dsp2";
241         const device_config *device = devtag_get_device(space->machine, dsptag);
242
240243         if (offset == 1)
241244         {
242245            nwk_device_sel[board] = data;
243246
244247            if (data & 0x01 || data & 0x10)
245248            {
246               sharc_set_flag_input(space->machine->cpu[board == 0 ? 2 : 3], 1, ASSERT_LINE);
249               sharc_set_flag_input(device, 1, ASSERT_LINE);
247250            }
248251
249252            if (texture_bank[board] != -1)
r4878r4879
349352
350353static UINT32 nwk_fifo_r(const address_space *space, int board)
351354{
352   int cpu = (board == 0) ? 2 : 3;
353   const device_config *device = space->machine->cpu[cpu];
355   const char *dsptag = (board == 0) ? "dsp" : "dsp2";
356   const device_config *device = devtag_get_device(space->machine, dsptag);
354357   UINT32 data;
355358
356359   if (nwk_fifo_read_ptr[board] < nwk_fifo_half_full_r)
r4878r4879
380383
381384static void nwk_fifo_w(running_machine *machine, int board, UINT32 data)
382385{
383   int cpu = (board == 0) ? 2 : 3;
384   const device_config *device = machine->cpu[cpu];
386   const char *dsptag = (board == 0) ? "dsp" : "dsp2";
387   const device_config *device = devtag_get_device(machine, dsptag);
385388
386389   if (nwk_fifo_write_ptr[board] < nwk_fifo_half_full_w)
387390   {
src/mame/machine/namco06.c
r0r4879
1/***************************************************************************
2
3The following Namco custom chips are all instances of the same 4-bit MCU,
4the Fujitsu MB8843 (42-pin DIP package) and MB8842/MB8844 (28-pin DIP),
5differently programmed.
6
7chip  MCU   pins function
8---- ------ ---- --------
950XX MB8842  28  player score handling (protection)
1051XX MB8843  42  I/O (coin management built-in)
1152XX MB8843  42  sample playback
1253XX MB8843  42  I/O (steering wheel support)
1354XX MB8844  28  explosion (noise) generator
14
1506XX interface:
16---------------
17Galaga                  51XX  ----  ----  54XX
18Bosconian (CPU board)   51XX  ----  50XX  54XX
19Bosconian (Video board) 50XX  52XX  ----  ----
20Xevious                 51XX  ----  50XX  54XX
21Dig Dug                 51XX  53XX  ----  ----
22Pole Position / PP II   51XX  53XX  52XX  54XX
23
24
25Pinouts:
26
27        MB8843                   MB8842/MB8844
28       +------+                    +------+
29  EXTAL|1   42|Vcc            EXTAL|1   28|Vcc
30   XTAL|2   41|K3              XTAL|2   27|K3
31 /RESET|3   40|K2            /RESET|3   26|K2
32   /IRQ|4   39|K1                O0|4   25|K1
33     SO|5   38|K0                O1|5   24|K0
34     SI|6   37|R15               O2|6   23|R10 /IRQ
35/SC /TO|7   36|R14               O3|7   22|R9 /TC
36    /TC|8   35|R13               O4|8   21|R8
37     P0|9   34|R12               O5|9   20|R7
38     P1|10  33|R11               O6|10  19|R6
39     P2|11  32|R10               O7|11  18|R5
40     P3|12  31|R9                R0|12  17|R4
41     O0|13  30|R8                R1|13  16|R3
42     O1|14  29|R7               GND|14  15|R2
43     O2|15  28|R6                  +------+
44     O3|16  27|R5
45     O4|17  26|R4
46     O5|18  25|R3
47     O6|19  24|R2
48     O7|20  23|R1
49    GND|21  22|R0
50       +------+
51
52
53      O  O  R  R  R  K
5450XX  O  O  I     I  I
5554XX  O  O  I  O     I
56
57      P  O  O  R  R  R  R  K
5851XX  O  O  O  I  I  I  I  I
5952XX  O  O  O  I  I  O  O  I
6053XX  O? O  O  I  I  I  I  I
61
62
63For the 52XX, see sound/namco52.c
64
65For the 54XX, see audio/namco54.c
66
67***************************************************************************/
68
69#include "driver.h"
70#include "machine/namco06.h"
71#include "machine/namco50.h"
72#include "machine/namco51.h"
73#include "machine/namco53.h"
74#include "audio/namco52.h"
75#include "audio/namco54.h"
76
77
78#define VERBOSE 0
79#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
80
81
82
83typedef struct _namco_06xx_state namco_06xx_state;
84struct _namco_06xx_state
85{
86   UINT8 command;
87   emu_timer *nmi_timer;
88   const device_config *nmicpu;
89   const device_config *device[4];
90   read8_device_func read[4];
91   void (*readreq[4])(const device_config *device);
92   write8_device_func write[4];
93};
94
95INLINE namco_06xx_state *get_safe_token(const device_config *device)
96{
97   assert(device != NULL);
98   assert(device->token != NULL);
99   assert(device->type == NAMCO_06XX);
100
101   return (namco_06xx_state *)device->token;
102}
103
104
105
106static TIMER_CALLBACK( nmi_generate )
107{
108   namco_06xx_state *state = get_safe_token((const device_config *)ptr);
109
110   if (!cpu_is_suspended(state->nmicpu, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
111   {
112      LOG(("NMI cpu '%s'\n",state->nmicpu->tag));
113
114      cpu_set_input_line(state->nmicpu, INPUT_LINE_NMI, PULSE_LINE);
115   }
116   else
117      LOG(("NMI not generated because cpu '%s' is suspended\n",state->nmicpu->tag));
118}
119
120
121READ8_DEVICE_HANDLER( namco_06xx_data_r )
122{
123   namco_06xx_state *state = get_safe_token(device);
124
125   LOG(("%s: 06XX '%s' read offset %d\n",cpuexec_describe_context(device->machine),device->tag,offset));
126
127   if (!(state->command & 0x10))
128   {
129      logerror("%s: 06XX '%s' read in write mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->command);
130      return 0;
131   }
132
133   switch (state->command & 0xf)
134   {
135      case 0x1: return (state->read[0] != NULL) ? (*state->read[0])(state->device[0],0) : 0xff;
136      case 0x2: return (state->read[1] != NULL) ? (*state->read[1])(state->device[1],0) : 0xff;
137      case 0x4: return (state->read[2] != NULL) ? (*state->read[2])(state->device[2],0) : 0xff;
138      case 0x8: return (state->read[3] != NULL) ? (*state->read[3])(state->device[3],0) : 0xff;
139      default:
140         logerror("%s: 06XX '%s' read in unsupported mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->command);
141         return 0xff;
142   }
143}
144
145
146WRITE8_DEVICE_HANDLER( namco_06xx_data_w )
147{
148   namco_06xx_state *state = get_safe_token(device);
149
150   LOG(("%s: 06XX '%s' write offset %d = %02x\n",cpuexec_describe_context(device->machine),device->tag,offset,data));
151
152   if (state->command & 0x10)
153   {
154      logerror("%s: 06XX '%s' write in read mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->command);
155      return;
156   }
157
158   switch (state->command & 0xf)
159   {
160      case 0x1: if (state->write[0] != NULL) (*state->write[0])(state->device[0],0,data); break;
161      case 0x2: if (state->write[1] != NULL) (*state->write[1])(state->device[1],0,data); break;
162      case 0x4: if (state->write[2] != NULL) (*state->write[2])(state->device[2],0,data); break;
163      case 0x8: if (state->write[3] != NULL) (*state->write[3])(state->device[3],0,data); break;
164      default:
165         logerror("%s: 06XX '%s' write in unsupported mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->command);
166         break;
167   }
168}
169
170
171READ8_DEVICE_HANDLER( namco_06xx_ctrl_r )
172{
173   namco_06xx_state *state = get_safe_token(device);
174   LOG(("%s: 06XX '%s' ctrl_r\n",cpuexec_describe_context(device->machine),device->tag));
175   return state->command;
176}
177
178WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w )
179{
180   namco_06xx_state *state = get_safe_token(device);
181
182   LOG(("%s: 06XX '%s' command %02x\n",cpuexec_describe_context(device->machine),device->tag,data));
183
184   state->command = data;
185
186   if ((state->command & 0x0f) == 0)
187   {
188      LOG(("disabling nmi generate timer\n"));
189      timer_adjust_oneshot(state->nmi_timer, attotime_never, 0);
190   }
191   else
192   {
193      LOG(("setting nmi generate timer to 200us\n"));
194
195      // this timing is critical. Due to a bug, Bosconian will stop responding to
196      // inputs if a transfer terminates at the wrong time.
197      // On the other hand, the time cannot be too short otherwise the 54XX will
198      // not have enough time to process the incoming commands.
199      timer_adjust_periodic(state->nmi_timer, ATTOTIME_IN_USEC(200), 0, ATTOTIME_IN_USEC(200));
200
201      if (state->command & 0x10)
202      {
203         switch (state->command & 0xf)
204         {
205            case 0x1: if (state->readreq[0] != NULL) (*state->readreq[0])(state->device[0]); break;
206            case 0x2: if (state->readreq[1] != NULL) (*state->readreq[1])(state->device[1]); break;
207            case 0x4: if (state->readreq[2] != NULL) (*state->readreq[2])(state->device[2]); break;
208            case 0x8: if (state->readreq[3] != NULL) (*state->readreq[3])(state->device[3]); break;
209            default:
210               logerror("%s: 06XX '%s' read in unsupported mode %02x\n",cpuexec_describe_context(device->machine),device->tag,state->command);
211         }
212      }
213   }
214}
215
216
217/***************************************************************************
218    DEVICE INTERFACE
219***************************************************************************/
220
221/*-------------------------------------------------
222    device start callback
223-------------------------------------------------*/
224
225static DEVICE_START( namco_06xx )
226{
227   const namco_06xx_interface *config = (const namco_06xx_interface *)device->inline_config;
228   namco_06xx_state *state = get_safe_token(device);
229   int devnum;
230
231   assert(config != NULL);
232
233   /* resolve our CPU */
234   state->nmicpu = cputag_get_cpu(device->machine, config->nmicpu);
235   assert(state->nmicpu != NULL);
236
237   /* resolve our devices */
238   state->device[0] = (config->chip0 != NULL) ? devtag_get_device(device->machine, config->chip0) : NULL;
239   assert(state->device[0] != NULL || config->chip0 == NULL);
240   state->device[1] = (config->chip1 != NULL) ? devtag_get_device(device->machine, config->chip1) : NULL;
241   assert(state->device[1] != NULL || config->chip1 == NULL);
242   state->device[2] = (config->chip2 != NULL) ? devtag_get_device(device->machine, config->chip2) : NULL;
243   assert(state->device[2] != NULL || config->chip2 == NULL);
244   state->device[3] = (config->chip3 != NULL) ? devtag_get_device(device->machine, config->chip3) : NULL;
245   assert(state->device[3] != NULL || config->chip3 == NULL);
246
247   /* loop over devices and set their read/write handlers */
248   for (devnum = 0; devnum < 4; devnum++)
249      if (state->device[devnum] != NULL)
250      {
251         device_type type = state->device[devnum]->type;
252
253         if (type == NAMCO_50XX)
254         {
255            state->read[devnum] = namco_50xx_read;
256            state->readreq[devnum] = namco_50xx_read_request;
257            state->write[devnum] = namco_50xx_write;
258         }
259         else if (type == NAMCO_51XX)
260         {
261            state->read[devnum] = namco_51xx_read;
262            state->write[devnum] = namco_51xx_write;
263         }
264         else if (type == NAMCO_52XX)
265            state->write[devnum] = namco_52xx_write;
266         else if (type == NAMCO_53XX)
267         {
268            state->read[devnum] = namco_53xx_read;
269            state->readreq[devnum] = namco_53xx_read_request;
270         }
271         else if (type == NAMCO_54XX)
272            state->write[devnum] = namco_54xx_write;
273         else
274            fatalerror("Unknown device type %s connected to Namco 06xx", devtype_get_name(type));
275      }
276
277   /* allocate a timer */
278   state->nmi_timer = timer_alloc(device->machine, nmi_generate, (void *)device);
279
280   state_save_register_device_item(device, 0, state->command);
281}
282
283
284/*-------------------------------------------------
285    device reset callback
286-------------------------------------------------*/
287
288static DEVICE_RESET( namco_06xx )
289{
290   namco_06xx_state *state = get_safe_token(device);
291   state->command = 0;
292}
293
294
295/*-------------------------------------------------
296    device get info callback
297-------------------------------------------------*/
298
299DEVICE_GET_INFO( namco_06xx )
300{
301   switch (state)
302   {
303      /* --- the following bits of info are returned as 64-bit signed integers --- */
304      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(namco_06xx_state);            break;
305      case DEVINFO_INT_INLINE_CONFIG_BYTES:   info->i = sizeof(namco_06xx_interface);         break;
306      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
307
308      /* --- the following bits of info are returned as pointers to data or functions --- */
309      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(namco_06xx);    break;
310      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(namco_06xx);    break;
311
312      /* --- the following bits of info are returned as NULL-terminated strings --- */
313      case DEVINFO_STR_NAME:               strcpy(info->s, "Namco 06xx");               break;
314      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Namco I/O");               break;
315      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
316      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
317      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
318   }
319}
src/mame/machine/namco06.h
r0r4879
1#ifndef NAMCO06_H
2#define NAMCO06_H
3
4#include "devintrf.h"
5
6
7typedef struct _namco_06xx_interface namco_06xx_interface;
8struct _namco_06xx_interface
9{
10   const char *nmicpu;
11   const char *chip0;
12   const char *chip1;
13   const char *chip2;
14   const char *chip3;
15};
16
17
18#define MDRV_NAMCO_06XX_ADD(_tag, _nmicpu, _chip0, _chip1, _chip2, _chip3) \
19   MDRV_DEVICE_ADD(_tag, NAMCO_06XX, 0) \
20   MDRV_DEVICE_CONFIG_DATAPTR(namco_06xx_interface, nmicpu, _nmicpu) \
21   MDRV_DEVICE_CONFIG_DATAPTR(namco_06xx_interface, chip0, _chip0) \
22   MDRV_DEVICE_CONFIG_DATAPTR(namco_06xx_interface, chip1, _chip1) \
23   MDRV_DEVICE_CONFIG_DATAPTR(namco_06xx_interface, chip2, _chip2) \
24   MDRV_DEVICE_CONFIG_DATAPTR(namco_06xx_interface, chip3, _chip3)
25
26#define MDRV_NAMCO_06XX_REMOVE(_tag) \
27   MDRV_DEVICE_REMOVE(_tag)
28
29
30READ8_DEVICE_HANDLER( namco_06xx_data_r );
31WRITE8_DEVICE_HANDLER( namco_06xx_data_w );
32READ8_DEVICE_HANDLER( namco_06xx_ctrl_r );
33WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w );
34
35
36/* device get info callback */
37#define NAMCO_06XX DEVICE_GET_INFO_NAME(namco_06xx)
38DEVICE_GET_INFO( namco_06xx );
39
40
41#endif
src/mame/machine/namcoio.c
r4878r4879
66
77chip  MCU   pins function
88---- ------ ---- --------
950XX MB8842  28  player score handling (protection)
1051XX MB8843  42  I/O (coin management built-in)
1152XX MB8843  42  sample playback
1253XX MB8843  42  I/O (steering wheel support)
1354XX MB8844  28  explosion (noise) generator
14956XX         42  I/O (coin management built-in)
151058XX         42  I/O (coin management built-in)
161162XX         28  I/O and explosion (noise) generator
1712
1806XX interface:
19---------------
20Galaga                  51XX  ----  ----  54XX
21Bosconian (CPU board)   51XX  ----  50XX  54XX
22Bosconian (Video board) 50XX  52XX  ----  ----
23Xevious                 51XX  ----  50XX  54XX
24Dig Dug                 51XX  53XX  ----  ----
25Pole Position / PP II   51XX  53XX  52XX  54XX
26
271316XX interface:
2814---------------
2915Super Pac Man           56XX  56XX  ----  ----
r4878r4879
6955
7056
7157      O  O  R  R  R  K
7250XX  O  O  I     I  I
7354XX  O  O  I  O     I
745862XX  O  O  IO O     I
7559
7660      P  O  O  R  R  R  R  K
7751XX  O  O  O  I  I  I  I  I
7852XX  O  O  O  I  I  O  O  I
7953XX  O? O  O  I  I  I  I  I
806156XX  O  O  O  I  I  I  IO I
816258XX  O  O  O  I  I  I  IO I
826359XX  O  O  O  I  I  I  IO I
8364
8465
85For the 52XX, see sound/namco52.c
86
87For the 54XX, see audio/namco54.c
88
89
9066Namco custom I/O chips 56XX, 58XX, 59XX
9167
9268These chips work together with a 16XX, that interfaces them with the buffer
r4878r4879
135111#include "driver.h"
136112#include "machine/namcoio.h"
137113#include "machine/namco50.h"
138#include "sound/namco52.h"
114#include "machine/namco51.h"
115#include "machine/namco53.h"
116#include "audio/namco52.h"
139117#include "audio/namco54.h"
140118
141119
r4878r4879
145123struct namcoio
146124{
147125   INT32 type;
126   const device_config *device;
148127   read8_space_func in[4];
149128   write8_space_func out[2];
150129   INT32 reset;
r4878r4879
154133   INT32 coins_per_cred[2];
155134   INT32 creds_per_coin[2];
156135   INT32 in_count;
157   INT32 mode,coincred_mode,remap_joy;   // for 51XX
158136};
159137
160138static struct namcoio io[MAX_NAMCOIO];
161static INT32 nmi_cpu[MAX_06XX];
162static emu_timer *nmi_timer[MAX_06XX];
163139
164140static READ8_HANDLER( nop_r ) { return 0x0f; }
165141static WRITE8_HANDLER( nop_w ) { }
r4878r4879
169145
170146
171147
172/*
17351XX
174
175commands:
17600: nop
17701 + 4 arguments: set coinage (xevious, possibly because of a bug, is different)
17802: go in "credit" mode and enable start buttons
17903: disable joystick remapping
18004: enable joystick remapping
18105: go in "switch" mode
18206: nop
18307: nop
184*/
185
186static void namcoio_51XX_write(running_machine *machine,int chip,int data)
187{
188   data &= 0x07;
189
190   LOG(("%s: custom 51XX write %02x\n",cpuexec_describe_context(machine),data));
191
192   if (io[chip].coincred_mode)
193   {
194      switch (io[chip].coincred_mode--)
195      {
196         case 4: io[chip].coins_per_cred[0] = data; break;
197         case 3: io[chip].creds_per_coin[0] = data; break;
198         case 2: io[chip].coins_per_cred[1] = data; break;
199         case 1: io[chip].creds_per_coin[1] = data; break;
200      }
201   }
202   else
203   {
204      switch (data)
205      {
206         case 0:   // nop
207            break;
208
209         case 1:   // set coinage
210            io[chip].coincred_mode = 4;
211            /* this is a good time to reset the credits counter */
212            io[chip].credits = 0;
213
214            {
215               /* kludge for a possible bug in Xevious */
216               static const game_driver *namcoio_51XX_driver = NULL;
217               static int namcoio_51XX_kludge = 0;
218
219               /* Only compute namcoio_51XX_kludge when gamedrv changes */
220               if (namcoio_51XX_driver != machine->gamedrv)
221               {
222                  namcoio_51XX_driver = machine->gamedrv;
223                  if (strcmp(namcoio_51XX_driver->name, "xevious") == 0 ||
224                     strcmp(namcoio_51XX_driver->parent, "xevious") == 0)
225                     namcoio_51XX_kludge = 1;
226                  else
227                     namcoio_51XX_kludge = 0;
228               }
229
230               if (namcoio_51XX_kludge)
231               {
232                  io[chip].coincred_mode = 6;
233                  io[chip].remap_joy = 1;
234               }
235            }
236            break;
237
238         case 2:   // go in "credits" mode and enable start buttons
239            io[chip].mode = 1;
240            io[chip].in_count = 0;
241            break;
242
243         case 3:   // disable joystick remapping
244            io[chip].remap_joy = 0;
245            break;
246
247         case 4:   // enable joystick remapping
248            io[chip].remap_joy = 1;
249            break;
250
251         case 5:   // go in "switch" mode
252            io[chip].mode = 0;
253            io[chip].in_count = 0;
254            break;
255
256         default:
257            logerror("unknown 51XX command %02x\n",data);
258            break;
259      }
260   }
261}
262
263
264/* joystick input mapping
265
266  The joystick is parsed and a number corresponding to the direction is returned,
267  according to the following table:
268
269          0
270        7   1
271      6   8   2
272        5   3
273          4
274
275  The values for directions impossible to obtain on a joystick have not been
276  verified on Namco original hardware, but they are the same in all the bootlegs,
277  so we can assume they are right.
278*/
279static const int joy_map[16] =
280/*  LDRU, LDR, LDU,  LD, LRU, LR,  LU,    L, DRU,  DR,  DU,   D,  RU,   R,   U, center */
281{    0xf, 0xe, 0xd, 0x5, 0xc, 0x9, 0x7, 0x6, 0xb, 0x3, 0xa, 0x4, 0x1, 0x2, 0x0, 0x8 };
282
283
284static UINT8 namcoio_51XX_read(running_machine *machine, int chip)
285{
286   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
287
288   LOG(("%s: custom 51XX read\n",cpuexec_describe_context(machine)));
289
290   if (io[chip].mode == 0)   /* switch mode */
291   {
292      switch ((io[chip].in_count++) % 3)
293      {
294         default:
295         case 0: return READ_PORT(space,0) | (READ_PORT(space,1) << 4);
296         case 1: return READ_PORT(space,2) | (READ_PORT(space,3) << 4);
297         case 2: return 0;   // nothing?
298      }
299   }
300   else   /* credits mode */
301   {
302      switch ((io[chip].in_count++) % 3)
303      {
304         default:
305         case 0:   // number of credits in BCD format
306            {
307               int in,toggle;
308
309               in = ~(READ_PORT(space,0) | (READ_PORT(space,1) << 4));
310               toggle = in ^ io[chip].lastcoins;
311               io[chip].lastcoins = in;
312
313               if (io[chip].coins_per_cred[0] > 0)
314               {
315                  if (io[chip].credits >= 99)
316                  {
317                     WRITE_PORT(space,1,1);   // coin lockout
318                  }
319                  else
320                  {
321                     WRITE_PORT(space,1,0);   // coin lockout
322                     /* check if the user inserted a coin */
323                     if (toggle & in & 0x10)
324                     {
325                        io[chip].coins[0]++;
326                        WRITE_PORT(space,0,0x04);   // coin counter
327                        WRITE_PORT(space,0,0x0c);
328                        if (io[chip].coins[0] >= io[chip].coins_per_cred[0])
329                        {
330                           io[chip].credits += io[chip].creds_per_coin[0];
331                           io[chip].coins[0] -= io[chip].coins_per_cred[0];
332                        }
333                     }
334                     if (toggle & in & 0x20)
335                     {
336                        io[chip].coins[1]++;
337                        WRITE_PORT(space,0,0x08);   // coin counter
338                        WRITE_PORT(space,0,0x0c);
339                        if (io[chip].coins[1] >= io[chip].coins_per_cred[1])
340                        {
341                           io[chip].credits += io[chip].creds_per_coin[1];
342                           io[chip].coins[1] -= io[chip].coins_per_cred[1];
343                        }
344                     }
345                     if (toggle & in & 0x40)
346                     {
347                        io[chip].credits++;
348                     }
349                  }
350               }
351               else io[chip].credits = 100;   // free play
352
353               if (io[chip].mode == 1)
354               {
355                  int on = (video_screen_get_frame_number(machine->primary_screen) & 0x10) >> 4;
356
357                  if (io[chip].credits >= 2)
358                     WRITE_PORT(space,0,0x0c | 3*on);   // lamps
359                  else if (io[chip].credits >= 1)
360                     WRITE_PORT(space,0,0x0c | 2*on);   // lamps
361                  else
362                     WRITE_PORT(space,0,0x0c);   // lamps off
363
364                  /* check for 1 player start button */
365                  if (toggle & in & 0x04)
366                  {
367                     if (io[chip].credits >= 1)
368                     {
369                        io[chip].credits--;
370                        io[chip].mode = 2;
371                        WRITE_PORT(space,0,0x0c);   // lamps off
372                     }
373                  }
374                  /* check for 2 players start button */
375                  else if (toggle & in & 0x08)
376                  {
377                     if (io[chip].credits >= 2)
378                     {
379                        io[chip].credits -= 2;
380                        io[chip].mode = 2;
381                        WRITE_PORT(space, 0,0x0c);   // lamps off
382                     }
383                  }
384               }
385            }
386
387            if (~input_port_read(machine, "IN0") & 0x80)   /* check test mode switch */
388               return 0xbb;
389
390            return (io[chip].credits / 10) * 16 + io[chip].credits % 10;
391
392         case 1:
393            {
394               int joy = READ_PORT(space,2) & 0x0f;
395               int in,toggle;
396
397               in = ~READ_PORT(space,0);
398               toggle = in ^ io[chip].lastbuttons;
399               io[chip].lastbuttons = (io[chip].lastbuttons & 2) | (in & 1);
400
401               /* remap joystick */
402               if (io[chip].remap_joy) joy = joy_map[joy];
403
404               /* fire */
405               joy |= ((toggle & in & 0x01)^1) << 4;
406               joy |= ((in & 0x01)^1) << 5;
407
408               return joy;
409            }
410
411         case 2:
412            {
413               int joy = READ_PORT(space,3) & 0x0f;
414               int in,toggle;
415
416               in = ~READ_PORT(space,0);
417               toggle = in ^ io[chip].lastbuttons;
418               io[chip].lastbuttons = (io[chip].lastbuttons & 1) | (in & 2);
419
420               /* remap joystick */
421               if (io[chip].remap_joy) joy = joy_map[joy];
422
423               /* fire */
424               joy |= ((toggle & in & 0x02)^2) << 3;
425               joy |= ((in & 0x02)^2) << 4;
426
427               return joy;
428            }
429      }
430   }
431}
432
433
434148/***************************************************************************/
435149
436150
r4878r4879
446160   int credit_add = 0;
447161   int credit_sub = 0;
448162   int button;
449   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
163   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
450164
451165//popmessage("%x %x %x %x %x %x %x %x",IORAM_READ(8),IORAM_READ(9),IORAM_READ(10),IORAM_READ(11),IORAM_READ(12),IORAM_READ(13),IORAM_READ(14),IORAM_READ(15));
452166
r4878r4879
518232
519233static void namco_customio_56XX_run(running_machine *machine, int chip)
520234{
521   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
235   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
522236
523237   LOG(("execute 56XX %d mode %d\n",chip,IORAM_READ(8)));
524238
r4878r4879
600314
601315static void namco_customio_59XX_run(running_machine *machine, int chip)
602316{
603   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
317   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
604318
605319   LOG(("execute 59XX %d mode %d\n",chip,IORAM_READ(8)));
606320
r4878r4879
625339
626340static void namco_customio_58XX_run(running_machine *machine, int chip)
627341{
628   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
342   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
629343
630344   LOG(("execute 58XX %d mode %d\n",chip,IORAM_READ(8)));
631345
r4878r4879
805519   state_save_register_item_array(machine, "namcoio", NULL, chipnum, io[chipnum].coins_per_cred);
806520   state_save_register_item_array(machine, "namcoio", NULL, chipnum, io[chipnum].creds_per_coin);
807521   state_save_register_item(machine, "namcoio", NULL, chipnum, io[chipnum].in_count);
808   state_save_register_item(machine, "namcoio", NULL, chipnum, io[chipnum].mode);
809   state_save_register_item(machine, "namcoio", NULL, chipnum, io[chipnum].coincred_mode);
810   state_save_register_item(machine, "namcoio", NULL, chipnum, io[chipnum].remap_joy);
811522}
812523
813void namcoio_init(running_machine *machine, int chipnum, int type, const struct namcoio_interface *intf)
524void namcoio_init(running_machine *machine, int chipnum, int type, const struct namcoio_interface *intf, const char *device)
814525{
815526   if (chipnum < MAX_NAMCOIO)
816527   {
817528      io[chipnum].type = type;
529      io[chipnum].device = device ? devtag_get_device(machine, device) : NULL;
818530      io[chipnum].in[0] = (intf && intf->in[0]) ? intf->in[0] : nop_r;
819531      io[chipnum].in[1] = (intf && intf->in[1]) ? intf->in[1] : nop_r;
820532      io[chipnum].in[2] = (intf && intf->in[2]) ? intf->in[2] : nop_r;
r4878r4879
825537      namcoio_set_reset_line(chipnum,PULSE_LINE);
826538   }
827539}
828
829
830
831
832
833
834
835static TIMER_CALLBACK( nmi_generate )
836{
837   if (!cpu_is_suspended(machine->cpu[param], SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
838   {
839      LOG(("NMI cpu %d\n",nmi_cpu[param]));
840
841      cpu_set_input_line(machine->cpu[nmi_cpu[param]], INPUT_LINE_NMI, PULSE_LINE);
842   }
843   else
844      LOG(("NMI not generated because cpu %d is suspended\n",nmi_cpu[param]));
845}
846
847static UINT8 customio_command[MAX_06XX];
848
849static void namco_06xx_state_save(running_machine *machine, int chipnum)
850{
851
852   //state_save_register_item(machine, "namcoio06xx", NULL, chipnum, nmi_cpu[chipnum]);
853   state_save_register_item(machine, "namcoio06xx", NULL, chipnum, customio_command[chipnum]);
854}
855
856
857void namco_06xx_init(running_machine *machine, int chipnum, int cpu,
858   int type0, const struct namcoio_interface *intf0,
859   int type1, const struct namcoio_interface *intf1,
860   int type2, const struct namcoio_interface *intf2,
861   int type3, const struct namcoio_interface *intf3)
862{
863   if (chipnum < MAX_06XX)
864   {
865      namcoio_init(machine, 4*chipnum + 0, type0, intf0);
866      namcoio_init(machine, 4*chipnum + 1, type1, intf1);
867      namcoio_init(machine, 4*chipnum + 2, type2, intf2);
868      namcoio_init(machine, 4*chipnum + 3, type3, intf3);
869      nmi_cpu[chipnum] = cpu;
870      nmi_timer[chipnum] = timer_alloc(machine, nmi_generate, NULL);
871      namco_06xx_state_save(machine, chipnum);
872   }
873}
874
875
876
877static UINT8 namcoio_53XX_digdug_read(running_machine *machine, int chip)
878{
879   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
880
881   LOG(("%s: custom 53XX read\n",cpuexec_describe_context(machine)));
882
883   switch ((io[chip].in_count++) % 2)
884   {
885      default:
886      case 0: return READ_PORT(space,0) | (READ_PORT(space,1) << 4);
887      case 1: return READ_PORT(space,2) | (READ_PORT(space,3) << 4);
888   }
889}
890
891
892static UINT8 namcoio_53XX_polepos_read(running_machine *machine,int chip)
893{
894   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
895
896   LOG(("%s: custom 53XX read\n",cpuexec_describe_context(machine)));
897
898   switch ((io[chip].in_count++) % 8)
899   {
900      case 0: return READ_PORT(space,0) | (READ_PORT(space,1) << 4);   // steering
901      case 4: return READ_PORT(space,2) | (READ_PORT(space,3) << 4);   // dip switches
902      default: return 0xff;   // polepos2 hangs if 0 is returned
903   }
904}
905
906
907static UINT8 namco_06xx_data_read(running_machine *machine, int chipnum)
908{
909   LOG(("forwarding read to chip %d\n",chipnum%3));
910
911   switch (io[chipnum].type)
912   {
913      case NAMCOIO_50XX:   return namco_50xx_read(machine);
914      case NAMCOIO_50XX_2: return namco_50xx_2_read(machine);
915      case NAMCOIO_51XX: return namcoio_51XX_read(machine, chipnum);
916      case NAMCOIO_53XX_DIGDUG:  return namcoio_53XX_digdug_read(machine, chipnum);
917      case NAMCOIO_53XX_POLEPOS: return namcoio_53XX_polepos_read(machine, chipnum);
918      default:
919         logerror("%s: custom IO type %d unsupported read\n",cpuexec_describe_context(machine),io[chipnum].type);
920         return 0xff;
921   }
922}
923
924
925static void namco_06xx_data_write(running_machine *machine,int chipnum,UINT8 data)
926{
927   LOG(("forwarding write to chip %d\n",chipnum%3));
928
929   switch (io[chipnum].type)
930   {
931      case NAMCOIO_50XX:   namco_50xx_write(machine, data); break;
932      case NAMCOIO_50XX_2: namco_50xx_2_write(machine, data); break;
933      case NAMCOIO_51XX:   namcoio_51XX_write(machine,chipnum,data); break;
934      case NAMCOIO_52XX:   namcoio_52xx_write(devtag_get_device(machine, "namco52"), data); break;
935      case NAMCOIO_54XX:   namco_54xx_write(machine, data); break;
936      default:
937         logerror("%s: custom IO type %d unsupported write\n",cpuexec_describe_context(machine),io[chipnum].type);
938         break;
939   }
940}
941
942
943static void namco_06xx_read_request(running_machine *machine, int chipnum)
944{
945   LOG(("requesting read to chip %d\n",chipnum%3));
946
947   switch (io[chipnum].type)
948   {
949      case NAMCOIO_50XX:   namco_50xx_read_request(machine); break;
950      case NAMCOIO_50XX_2: namco_50xx_2_read_request(machine); break;
951      default:
952         logerror("%s: custom IO type %d read_request unsupported\n",cpuexec_describe_context(machine),io[chipnum].type);
953         break;
954   }
955}
956
957
958static UINT8 namco_06xx_data_r(running_machine *machine,int chip,int offset)
959{
960   LOG(("%s: 06XX #%d read offset %d\n",cpuexec_describe_context(machine),chip,offset));
961
962   if (!(customio_command[chip] & 0x10))
963   {
964      logerror("%s: 06XX #%d read in write mode %02x\n",cpuexec_describe_context(machine),chip,customio_command[chip]);
965      return 0;
966   }
967
968   switch (customio_command[chip] & 0xf)
969   {
970      case 0x1: return namco_06xx_data_read(machine, 4*chip + 0);
971      case 0x2: return namco_06xx_data_read(machine, 4*chip + 1);
972      case 0x4: return namco_06xx_data_read(machine, 4*chip + 2);
973      case 0x8: return namco_06xx_data_read(machine, 4*chip + 3);
974      default:
975         logerror("%s: 06XX #%d read in unsupported mode %02x\n",cpuexec_describe_context(machine),chip,customio_command[chip]);
976         return 0xff;
977   }
978}
979
980
981static void namco_06xx_data_w(running_machine *machine,int chip,int offset,int data)
982{
983   LOG(("%s: 06XX #%d write offset %d = %02x\n",cpuexec_describe_context(machine),chip,offset,data));
984
985   if (customio_command[chip] & 0x10)
986   {
987      logerror("%s: 06XX #%d write in read mode %02x\n",cpuexec_describe_context(machine),chip,customio_command[chip]);
988      return;
989   }
990
991   switch (customio_command[chip] & 0xf)
992   {
993      case 0x1: namco_06xx_data_write(machine,4*chip + 0,data); break;
994      case 0x2: namco_06xx_data_write(machine,4*chip + 1,data); break;
995      case 0x4: namco_06xx_data_write(machine,4*chip + 2,data); break;
996      case 0x8: namco_06xx_data_write(machine,4*chip + 3,data); break;
997      default:
998         logerror("%s: 06XX #%d write in unsupported mode %02x\n",cpuexec_describe_context(machine),chip,customio_command[chip]);
999         break;
1000   }
1001}
1002
1003
1004static UINT8 namco_06xx_ctrl_r(running_machine *machine, int chip)
1005{
1006   LOG(("%s: 06XX #%d ctrl_r\n",cpuexec_describe_context(machine),chip));
1007   return customio_command[chip];
1008}
1009
1010static void namco_06xx_ctrl_w(running_machine *machine, int chip,int data)
1011{
1012   LOG(("%s: 06XX #%d command %02x\n",cpuexec_describe_context(machine),chip,data));
1013
1014   customio_command[chip] = data;
1015
1016   if ((customio_command[chip] & 0x0f) == 0)
1017   {
1018      LOG(("disabling nmi generate timer\n"));
1019      timer_adjust_oneshot(nmi_timer[chip], attotime_never, chip);
1020   }
1021   else
1022   {
1023      LOG(("setting nmi generate timer to 200us\n"));
1024
1025      // this timing is critical. Due to a bug, Bosconian will stop responding to
1026      // inputs if a transfer terminates at the wrong time.
1027      // On the other hand, the time cannot be too short otherwise the 54XX will
1028      // not have enough time to process the incoming commands.
1029      timer_adjust_periodic(nmi_timer[chip], ATTOTIME_IN_USEC(200), chip, ATTOTIME_IN_USEC(200));
1030
1031      if (customio_command[chip] & 0x10)
1032      {
1033         switch (customio_command[chip] & 0xf)
1034         {
1035            case 0x1: namco_06xx_read_request(machine, 4*chip + 0); break;
1036            case 0x2: namco_06xx_read_request(machine, 4*chip + 1); break;
1037            case 0x4: namco_06xx_read_request(machine, 4*chip + 2); break;
1038            case 0x8: namco_06xx_read_request(machine, 4*chip + 3); break;
1039            default:
1040               logerror("%s: 06XX #%d read in unsupported mode %02x\n",cpuexec_describe_context(machine),chip,customio_command[chip]);
1041         }
1042      }
1043   }
1044}
1045
1046
1047
1048READ8_HANDLER( namco_06xx_0_data_r )   { return namco_06xx_data_r(space->machine,0,offset); }
1049READ8_HANDLER( namco_06xx_1_data_r )   { return namco_06xx_data_r(space->machine,1,offset); }
1050WRITE8_HANDLER( namco_06xx_0_data_w )   { namco_06xx_data_w(space->machine,0,offset,data); }
1051WRITE8_HANDLER( namco_06xx_1_data_w )   { namco_06xx_data_w(space->machine,1,offset,data); }
1052READ8_HANDLER( namco_06xx_0_ctrl_r )   { return namco_06xx_ctrl_r(space->machine,0); }
1053READ8_HANDLER( namco_06xx_1_ctrl_r )   { return namco_06xx_ctrl_r(space->machine,1); }
1054WRITE8_HANDLER( namco_06xx_0_ctrl_w )   { namco_06xx_ctrl_w(space->machine, 0,data); }
1055WRITE8_HANDLER( namco_06xx_1_ctrl_w )   { namco_06xx_ctrl_w(space->machine, 1,data); }
src/mame/machine/dc.c
r4878r4879
11791179
11801180READ64_DEVICE_HANDLER( dc_aica_reg_r )
11811181{
1182   int reg;
1182   //int reg;
11831183   UINT64 shift;
11841184
1185   reg = decode_reg32_64(device->machine, offset, mem_mask, &shift);
1185   /*reg = */decode_reg32_64(device->machine, offset, mem_mask, &shift);
11861186
11871187//  mame_printf_verbose("AICA REG: [%08x] read %llx, mask %llx\n", 0x700000+reg*4, (UINT64)offset, mem_mask);
11881188
src/mame/machine/scramble.c
r4878r4879
2626  security_2B_counter = 0;
2727}
2828
29MACHINE_RESET( sfx )
30{
31   MACHINE_RESET_CALL(scramble);
32
33   sfx_sh_init(machine);
34}
35
36static int monsterz_count = 0;
37MACHINE_RESET( monsterz )
38{
39/*
40// patch rom crc
41    UINT8 *ROM = memory_region(machine, "maincpu");
42    ROM[0x363f] = 0;
43    ROM[0x3640] = 0;
44    ROM[0x3641] = 0;
45
46    ROM[0xc5bc] = 0xaf;
47*/
48   MACHINE_RESET_CALL(scramble);
49
50   sfx_sh_init(machine);
51
52   monsterz_count = 0;
53}
54
5529MACHINE_RESET( explorer )
5630{
5731   UINT8 *RAM = memory_region(machine, "maincpu");
src/mame/machine/namcoio.h
r4878r4879
11#ifndef NAMCOIO_H
22#define NAMCOIO_H
33
4#include "devintrf.h"
5
6
47enum
58{
6   NAMCOIO_NONE = 0,
7   NAMCOIO_50XX,
8   NAMCOIO_50XX_2,
9   NAMCOIO_51XX,
10   NAMCOIO_52XX,
11   NAMCOIO_53XX_DIGDUG,
12   NAMCOIO_53XX_POLEPOS,
13   NAMCOIO_54XX,
149   NAMCOIO_56XX,
1510   NAMCOIO_58XX,
1611   NAMCOIO_59XX,
r4878r4879
1813};
1914
2015#define MAX_NAMCOIO 8
21#define MAX_06XX 2
2216
2317
2418struct namcoio_interface
r4878r4879
2822};
2923
3024
31void namco_06xx_init(running_machine *machine, int chipnum, int cpu,
32   int type0, const struct namcoio_interface *intf0,
33   int type1, const struct namcoio_interface *intf1,
34   int type2, const struct namcoio_interface *intf2,
35   int type3, const struct namcoio_interface *intf3);
36READ8_HANDLER( namco_06xx_0_data_r );
37READ8_HANDLER( namco_06xx_1_data_r );
38WRITE8_HANDLER( namco_06xx_0_data_w );
39WRITE8_HANDLER( namco_06xx_1_data_w );
40READ8_HANDLER( namco_06xx_0_ctrl_r );
41READ8_HANDLER( namco_06xx_1_ctrl_r );
42WRITE8_HANDLER( namco_06xx_0_ctrl_w );
43WRITE8_HANDLER( namco_06xx_1_ctrl_w );
44
45
4625READ8_HANDLER( namcoio_r );
4726WRITE8_HANDLER( namcoio_w );
48void namcoio_init(running_machine *machine, int chipnum, int type, const struct namcoio_interface *intf);
27void namcoio_init(running_machine *machine, int chipnum, int type, const struct namcoio_interface *intf, const char *device);
4928void namcoio_set_reset_line(int chipnum, int state);
5029void namcoio_set_irq_line(running_machine *machine, int chipnum, int state);
5130
src/mame/machine/namco53.c
r0r4879
1/***************************************************************************
2
3Namco 53XX
4
5This custom chip is a Fujitsu MB8843 MCU programmed to act as an I/O device.
6
7        MB8843
8       +------+
9  EXTAL|1   42|Vcc
10   XTAL|2   41|K3
11 /RESET|3   40|K2
12   /IRQ|4   39|K1
13     SO|5   38|K0
14     SI|6   37|R15
15/SC /TO|7   36|R14
16    /TC|8   35|R13
17     P0|9   34|R12
18     P1|10  33|R11
19     P2|11  32|R10
20     P3|12  31|R9
21     O0|13  30|R8
22     O1|14  29|R7
23     O2|15  28|R6
24     O3|16  27|R5
25     O4|17  26|R4
26     O5|18  25|R3
27     O6|19  24|R2
28     O7|20  23|R1
29    GND|21  22|R0
30       +------+
31
32Bits K1-K3 select one of 8 modes in which the input data is interpreted.
33
34Pole Position is hard-wired to use mode 0, which reads 4 steering inputs
35and 4 DIP switches (only 1 of each is used).
36
37Dig Dug can control which mode to use via the MOD bit latches. It sets
38these values to mode 7 when running.
39
40***************************************************************************/
41
42#include "driver.h"
43#include "namco53.h"
44#include "cpu/mb88xx/mb88xx.h"
45
46
47#define VERBOSE 0
48#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
49
50
51typedef struct _namco_53xx_state namco_53xx_state;
52struct _namco_53xx_state
53{
54   const device_config *   cpu;
55   UINT8               portO;
56   devcb_resolved_read8    k;
57   devcb_resolved_read8    in[4];
58   devcb_resolved_write8    p;
59};
60
61INLINE namco_53xx_state *get_safe_token(const device_config *device)
62{
63   assert(device != NULL);
64   assert(device->token != NULL);
65   assert(device->type == NAMCO_53XX);
66
67   return (namco_53xx_state *)device->token;
68}
69
70
71
72static READ8_HANDLER( namco_53xx_K_r )
73{
74   namco_53xx_state *state = get_safe_token(space->cpu->owner);
75   return devcb_call_read8(&state->k, 0);
76}
77
78static READ8_HANDLER( namco_53xx_Rx_r )
79{
80   namco_53xx_state *state = get_safe_token(space->cpu->owner);
81   return devcb_call_read8(&state->in[offset], 0);
82}
83
84static WRITE8_HANDLER( namco_53xx_O_w )
85{
86   namco_53xx_state *state = get_safe_token(space->cpu->owner);
87   UINT8 out = (data & 0x0f);
88   if (data & 0x10)
89      state->portO = (state->portO & 0x0f) | (out << 4);
90   else
91      state->portO = (state->portO & 0xf0) | (out);
92}
93
94static WRITE8_HANDLER( namco_53xx_P_w )
95{
96   namco_53xx_state *state = get_safe_token(space->cpu->owner);
97   devcb_call_write8(&state->p, 0, data);
98}
99
100
101static TIMER_CALLBACK( namco_53xx_irq_clear )
102{
103   namco_53xx_state *state = get_safe_token((const device_config *)ptr);
104   cpu_set_input_line(state->cpu, 0, CLEAR_LINE);
105}
106
107void namco_53xx_read_request(const device_config *device)
108{
109   namco_53xx_state *state = get_safe_token(device);
110   cpu_set_input_line(state->cpu, 0, ASSERT_LINE);
111
112   // The execution time of one instruction is ~4us, so we must make sure to
113   // give the cpu time to poll the /IRQ input before we clear it.
114   // The input clock to the 06XX interface chip is 64H, that is
115   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
116   // asserted for one clock cycle ~= 21us.
117   timer_set(device->machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_53xx_irq_clear);
118}
119
120READ8_DEVICE_HANDLER( namco_53xx_read )
121{
122   namco_53xx_state *state = get_safe_token(device);
123   UINT8 res = state->portO;
124
125   namco_53xx_read_request(device);
126
127   return res;
128}
129
130
131/***************************************************************************
132    DEVICE INTERFACE
133***************************************************************************/
134
135ADDRESS_MAP_START( namco_53xx_map_io, ADDRESS_SPACE_IO, 8 )
136   AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_53xx_K_r)
137   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_53xx_O_w)
138   AM_RANGE(MB88_PORTP,  MB88_PORTP)  AM_WRITE(namco_53xx_P_w)
139   AM_RANGE(MB88_PORTR0, MB88_PORTR3) AM_READ(namco_53xx_Rx_r)
140ADDRESS_MAP_END
141
142
143static MACHINE_DRIVER_START( namco_53xx )
144   MDRV_CPU_ADD("mcu", MB8843, DERIVED_CLOCK(1,1))      /* parent clock, internally divided by 6 */
145   MDRV_CPU_IO_MAP(namco_53xx_map_io)
146MACHINE_DRIVER_END
147
148
149ROM_START( namco_53xx )
150   ROM_REGION( 0x400, "mcu", ROMREGION_LOADBYNAME )
151   ROM_LOAD( "53xx.bin",     0x0000, 0x0400, CRC(b326fecb) SHA1(758d8583d658e4f1df93184009d86c3eb8713899) )
152ROM_END
153
154
155/*-------------------------------------------------
156    device start callback
157-------------------------------------------------*/
158
159static DEVICE_START( namco_53xx )
160{
161   const namco_53xx_interface *config = (const namco_53xx_interface *)device->static_config;
162   namco_53xx_state *state = get_safe_token(device);
163   astring *tempstring = astring_alloc();
164
165   assert(config != NULL);
166
167   /* find our CPU */
168   state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
169   assert(state->cpu != NULL);
170   astring_free(tempstring);
171
172   /* resolve our read/write callbacks */
173   devcb_resolve_read8(&state->k, &config->k, device);
174   devcb_resolve_read8(&state->in[0], &config->in[0], device);
175   devcb_resolve_read8(&state->in[1], &config->in[1], device);
176   devcb_resolve_read8(&state->in[2], &config->in[2], device);
177   devcb_resolve_read8(&state->in[3], &config->in[3], device);
178   devcb_resolve_write8(&state->p, &config->p, device);
179}
180
181
182/*-------------------------------------------------
183    device reset callback
184-------------------------------------------------*/
185
186static DEVICE_RESET( namco_53xx )
187{
188//  namco_53xx_state *state = get_safe_token(device);
189}
190
191
192/*-------------------------------------------------
193    device get info callback
194-------------------------------------------------*/
195
196DEVICE_GET_INFO( namco_53xx )
197{
198   switch (state)
199   {
200      /* --- the following bits of info are returned as 64-bit signed integers --- */
201      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(namco_53xx_state);            break;
202      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
203
204      /* --- the following bits of info are returned as pointers --- */
205      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(namco_53xx);         break;
206      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(namco_53xx); break;
207
208      /* --- the following bits of info are returned as pointers to data or functions --- */
209      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(namco_53xx);    break;
210      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(namco_53xx);    break;
211
212      /* --- the following bits of info are returned as NULL-terminated strings --- */
213      case DEVINFO_STR_NAME:               strcpy(info->s, "Namco 53xx");               break;
214      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Namco I/O");               break;
215      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
216      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
217      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
218   }
219}
src/mame/machine/namco53.h
r0r4879
1#ifndef NAMCO53_H
2#define NAMCO53_H
3
4#include "devcb.h"
5
6
7typedef struct _namco_53xx_interface namco_53xx_interface;
8struct _namco_53xx_interface
9{
10   devcb_read8      k;         /* read handlers for K port */
11   devcb_read8    in[4];      /* read handlers for ports A-D */
12   devcb_write8   p;         /* write handler for P port */
13};
14
15
16#define MDRV_NAMCO_53XX_ADD(_tag, _clock, _interface) \
17   MDRV_DEVICE_ADD(_tag, NAMCO_53XX, _clock) \
18   MDRV_DEVICE_CONFIG(_interface)
19
20#define MDRV_NAMCO_53XX_REMOVE(_tag) \
21   MDRV_DEVICE_REMOVE(_tag)
22
23
24void namco_53xx_read_request(const device_config *device);
25READ8_DEVICE_HANDLER( namco_53xx_read );
26
27
28/* device get info callback */
29#define NAMCO_53XX DEVICE_GET_INFO_NAME(namco_53xx)
30DEVICE_GET_INFO( namco_53xx );
31
32
33#endif   /* NAMCO53_H */
src/mame/machine/tait8741.c
r4878r4879
443443   }
444444}
445445
446static void josvolly_8741_w(const address_space *space,int num,int offset,int data)
446static void josvolly_8741_w(const address_space *space, int num, int offset, int data)
447447{
448448   JV8741 *mcu = &i8741[num];
449449
450450   if(offset==1)
451451   {
452      LOG(("%s:8741[%d] CW %02X\n",cpuexec_describe_context(space->machine),num,data));
452      LOG(("%s:8741[%d] CW %02X\n", cpuexec_describe_context(space->machine), num, data));
453453
454454      /* read pointer */
455455      mcu->cmd = data;
r4878r4879
487487   else
488488   {
489489      /* data */
490      LOG(("%s:8741[%d] DW %02X\n",cpuexec_describe_context(space->machine),num,data));
490      LOG(("%s:8741[%d] DW %02X\n", cpuexec_describe_context(space->machine), num, data));
491491
492      mcu->txd  = data^0x40; /* parity reverce ? */
493      mcu->sts  |= 0x02;     /* TXD busy         */
492      mcu->txd = data ^ 0x40; /* parity reverce ? */
493      mcu->sts |= 0x02;     /* TXD busy         */
494494#if 1
495495      /* interrupt ? */
496      if(num==0)
496      if(num == 0)
497497      {
498498         if(josvolly_nmi_enable)
499499         {
500            cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
500            cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
501501            josvolly_nmi_enable = 0;
502502         }
503503      }
src/mame/machine/balsente.c
r4878r4879
10821082   for (i = 0; i < 6; i++)
10831083      if ((diffchip & (1 << i)) && (data & (1 << i)))
10841084      {
1085#if LOG_CEM_WRITES
10851086         double temp = 0;
10861087
10871088         /* remember the previous value */
1088         temp = cem3394_get_parameter(cem_device[i], reg);
1089         temp =
1090#endif
1091            cem3394_get_parameter(cem_device[i], reg);
10891092
10901093         /* set the voltage */
10911094         cem3394_set_voltage(cem_device[i], reg, voltage);
src/mame/machine/namcos2.c
r4878r4879
7979static void
8080ResetAllSubCPUs( running_machine *machine, int state )
8181{
82   cpu_set_input_line(machine->cpu[CPU_SLAVE], INPUT_LINE_RESET, state);
83   cpu_set_input_line(machine->cpu[CPU_MCU], INPUT_LINE_RESET, state);
82   cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, state);
83   cputag_set_input_line(machine, "mcu", INPUT_LINE_RESET, state);
8484   switch( namcos2_gametype )
8585   {
8686   case NAMCOS21_SOLVALOU:
8787   case NAMCOS21_STARBLADE:
8888   case NAMCOS21_AIRCOMBAT:
8989   case NAMCOS21_CYBERSLED:
90      cpu_set_input_line(machine->cpu[4],INPUT_LINE_RESET,state); /* MASTER DSP */
91      cpu_set_input_line(machine->cpu[5],INPUT_LINE_RESET,state); /* SLAVE DSP */
90      cputag_set_input_line(machine, "dspmaster", INPUT_LINE_RESET, state);
91      cputag_set_input_line(machine, "dspslave", INPUT_LINE_RESET, state);
9292      break;
9393
9494//  case NAMCOS21_WINRUN91:
r4878r4879
105105
106106MACHINE_RESET( namcos2 )
107107{
108   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
108   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
109109   int loop;
110110   mFinalLapProtCount = 0;
111   namcos2_mcu_analog_ctrl=0;
112   namcos2_mcu_analog_data=0xaa;
113   namcos2_mcu_analog_complete=0;
111   namcos2_mcu_analog_ctrl = 0;
112   namcos2_mcu_analog_data = 0xaa;
113   namcos2_mcu_analog_complete = 0;
114114   sendval = 0;
115115
116116   /* Initialise the bank select in the sound CPU */
117   namcos2_sound_bankselect_w(space,0,0); /* Page in bank 0 */
117   namcos2_sound_bankselect_w(space, 0, 0); /* Page in bank 0 */
118118
119   cpu_set_input_line(machine->cpu[CPU_SOUND], INPUT_LINE_RESET, ASSERT_LINE );
119   cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE );
120120
121121   /* Place CPU2 & CPU3 into the reset condition */
122122   ResetAllSubCPUs( machine, ASSERT_LINE );
123123
124124   /* Initialise interrupt handlers */
125   for(loop=0;loop<0x20;loop++)
125   for(loop = 0; loop < 0x20; loop++)
126126   {
127      namcos2_68k_master_C148[loop]=0;
128      namcos2_68k_slave_C148[loop]=0;
129      namcos2_68k_gpu_C148[loop]=0;
127      namcos2_68k_master_C148[loop] = 0;
128      namcos2_68k_slave_C148[loop] = 0;
129      namcos2_68k_gpu_C148[loop] = 0;
130130   }
131131}
132132
r4878r4879
476476static UINT16
477477ReadWriteC148( const address_space *space, offs_t offset, UINT16 data, int bWrite )
478478{
479   offs_t addr = ((offset*2)+0x1c0000)&0x1fe000;
479   offs_t addr = ((offset * 2) + 0x1c0000) & 0x1fe000;
480480   const device_config *altcpu = NULL;
481481   UINT16 *pC148Reg = NULL;
482482   UINT16 *pC148RegAlt = NULL;
483483   UINT16 result = 0;
484484
485   if (space->cpu == space->machine->cpu[CPU_MASTER])
485   if (space->cpu == cputag_get_cpu(space->machine, "maincpu"))
486486   {
487487      pC148Reg = namcos2_68k_master_C148;
488      altcpu = space->machine->cpu[CPU_SLAVE];
488      altcpu = cputag_get_cpu(space->machine, "slave");
489489      pC148RegAlt = namcos2_68k_slave_C148;
490490   }
491   else if (space->cpu == space->machine->cpu[CPU_SLAVE])
491   else if (space->cpu == cputag_get_cpu(space->machine, "slave"))
492492   {
493493      pC148Reg = namcos2_68k_slave_C148;
494      altcpu = space->machine->cpu[CPU_MASTER];
494      altcpu = cputag_get_cpu(space->machine, "maincpu");
495495      pC148RegAlt = namcos2_68k_master_C148;
496496   }
497   else if (space->cpu == space->machine->cpu[CPU_GPU])
497   else if (space->cpu == cputag_get_cpu(space->machine, "gpu"))
498498   {
499499      pC148Reg = namcos2_68k_gpu_C148;
500      altcpu = space->machine->cpu[CPU_MASTER];
500      altcpu = cputag_get_cpu(space->machine, "maincpu");
501501      pC148RegAlt = namcos2_68k_master_C148;
502502   }
503503
r4878r4879
577577      break;
578578
579579   case 0x1e2000: /* Sound CPU Reset control */
580      if( space->cpu == space->machine->cpu[CPU_MASTER] ) /* ? */
580      if (space->cpu == cputag_get_cpu(space->machine, "maincpu")) /* ? */
581581      {
582         if( data&0x01 )
582         if (data & 0x01)
583583         {
584584            /* Resume execution */
585            cpu_set_input_line(space->machine->cpu[CPU_SOUND], INPUT_LINE_RESET, CLEAR_LINE);
585            cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
586586            cpu_yield(space->cpu);
587587         }
588588         else
589589         {
590590            /* Suspend execution */
591            cpu_set_input_line(space->machine->cpu[CPU_SOUND], INPUT_LINE_RESET, ASSERT_LINE);
591            cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
592592         }
593         if( IsSystem21() )
593         if (IsSystem21())
594594         {
595595            //printf( "dspkick=0x%x\n", data );
596            if( data&4 )
596            if (data & 0x04)
597597            {
598598               namcos21_kickstart(space->machine, 1);
599599            }
r4878r4879
602602      break;
603603
604604   case 0x1e4000: /* Alt 68000 & IO CPU Reset */
605      if( space->cpu == space->machine->cpu[CPU_MASTER] ) /* ? */
605      if (space->cpu == cputag_get_cpu(space->machine, "maincpu")) /* ? */
606606      {
607         if( data&0x01 )
607         if (data & 0x01)
608608         { /* Resume execution */
609            ResetAllSubCPUs( space->machine, CLEAR_LINE );
609            ResetAllSubCPUs(space->machine, CLEAR_LINE);
610610            /* Give the new CPU an immediate slice of the action */
611611            cpu_yield(space->cpu);
612612         }
613613         else
614614         { /* Suspend execution */
615            ResetAllSubCPUs( space->machine, ASSERT_LINE );
615            ResetAllSubCPUs(space->machine, ASSERT_LINE);
616616         }
617617      }
618618      break;
r4878r4879
629629
630630WRITE16_HANDLER( namcos2_68k_master_C148_w )
631631{
632   (void)ReadWriteC148( space, offset, data, 1 );
632   (void)ReadWriteC148(space, offset, data, 1);
633633}
634634
635635READ16_HANDLER( namcos2_68k_master_C148_r )
636636{
637   return ReadWriteC148(  space, offset, 0, 0 );
637   return ReadWriteC148(space, offset, 0, 0);
638638}
639639
640640WRITE16_HANDLER( namcos2_68k_slave_C148_w )
641641{
642   (void)ReadWriteC148(  space, offset, data, 1 );
642   (void)ReadWriteC148(space, offset, data, 1);
643643}
644644
645645READ16_HANDLER( namcos2_68k_slave_C148_r )
646646{
647   return ReadWriteC148(  space, offset, 0, 0 );
647   return ReadWriteC148(space, offset, 0, 0);
648648}
649649
650650WRITE16_HANDLER( namcos2_68k_gpu_C148_w )
651651{
652   (void)ReadWriteC148(  space, offset, data, 1 );
652   (void)ReadWriteC148(space, offset, data, 1);
653653}
654654
655655READ16_HANDLER( namcos2_68k_gpu_C148_r )
656656{
657   return ReadWriteC148(  space, offset, 0, 0 );
657   return ReadWriteC148(space, offset, 0, 0);
658658}
659659
660660static TIMER_CALLBACK( namcos2_68k_master_posirq )
661661{
662662   video_screen_update_partial(machine->primary_screen, param);
663   cpu_set_input_line(machine->cpu[CPU_MASTER ], namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
663   cputag_set_input_line(machine, "maincpu", namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
664664}
665665
666666static int
667667GetPosIRQScanline( running_machine *machine )
668668{
669   if( IsSystem21() ) return 0;
669   if (IsSystem21()) return 0;
670670   return namcos2_GetPosIrqScanline(machine);
671671}
672672
673673INTERRUPT_GEN( namcos2_68k_master_vblank )
674674{
675   if( IsSystem21()==0 && namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ] )
675   if (IsSystem21() == 0 && namcos2_68k_master_C148[NAMCOS2_C148_POSIRQ])
676676   {
677677      int scanline = GetPosIRQScanline(device->machine);
678678      timer_set(device->machine, video_screen_get_time_until_pos(device->machine->primary_screen, scanline, 0), NULL, scanline, namcos2_68k_master_posirq );
r4878r4879
683683static TIMER_CALLBACK( namcos2_68k_slave_posirq )
684684{
685685   video_screen_update_partial(machine->primary_screen, param);
686   cpu_set_input_line(machine->cpu[CPU_SLAVE ], namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
686   cputag_set_input_line(machine, "slave", namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
687687}
688688
689689INTERRUPT_GEN( namcos2_68k_slave_vblank )
690690{
691   if( IsSystem21()==0 && namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ] )
691   if (IsSystem21() == 0 && namcos2_68k_slave_C148[NAMCOS2_C148_POSIRQ])
692692   {
693693      int scanline = GetPosIRQScanline(device->machine);
694694      timer_set(device->machine, video_screen_get_time_until_pos(device->machine->primary_screen, scanline, 0), NULL, scanline, namcos2_68k_slave_posirq );
r4878r4879
700700{
701701   //printf( "namcos2_68k_gpu_posirq(%d)\n", param );
702702   video_screen_update_partial(machine->primary_screen, param);
703   cpu_set_input_line(machine->cpu[CPU_GPU], namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
703   cputag_set_input_line(machine, "gpu", namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] , ASSERT_LINE);
704704}
705705
706706INTERRUPT_GEN( namcos2_68k_gpu_vblank )
707707{
708708   //printf( "namcos2_68k_gpu_vblank(%d)\n",namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] );
709   if( namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ] )
709   if (namcos2_68k_gpu_C148[NAMCOS2_C148_POSIRQ])
710710   {
711711      int scanline = 0x50+0x89; /* HACK for Winning Run */
712712      timer_set(device->machine, video_screen_get_time_until_pos(device->machine->primary_screen, scanline, 0), NULL, scanline, namcos2_68k_gpu_posirq );
r4878r4879
782782      /* If the interrupt enable bit is set trigger an A/D IRQ */
783783      if(data & 0x20)
784784      {
785         generic_pulse_irq_line(space->machine->cpu[CPU_MCU], HD63705_INT_ADCONV);
785         generic_pulse_irq_line(cputag_get_cpu(space->machine, "mcu"), HD63705_INT_ADCONV);
786786      }
787787   }
788788}
src/mame/machine/namco50.c
r4878r4879
134134#include "cpu/mb88xx/mb88xx.h"
135135
136136
137static UINT8 latched_cmd[2];
138static UINT8 latched_rw[2];
139static UINT8 portO[2];
137typedef struct _namco_50xx_state namco_50xx_state;
138struct _namco_50xx_state
139{
140   const device_config *   cpu;
141   UINT8               latched_cmd;
142   UINT8               latched_rw;
143   UINT8               portO;
144};
140145
141
142static TIMER_CALLBACK( namco_50xx_latch_callback )
146INLINE namco_50xx_state *get_safe_token(const device_config *device)
143147{
144   latched_cmd[0] = param;
145   latched_rw[0] = 1;
148   assert(device != NULL);
149   assert(device->token != NULL);
150   assert(device->type == NAMCO_50XX);
151
152   return (namco_50xx_state *)device->token;
146153}
147154
148static TIMER_CALLBACK( namco_50xx_2_latch_callback )
155
156
157static TIMER_CALLBACK( namco_50xx_latch_callback )
149158{
150   latched_cmd[1] = param;
151   latched_rw[1] = 1;
159   namco_50xx_state *state = get_safe_token((const device_config *)ptr);
160   state->latched_cmd = param;
161   state->latched_rw = 1;
152162}
153163
154164
155165static TIMER_CALLBACK( namco_50xx_readrequest_callback )
156166{
157   latched_rw[0] = 0;
167   namco_50xx_state *state = get_safe_token((const device_config *)ptr);
168   state->latched_rw = 0;
158169}
159170
160static TIMER_CALLBACK( namco_50xx_2_readrequest_callback )
161{
162   latched_rw[1] = 0;
163}
164171
165
166172static READ8_HANDLER( namco_50xx_K_r )
167173{
168   return latched_cmd[0] >> 4;
174   namco_50xx_state *state = get_safe_token(space->cpu->owner);
175   return state->latched_cmd >> 4;
169176}
170177
171178static READ8_HANDLER( namco_50xx_R0_r )
172179{
173   return latched_cmd[0] & 0x0f;
180   namco_50xx_state *state = get_safe_token(space->cpu->owner);
181   return state->latched_cmd & 0x0f;
174182}
175183
176184static READ8_HANDLER( namco_50xx_R2_r )
177185{
178   return latched_rw[0] & 1;
186   namco_50xx_state *state = get_safe_token(space->cpu->owner);
187   return state->latched_rw & 1;
179188}
180189
181190
182191
183static READ8_HANDLER( namco_50xx_2_K_r )
184{
185   return latched_cmd[1] >> 4;
186}
187
188static READ8_HANDLER( namco_50xx_2_R0_r )
189{
190   return latched_cmd[1] & 0x0f;
191}
192
193static READ8_HANDLER( namco_50xx_2_R2_r )
194{
195   return latched_rw[1] & 1;
196}
197
198
199192static WRITE8_HANDLER( namco_50xx_O_w )
200193{
194   namco_50xx_state *state = get_safe_token(space->cpu->owner);
201195   UINT8 out = (data & 0x0f);
202196   if (data & 0x10)
203      portO[0] = (portO[0] & 0x0f) | (out << 4);
197      state->portO = (state->portO & 0x0f) | (out << 4);
204198   else
205      portO[0] = (portO[0] & 0xf0) | (out);
199      state->portO = (state->portO & 0xf0) | (out);
206200}
207201
208202
209203
210static WRITE8_HANDLER( namco_50xx_2_O_w )
211{
212   UINT8 out = (data & 0x0f);
213   if (data & 0x10)
214      portO[1] = (portO[1] & 0x0f) | (out << 4);
215   else
216      portO[1] = (portO[1] & 0xf0) | (out);
217}
218204
219
220
221ADDRESS_MAP_START( namco_50xx_map_program, ADDRESS_SPACE_PROGRAM, 8 )
222   AM_RANGE(0x000, 0x7ff) AM_ROM
223ADDRESS_MAP_END
224
225ADDRESS_MAP_START( namco_50xx_map_data, ADDRESS_SPACE_DATA, 8 )
226   AM_RANGE(0x00, 0x7f) AM_RAM
227ADDRESS_MAP_END
228
229ADDRESS_MAP_START( namco_50xx_map_io, ADDRESS_SPACE_IO, 8 )
230   AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_50xx_K_r)
231   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_50xx_O_w)
232   AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_50xx_R0_r)
233   AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_READ(namco_50xx_R2_r)
234ADDRESS_MAP_END
235
236
237
238ADDRESS_MAP_START( namco_50xx_2_map_program, ADDRESS_SPACE_PROGRAM, 8 )
239   AM_RANGE(0x000, 0x7ff) AM_ROM
240ADDRESS_MAP_END
241
242ADDRESS_MAP_START( namco_50xx_2_map_data, ADDRESS_SPACE_DATA, 8 )
243   AM_RANGE(0x00, 0x7f) AM_RAM
244ADDRESS_MAP_END
245
246ADDRESS_MAP_START( namco_50xx_2_map_io, ADDRESS_SPACE_IO, 8 )
247   AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_50xx_2_K_r)
248   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_50xx_2_O_w)
249   AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_50xx_2_R0_r)
250   AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_READ(namco_50xx_2_R2_r)
251ADDRESS_MAP_END
252
253
254
255205static TIMER_CALLBACK( namco_50xx_irq_clear )
256206{
257   const device_config *cpu = (const device_config *)ptr;
258   cpu_set_input_line(cpu, 0, CLEAR_LINE);
207   namco_50xx_state *state = get_safe_token((const device_config *)ptr);
208   cpu_set_input_line(state->cpu, 0, CLEAR_LINE);
259209}
260210
261static void namco_50xx_irq_set(const device_config *cpu)
211static void namco_50xx_irq_set(const device_config *device)
262212{
263   cpu_set_input_line(cpu, 0, ASSERT_LINE);
213   namco_50xx_state *state = get_safe_token(device);
264214
215   cpu_set_input_line(state->cpu, 0, ASSERT_LINE);
216
265217   // The execution time of one instruction is ~4us, so we must make sure to
266218   // give the cpu time to poll the /IRQ input before we clear it.
267219   // The input clock to the 06XX interface chip is 64H, that is
268220   // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
269221   // asserted for one clock cycle ~= 21us.
270   timer_set(cpu->machine, ATTOTIME_IN_USEC(21), (void *)cpu, 0, namco_50xx_irq_clear);
222   timer_set(device->machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_50xx_irq_clear);
271223}
272224
273void namco_50xx_write(running_machine *machine, UINT8 data)
225WRITE8_DEVICE_HANDLER( namco_50xx_write )
274226{
275   const device_config *cpu = cputag_get_cpu(machine, CPUTAG_50XX);
227   timer_call_after_resynch(device->machine, (void *)device, data, namco_50xx_latch_callback);
276228
277   if (cpu == NULL)
278      return;
229   namco_50xx_irq_set(device);
230}
279231
280   timer_call_after_resynch(machine, NULL, data, namco_50xx_latch_callback);
281232
282   namco_50xx_irq_set(cpu);
233void namco_50xx_read_request(const device_config *device)
234{
235   timer_call_after_resynch(device->machine, (void *)device, 0, namco_50xx_readrequest_callback);
236
237   namco_50xx_irq_set(device);
283238}
284239
285void namco_50xx_2_write(running_machine *machine, UINT8 data)
240
241READ8_DEVICE_HANDLER( namco_50xx_read )
286242{
287   const device_config *cpu = cputag_get_cpu(machine, CPUTAG_50XX_2);
243   namco_50xx_state *state = get_safe_token(device);
244   UINT8 res = state->portO;
288245
289   if (cpu == NULL)
290      return;
246   namco_50xx_read_request(device);
291247
292   timer_call_after_resynch(machine, NULL, data, namco_50xx_2_latch_callback);
293
294   namco_50xx_irq_set(cpu);
248   return res;
295249}
296250
297251
298void namco_50xx_read_request(running_machine *machine)
299{
300   const device_config *cpu = cputag_get_cpu(machine, CPUTAG_50XX);
252/***************************************************************************
253    DEVICE INTERFACE
254***************************************************************************/
301255
302   if (cpu == NULL)
303      return;
256ADDRESS_MAP_START( namco_50xx_map_io, ADDRESS_SPACE_IO, 8 )
257   AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_50xx_K_r)
258   AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_50xx_O_w)
259   AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_50xx_R0_r)
260   AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_READ(namco_50xx_R2_r)
261ADDRESS_MAP_END
304262
305   timer_call_after_resynch(machine, NULL, 0, namco_50xx_readrequest_callback);
306263
307   namco_50xx_irq_set(cpu);
308}
264static MACHINE_DRIVER_START( namco_50xx )
265   MDRV_CPU_ADD("mcu", MB8842, DERIVED_CLOCK(1,1))      /* parent clock, internally divided by 6 */
266   MDRV_CPU_IO_MAP(namco_50xx_map_io)
267MACHINE_DRIVER_END
309268
310void namco_50xx_2_read_request(running_machine *machine)
311{
312   const device_config *cpu = cputag_get_cpu(machine, CPUTAG_50XX_2);
313269
314   if (cpu == NULL)
315      return;
270ROM_START( namco_50xx )
271   ROM_REGION( 0x800, "mcu", ROMREGION_LOADBYNAME )
272   ROM_LOAD( "50xx.bin",     0x0000, 0x0800, CRC(a0acbaf7) SHA1(f03c79451e73b3a93c1591cdb27fedc9f130508d) )
273ROM_END
316274
317   timer_call_after_resynch(machine, NULL, 0, namco_50xx_2_readrequest_callback);
318275
319   namco_50xx_irq_set(cpu);
276/*-------------------------------------------------
277    device start callback
278-------------------------------------------------*/
279
280static DEVICE_START( namco_50xx )
281{
282   namco_50xx_state *state = get_safe_token(device);
283   astring *tempstring = astring_alloc();
284
285   /* find our CPU */
286   state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
287   assert(state->cpu != NULL);
288   astring_free(tempstring);
320289}
321290
322291
323UINT8 namco_50xx_read(running_machine *machine)
292/*-------------------------------------------------
293    device reset callback
294-------------------------------------------------*/
295
296static DEVICE_RESET( namco_50xx )
324297{
325   UINT8 res = portO[0];
298//  namco_50xx_state *state = get_safe_token(device);
299}
326300
327   namco_50xx_read_request(machine);
328301
329   return res;
330}
302/*-------------------------------------------------
303    device get info callback
304-------------------------------------------------*/
331305
332UINT8 namco_50xx_2_read(running_machine *machine)
306DEVICE_GET_INFO( namco_50xx )
333307{
334   UINT8 res = portO[1];
308   switch (state)
309   {
310      /* --- the following bits of info are returned as 64-bit signed integers --- */
311      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(namco_50xx_state);            break;
312      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
335313
336   namco_50xx_2_read_request(machine);
314      /* --- the following bits of info are returned as pointers --- */
315      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(namco_50xx);         break;
316      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(namco_50xx); break;
337317
338   return res;
318      /* --- the following bits of info are returned as pointers to data or functions --- */
319      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(namco_50xx);    break;
320      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(namco_50xx);    break;
321
322      /* --- the following bits of info are returned as NULL-terminated strings --- */
323      case DEVINFO_STR_NAME:               strcpy(info->s, "Namco 50xx");               break;
324      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Namco I/O");               break;
325      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
326      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
327      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
328   }
339329}
src/mame/machine/namco50.h
r4878r4879
11#ifndef NAMCO50_H
22#define NAMCO50_H
33
4#define CPUTAG_50XX "50xx"
5#define CPUTAG_50XX_2 "50xx_2"
64
7ADDRESS_MAP_EXTERN( namco_50xx_map_program, 8 );
8ADDRESS_MAP_EXTERN( namco_50xx_map_data, 8 );
9ADDRESS_MAP_EXTERN( namco_50xx_map_io, 8 );
5#define MDRV_NAMCO_50XX_ADD(_tag, _clock) \
6   MDRV_DEVICE_ADD(_tag, NAMCO_50XX, _clock) \
107
11ADDRESS_MAP_EXTERN( namco_50xx_2_map_program, 8 );
12ADDRESS_MAP_EXTERN( namco_50xx_2_map_data, 8 );
13ADDRESS_MAP_EXTERN( namco_50xx_2_map_io, 8 );
8#define MDRV_NAMCO_50XX_REMOVE(_tag) \
9   MDRV_DEVICE_REMOVE(_tag)
1410
15UINT8 namco_50xx_read(running_machine *machine);
16void namco_50xx_read_request(running_machine *machine);
17void namco_50xx_write(running_machine *machine, UINT8 data);
1811
19UINT8 namco_50xx_2_read(running_machine *machine);
20void namco_50xx_2_read_request(running_machine *machine);
21void namco_50xx_2_write(running_machine *machine, UINT8 data);
12READ8_DEVICE_HANDLER( namco_50xx_read );
13void namco_50xx_read_request(const device_config *device);
14WRITE8_DEVICE_HANDLER( namco_50xx_write );
2215
23#endif   /* NAMCO54_H */
16
17/* device get info callback */
18#define NAMCO_50XX DEVICE_GET_INFO_NAME(namco_50xx)
19DEVICE_GET_INFO( namco_50xx );
20
21
22#endif   /* NAMCO50_H */
src/mame/machine/decoprot.c
r4878r4879
108108
109109WRITE16_HANDLER( deco16_104_prot_w ) /* Wizard Fire */
110110{
111   if (offset==(0x150/2)) {
112      soundlatch_w(space,0,data&0xff);
113      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
111   if (offset == (0x150 / 2))
112   {
113      soundlatch_w(space, 0, data & 0xff);
114      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
114115      return;
115116   }
116117
117   if (offset!=(0x150>>1) && offset!=(0x0>>1) && offset!=(0x110>>1) && offset!=(0x280>>1)
118      && offset!=(0x290>>1) && offset!=(0x2b0>>1) && offset!=(0x370>>1) && offset!=(0x3c0>>1)
119      && offset!=(0x370>>1) && offset!=(0x3c0>>1) && offset!=(0x430>>1) && offset!=(0x460>>1)
120      && offset!=(0x5a0>>1) && offset!=(0x5b0>>1) && offset!=(0x6e0>>1) && offset!=(0x7d0>>1)
118   if (offset != (0x150 >> 1) && offset != (0x0 >> 1) && offset != (0x110 >> 1) && offset != (0x280 >> 1)
119      && offset != (0x290 >> 1) && offset != (0x2b0 >> 1) && offset != (0x370 >> 1) && offset != (0x3c0 >> 1)
120      && offset != (0x370 >> 1) && offset != (0x3c0 >> 1) && offset != (0x430 >> 1) && offset != (0x460 >> 1)
121      && offset != (0x5a0 >> 1) && offset != (0x5b0 >> 1) && offset != (0x6e0 >> 1) && offset != (0x7d0 >> 1)
121122      )
122      logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n",cpu_get_pc(space->cpu),offset<<1,data);
123      logerror("CONTROL PC %06x: warning - write protection memory address %04x %04x\n", cpu_get_pc(space->cpu), offset << 1, data);
123124
124125   COMBINE_DATA(&deco16_prot_ram[offset]);
125126}
r4878r4879
226227
227228WRITE16_HANDLER( deco16_60_prot_w ) /* Edward Randy */
228229{
229   if (offset==(0x64/2)) {
230      soundlatch_w(space,0,data&0xff);
231      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
230   if (offset == (0x64 / 2))
231   {
232      soundlatch_w(space, 0, data & 0xff);
233      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
232234   }
233235
234236   COMBINE_DATA(&deco16_prot_ram[offset]);
r4878r4879
415417
416418WRITE16_HANDLER( deco16_66_prot_w ) /* Mutant Fighter */
417419{
418   if (offset==(0x64/2)) {
419      soundlatch_w(space,0,data&0xff);
420      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
420   if (offset == (0x64 / 2))
421   {
422      soundlatch_w(space, 0, data & 0xff);
423      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
421424      return;
422425   }
423426
r4878r4879
601604
602605WRITE16_HANDLER( deco16_104_cninja_prot_w )
603606{
604   if (offset==(0xa8/2)) {
605      soundlatch_w(space,0,data&0xff);
606      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
607   if (offset == (0xa8 / 2))
608   {
609      soundlatch_w(space, 0, data & 0xff);
610      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
607611      return;
608612   }
609613
r4878r4879
663667{
664668   COMBINE_DATA(&deco16_prot_ram[offset]);
665669
666   if (offset == (0x10a >> 1)) {
667      soundlatch_w(space,0,data&0xff);
668      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
670   if (offset == (0x10a >> 1))
671   {
672      soundlatch_w(space, 0, data & 0xff);
673      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
669674      return;
670675   }
671676}
r4878r4879
782787   else
783788      COMBINE_DATA(&deco16_prot_ram[offset]);
784789
785   if (offset==(0xa8/2)) {
786      soundlatch_w(space,0,data&0xff);
787      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
790   if (offset == (0xa8 / 2))
791   {
792      soundlatch_w(space, 0, data & 0xff);
793      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
788794      return;
789795   }
790796
r4878r4879
12111217   const int sndport=0x260;
12121218   const int xorport=0x340;
12131219   const int maskport=0x6c0;
1214   if (writeport==sndport) {
1215      soundlatch_w(space,0,data&0xff);
1216      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
1220   if (writeport == sndport)
1221   {
1222      soundlatch_w(space, 0, data & 0xff);
1223      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
12171224      return;
12181225   }
12191226
r4878r4879
16351642
16361643WRITE32_HANDLER( deco16_146_fghthist_prot_w )
16371644{
1638   UINT16 addr=BITSWAP16(offset<<1, 0, 0, 0, 0, 0, 10, 1, 9, 2, 8, 3, 7, 4, 6, 5, 0);
1645   UINT16 addr = BITSWAP16(offset << 1, 0, 0, 0, 0, 0, 10, 1, 9, 2, 8, 3, 7, 4, 6, 5, 0);
16391646
1640   decoprot_last_write=addr;
1641   decoprot_last_write_val=data>>16;
1647   decoprot_last_write = addr;
1648   decoprot_last_write_val = data >> 16;
16421649
1643   deco16_146_core_prot_w(space, addr, data>>16, mem_mask>>16);
1650   deco16_146_core_prot_w(space, addr, data >> 16, mem_mask >> 16);
16441651}
16451652
16461653READ32_HANDLER( deco16_146_fghthist_prot_r )
r4878r4879
17111718
17121719WRITE16_HANDLER( deco16_146_nitroball_prot_w )
17131720{
1714   UINT16 addr=BITSWAP16(offset<<1, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1721   UINT16 addr = BITSWAP16(offset << 1, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
17151722   deco16_146_core_prot_w(space, addr, data, mem_mask);
17161723}
17171724
17181725READ16_HANDLER( deco16_146_nitroball_prot_r )
17191726{
1720   UINT16 addr=BITSWAP16(offset<<1, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
1727   UINT16 addr = BITSWAP16(offset << 1, 0, 0, 0, 0, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0);
17211728   return deco16_146_core_prot_r(space, addr, mem_mask);
17221729}
17231730
r4878r4879
17391746
17401747WRITE16_HANDLER( dietgo_104_prot_w )
17411748{
1742   if (offset==(0x380/2)) {
1743      soundlatch_w(space,0,data&0xff);
1744      cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
1749   if (offset == (0x380 / 2))
1750   {
1751      soundlatch_w(space, 0, data & 0xff);
1752      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
17451753      return;
17461754   }
1747   logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",cpu_get_pc(space->cpu),offset<<1,data);
1755   logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n", cpu_get_pc(space->cpu), offset << 1, data);
17481756}
17491757
17501758/**********************************************************************************/
src/mame/machine/mcr.c
r4878r4879
377377   }
378378
379379   /* initialize the clock */
380   m6840_internal_counter_period = ATTOTIME_IN_HZ(cpu_get_clock(machine->cpu[0]) / 10);
380   m6840_internal_counter_period = ATTOTIME_IN_HZ(cputag_get_clock(machine, "maincpu") / 10);
381381
382382   /* reset cocktail flip */
383383   mcr_cocktail_flip = 0;
r4878r4879
481481
482482static void update_mcr68_interrupts(running_machine *machine)
483483{
484   cpu_set_input_line(machine->cpu[0], v493_irq_vector, v493_irq_state ? ASSERT_LINE : CLEAR_LINE);
485   cpu_set_input_line(machine->cpu[0], m6840_irq_vector, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
484   cputag_set_input_line(machine, "maincpu", v493_irq_vector, v493_irq_state ? ASSERT_LINE : CLEAR_LINE);
485   cputag_set_input_line(machine, "maincpu", m6840_irq_vector, m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
486486}
487487
488488
src/mame/machine/galaxold.c
r4878r4879
2727static void galaxold_7474_9M_1_callback(running_machine *machine)
2828{
2929   /* Q goes to the NMI line */
30   cpu_set_input_line(machine->cpu[0], irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE);
30   cputag_set_input_line(machine, "maincpu", irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE);
3131}
3232
3333static const struct TTL7474_interface galaxold_7474_9M_2_intf =
r4878r4879
209209         rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4);
210210   }
211211
212   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3001, 0x3001, 0, 0, dingoe_3001_r);   /* Protection check */
212   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3001, 0x3001, 0, 0, dingoe_3001_r);   /* Protection check */
213213
214214}
215215
r4878r4879
256256DRIVER_INIT( pisces )
257257{
258258   /* the coin lockout was replaced */
259   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w);
259   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w);
260260}
261261
262262DRIVER_INIT( checkmaj )
263263{
264264   /* for the title screen */
265   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
265   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
266266}
267267
268268DRIVER_INIT( dingo )
269269{
270   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, dingo_3000_r);
271   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3035, 0x3035, 0, 0, dingo_3035_r);
270   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, dingo_3000_r);
271   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3035, 0x3035, 0, 0, dingo_3035_r);
272272}
273273
274274
r4878r4879
286286
287287DRIVER_INIT( mooncrsu )
288288{
289   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w);
289   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w);
290290}
291291
292292DRIVER_INIT( mooncrst )
r4878r4879
303303
304304DRIVER_INIT( mooncrgx )
305305{
306   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w);
306   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w);
307307}
308308
309309DRIVER_INIT( moonqsr )
r4878r4879
386386
387387DRIVER_INIT( 4in1 )
388388{
389   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
389   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
390390   offs_t i, len = memory_region_length(machine, "maincpu");
391391   UINT8 *RAM = memory_region(machine, "maincpu");
392392
r4878r4879
410410DRIVER_INIT( ladybugg )
411411{
412412/* Doesn't actually use the bank, but it mustn't have a coin lock! */
413memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w);
413memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w);
414414}
src/mame/machine/psx.c
r4878r4879
6464   if( ( m_n_irqdata & m_n_irqmask ) != 0 )
6565   {
6666      verboselog( machine, 2, "psx irq assert\n" );
67      cpu_set_input_line(machine->cpu[0], PSXCPU_IRQ0, ASSERT_LINE );
67      cputag_set_input_line(machine, "maincpu", PSXCPU_IRQ0, ASSERT_LINE );
6868   }
6969   else
7070   {
7171      verboselog( machine, 2, "psx irq clear\n" );
72      cpu_set_input_line(machine->cpu[0], PSXCPU_IRQ0, CLEAR_LINE );
72      cputag_set_input_line(machine, "maincpu", PSXCPU_IRQ0, CLEAR_LINE );
7373   }
7474}
7575
r4878r4879
485485static UINT64 psxcpu_gettotalcycles( running_machine *machine )
486486{
487487   /* TODO: should return the start of the current tick. */
488   return cpu_get_total_cycles(machine->cpu[0]) * 2;
488   return cpu_get_total_cycles(cputag_get_cpu(machine, "maincpu")) * 2;
489489}
490490
491491static int root_divider( int n_counter )
src/mame/machine/williams.c
r4878r4879
5050
5151/* Lotto Fun-specific code */
5252static READ8_DEVICE_HANDLER( lottofun_input_port_0_r );
53static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w );
5354
5455/* Turkey Shoot-specific code */
5556static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r );
r4878r4879
142143const pia6821_interface lottofun_pia_0_intf =
143144{
144145   /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(lottofun_input_port_0_r), DEVCB_HANDLER(input_port_1_device_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
145   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, ticket_dispenser_w), DEVCB_NULL, DEVCB_NULL,
146   /*outputs: A/B,CA/B2       */ DEVCB_NULL, DEVCB_MEMORY_HANDLER("maincpu", PROGRAM, ticket_dispenser_w), DEVCB_HANDLER(lottofun_coin_lock_w), DEVCB_NULL,
146147   /*irqs   : A/B             */ DEVCB_NULL, DEVCB_NULL
147148};
148149
r4878r4879
889890   return input_port_read(device->machine, "IN0") | ticket_dispenser_r(space, offset);
890891}
891892
893static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
894{
895   coin_lockout_global_w(data & 1); /* bit 5 of PIC control port A */
896}
892897
893
894898/*************************************
895899 *
896900 *  Turkey Shoot-specific routines
src/mame/machine/namco51.c
r0r4879
1/***************************************************************************
2
3Namco 51XX
4
5This custom chip is a Fujitsu MB8843 MCU programmed to act as an I/O device
6with built-in coin management.
7 protection
8device. It keeps track of the players scores, and checks if a high score has
9been obtained or bonus lives should be awarded. The main CPU has a range of
10commands to increment/decrement the score by various fixed amounts.
11
12The device is used to its full potential only by Bosconian; Xevious uses it
13too, but only to do a protection check on startup.
14
15CMD = command from main CPU
16ANS = answer to main CPU
17
18The chip reads/writes the I/O ports when the /IRQ is pulled down. Pin 21
19determines whether a read or write should happen (1=R, 0=W).
20
21        MB8843
22       +------+
23  EXTAL|1   42|Vcc
24   XTAL|2   41|K3
25 /RESET|3   40|K2
26   /IRQ|4   39|K1
27     SO|5   38|K0
28     SI|6   37|R15
29/SC /TO|7   36|R14
30    /TC|8   35|R13
31     P0|9   34|R12
32     P1|10  33|R11
33     P2|11  32|R10
34     P3|12  31|R9
35     O0|13  30|R8
36     O1|14  29|R7
37     O2|15  28|R6
38     O3|16  27|R5
39     O4|17  26|R4
40     O5|18  25|R3
41     O6|19  24|R2
42     O7|20  23|R1
43    GND|21  22|R0
44       +------+
45
46
47commands:
4800: nop
4901 + 4 arguments: set coinage (xevious, possibly because of a bug, is different)
5002: go in "credit" mode and enable start buttons
5103: disable joystick remapping
5204: enable joystick remapping
5305: go in "switch" mode
5406: nop
5507: nop
56
57***************************************************************************/
58
59#include "driver.h"
60#include "namco51.h"
61#include "cpu/mb88xx/mb88xx.h"
62
63
64#define VERBOSE 0
65#define LOG(x) do { if (VERBOSE) logerror x; } while (0)
66
67
68#define READ_PORT(st,num)          devcb_call_read8(&(st)->in[num], 0)
69#define WRITE_PORT(st,num,data)    devcb_call_write8(&(st)->out[num], 0, data)
70
71
72typedef struct _namco_51xx_state namco_51xx_state;
73struct _namco_51xx_state
74{
75   const device_config *   cpu;
76   devcb_resolved_read8 in[4];
77   devcb_resolved_write8 out[2];
78   INT32 lastcoins,lastbuttons;
79   INT32 credits;
80   INT32 coins[2];
81   INT32 coins_per_cred[2];
82   INT32 creds_per_coin[2];
83   INT32 in_count;
84   INT32 mode,coincred_mode,remap_joy;
85};
86
87INLINE namco_51xx_state *get_safe_token(const device_config *device)
88{
89   assert(device != NULL);
90   assert(device->token != NULL);
91   assert(device->type == NAMCO_51XX);
92
93   return (namco_51xx_state *)device->token;
94}
95
96
97
98WRITE8_DEVICE_HANDLER( namco_51xx_write )
99{
100   namco_51xx_state *state = get_safe_token(device);
101
102   data &= 0x07;
103
104   LOG(("%s: custom 51XX write %02x\n",cpuexec_describe_context(device->machine),data));
105
106   if (state->coincred_mode)
107   {
108      switch (state->coincred_mode--)
109      {
110         case 4: state->coins_per_cred[0] = data; break;
111         case 3: state->creds_per_coin[0] = data; break;
112         case 2: state->coins_per_cred[1] = data; break;
113         case 1: state->creds_per_coin[1] = data; break;
114      }
115   }
116   else
117   {
118      switch (data)
119      {
120         case 0:   // nop
121            break;
122
123         case 1:   // set coinage
124            state->coincred_mode = 4;
125            /* this is a good time to reset the credits counter */
126            state->credits = 0;
127
128            {
129               /* kludge for a possible bug in Xevious */
130               static const game_driver *namcoio_51XX_driver = NULL;
131               static int namcoio_51XX_kludge = 0;
132
133               /* Only compute namcoio_51XX_kludge when gamedrv changes */
134               if (namcoio_51XX_driver != device->machine->gamedrv)
135               {
136                  namcoio_51XX_driver = device->machine->gamedrv;
137                  if (strcmp(namcoio_51XX_driver->name, "xevious") == 0 ||
138                     strcmp(namcoio_51XX_driver->parent, "xevious") == 0)
139                     namcoio_51XX_kludge = 1;
140                  else
141                     namcoio_51XX_kludge = 0;
142               }
143
144               if (namcoio_51XX_kludge)
145               {
146                  state->coincred_mode = 6;
147                  state->remap_joy = 1;
148               }
149            }
150            break;
151
152         case 2:   // go in "credits" mode and enable start buttons
153            state->mode = 1;
154            state->in_count = 0;
155            break;
156
157         case 3:   // disable joystick remapping
158            state->remap_joy = 0;
159            break;
160
161         case 4:   // enable joystick remapping
162            state->remap_joy = 1;
163            break;
164
165         case 5:   // go in "switch" mode
166            state->mode = 0;
167            state->in_count = 0;
168            break;
169
170         default:
171            logerror("unknown 51XX command %02x\n",data);
172            break;
173      }
174   }
175}
176
177
178/* joystick input mapping
179
180  The joystick is parsed and a number corresponding to the direction is returned,
181  according to the following table:
182
183          0
184        7   1
185      6   8   2
186        5   3
187          4
188
189  The values for directions impossible to obtain on a joystick have not been
190  verified on Namco original hardware, but they are the same in all the bootlegs,
191  so we can assume they are right.
192*/
193static const int joy_map[16] =
194/*  LDRU, LDR, LDU,  LD, LRU, LR,  LU,    L, DRU,  DR,  DU,   D,  RU,   R,   U, center */
195{    0xf, 0xe, 0xd, 0x5, 0xc, 0x9, 0x7, 0x6, 0xb, 0x3, 0xa, 0x4, 0x1, 0x2, 0x0, 0x8 };
196
197
198READ8_DEVICE_HANDLER( namco_51xx_read )
199{
200   namco_51xx_state *state = get_safe_token(device);
201
202   LOG(("%s: custom 51XX read\n",cpuexec_describe_context(device->machine)));
203
204   if (state->mode == 0)   /* switch mode */
205   {
206      switch ((state->in_count++) % 3)
207      {
208         default:
209         case 0: return READ_PORT(state,0) | (READ_PORT(state,1) << 4);
210         case 1: return READ_PORT(state,2) | (READ_PORT(state,3) << 4);
211         case 2: return 0;   // nothing?
212      }
213   }
214   else   /* credits mode */
215   {
216      switch ((state->in_count++) % 3)
217      {
218         default:
219         case 0:   // number of credits in BCD format
220            {
221               int in,toggle;
222
223               in = ~(READ_PORT(state,0) | (READ_PORT(state,1) << 4));
224               toggle = in ^ state->lastcoins;
225               state->lastcoins = in;
226
227               if (state->coins_per_cred[0] > 0)
228               {
229                  if (state->credits >= 99)
230                  {
231                     WRITE_PORT(state,1,1);   // coin lockout
232                  }
233                  else
234                  {
235                     WRITE_PORT(state,1,0);   // coin lockout
236                     /* check if the user inserted a coin */
237                     if (toggle & in & 0x10)
238                     {
239                        state->coins[0]++;
240                        WRITE_PORT(state,0,0x04);   // coin counter
241                        WRITE_PORT(state,0,0x0c);
242                        if (state->coins[0] >= state->coins_per_cred[0])
243                        {
244                           state->credits += state->creds_per_coin[0];
245                           state->coins[0] -= state->coins_per_cred[0];
246                        }
247                     }
248                     if (toggle & in & 0x20)
249                     {
250                        state->coins[1]++;
251                        WRITE_PORT(state,0,0x08);   // coin counter
252                        WRITE_PORT(state,0,0x0c);
253                        if (state->coins[1] >= state->coins_per_cred[1])
254                        {
255                           state->credits += state->creds_per_coin[1];
256                           state->coins[1] -= state->coins_per_cred[1];
257                        }
258                     }
259                     if (toggle & in & 0x40)
260                     {
261                        state->credits++;
262                     }
263                  }
264               }
265               else state->credits = 100;   // free play
266
267               if (state->mode == 1)
268               {
269                  int on = (video_screen_get_frame_number(device->machine->primary_screen) & 0x10) >> 4;
270
271                  if (state->credits >= 2)
272                     WRITE_PORT(state,0,0x0c | 3*on);   // lamps
273                  else if (state->credits >= 1)
274                     WRITE_PORT(state,0,0x0c | 2*on);   // lamps
275                  else
276                     WRITE_PORT(state,0,0x0c);   // lamps off
277
278                  /* check for 1 player start button */
279                  if (toggle & in & 0x04)
280                  {
281                     if (state->credits >= 1)
282                     {
283                        state->credits--;
284                        state->mode = 2;
285                        WRITE_PORT(state,0,0x0c);   // lamps off
286                     }
287                  }
288                  /* check for 2 players start button */
289                  else if (toggle & in & 0x08)
290                  {
291                     if (state->credits >= 2)
292                     {
293                        state->credits -= 2;
294                        state->mode = 2;
295                        WRITE_PORT(state, 0,0x0c);   // lamps off
296                     }
297                  }
298               }
299            }
300
301            if (~READ_PORT(state, 1) & 0x08)   /* check test mode switch */
302               return 0xbb;
303
304            return (state->credits / 10) * 16 + state->credits % 10;
305
306         case 1:
307            {
308               int joy = READ_PORT(state,2) & 0x0f;
309               int in,toggle;
310
311               in = ~READ_PORT(state,0);
312               toggle = in ^ state->lastbuttons;
313               state->lastbuttons = (state->lastbuttons & 2) | (in & 1);
314
315               /* remap joystick */
316               if (state->remap_joy) joy = joy_map[joy];
317
318               /* fire */
319               joy |= ((toggle & in & 0x01)^1) << 4;
320               joy |= ((in & 0x01)^1) << 5;
321
322               return joy;
323            }
324
325         case 2:
326            {
327               int joy = READ_PORT(state,3) & 0x0f;
328               int in,toggle;
329
330               in = ~READ_PORT(state,0);
331               toggle = in ^ state->lastbuttons;
332               state->lastbuttons = (state->lastbuttons & 1) | (in & 2);
333
334               /* remap joystick */
335               if (state->remap_joy) joy = joy_map[joy];
336
337               /* fire */
338               joy |= ((toggle & in & 0x02)^2) << 3;
339               joy |= ((in & 0x02)^2) << 4;
340
341               return joy;
342            }
343      }
344   }
345}
346
347
348
349
350
351/***************************************************************************
352    DEVICE INTERFACE
353***************************************************************************/
354
355ADDRESS_MAP_START( namco_51xx_map_io, ADDRESS_SPACE_IO, 8 )
356//  AM_RANGE(MB88_PORTK,  MB88_PORTK)  AM_READ(namco_51xx_K_r)
357//  AM_RANGE(MB88_PORTO,  MB88_PORTO)  AM_WRITE(namco_51xx_O_w)
358//  AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_51xx_R0_r)
359//  AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_READ(namco_51xx_R2_r)
360ADDRESS_MAP_END
361
362
363static MACHINE_DRIVER_START( namco_51xx )
364   MDRV_CPU_ADD("mcu", MB8843, DERIVED_CLOCK(1,1))      /* parent clock, internally divided by 6 */
365   MDRV_CPU_IO_MAP(namco_51xx_map_io)
366   MDRV_CPU_FLAGS(CPU_DISABLE)
367MACHINE_DRIVER_END
368
369
370ROM_START( namco_51xx )
371   ROM_REGION( 0x400, "mcu", ROMREGION_LOADBYNAME )
372   ROM_LOAD( "51xx.bin",     0x0000, 0x0400, CRC(c2f57ef8) SHA1(50de79e0d6a76bda95ffb02fcce369a79e6abfec) )
373ROM_END
374
375
376/*-------------------------------------------------
377    device start callback
378-------------------------------------------------*/
379
380static DEVICE_START( namco_51xx )
381{
382   const namco_51xx_interface *config = (const namco_51xx_interface *)device->static_config;
383   namco_51xx_state *state = get_safe_token(device);
384   astring *tempstring = astring_alloc();
385
386   assert(config != NULL);
387
388   /* find our CPU */
389   state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu"));
390   assert(state->cpu != NULL);
391   astring_free(tempstring);
392
393   /* resolve our read callbacks */
394   devcb_resolve_read8(&state->in[0], &config->in[0], device);
395   devcb_resolve_read8(&state->in[1], &config->in[1], device);
396   devcb_resolve_read8(&state->in[2], &config->in[2], device);
397   devcb_resolve_read8(&state->in[3], &config->in[3], device);
398
399   /* resolve our write callbacks */
400   devcb_resolve_write8(&state->out[0], &config->out[0], device);
401   devcb_resolve_write8(&state->out[1], &config->out[1], device);
402
403   state_save_register_device_item(device, 0, state->lastcoins);
404   state_save_register_device_item(device, 0, state->lastbuttons);
405   state_save_register_device_item(device, 0, state->credits);
406   state_save_register_device_item_array(device, 0, state->coins);
407   state_save_register_device_item_array(device, 0, state->coins_per_cred);
408   state_save_register_device_item_array(device, 0, state->creds_per_coin);
409   state_save_register_device_item(device, 0, state->in_count);
410}
411
412
413/*-------------------------------------------------
414    device reset callback
415-------------------------------------------------*/
416
417static DEVICE_RESET( namco_51xx )
418{
419   namco_51xx_state *state = get_safe_token(device);
420
421   /* reset internal registers */
422   state->credits = 0;
423   state->coins[0] = 0;
424   state->coins_per_cred[0] = 1;
425   state->creds_per_coin[0] = 1;
426   state->coins[1] = 0;
427   state->coins_per_cred[1] = 1;
428   state->creds_per_coin[1] = 1;
429   state->in_count = 0;
430}
431
432
433/*-------------------------------------------------
434    device get info callback
435-------------------------------------------------*/
436
437DEVICE_GET_INFO( namco_51xx )
438{
439   switch (state)
440   {
441      /* --- the following bits of info are returned as 64-bit signed integers --- */
442      case DEVINFO_INT_TOKEN_BYTES:         info->i = sizeof(namco_51xx_state);            break;
443      case DEVINFO_INT_CLASS:               info->i = DEVICE_CLASS_PERIPHERAL;            break;
444
445      /* --- the following bits of info are returned as pointers --- */
446      case DEVINFO_PTR_ROM_REGION:         info->romregion = ROM_NAME(namco_51xx);         break;
447      case DEVINFO_PTR_MACHINE_CONFIG:      info->machine_config = MACHINE_DRIVER_NAME(namco_51xx); break;
448
449      /* --- the following bits of info are returned as pointers to data or functions --- */
450      case DEVINFO_FCT_START:               info->start = DEVICE_START_NAME(namco_51xx);    break;
451      case DEVINFO_FCT_RESET:               info->reset = DEVICE_RESET_NAME(namco_51xx);    break;
452
453      /* --- the following bits of info are returned as NULL-terminated strings --- */
454      case DEVINFO_STR_NAME:               strcpy(info->s, "Namco 51xx");               break;
455      case DEVINFO_STR_FAMILY:            strcpy(info->s, "Namco I/O");               break;
456      case DEVINFO_STR_VERSION:            strcpy(info->s, "1.0");                     break;
457      case DEVINFO_STR_SOURCE_FILE:         strcpy(info->s, __FILE__);                  break;
458      case DEVINFO_STR_CREDITS:            strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break;
459   }
460}
src/mame/machine/r2crypt.c
r4878r4879
256256    UINT32 x1, v1, y1;
257257
258258    int idx = i & 0xff;
259    int i2;
260    int idx2;
259    //int i2;
260    //int idx2;
261261
262    idx2 = ((i>>7) & 0x3ff) | ((i>>8) & 0x400);
262    //idx2 = ((i>>7) & 0x3ff) | ((i>>8) & 0x400);
263263    if(i & 0x008000)
264264      idx ^= 1;
265265    if(i & 0x100000)
266266      idx ^= 256;
267267
268    i2 = i >> 8;
268    //i2 = i >> 8;
269269
270270    v1 = sw(yrot(data[i], gr(i)));
271271
src/mame/machine/namco51.h
r0r4879
1#ifndef NAMCO51_H
2#define NAMCO51_H
3
4#include "devcb.h"
5
6
7typedef struct _namco_51xx_interface namco_51xx_interface;
8struct _namco_51xx_interface
9{
10   devcb_read8    in[4];      /* read handlers for ports A-D */
11   devcb_write8    out[2];      /* write handlers for ports A-B */
12};
13
14
15#define MDRV_NAMCO_51XX_ADD(_tag, _clock, _interface) \
16   MDRV_DEVICE_ADD(_tag, NAMCO_51XX, _clock) \
17   MDRV_DEVICE_CONFIG(_interface)
18
19#define MDRV_NAMCO_51XX_REMOVE(_tag) \
20   MDRV_DEVICE_REMOVE(_tag)
21
22
23READ8_DEVICE_HANDLER( namco_51xx_read );
24WRITE8_DEVICE_HANDLER( namco_51xx_write );
25
26
27/* device get info callback */
28#define NAMCO_51XX DEVICE_GET_INFO_NAME(namco_51xx)
29DEVICE_GET_INFO( namco_51xx );
30
31
32#endif   /* NAMCO51_H */
src/mame/mamedriv.c
r4878r4879
884884   DRIVER( raveraja )   /* (c) 1995 */
885885   DRIVER( airco22b )   /* (c) 1995 */
886886   DRIVER( alpinr2b )   /* (c) 1995 */
887   DRIVER( alpinr2a )   /* (c) 1995 */
887888   DRIVER( cybrcomm )   /* (c) 1995 */
888889   DRIVER( cybrcycc )   /* (c) 1995 */
889890   DRIVER( timecris )   /* (c) 1995 */
r4878r4879
891892   DRIVER( victlapw )   /* (c) 1996 */
892893   DRIVER( alpinesa )   /* (c) 1996 */
893894   DRIVER( propcycl )   /* (c) 1996 */
895   DRIVER( tokyowar )   /* (c) 1996 */
896   DRIVER( aquajet )    /* (c) 1996 */
894897
895898   /* Namco System 23 */
896899   DRIVER( rapidrvr )   /* (c) 1997 */
r4878r4879
12131216   DRIVER( schaser )   /* RT  Taito */
12141217   DRIVER( schasrcv )   /* RT  Taito */
12151218   DRIVER( lupin3 )   /* LP  (c) 1980 Taito */
1219   DRIVER( intruder )   /* (c) 1980 GamePlan (Taito) */
12161220   DRIVER( spclaser )   /* (c) 1980 GamePlan (Taito) */
12171221   DRIVER( laser )      /* (c) 1980 Leisure Time Electronics Inc. */
12181222   DRIVER( spcewarl )   /* (c) 1979 Leijac Corporation (Konami) */
r4878r4879
17361740   DRIVER( arkatour )   /* ??? (c) 1987 Taito America Corporation + Romstar license (US) */
17371741   DRIVER( tetrsark )   /* ??? (c) D.R.Korea */
17381742   DRIVER( sqix )      /* B03 1987 */
1739   DRIVER( sqixa )      /* B03 1987 */
1743   DRIVER( sqixr1 )   /* B03 1987 */
17401744   DRIVER( sqixu )      /* B03 1987 */
1741   DRIVER( sqixbl )   /* bootleg? but (c) 1987 */
1745   DRIVER( sqixb1 )   /* bootleg? but (c) 1987 */
1746   DRIVER( sqixb2 )   /* bootleg? but (c) 1987 */
17421747   DRIVER( perestro )   /* (c) 1994 Promat */
17431748   DRIVER( perestrf )   /* (c) 1993 Promat / Fuuki */
17441749   DRIVER( pbillian )   /* (c) 1986 Taito */
r4878r4879
24682473
24692474
24702475   /* Capcom CPS1 games */
2471   DRIVER( forgottn )   /*  7/1988 (c) 1988 (US) */
2472   DRIVER( forgott1 )   /*  7/1988 (c) 1988 (World?) */
2476   DRIVER( forgottn )   /*  7/1988 (c) 1988 (World) */
2477   DRIVER( forgottu )   /*  7/1988 (c) 1988 (US) */
24732478   DRIVER( lostwrld )   /*  7/1988 (c) 1988 (Japan) */
24742479   DRIVER( ghouls )   /* 12/1988 (c) 1988 (World) */
24752480   DRIVER( ghoulsu )   /* 12/1988 (c) 1988 (US) */
r4878r4879
29312936   /* PS Arcade 95 */
29322937   DRIVER( psarc95 )
29332938   DRIVER( beastrzr )   /* Beastorizer (USA) */
2939   DRIVER( bldyroar )   /* Bloody Roar (JAPAN) */
29342940   DRIVER( beastrzb )   /* Beastorizer (USA Bootleg) */
29352941   DRIVER( bldyror2 )   /* Bloody Roar 2 (JAPAN) */
29362942   DRIVER( brvblade )   /* Brave Blade (JAPAN) */
r4878r4879
29652971   DRIVER( raystorm )   /* Ray Storm (Ver 2.06A) */
29662972   DRIVER( raystorj )   /* Ray Storm (Ver 2.05J) */
29672973   DRIVER( ftimpact )   /* Fighters' Impact (Ver 2.02O) */
2974   DRIVER( ftimpactj )   /* Fighters' Impact (Ver 2.02J) */
29682975   DRIVER( ftimpcta )   /* Fighters' Impact A (Ver 2.00J) */
29692976   DRIVER( gdarius )   /* G-Darius (Ver 2.01J) */
29702977   DRIVER( gdariusb )   /* G-Darius (Ver 2.02A) */
r4878r4879
29722979
29732980   /* Taito GNET */
29742981   DRIVER( taitogn )
2975   DRIVER( chaoshea )   /* 1998.10 Chaos Heat (V2.08J) */
2982   DRIVER( chaoshea )   /* 1998.10 Chaos Heat (V2.09O) */
2983   DRIVER( chaoshej )   /* 1998.10 Chaos Heat (V2.08J) */
29762984   DRIVER( raycris )   /* 1998.12 Ray Crisis (V2.03J) */
29772985   DRIVER( otenamih )   /* 1999.02 Otenami Haiken (Success) */
29782986   DRIVER( spuzbobj )   /* 1999.03 Super Puzzle Bobble (Japan) */
r4878r4879
30333041   DRIVER( toukon3 )   /* 1997.12 Shin Nihon Pro Wrestling Toukon Retsuden 3 Arcade Edition (TR1/VER.A, Japan) */
30343042   DRIVER( ehrgeiz )   /* 1998.?? Ehrgeiz (EG3/VER.A) */
30353043   DRIVER( ehrgeiza )   /* 1998.?? Ehrgeiz (EG2/VER.A) */
3036                  /* 1998.05 Ehrgeiz (EG1, Japan) */
3044   DRIVER( ehrgeizj )   /* 1998.05 Ehrgeiz (EG1, Japan) */
30373045   DRIVER( sws98 )      /* 1998.06 Super World Stadium '98 (SS81/VER.A, Japan) */
30383046   DRIVER( soulclbr )   /* 1998.?? Soul Calibur (SOC14/VER.C) */
30393047   DRIVER( soulclba )   /* 1998.07 Soul Calibur (SOC11/VER.C, Japan) */
r4878r4879
31903198   DRIVER( ddrextrm )   /* 2002 - Dance Dance Revolution Extreme (G*C36 VER. JAA) */
31913199   DRIVER( gtfrk11m )   /* 2004 - Guitar Freaks 11th Mix (G*D39 VER. JAA) */
31923200
3201   /* Konami Twinkle games */
3202   DRIVER( gq863 )
3203   DRIVER( bmiidxc )
3204   DRIVER( bmiidxca )
3205   DRIVER( bmiidxc2 )
3206   DRIVER( bmiidx4 )
3207   DRIVER( bmiidx6 )
3208   DRIVER( bmiidx7 )
3209   DRIVER( bmiidx8 )
3210
31933211   /* Konami Viper games */
31943212   DRIVER( kviper )   /* 1999 */
31953213   DRIVER( ppp2nd )   /* 2001 */
r4878r4879
37163734
37173735
37183736   /* S16 Bootlegs */
3719   DRIVER( bayrtbl1 )   /* (c) 1989 (protected) (bootleg) */
3720   DRIVER( bayrtbl2 )   /* (c) 1989 (protected) (bootleg) */
3737   DRIVER( bayrouteb1 )   /* (c) 1989 (protected) (bootleg) */
3738   DRIVER( bayrouteb2 )   /* (c) 1989 (protected) (bootleg) */
37213739   DRIVER( dduxbl )   /* (c) 1989 (Datsu bootleg) */
37223740   DRIVER( eswatbl )   /* BOOTLEG */
37233741   DRIVER( fpointbl )   /* (c) 1989 (Datsu bootleg) */
37243742   DRIVER( fpointbj )   /* (c) 1989 (Datsu bootleg, Japan) */
3725   DRIVER( goldnabl )   /* BOOTLEG  */
3726   DRIVER( goldnab2 )   /* BOOTLEG  */
3743   DRIVER( goldnaxeb1 )   /* BOOTLEG  */
3744   DRIVER( goldnaxeb2 )   /* BOOTLEG  */
37273745   DRIVER( passht4b )   /* bootleg */
37283746   DRIVER( passshtb )   /* bootleg */
37293747   DRIVER( shinoblb )   /* (c) 1987 (but bootleg) */
r4878r4879
39793997   DRIVER( shienryu )   /* 1997.02 Shienryu (Warashi) */
39803998   DRIVER( vmahjong )   /* 1997.02 Virtual Mahjong (Micronet) */
39813999   DRIVER( groovef )   /* 1997.05 Groove on Fight (Atlus) */
4000   DRIVER( nclubv3 )   /* 1997.07 Name Club Ver. 3 */
4001   DRIVER( thunt )      /* 1997.09 Puzzle & Action Treasure Hunt (Sega (Deniam License)) */
4002   DRIVER( thuntk )
39824003   DRIVER( winterht )   /* 1997.10 Winter Heat (Data East) */
39834004   DRIVER( cotton2 )   /* 1997.11 Cotton 2 (Success) */
39844005   DRIVER( hanagumi )   /* 1997.11 Sakura Taisen Hanagumi Taisen Columns */
39854006   DRIVER( findlove )   /* 1997.12 Find Love (Daiki / FCF) */
39864007   DRIVER( maruchan )   /* 1997.12 Maruchan de Goo!!! */
4008   DRIVER( techbowl )   /* 1997.12 Technical Bowling */
39874009   DRIVER( znpwfv )   /* 1997.12 Zen Nippon Pro Wrestling featuring Virtua */
39884010   DRIVER( seabass )   /* 1998.02 Sea Bass Fishing (A wave Inc (Able License)) */
39894011   DRIVER( sasissu )   /* 1998.02 Taisen Tanto-R Sasissu!! */
r4878r4879
39984020   DRIVER( stress )   /* 1998.10 Stress Busters */
39994021   DRIVER( elandore )   /* 1998.11 Touryuu Densetsu Elandore (Sai-Mate) */
40004022   DRIVER( sss )      /* 1998.12 Steep Slope Sliders (Capcom / Cave / Victor) */
4023   DRIVER( micrombc )   /* 1999.03 Microman Battle Charge */
4024   DRIVER( sanjeon )   /* 1999.04 Sanjun Sujun (Sega / Deniam) */
40014025   DRIVER( danchih )   /* 1999.06 Danchi de Hanafuda Okusan Komeya Desuyo! (Altron (Tecmo License)) */
40024026   DRIVER( ffreveng )   /* 1999.09 Final Fight Revenge (Capcom) */
40034027                  /* 2000.12 Danchi de Quiz Okusan Yontaku Desuyo! (Altron) */
40044028
4005   DRIVER( thunt )      /* 1995.?? Puzzle & Action Treasure Hunt (Sega (Deniam License)) */
4006   DRIVER( thuntk )
4007   DRIVER( sanjeon )   /* 1999.?? Sanjun Sujun (Sega / Deniam) */
4008
4009   DRIVER( nclubv3 )
4010
40114029   /* Sega Model 2 Games */
40124030
40134031   /* Model 2 (TGPs, Model 1 sound board) */
r4878r4879
47024720   DRIVER( deshoros )   /* (c) 1983 */
47034721   DRIVER( prosoccr )   /* (c) 1983 */
47044722   DRIVER( prosport )   /* (c) 1983 */
4723   DRIVER( prosporta )   /* (c) 1983 */
47054724   DRIVER( boomrang )   /* (c) 1983 */
4706   DRIVER( boomrana )   /* (c) 1983 */
4725   DRIVER( boomranga )   /* (c) 1983 */
47074726   DRIVER( kamikcab )   /* (c) 1984 */
4708   DRIVER( yellowcj )   /* (c) 1984 */
4709   DRIVER( yellowcb )   /* bootleg */
4727   DRIVER( yellowcbj )   /* (c) 1984 */
4728   DRIVER( yellowcbb )   /* bootleg */
47104729   DRIVER( liberate )   /* (c) 1984  Data East Corporation */
47114730   DRIVER( dualaslt )   /* (c) 1984  Data East USA (US) */
4712   DRIVER( liberatb )   /* bootleg */
4731   DRIVER( liberateb )   /* bootleg */
47134732   DRIVER( bwings )   /* (c) 1984 */
47144733   DRIVER( bwingso )   /* (c) 1984 */
47154734   DRIVER( bwingsa )   /* (c) 1984 */
r4878r4879
48944913   DRIVER( lemmings )   /* prototype (c) 1991 Data East USA (US) */
48954914            /* MAQ ?? */
48964915   DRIVER( dragngun )   /* MAR (c) 1992 Data East Corporation (US) */
4897   DRIVER( wizdfire )   /* MAS (c) 1992 Data East Corporation (US) */
4916   DRIVER( wizdfire )   /* MAS (c) 1992 Data East Corporation (Over Sea) */
4917   DRIVER( wizdfiru )   /* MAS (c) 1992 Data East Corporation (US) */
48984918   DRIVER( darksel2 )   /* MAS (c) 1992 Data East Corporation (Japan) */
48994919   DRIVER( funkyjet )   /* MAT (c) 1992 Mitchell */
49004920   DRIVER( funkyjej )   /* MAT (c) 1992 Mitchell */
r4878r4879
65946614
65956615   /* nmk16.c bootlegs using the Seibu Sound System */
65966616   DRIVER( mustangb )   /* bootleg */
6617   DRIVER( mustangb2 ) /* TAB Austria bootleg */
65976618   DRIVER( tdragonb )   /* bootleg */
65986619
65996620   /* Comad games on unofficial hardware based on nmk16.c */
r4878r4879
66416662   DRIVER( smashtv5 )   /* (c) 1990 Williams */
66426663   DRIVER( smashtv4 )   /* (c) 1990 Williams */
66436664   DRIVER( hiimpact )   /* (c) 1990 Williams */
6665   DRIVER( hiimpac4 )   /* (c) 1990 Williams */
66446666   DRIVER( hiimpac3 )   /* (c) 1990 Williams */
66456667   DRIVER( hiimpacp )   /* (c) 1990 Williams */
66466668   DRIVER( shimpact )   /* (c) 1991 Midway */
r4878r4879
90389060   DRIVER( ncb3 )      /* (c) 199? Dyna Electronics */
90399061   DRIVER( cb3a )      /* (c) 199? Dyna Electronics */
90409062   DRIVER( cb3 )      /* (c) 199? Dyna Electronics */
9063   DRIVER( cb3b )      /* (c) 199? Dyna Electronics */
90419064   DRIVER( cmv801 )   /* (c) 198? Corsica */
90429065   DRIVER( cmv4 )      /* (c) 1992 Dyna Electronics */
90439066   DRIVER( cmv4a )      /* (c) 1992 Dyna Electronics */
r4878r4879
90559078
90569079   /* Aristocrat Mk5 hardware */
90579080   DRIVER( swthrt2v )   /* (c) 1995 */
9081   DRIVER( enchfrst )   /* (c) 1995 */
90589082   DRIVER( dmdtouch )   /* (c) 1997 */
9083   DRIVER( goldprmd )   /* (c) 1997 */
9084   DRIVER( qotn )      /* (c) 1997 */
90599085   DRIVER( adonis )   /* (c) 1998 */
90609086   DRIVER( reelrock )   /* (c) 1998 */
90619087   DRIVER( indiandr )   /* (c) 1998 */
r4878r4879
90969122   DRIVER( carb2002 )   /* bootleg */
90979123   DRIVER( carb2003 )   /* bootleg */
90989124   DRIVER( nfm )      /* bootleg */
9125   DRIVER( unkch1 )   /* bootleg */
9126   DRIVER( unkch2 )   /* bootleg */
9127   DRIVER( unkch3 )   /* bootleg */
9128   DRIVER( unkch4 )   /* bootleg */
90999129
91009130   DRIVER( ladylinr )   /* (c) 198? TAB Austria */
91019131   DRIVER( kkojnoli )   /* 198? south korean hack */
src/mame/includes/dc.h
r4878r4879
3838
3939extern UINT32 dc_sysctrl_regs[0x200/4];
4040extern UINT32 dc_coin_counts[2];
41extern UINT32 pvrctrl_regs[0x100/4];
4142
4243/*--------- Ch2-DMA Control Registers ----------*/
4344#define SB_C2DSTAT   ((0x005f6800-0x005f6800)/4)
r4878r4879
201202/*----------- defined in video/dc.c -----------*/
202203
203204extern UINT64 *dc_texture_ram;
205extern UINT64 *dc_framebuffer_ram;
204206
205207void dc_vblank( running_machine *machine );
206208
src/mame/includes/konamipt.h
r4878r4879
148148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START##player )
149149
150150#define KONAMI8_B12_COIN_START( player )   \
151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY   \
152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY   \
153   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY      \
154   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY   \
155   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )    \
156   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )    \
151   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(player)   \
152   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(player)   \
153   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(player)      \
154   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(player)   \
155   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(player)    \
156   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(player)    \
157157   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN##player )      \
158158   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START##player )
159159
src/mame/includes/namcos22.h
r4878r4879
1818   NAMCOS22_VICTORY_LAP,
1919   NAMCOS22_ACE_DRIVER,
2020   NAMCOS22_ALPINE_RACER_2,
21   NAMCOS22_ALPINE_SURFER
21   NAMCOS22_ALPINE_SURFER,
22   NAMCOS22_TOKYO_WARS,
23   NAMCOS22_AQUA_JET
2224} namcos22_gametype;
2325
2426#define NAMCOS22_NUM_ROWS 30
src/mame/includes/arkanoid.h
r4878r4879
2020extern WRITE8_HANDLER( arkanoid_videoram_w );
2121
2222extern WRITE8_HANDLER( arkanoid_d008_w );
23extern WRITE8_HANDLER( tetrsark_d008_w );
2324
2425extern VIDEO_START( arkanoid );
2526extern VIDEO_UPDATE( arkanoid );
src/mame/includes/megasys1.h
r4878r4879
3737/* Functions */
3838VIDEO_START( megasys1 );
3939VIDEO_UPDATE( megasys1 );
40VIDEO_EOF( megasys1 );
4041
4142PALETTE_INIT( megasys1 );
4243
src/mame/includes/galaxold.h
r4878r4879
174174DRIVER_INIT( ad2083 );
175175
176176MACHINE_RESET( scramble );
177MACHINE_RESET( sfx );
178MACHINE_RESET( monsterz );
179177MACHINE_RESET( explorer );
180178
181179READ8_HANDLER( triplep_pip_r );
r4878r4879
190188/*----------- defined in audio/scramble.c -----------*/
191189
192190void scramble_sh_init(running_machine *machine);
193void sfx_sh_init(running_machine *machine);
194191
195192WRITE8_HANDLER( scramble_filter_w );
196193WRITE8_HANDLER( frogger_filter_w );
r4878r4879
201198READ8_DEVICE_HANDLER( hotshock_soundlatch_r );
202199
203200WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w );
204WRITE8_HANDLER( sfx_sh_irqtrigger_w );
205201WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w );
206202WRITE8_HANDLER( froggrmc_sh_irqtrigger_w );
207203WRITE8_HANDLER( hotshock_sh_irqtrigger_w );
src/mame/mame.mak
r4878r4879
800800   $(DRIVERS)/konamigx.o $(MACHINE)/konamigx.o $(VIDEO)/konamigx.o \
801801   $(DRIVERS)/konamim2.o \
802802   $(DRIVERS)/ksys573.o $(MACHINE)/zs01.o \
803   $(DRIVERS)/twinkle.o \
803804   $(DRIVERS)/labyrunr.o $(VIDEO)/labyrunr.o \
804805   $(DRIVERS)/lethal.o $(VIDEO)/lethal.o \
805806   $(DRIVERS)/mainevt.o $(VIDEO)/mainevt.o \
r4878r4879
939940   $(DRIVERS)/warpwarp.o $(AUDIO)/warpwarp.o $(VIDEO)/warpwarp.o \
940941   $(MACHINE)/namcoio.o \
941942   $(AUDIO)/geebee.o \
943   $(MACHINE)/namco06.o \
942944   $(MACHINE)/namco50.o \
945   $(MACHINE)/namco51.o \
946   $(MACHINE)/namco53.o \
947   $(AUDIO)/namco52.o \
943948   $(AUDIO)/namco54.o \
944949   $(AUDIO)/namcoc7x.o \
945950   $(VIDEO)/bosco.o \
src/mame/video/tryout.c
r4878r4879
4242
4343static TILE_GET_INFO( get_fg_tile_info )
4444{
45   int code, attr;
45   int code, attr, color;
4646
4747   code = videoram[tile_index];
4848   attr = videoram[tile_index + 0x400];
49
5049   code |= ((attr & 0x03) << 8);
50   color = ((attr & 0x4)>>2)+6;
5151
52   SET_TILE_INFO(0, code, 6, 0);
52   SET_TILE_INFO(0, code, color, 0);
5353}
5454
5555static TILE_GET_INFO( get_bg_tile_info )
5656{
57   SET_TILE_INFO(2, tryout_vram[tile_index] & 0x7f, 0, 0);
57   SET_TILE_INFO(2, tryout_vram[tile_index] & 0x7f, 2, 0);
5858}
5959
6060READ8_HANDLER( tryout_vram_r )
r4878r4879
8989   if ((bank==0 || bank==2 || bank==4 || bank==6) && (offset&0x7ff)<0x400) {
9090      int newoff=offset&0x3ff;
9191
92      switch (newoff&0x300){
93      case 0x000: newoff=(newoff&0xff) | 0x100; break;
94      case 0x100: newoff=(newoff&0xff) | 0x200; break;
95      case 0x200: newoff=(newoff&0xff) | 0x000; break;
96      case 0x300: newoff=(newoff&0xff) | 0x300; break;
97      }
98
9992      tryout_vram[newoff]=data;
10093      tilemap_mark_tile_dirty(bg_tilemap,newoff);
10194      return;
r4878r4879
115108
116109   switch (offset&0x1c00) {
117110   case 0x0400:
118      tryout_vram_gfx[(offset&0x3ff) + 0x0000 + ((offset&0x2000)>>1)]=(data&0xf);
119      tryout_vram_gfx[(offset&0x3ff) + 0x2000 + ((offset&0x2000)>>1)]=(data&0xf0)>>4;
111      tryout_vram_gfx[(offset&0x3ff) + 0x0000 + ((offset&0x2000)>>1)]=(~data&0xf);
112      tryout_vram_gfx[(offset&0x3ff) + 0x2000 + ((offset&0x2000)>>1)]=(~data&0xf0)>>4;
120113      break;
121114   case 0x0800:
122      tryout_vram_gfx[(offset&0x3ff) + 0x4000 + ((offset&0x2000)>>1)]=(data&0xf);
123      tryout_vram_gfx[(offset&0x3ff) + 0x4400 + ((offset&0x2000)>>1)]=(data&0xf0)>>4;
115      tryout_vram_gfx[(offset&0x3ff) + 0x4000 + ((offset&0x2000)>>1)]=(~data&0xf);
116      tryout_vram_gfx[(offset&0x3ff) + 0x4400 + ((offset&0x2000)>>1)]=(~data&0xf0)>>4;
124117      break;
125118   case 0x0c00:
126      tryout_vram_gfx[(offset&0x3ff) + 0x0400 + ((offset&0x2000)>>1)]=(data&0xf);
127      tryout_vram_gfx[(offset&0x3ff) + 0x2400 + ((offset&0x2000)>>1)]=(data&0xf0)>>4;
119      tryout_vram_gfx[(offset&0x3ff) + 0x0400 + ((offset&0x2000)>>1)]=(~data&0xf);
120      tryout_vram_gfx[(offset&0x3ff) + 0x2400 + ((offset&0x2000)>>1)]=(~data&0xf0)>>4;
128121      break;
129122   case 0x1400:
130      tryout_vram_gfx[(offset&0x3ff) + 0x0800 + ((offset&0x2000)>>1)]=(data&0xf);
131      tryout_vram_gfx[(offset&0x3ff) + 0x2800 + ((offset&0x2000)>>1)]=(data&0xf0)>>4;
123      tryout_vram_gfx[(offset&0x3ff) + 0x0800 + ((offset&0x2000)>>1)]=(~data&0xf);
124      tryout_vram_gfx[(offset&0x3ff) + 0x2800 + ((offset&0x2000)>>1)]=(~data&0xf0)>>4;
132125      break;
133126   case 0x1800:
134      tryout_vram_gfx[(offset&0x3ff) + 0x4800 + ((offset&0x2000)>>1)]=(data&0xf);
135      tryout_vram_gfx[(offset&0x3ff) + 0x4c00 + ((offset&0x2000)>>1)]=(data&0xf0)>>4;
127      tryout_vram_gfx[(offset&0x3ff) + 0x4800 + ((offset&0x2000)>>1)]=(~data&0xf);
128      tryout_vram_gfx[(offset&0x3ff) + 0x4c00 + ((offset&0x2000)>>1)]=(~data&0xf0)>>4;
136129      break;
137130   case 0x1c00:
138      tryout_vram_gfx[(offset&0x3ff) + 0x0c00 + ((offset&0x2000)>>1)]=(data&0xf);
139      tryout_vram_gfx[(offset&0x3ff) + 0x2c00 + ((offset&0x2000)>>1)]=(data&0xf0)>>4;
131      tryout_vram_gfx[(offset&0x3ff) + 0x0c00 + ((offset&0x2000)>>1)]=(~data&0xf);
132      tryout_vram_gfx[(offset&0x3ff) + 0x2c00 + ((offset&0x2000)>>1)]=(~data&0xf0)>>4;
140133      break;
141134   }
142135
r4878r4879
195188      sprite = spriteram[offs+1] + ((spriteram_2[offs]&7)<<8);
196189      x = spriteram[offs+3]-3;
197190      y = spriteram[offs+2];
198      color = (spriteram[offs] & 8)>>3;
199      fx = 0;
191      color = 0;//(spriteram[offs] & 8)>>3;
192      fx = (spriteram[offs] & 8)>>3;
200193      fy = 0;
201194      inc = 16;
202195
r4878r4879
236229
237230VIDEO_UPDATE( tryout )
238231{
239//  UINT8* mem=memory_region(machine, REGION_CPU1);
232   int scrollx = 0;
240233
241   int scrollx;
242
243234   if (!flip_screen_get(screen->machine))
244235      tilemap_set_scrollx(fg_tilemap, 0, 16); /* Assumed hard-wired */
245236   else
246237      tilemap_set_scrollx(fg_tilemap, 0, -8); /* Assumed hard-wired */
247238
248   if(tryout_gfx_control[0] == 0xc)
249      scrollx = tryout_gfx_control[1];
250   if(tryout_gfx_control[0] == 0x8 && !tryout_gfx_control[1])
251      scrollx = 0x100;
252   else
253      scrollx = tryout_gfx_control[1] | ((tryout_gfx_control[0]&1)<<8) | ((tryout_gfx_control[0]&4)<<7);
239   scrollx = tryout_gfx_control[1] + ((tryout_gfx_control[0]&1)<<8) + ((tryout_gfx_control[0]&4)<<7) - ((tryout_gfx_control[0] & 2) ? 0 : 0x100);
254240
255   tilemap_set_scrollx(bg_tilemap, 0, scrollx);
241   /* wrap-around */
242   if(tryout_gfx_control[1] == 0) { scrollx+=0x100; }
243
244   tilemap_set_scrollx(bg_tilemap, 0, scrollx+2); /* why +2? hard-wired? */
256245   tilemap_set_scrolly(bg_tilemap, 0, -tryout_gfx_control[2]);
257246
258   tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
259   tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
260   draw_sprites(screen->machine, bitmap,cliprect);
247   if(!(tryout_gfx_control[0] & 0x8)) // screen disable
248   {
249      /* TODO: Color might be different, needs a video from an original pcb. */
250      bitmap_fill(bitmap, cliprect, screen->machine->pens[0x10]);
251   }
252   else
253   {
254      tilemap_draw(bitmap,cliprect,bg_tilemap,0,0);
255      tilemap_draw(bitmap,cliprect,fg_tilemap,0,0);
256      draw_sprites(screen->machine, bitmap,cliprect);
257   }
261258
262//  popmessage("%02x %02x %02x - %04x",mem[0xe402],mem[0xe403],mem[0xe404], ((tryout_gfx_control[0]&1)<<8) | ((tryout_gfx_control[0]&4)<<7));
259//  popmessage("%02x %02x %02x %02x",tryout_gfx_control[0],tryout_gfx_control[1],tryout_gfx_control[2],scrollx);
263260   return 0;
264261}
src/mame/video/ygv608.c
r4878r4879
736736#ifdef _SHOW_VIDEO_DEBUG
737737    char buffer[64];
738738#endif
739#ifdef _ENABLE_SCROLLY
739740    int col;
741#endif
740742#ifdef _ENABLE_ROTATE_ZOOM
741743    int xc, yc;
742744    double r, alpha, sin_theta, cos_theta;
r4878r4879
15701572
15711573#ifdef MAME_DEBUG
15721574
1573#define nSHOW_SOURCE_MODE
1575//#define SHOW_SOURCE_MODE
15741576
15751577#if 0
15761578void dump_block( char *name, UINT8 *block, int len )
r4878r4879
15921594{
15931595  static int oneshot = 0;
15941596
1597#ifndef SHOW_SOURCE_MODE
15951598  int i;
1599#endif
15961600  char ascii[16];
15971601
15981602  if( oneshot )
src/mame/video/artmagic.c
r4878r4879
6060{
6161   blitter_base = (UINT16 *)memory_region(machine, "gfx1");
6262   blitter_mask = memory_region_length(machine, "gfx1")/2 - 1;
63
64   state_save_register_global_array(machine, artmagic_xor);
65   state_save_register_global(machine, artmagic_is_stoneball);
66   state_save_register_global_array(machine, blitter_data);
67   state_save_register_global(machine, blitter_page);
6368}
6469
6570
src/mame/video/thief.c
r4878r4879
5454*/
5555}
5656
57WRITE8_HANDLER( thief_vtcsel_w ){
58   /* TMS9927 VTAC registers */
59}
60
6157WRITE8_HANDLER( thief_color_map_w ){
6258/*
6359    --xx----    blue
src/mame/video/midtunit.c
r4878r4879
293293
294294WRITE16_HANDLER( midtunit_paletteram_w )
295295{
296   int newword;
296   //int newword;
297297
298298   COMBINE_DATA(&paletteram16[offset]);
299   newword = paletteram16[offset];
299   //newword = paletteram16[offset];
300300   palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
301301}
302302
src/mame/video/stvvdp2.c
r4878r4879
29592959      case 1:
29602960         if ( stv2_current_tilemap.incx == 0x10000 && stv2_current_tilemap.incy == 0x10000 )
29612961         {
2962            int gfx_wraparound = -1;
2962            //int gfx_wraparound = -1;
29632963
29642964            gfxdata += xlinesize*cliprect->min_y;
29652965
r4878r4879
29852985                  }
29862986                  if ( (gfxdata + xs) >= gfxdatahigh )
29872987                  {
2988                     gfx_wraparound = (ycnt << 16) | xcnt;
2988                     //gfx_wraparound = (ycnt << 16) | xcnt;
29892989                     gfxdata = gfxdatalow - xs;
29902990                  }
29912991               }
r4878r4879
53025302/*some vblank lines measurements (according to Charles MacDonald)*/
53035303static int get_vblank_duration(running_machine *machine)
53045304{
5305   /* TODO: +64 is probably due of missing pixel clock/screen raw params hook-up.
5306             Problem is, I don't know if it's possible to handle that in MAME with
5307             all this dynamic resolution babblecrap...
5308             */
5309
53055310   if(STV_VDP2_HRES & 4)
53065311   {
53075312      switch(STV_VDP2_HRES & 1)
53085313      {
5309         case 0: return 45; //31kHz Monitor
5310         case 1: return 82; //Hi-Vision Monitor
5314         case 0: return 45+64; //31kHz Monitor
5315         case 1: return 82+64; //Hi-Vision Monitor
53115316      }
53125317   }
53135318
53145319   switch(STV_VDP2_VRES & 3)
53155320   {
5316      case 0: return 39; //263-224
5317      case 1: return 23; //263-240
5318      case 2: return 7; //263-256
5319      case 3: return 7; //263-256
5321      case 0: return 39+64; //263-224
5322      case 1: return 23+64; //263-240
5323      case 2: return 7+64; //263-256
5324      case 3: return 7+64; //263-256
53205325   }
53215326
53225327   return 0;
r4878r4879
53555360      }
53565361      case 0x8/4:
53575362      /*H/V Counter Register*/
5358                             /*H-Counter                               V-Counter                                         */
5359         stv_vdp2_regs[offset] = (((video_screen_get_visible_area(space->machine->primary_screen)->max_x - 1)<<16)&0x3ff0000)|(((video_screen_get_visible_area(space->machine->primary_screen)->max_y - 1)<<0)& ((STV_VDP2_LSMD == 3) ? 0x7ff : 0x3ff));
5363      {
5364         static UINT16 h_count,v_count;
5365         /* TODO: handle various h/v settings. */
5366         h_count = video_screen_get_hpos(space->machine->primary_screen) & 0x3ff;
5367         v_count = video_screen_get_vpos(space->machine->primary_screen) & (STV_VDP2_LSMD == 3 ? 0x7ff : 0x3ff);
5368         stv_vdp2_regs[offset] = (h_count<<16)|(v_count);
53605369         if(LOG_VDP2) logerror("CPU %s PC(%08x) = VDP2: H/V counter read : %08x\n", space->cpu->tag, cpu_get_pc(space->cpu),stv_vdp2_regs[offset]);
5361         stv_vdp2_regs[offset] = 0;
5362      break;
5370         break;
5371      }
53635372   }
53645373   return stv_vdp2_regs[offset];
53655374}
src/mame/video/deco32.c
r4878r4879
420420   for (offs = 0; offs<0x400; offs+=4)
421421   {
422422      int x,y,sprite,colour,multi,fx,fy,inc,flash,mult; /*,pri=0,spri=0;*/
423      int trans;
423      //int trans;
424424
425425      sprite = spritedata[offs+1] & 0xffff;
426426
r4878r4879
428428      flash=y&0x1000;
429429      if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
430430
431      trans=TRANSPARENCY_PEN;
431      //trans=TRANSPARENCY_PEN;
432432      x = spritedata[offs+2];
433433
434434      // Prepare colour, priority and alpha info
src/mame/video/gticlub.c
r4878r4879
316316         {
317317            if (K001005_fifo_read_ptr < 0x3ff)
318318            {
319               //cpu_set_input_line(space->machine->cpu[2], SHARC_INPUT_FLAG1, CLEAR_LINE);
320               sharc_set_flag_input(space->machine->cpu[2], 1, CLEAR_LINE);
319               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
320               sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, CLEAR_LINE);
321321            }
322322            else
323323            {
324               //cpu_set_input_line(space->machine->cpu[2], SHARC_INPUT_FLAG1, ASSERT_LINE);
325               sharc_set_flag_input(space->machine->cpu[2], 1, ASSERT_LINE);
324               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
325               sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, ASSERT_LINE);
326326            }
327327         }
328328         else
329329         {
330            //cpu_set_input_line(space->machine->cpu[2], SHARC_INPUT_FLAG1, ASSERT_LINE);
331            sharc_set_flag_input(space->machine->cpu[2], 1, ASSERT_LINE);
330            //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
331            sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, ASSERT_LINE);
332332         }
333333
334334         K001005_fifo_read_ptr++;
r4878r4879
369369         {
370370            if (K001005_fifo_write_ptr < 0x400)
371371            {
372               //cpu_set_input_line(space->machine->cpu[2], SHARC_INPUT_FLAG1, ASSERT_LINE);
373               sharc_set_flag_input(space->machine->cpu[2], 1, ASSERT_LINE);
372               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
373               sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, ASSERT_LINE);
374374            }
375375            else
376376            {
377               //cpu_set_input_line(space->machine->cpu[2], SHARC_INPUT_FLAG1, CLEAR_LINE);
378               sharc_set_flag_input(space->machine->cpu[2], 1, CLEAR_LINE);
377               //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
378               sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, CLEAR_LINE);
379379            }
380380         }
381381         else
382382         {
383            //cpu_set_input_line(space->machine->cpu[2], SHARC_INPUT_FLAG1, ASSERT_LINE);
384            sharc_set_flag_input(space->machine->cpu[2], 1, ASSERT_LINE);
383            //cputag_set_input_line(space->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
384            sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, ASSERT_LINE);
385385         }
386386
387387       //  mame_printf_debug("K001005 FIFO write: %08X at %08X\n", data, cpu_get_pc(space->cpu));
r4878r4879
10451045   draw_7segment_led(bitmap, 3, 3, gticlub_led_reg0);
10461046   draw_7segment_led(bitmap, 9, 3, gticlub_led_reg1);
10471047
1048   //cpu_set_input_line(screen->machine->cpu[2], SHARC_INPUT_FLAG1, ASSERT_LINE);
1049   sharc_set_flag_input(screen->machine->cpu[2], 1, ASSERT_LINE);
1048   //cputag_set_input_line(screen->machine, "dsp", SHARC_INPUT_FLAG1, ASSERT_LINE);
1049   sharc_set_flag_input(cputag_get_cpu(screen->machine, "dsp"), 1, ASSERT_LINE);
10501050   return 0;
10511051}
10521052
src/mame/video/psx.c
r4878r4879
39213921
39223922void psx_gpu_reset( running_machine *machine )
39233923{
3924   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
3924   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
39253925
39263926   psx_gpu_w(space, 1, 0, 0xffffffff );
39273927}
src/mame/video/system16.c
r4878r4879
11/***************************************************************************
22
3Sega System 16 Video Hardware
3    System 16 / 18 bootleg video
44
5Known issues:
6- better abstraction of tilemap hardware is needed; a lot of this mess could and should
7    be consolidated further
8- many games have ROM patches - why?  let's emulate protection when possible
9- several games fail their RAM self-test because of hacks in the drivers
10- many registers are suspiciously plucked from working RAM
11- several games have nvram according to the self test, but we aren't yet saving it
12- many games suffer from sys16_refreshenable register not being mapped
13- road-rendering routines need to be cleaned up or at least better described
14- logical sprite height computation isn't quite right - garbage pixels are drawn
15- sprite drawing is unoptimized
16- end-of-sprite marker support will fix some glitches
17- shadow and partial shadow sprite support
18- to achieve sprite-tilemap orthogonality we must draw sprites from front to back;
19    this will also allow us to avoid processing the same shadowed pixel twice.
5    Bugs to check against real HW
206
21The System16 video hardware consists of:
7    System16A Tilemap bootlegs
228
23- Road Layer (present only for certain games)
9    - Shinobi (Datsu bootleg) has a black bar down the right hand side,
10      which turns red on the high score table.  This is in the Text layer.
11      According to other games this should be the correct alignment for
12      this bootleg HW.
2413
25- Two scrolling tilemap layers
14    - After inserting a coin in Passing Shot (2p version) the layers are
15      misaligned by 1 pixel (happens on non-bootlegs too)
2616
27- Two alternate scrolling tilemap layers, normally invisible.
17    - Causing a 'fault' in the Passing Shot 2p bootleg (not hitting the ball
18      on your serve) causes the tilemaps to be erased and not updated
19      properly (mirroring?, bootleg protection?, missed case in bootleg?)
2820
29- A fixed tilemap layer, normally used for score, lives display
21 System18 Tilemap bootlegs
3022
31Each scrolling layer (foreground, background) is an arrangement
32of 4 pages selected from 16 available pages, laid out as follows:
23    - Alien Storm Credit text for Player 1 is not displayed after inserting
24      a coin.
3325
34    Page0  Page1
35    Page2  Page3
36
37Each page is an arrangement of 8x8 tiles, 64 tiles wide, and 32 tiles high.
38
39Layers normally scroll as a whole, with xscroll and yscroll.
40
41However, layers can also be configured with screenwise rowscroll, if the most significant
42bit of xscroll is set.  When a layer is in this mode, the splittable is used.
43
44When rowscroll is in effect, the most significant bit of rowscroll selects between the
45default layer and an alternate layer associated with it.
46
47The foreground layer's tiles may be flagged as high-priority; this is used to mask
48sprites, i.e. the grass in Altered Beast.
49
50The background layer's tiles may also be flagged as high-priority.  In this case,
51it's really a transparency_pen effect rather.  Aurail uses this.
52
53Most games map Video Registers in textram as follows:
54
55type0:
56most games
57
58type1:
59alexkidd,fantzone,shinobl,hangon
60mjleague
61
62others:
63    shangon, shdancbl,
64    dduxbl,eswat,
65    passsht,passht4b
66    quartet,quartet2,
67    tetris,tturfbl,wb3bl
68
69sys16_textram:
70type1       type0           function
71---------------------------------------
720x74f       0x740           sys16_fg_page
730x74e       0x741           sys16_bg_page
74            0x742           sys16_fg2_page
75            0x743           sys16_bg2_page
76
770x792       0x748           sys16_fg_scrolly
780x793       0x749           sys16_bg_scrolly
79            0x74a           sys16_fg2_scrolly
80            0x74b           sys16_bg2_scrolly
81
820x7fc       0x74c           sys16_fg_scrollx
830x7fd       0x74d           sys16_bg_scrollx
84            0x74e           sys16_fg2_scrollx
85            0x74f           sys16_bg2_scrollx
86
87            0x7c0..0x7df    sys18_splittab_fg_x
88            0x7e0..0x7ff    sys18_splittab_bg_x
89
9026***************************************************************************/
9127#include "driver.h"
9228#include "system16.h"
9329#include "video/resnet.h"
94#include "includes/genesis.h"
9530
96static UINT16 sys18_ddcrew_bankregs[0x20];
9731
98/* callback to poll video registers */
99void (* sys16_update_proc)( void );
32UINT16* system16a_bootleg_bg0_tileram;
33UINT16* system16a_bootleg_bg1_tileram;
10034
10135UINT16 *sys16_tileram;
10236UINT16 *sys16_textram;
r4878r4879
166100static int old_bg_page[4],old_fg_page[4], old_tile_bank1, old_tile_bank0;
167101static int old_bg2_page[4],old_fg2_page[4];
168102
169/***************************************************************************/
170103
171READ16_HANDLER( sys16_textram_r ){
172   return sys16_textram[offset];
104// doesn't use te page system
105#if 0
106
107//static UINT8 bg0_page[4];
108//static UINT8 bg1_page[4];
109
110static TILE_GET_INFO( get_system16b_bootleg_tile_info0 )
111{
112   /* TILEMAP_MAPPER can't be dynamic, so we do the page lookup here */
113   int data, tile_number;
114   int page = 0;
115
116   if (tile_index & 0x0040)
117      page+=1;
118
119   if (tile_index & 0x1000)
120      page+=2;
121
122   tile_index = ((tile_index & 0x03f) >> 0) |
123             ((tile_index & 0xf80) >> 1);
124
125   tile_index += bg0_page[page] * 0x800;
126
127   data = sys16_tileram[tile_index];
128   tile_number = data&0xfff;
129
130   SET_TILE_INFO(
131         0,
132         tile_number,
133         (data>>6)&0x7f,
134         0);
173135}
174136
175READ16_HANDLER( sys16_tileram_r ){
176   return sys16_tileram[offset];
137static TILE_GET_INFO( get_system16b_bootleg_tile_info1 )
138{
139   /* TILEMAP_MAPPER can't be dynamic, so we do the page lookup here */
140   int data, tile_number;
141   int page = 0;
142
143   if (tile_index & 0x0040)
144      page+=1;
145
146   if (tile_index & 0x1000)
147      page+=2;
148
149   tile_index = ((tile_index & 0x03f) >> 0) |
150             ((tile_index & 0xf80) >> 1);
151
152   tile_index += bg1_page[page] * 0x800;
153
154   data = sys16_tileram[tile_index];
155   tile_number = data&0xfff;
156
157   SET_TILE_INFO(
158         0,
159         tile_number,
160         (data>>6)&0x7f,
161         0);
177162}
163#endif
178164
165
179166/***************************************************************************/
180167
168
181169/*
182170    We mark the priority buffer as follows:
183171        text    (0xf)
r4878r4879
472460
473461WRITE16_HANDLER( sys16_paletteram_w )
474462{
475   UINT16 oldword = paletteram16[offset];
476463   UINT16 newword;
477464   COMBINE_DATA( &paletteram16[offset] );
478465   newword = paletteram16[offset];
479466
480   if( oldword!=newword )
467   /*  sBGR BBBB GGGG RRRR */
468   /*  x000 4321 4321 4321 */
481469   {
482      /* we can do this, because we initialize palette RAM to all black in vh_start */
483      /*     byte 0    byte 1 */
484      /*  sBGR BBBB GGGG RRRR */
485      /*  x000 4321 4321 4321 */
486
487470      int r, g, b, rs, gs, bs, rh, gh, bh;
488471      int r0 = (newword >> 12) & 1;
489472      int r1 = (newword >>  0) & 1;
r4878r4879
807790
808791   num_sprites = 128*2; /* only 128 for most games; aburner uses 256 */
809792
810   if(!strcmp(machine->gamedrv->name, "hangon"))
811      num_sprites = 128;
812
813793   {
814      /* initialize all entries to black - needed for Golden Axe*/
815      int i;
816      for( i=0; i<machine->config->total_colors; i++ ){
817         palette_set_color( machine, i, MAKE_RGB(0,0,0) );
818      }
819
820794      if(sys16_bg1_trans) tilemap_set_transparent_pen( background, 0 );
821795      tilemap_set_transparent_pen( foreground, 0 );
822796      tilemap_set_transparent_pen( text_layer, 0 );
r4878r4879
851825   }
852826}
853827
854VIDEO_START( system18old ){
855   int i;
856
828VIDEO_START( system18old )
829{
857830   sys16_bg1_trans=1;
858831
859   system18_vdp_start(machine);
860
861   /* clear these registers to -1 so that writes of 0 get picked up */
862   for (i=0;i<0x20;i++)
863   {
864      sys18_ddcrew_bankregs[i]=-1;
865   }
866
867832   background2 = tilemap_create(machine,
868833      get_bg2_tile_info,
869834      sys16_bg_map,
r4878r4879
903868   sys16_fg_priority_value=0x2000;
904869}
905870
906/***************************************************************************/
907871
908static void sys16_vh_refresh_helper( void ){
909   if( sys18_splittab_bg_x ){
910      if( (sys16_bg_scrollx&0xff00)  != sys16_rowscroll_scroll ){
911         tilemap_set_scroll_rows( background , 1 );
912         tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
913      }
914      else {
915         int offset, scroll,i;
872/*****************************************************************************************
873 System 16A bootleg video
916874
917         tilemap_set_scroll_rows( background , 64 );
918         offset = 32+((sys16_bg_scrolly&0x1f8) >> 3);
875 The System16A bootlegs have extra RAM for 2 tilemaps.  The game code copies data from
876 the usual 'tilemap ram' area to this new RAM and sets scroll registers as appropriate
877 using additional registers not present on the original System 16A hardware.
919878
920         for( i=0; i<29; i++ ){
921            scroll = sys18_splittab_bg_x[i];
922            tilemap_set_scrollx( background , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_bgxoffset );
923         }
924      }
925   }
926   else {
927      tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
928   }
879 For some unknown reason the 2p Passing Shot bootleg end up blanking this area at times,
880 this could be an emulation flaw or a problem with the original bootlegs.  Inserting a
881 coin at the incorrect time can also cause missing graphics on the initial entry screen.
882 See note at top of driver
929883
930   if( sys18_splittab_bg_y ){
931      if( (sys16_bg_scrolly&0xff00)  != sys16_rowscroll_scroll ){
932         tilemap_set_scroll_cols( background , 1 );
933         tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
934      }
935      else {
936         int offset, scroll,i;
884 Sprites:
885  ToDo
937886
938         tilemap_set_scroll_cols( background , 128 );
939         offset = 127-((sys16_bg_scrollx&0x3f8) >> 3)-40+2;
887*****************************************************************************************/
940888
941         for( i=0;i<41;i++ ){
942            scroll = sys18_splittab_bg_y[(i+24)>>1];
943            tilemap_set_scrolly( background , (i+offset)&0x7f, -256+(scroll&0x3ff) );
944         }
945      }
946   }
947   else {
948      tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
949   }
889static tilemap *system16a_bootleg_bg_tilemaps[2];
890static tilemap *system16a_bootleg_text_tilemap;
891static UINT16 system16a_bootleg_tilemapselect;
950892
951   if( sys18_splittab_fg_x ){
952      if( (sys16_fg_scrollx&0xff00)  != sys16_rowscroll_scroll ){
953         tilemap_set_scroll_rows( foreground , 1 );
954         tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
955      }
956      else {
957         int offset, scroll,i;
958893
959         tilemap_set_scroll_rows( foreground , 64 );
960         offset = 32+((sys16_fg_scrolly&0x1f8) >> 3);
894int system16a_bootleg_bgscrolly;
895int system16a_bootleg_bgscrollx;
896int system16a_bootleg_fgscrolly;
897int system16a_bootleg_fgscrollx;
961898
962         for(i=0;i<29;i++){
963            scroll = sys18_splittab_fg_x[i];
964            tilemap_set_scrollx( foreground , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_fgxoffset );
965         }
966      }
967   }
968   else {
969      tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
970   }
899static TILE_GET_INFO( get_system16a_bootleg_tile_infotxt )
900{
901   int data, tile_number;
971902
972   if( sys18_splittab_fg_y ){
973      if( (sys16_fg_scrolly&0xff00)  != sys16_rowscroll_scroll ){
974         tilemap_set_scroll_cols( foreground , 1 );
975         tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
976      }
977      else {
978         int offset, scroll,i;
903   data = sys16_textram[tile_index];
904   tile_number = data&0x1ff;
979905
980         tilemap_set_scroll_cols( foreground , 128 );
981         offset = 127-((sys16_fg_scrollx&0x3f8) >> 3)-40+2;
982906
983         for( i=0; i<41; i++ ){
984            scroll = sys18_splittab_fg_y[(i+24)>>1];
985            tilemap_set_scrolly( foreground , (i+offset)&0x7f, -256+(scroll&0x3ff) );
986         }
987      }
988   }
989   else {
990      tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
991   }
907
908
909   SET_TILE_INFO(
910         0,
911         tile_number,
912         ((data>>9)&0x7),
913         0);
992914}
993915
994static void sys18_vh_screenrefresh_helper( void ){
995   int i;
996   if( sys18_splittab_bg_x ){ // screenwise rowscroll?
997      int offset,offset2, scroll,scroll2,orig_scroll;
916static TILE_GET_INFO( get_system16a_bootleg_tile_info0 )
917{
918   int data, tile_number;
998919
999      offset = 32+((sys16_bg_scrolly&0x1f8) >> 3); // 0x00..0x3f
1000      offset2 = 32+((sys16_bg2_scrolly&0x1f8) >> 3); // 0x00..0x3f
920   data = system16a_bootleg_bg0_tileram[tile_index];
921   tile_number = data&0x1fff;
1001922
1002      for( i=0;i<29;i++ ){
1003         orig_scroll = scroll2 = scroll = sys18_splittab_bg_x[i];
1004         if((sys16_bg_scrollx  &0xff00) != 0x8000) scroll = sys16_bg_scrollx;
1005         if((sys16_bg2_scrollx &0xff00) != 0x8000) scroll2 = sys16_bg2_scrollx;
1006923
1007         if(orig_scroll&0x8000){ // background2
1008            tilemap_set_scrollx( background , (i+offset)&0x3f, TILE_LINE_DISABLED );
1009            tilemap_set_scrollx( background2, (i+offset2)&0x3f, -320-(scroll2&0x3ff)+sys16_bgxoffset );
1010         }
1011         else{ // background
1012            tilemap_set_scrollx( background , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_bgxoffset );
1013            tilemap_set_scrollx( background2, (i+offset2)&0x3f, TILE_LINE_DISABLED );
1014         }
1015      }
1016   }
1017   else {
1018      tilemap_set_scrollx( background , 0, -320-(sys16_bg_scrollx&0x3ff)+sys16_bgxoffset );
1019      tilemap_set_scrollx( background2, 0, -320-(sys16_bg2_scrollx&0x3ff)+sys16_bgxoffset );
1020   }
924   SET_TILE_INFO(
925         0,
926         tile_number,
927         (data>>6)&0x7f,
928         0);
929}
1021930
1022   tilemap_set_scrolly( background , 0, -256+sys16_bg_scrolly );
1023   tilemap_set_scrolly( background2, 0, -256+sys16_bg2_scrolly );
931static TILE_GET_INFO( get_system16a_bootleg_tile_info1 )
932{
933   int data, tile_number;
1024934
1025   if( sys18_splittab_fg_x ){
1026      int offset,offset2, scroll,scroll2,orig_scroll;
935   data = system16a_bootleg_bg1_tileram[tile_index];
936   tile_number = data&0x1fff;
1027937
1028      offset = 32+((sys16_fg_scrolly&0x1f8) >> 3);
1029      offset2 = 32+((sys16_fg2_scrolly&0x1f8) >> 3);
938   SET_TILE_INFO(
939         0,
940         tile_number,
941         (data>>6)&0x7f,
942         0);
943}
1030944
1031      for( i=0;i<29;i++ ){
1032         orig_scroll = scroll2 = scroll = sys18_splittab_fg_x[i];
1033         if( (sys16_fg_scrollx &0xff00) != 0x8000 ) scroll = sys16_fg_scrollx;
945WRITE16_HANDLER( system16a_bootleg_bgscrolly_w )
946{
947   system16a_bootleg_bgscrolly = data;
948}
1034949
1035         if( (sys16_fg2_scrollx &0xff00) != 0x8000 ) scroll2 = sys16_fg2_scrollx;
950WRITE16_HANDLER( system16a_bootleg_bgscrollx_w )
951{
952   system16a_bootleg_bgscrollx = data;
953}
1036954
1037         if( orig_scroll&0x8000 ){
1038            tilemap_set_scrollx( foreground , (i+offset)&0x3f, TILE_LINE_DISABLED );
1039            tilemap_set_scrollx( foreground2, (i+offset2)&0x3f, -320-(scroll2&0x3ff)+sys16_fgxoffset );
1040         }
1041         else {
1042            tilemap_set_scrollx( foreground , (i+offset)&0x3f, -320-(scroll&0x3ff)+sys16_fgxoffset );
1043            tilemap_set_scrollx( foreground2 , (i+offset2)&0x3f, TILE_LINE_DISABLED );
1044         }
1045      }
955WRITE16_HANDLER( system16a_bootleg_fgscrolly_w )
956{
957   system16a_bootleg_fgscrolly = data;
958}
959
960WRITE16_HANDLER( system16a_bootleg_fgscrollx_w )
961{
962   system16a_bootleg_fgscrollx = data;
963}
964
965WRITE16_HANDLER( system16a_bootleg_tilemapselect_w )
966{
967   COMBINE_DATA(&system16a_bootleg_tilemapselect);
968   //printf("system16a_bootleg_tilemapselect %04x\n", system16a_bootleg_tilemapselect);
969}
970
971
972
973VIDEO_START( system16a_bootleg )
974{
975   /* Normal colors */
976   compute_resistor_weights(0, 255, -1.0,
977      6, resistances_normal, weights[0][0], 0, 0,
978      6, resistances_normal, weights[0][1], 0, 0,
979      6, resistances_normal, weights[0][2], 0, 0
980      );
981
982   /* Shadow/Highlight colors */
983   compute_resistor_weights(0, 255, -1.0,
984      6, resistances_sh, weights[1][0], 0, 0,
985      6, resistances_sh, weights[1][1], 0, 0,
986      6, resistances_sh, weights[1][2], 0, 0
987      );
988
989
990
991   system16a_bootleg_text_tilemap = tilemap_create(machine, get_system16a_bootleg_tile_infotxt, tilemap_scan_rows, 8,8, 64,32 );
992
993   // the system16a bootlegs have simple tilemaps instead of the paged system
994   system16a_bootleg_bg_tilemaps[0] = tilemap_create(machine, get_system16a_bootleg_tile_info0, tilemap_scan_rows, 8,8, 64,32 );
995   system16a_bootleg_bg_tilemaps[1] = tilemap_create(machine, get_system16a_bootleg_tile_info1, tilemap_scan_rows, 8,8, 64,32 );
996
997   tilemap_set_transparent_pen( system16a_bootleg_text_tilemap, 0 );
998   tilemap_set_transparent_pen( system16a_bootleg_bg_tilemaps[0], 0 );
999   tilemap_set_transparent_pen( system16a_bootleg_bg_tilemaps[1], 0 );
1000
1001
1002}
1003
1004// Passing Shot (2 player), Shinobi (Datsu), Wonderboy 3
1005VIDEO_UPDATE( system16a_bootleg )
1006{
1007   int offset_txtx, offset_txty, offset_bg1x, offset_bg1y, offset_bg0x, offset_bg0y;
1008
1009   // passing shot
1010   offset_txtx = 192;
1011   offset_txty = 0;
1012   offset_bg1x = 190;
1013   offset_bg1y = 0;
1014   offset_bg0x = 187;
1015   offset_bg0y = 0;
1016
1017   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
1018
1019   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
1020   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[0]);
1021   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[1]);
1022   tilemap_mark_all_tiles_dirty (system16a_bootleg_text_tilemap);
1023
1024   tilemap_set_scrollx( system16a_bootleg_text_tilemap, 0, offset_txtx );
1025   tilemap_set_scrolly( system16a_bootleg_text_tilemap, 0, offset_txty );
1026
1027   if ((system16a_bootleg_tilemapselect&0xff) == 0x12)
1028   {
1029      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_bgscrollx+offset_bg1x );
1030      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_bgscrolly+offset_bg1y );
1031      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_fgscrollx+offset_bg0x );
1032      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_fgscrolly+offset_bg0y );
1033
1034      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[0], TILEMAP_DRAW_OPAQUE, 0 );
1035      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[1], 0, 0 );
1036      tilemap_draw( bitmap,cliprect, system16a_bootleg_text_tilemap, 0, 0 );
10461037   }
1047   else {
1048      tilemap_set_scrollx( foreground , 0, -320-(sys16_fg_scrollx&0x3ff)+sys16_fgxoffset );
1049      tilemap_set_scrollx( foreground2, 0, -320-(sys16_fg2_scrollx&0x3ff)+sys16_fgxoffset );
1038   else if ((system16a_bootleg_tilemapselect&0xff) == 0x21)
1039   {
1040      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_bgscrollx+187 );
1041      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_bgscrolly );
1042      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_fgscrollx+187 );
1043      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_fgscrolly+1 );
1044
1045      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[1], TILEMAP_DRAW_OPAQUE, 0 );
1046      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[0], 0, 0 );
1047      tilemap_draw( bitmap,cliprect, system16a_bootleg_text_tilemap, 0, 0 );
10501048   }
10511049
1050   return 0;
1051}
10521052
1053   tilemap_set_scrolly( foreground , 0, -256+sys16_fg_scrolly );
1054   tilemap_set_scrolly( foreground2, 0, -256+sys16_fg2_scrolly );
1053/* The Passing Shot 4 Player bootleg has weird scroll registers (different offsets, ^0x7 xor) */
1054VIDEO_UPDATE( system16a_bootleg_passht4b )
1055{
1056   int offset_txtx, offset_txty, offset_bg1x, offset_bg1y, offset_bg0x, offset_bg0y;
10551057
1056   tilemap_set_enable( background2, sys18_bg2_active );
1057   tilemap_set_enable( foreground2, sys18_fg2_active );
1058   // passing shot
1059   offset_txtx = 192;
1060   offset_txty = 0;
1061   offset_bg1x = 3;
1062   offset_bg1y = 32;
1063   offset_bg0x = 5;
1064   offset_bg0y = 32;
1065
1066   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
1067
1068   // I can't bring myself to care about dirty tile marking on something which runs at a bazillion % speed anyway, clean code is better
1069   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[0]);
1070   tilemap_mark_all_tiles_dirty (system16a_bootleg_bg_tilemaps[1]);
1071   tilemap_mark_all_tiles_dirty (system16a_bootleg_text_tilemap);
1072
1073   tilemap_set_scrollx( system16a_bootleg_text_tilemap, 0, offset_txtx );
1074   tilemap_set_scrolly( system16a_bootleg_text_tilemap, 0, offset_txty );
1075
1076   if ((system16a_bootleg_tilemapselect&0xff) == 0x12)
1077   {
1078      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[1], 0, (system16a_bootleg_bgscrollx^0x7)+offset_bg1x );
1079      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[1], 0, system16a_bootleg_bgscrolly+offset_bg1y );
1080      tilemap_set_scrollx( system16a_bootleg_bg_tilemaps[0], 0, (system16a_bootleg_fgscrollx^0x7)+offset_bg0x );
1081      tilemap_set_scrolly( system16a_bootleg_bg_tilemaps[0], 0, system16a_bootleg_fgscrolly+offset_bg0y );
1082
1083      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[0], TILEMAP_DRAW_OPAQUE, 0 );
1084      tilemap_draw( bitmap,cliprect, system16a_bootleg_bg_tilemaps[1], 0, 0 );
1085      tilemap_draw( bitmap,cliprect, system16a_bootleg_text_tilemap, 0, 0 );
1086   }
1087
1088   return 0;
10581089}
10591090
1060VIDEO_UPDATE( system16 ){
1091
1092/***************************************************************************/
1093
1094VIDEO_UPDATE( system16 )
1095{
10611096   if (!sys16_refreshenable)
10621097   {
10631098      bitmap_fill(bitmap, cliprect, 0);
10641099      return 0;
10651100   }
10661101
1067   if( sys16_update_proc ) sys16_update_proc();
10681102   update_page();
1069   sys16_vh_refresh_helper(); /* set scroll registers */
10701103
10711104   bitmap_fill(priority_bitmap,cliprect,0);
10721105
1073   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0x00 );
1074   if(sys16_bg_priority_mode) tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0x00 );
1075//  sprite_draw(sprite_list,3); // needed for Aurail
1076   if( sys16_bg_priority_mode==2 ) tilemap_draw( bitmap,cliprect, background, 1, 0x01 );// body slam (& wrestwar??)
1077//  sprite_draw(sprite_list,2);
1078   else if( sys16_bg_priority_mode==1 ) tilemap_draw( bitmap,cliprect, background, 1, 0x03 );// alien syndrome / aurail
1079   tilemap_draw( bitmap,cliprect, foreground, 0, 0x03 );
1080//  sprite_draw(sprite_list,1);
1081   tilemap_draw( bitmap,cliprect, foreground, 1, 0x07 );
1082   if( sys16_textlayer_lo_max!=0 ) tilemap_draw( bitmap,cliprect, text_layer, 1, 7 );// needed for Body Slam
1083//  sprite_draw(sprite_list,0);
1106   // draw bg
1107   {
1108      tilemap_set_scrollx( background, 0, -320-sys16_bg_scrollx+sys16_bgxoffset );
1109      tilemap_set_scrolly( background, 0, -256+sys16_bg_scrolly );
1110
1111      tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0x00 );
1112
1113      if(sys16_bg_priority_mode)
1114      {
1115         tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0x00 );
1116      }
1117
1118      if( sys16_bg_priority_mode==2 )
1119      {
1120         tilemap_draw( bitmap,cliprect, background, 1, 0x01 );// body slam (& wrestwar??)
1121      }
1122      else if ( sys16_bg_priority_mode==1 )
1123      {
1124         tilemap_draw( bitmap,cliprect, background, 1, 0x03 );// alien syndrome / aurail
1125      }
1126   }
1127
1128   // draw fg
1129   {
1130      tilemap_set_scrollx( foreground, 0, -320-sys16_fg_scrollx+sys16_fgxoffset );
1131      tilemap_set_scrolly( foreground, 0, -256+sys16_fg_scrolly );
1132
1133      tilemap_draw( bitmap,cliprect, foreground, 0, 0x03 );
1134      tilemap_draw( bitmap,cliprect, foreground, 1, 0x07 );
1135   }
1136
1137
1138   if( sys16_textlayer_lo_max!=0 )
1139   {
1140      tilemap_draw( bitmap,cliprect, text_layer, 1, 7 );// needed for Body Slam
1141   }
1142
10841143   tilemap_draw( bitmap,cliprect, text_layer, 0, 0xf );
10851144
10861145   draw_sprites(screen->machine, bitmap,cliprect,0 );
r4878r4879
10881147}
10891148
10901149
1091VIDEO_UPDATE( system18old ){
1150VIDEO_UPDATE( system18old )
1151{
10921152   if (!sys16_refreshenable)
10931153   {
1094      /* should it REALLY not clear the bitmap? ddcrew vdp gfx look ugly if i don't do it like this */
10951154      bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
10961155      return 0;
10971156   }
10981157
1099   if( sys16_update_proc ) sys16_update_proc();
11001158   update_page();
1101   sys18_vh_screenrefresh_helper(); /* set scroll registers */
11021159
11031160   bitmap_fill(priority_bitmap,NULL,0);
11041161   if(sys18_bg2_active)
r4878r4879
11091166   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE, 0 );
11101167   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 1, 0 );   //??
11111168   tilemap_draw( bitmap,cliprect, background, TILEMAP_DRAW_OPAQUE | 2, 0 );   //??
1112
1113   if (!strcmp(screen->machine->gamedrv->name,"astorm"))  system18_vdp_update(bitmap,cliprect); // kludge: render vdp here for astorm
1114   /* ASTORM also draws some sprites with the vdp, needs to be higher priority..*/
1115
1116//  sprite_draw(sprite_list,3);
11171169   tilemap_draw( bitmap,cliprect, background, 1, 0x1 );
1118//  sprite_draw(sprite_list,2);
11191170   tilemap_draw( bitmap,cliprect, background, 2, 0x3 );
11201171
1172   if(sys18_fg2_active)
1173   {
1174      tilemap_draw( bitmap,cliprect, foreground2, 0, 0x3 );
1175   }
11211176
1122   if(sys18_fg2_active) tilemap_draw( bitmap,cliprect, foreground2, 0, 0x3 );
11231177   tilemap_draw( bitmap,cliprect, foreground, 0, 0x3 );
1124//  sprite_draw(sprite_list,1);
1125   if(sys18_fg2_active) tilemap_draw( bitmap,cliprect, foreground2, 1, 0x7 );
1178
1179   if(sys18_fg2_active)
1180   {
1181      tilemap_draw( bitmap,cliprect, foreground2, 1, 0x7 );
1182   }
1183
11261184   tilemap_draw( bitmap,cliprect, foreground, 1, 0x7 );
11271185
1128   if (!strcmp(screen->machine->gamedrv->name,"ddcrew"))  system18_vdp_update(bitmap,cliprect); // kludge: render vdp here for ddcrew
1129
11301186   tilemap_draw( bitmap,cliprect, text_layer, 1, 0x7 );
1131//  sprite_draw(sprite_list,0);
11321187   tilemap_draw( bitmap,cliprect, text_layer, 0, 0xf );
11331188
1134   if (!strcmp(screen->machine->gamedrv->name,"cltchitr"))  system18_vdp_update(bitmap,cliprect); // kludge: render vdp here for clthitr, draws the ball in game!
1135   if (!strcmp(screen->machine->gamedrv->name,"cltchtrj"))  system18_vdp_update(bitmap,cliprect); // kludge: render vdp here for clthitr, draws the ball in game!
1136//  if (!strcmp(screen->machine->gamedrv->name,"astorm"))  system18_vdp_update(bitmap,cliprect); // kludge: render vdp here for astorm
1137
11381189   draw_sprites(screen->machine, bitmap,cliprect, 0 );
11391190   return 0;
11401191}
src/mame/video/model1.c
r4878r4879
731731   struct point *old_p0, *old_p1, *p0, *p1;
732732   struct vector vn;
733733   int link, type;
734#if 0
734735   int dump;
736#endif
735737   int lightmode;
736738   float old_z;
737739   struct quad cquad;
r4878r4879
743745      poly_data=(float *) poly_rom;
744746
745747   poly_adr &= 0x7fffff;
748#if 0
746749   dump = poly_adr == 0x944ea;
747750   dump = 0;
751#endif
748752
749753#if 0
750754   if(poly_adr < 0x10000 || poly_adr >= 0x80000)
src/mame/video/cps1.c
r4878r4879
12331233static const struct CPS1config cps1_config_table[]=
12341234{
12351235   /* name       CPSB         gfx mapper   in2  in3  out2   kludge */
1236   {"forgottn", CPS_B_01,     mapper_LWCHR },
1237   {"forgott1", CPS_B_01,     mapper_LW621 },
1236   {"forgottn", CPS_B_01,     mapper_LW621 },
1237   {"forgottu", CPS_B_01,     mapper_LWCHR },
12381238   {"lostwrld", CPS_B_01,     mapper_LWCHR },
12391239   {"ghouls",   CPS_B_01,     mapper_DM620 },
12401240   {"ghoulsu",  CPS_B_01,     mapper_DM620 },
src/mame/video/bbusters.c
r4878r4879
2727static const UINT8 *scale_table_ptr;
2828static UINT8 scale_line_count;
2929
30UINT16 *bbuster_pf1_data,*bbuster_pf2_data,*bbuster_pf1_scroll_data,*bbuster_pf2_scroll_data;
30UINT16 *bbusters_pf1_data,*bbusters_pf2_data,*bbusters_pf1_scroll_data,*bbusters_pf2_scroll_data;
3131
3232/******************************************************************************/
3333
34static TILE_GET_INFO( get_bbuster_tile_info )
34static TILE_GET_INFO( get_bbusters_tile_info )
3535{
3636   UINT16 tile=videoram16[tile_index];
3737   SET_TILE_INFO(0,tile&0xfff,tile>>12,0);
r4878r4879
3939
4040static TILE_GET_INFO( get_pf1_tile_info )
4141{
42   UINT16 tile=bbuster_pf1_data[tile_index];
42   UINT16 tile=bbusters_pf1_data[tile_index];
4343   SET_TILE_INFO(3,tile&0xfff,tile>>12,0);
4444}
4545
4646static TILE_GET_INFO( get_pf2_tile_info )
4747{
48   UINT16 tile=bbuster_pf2_data[tile_index];
48   UINT16 tile=bbusters_pf2_data[tile_index];
4949   SET_TILE_INFO(4,tile&0xfff,tile>>12,0);
5050}
5151
52WRITE16_HANDLER( bbuster_video_w )
52WRITE16_HANDLER( bbusters_video_w )
5353{
5454   COMBINE_DATA(&videoram16[offset]);
5555   tilemap_mark_tile_dirty(fix_tilemap,offset);
5656}
5757
58WRITE16_HANDLER( bbuster_pf1_w )
58WRITE16_HANDLER( bbusters_pf1_w )
5959{
60   COMBINE_DATA(&bbuster_pf1_data[offset]);
60   COMBINE_DATA(&bbusters_pf1_data[offset]);
6161   tilemap_mark_tile_dirty(pf1_tilemap,offset);
6262}
6363
64WRITE16_HANDLER( bbuster_pf2_w )
64WRITE16_HANDLER( bbusters_pf2_w )
6565{
66   COMBINE_DATA(&bbuster_pf2_data[offset]);
66   COMBINE_DATA(&bbusters_pf2_data[offset]);
6767   tilemap_mark_tile_dirty(pf2_tilemap,offset);
6868}
6969
r4878r4879
7171
7272VIDEO_START( bbuster )
7373{
74   fix_tilemap = tilemap_create(machine, get_bbuster_tile_info,tilemap_scan_rows,8,8,32,32);
74   fix_tilemap = tilemap_create(machine, get_bbusters_tile_info,tilemap_scan_rows,8,8,32,32);
7575   pf1_tilemap = tilemap_create(machine, get_pf1_tile_info,tilemap_scan_cols,16,16,128,32);
7676   pf2_tilemap = tilemap_create(machine, get_pf2_tile_info,tilemap_scan_cols,16,16,128,32);
7777
r4878r4879
8181
8282VIDEO_START( mechatt )
8383{
84   fix_tilemap = tilemap_create(machine, get_bbuster_tile_info,tilemap_scan_rows,8,8,32,32);
84   fix_tilemap = tilemap_create(machine, get_bbusters_tile_info,tilemap_scan_rows,8,8,32,32);
8585   pf1_tilemap = tilemap_create(machine, get_pf1_tile_info,tilemap_scan_cols,16,16,256,32);
8686   pf2_tilemap = tilemap_create(machine, get_pf2_tile_info,tilemap_scan_cols,16,16,256,32);
8787
r4878r4879
267267
268268VIDEO_UPDATE( bbuster )
269269{
270   tilemap_set_scrollx( pf1_tilemap,0, bbuster_pf1_scroll_data[0] );
271   tilemap_set_scrolly( pf1_tilemap,0, bbuster_pf1_scroll_data[1] );
272   tilemap_set_scrollx( pf2_tilemap,0, bbuster_pf2_scroll_data[0] );
273   tilemap_set_scrolly( pf2_tilemap,0, bbuster_pf2_scroll_data[1] );
270   tilemap_set_scrollx( pf1_tilemap,0, bbusters_pf1_scroll_data[0] );
271   tilemap_set_scrolly( pf1_tilemap,0, bbusters_pf1_scroll_data[1] );
272   tilemap_set_scrollx( pf2_tilemap,0, bbusters_pf2_scroll_data[0] );
273   tilemap_set_scrolly( pf2_tilemap,0, bbusters_pf2_scroll_data[1] );
274274
275275   tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0);
276276//  draw_sprites(screen->machine,bitmap,buffered_spriteram16_2,2,0x8,0x8);
r4878r4879
283283
284284VIDEO_UPDATE( mechatt )
285285{
286   tilemap_set_scrollx( pf1_tilemap,0, bbuster_pf1_scroll_data[0] );
287   tilemap_set_scrolly( pf1_tilemap,0, bbuster_pf1_scroll_data[1] );
288   tilemap_set_scrollx( pf2_tilemap,0, bbuster_pf2_scroll_data[0] );
289   tilemap_set_scrolly( pf2_tilemap,0, bbuster_pf2_scroll_data[1] );
286   tilemap_set_scrollx( pf1_tilemap,0, bbusters_pf1_scroll_data[0] );
287   tilemap_set_scrolly( pf1_tilemap,0, bbusters_pf1_scroll_data[1] );
288   tilemap_set_scrollx( pf2_tilemap,0, bbusters_pf2_scroll_data[0] );
289   tilemap_set_scrolly( pf2_tilemap,0, bbusters_pf2_scroll_data[1] );
290290
291291   tilemap_draw(bitmap,cliprect,pf2_tilemap,0,0);
292292   tilemap_draw(bitmap,cliprect,pf1_tilemap,0,0);
src/mame/video/hyprduel.c
r4878r4879
430430
431431/* Draw sprites */
432432
433void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
433static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
434434{
435435   UINT8 *base_gfx   =   memory_region(machine, "gfx1");
436436   UINT8 *gfx_max   =   base_gfx + memory_region_length(machine, "gfx1");
src/mame/video/sshangha.c
r4878r4879
218218   tilemap_set_scrolly( pf1_8x8_tilemap,0, sshangha_control_0[2] );
219219   tilemap_set_scrolly( pf1_16x16_tilemap,0, sshangha_control_0[2] );
220220
221   if ((sshangha_control_0[5]&0x8000)==0)
222      bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
221   //if ((sshangha_control_0[5]&0x8000)==0) /* <- used on hot-b logo and girl presentation screens */
222   bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
223223
224224   /* Super Shanghai has a mode where the two tilemaps are combined to
225225    produce a 6bpp tilemap.  We can't precompute this as any tiles can be
src/mame/video/dc.c
r4878r4879
2323
2424#define NUM_BUFFERS 4
2525
26static UINT32 pvrctrl_regs[0x100/4];
26UINT32 pvrctrl_regs[0x100/4];
2727static UINT32 pvrta_regs[0x2000/4];
2828static 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};
2929static const int pvr_wordsvertex[24]  = {8,8,8,8,8,16,16,8,8,8, 8, 8,8,8,8,8,16,16, 8,16,16,8,16,16};
r4878r4879
3535static float wbuffer[480][640];
3636static UINT32 debug_dip_status;
3737
38UINT64 *dc_texture_ram;
38UINT64 *dc_framebuffer_ram; // '32-bit access area'
39UINT64 *dc_texture_ram; // '64-bit access area'
3940static UINT32 tafifo_buff[32];
4041
4142static emu_timer *vbout_timer;
r4878r4879
971972   mame_printf_verbose("PVRCTRL: [%08x=%x] write %llx to %x (reg %x), mask %llx\n", 0x5f7c00+reg*4, dat, data>>shift, offset, reg, mem_mask);
972973   #endif
973974
974   pvrctrl_regs[reg] |= dat;
975//  pvrctrl_regs[reg] |= dat;
976   pvrctrl_regs[reg] = dat;
977
975978}
976979
977980READ64_HANDLER( pvr_ta_r )
r4878r4879
12071210      mame_printf_verbose("PVRTA: [%08x=%x] write %llx to %x (reg %x %x), mask %llx\n", 0x5f8000+reg*4, dat, data>>shift, offset, reg, (reg*4)+0x8000, mem_mask);
12081211   #endif
12091212}
1210void process_ta_fifo(running_machine* machine)
1213static void process_ta_fifo(running_machine* machine)
12111214{
12121215   UINT32 a;
12131216
r4878r4879
15971600         dilatechose[(b << 3) + a]=3+(a < b ? a : b);
15981601}
15991602
1600void render_hline(bitmap_t *bitmap, texinfo *ti, int y, float xl, float xr, float ul, float ur, float vl, float vr, float wl, float wr)
1603static void render_hline(bitmap_t *bitmap, texinfo *ti, int y, float xl, float xr, float ul, float ur, float vl, float vr, float wl, float wr)
16011604{
16021605   int xxl, xxr;
16031606   float dx, ddx, dudx, dvdx, dwdx;
r4878r4879
16821685   }
16831686}
16841687
1685void render_span(bitmap_t *bitmap, texinfo *ti,
1688static void render_span(bitmap_t *bitmap, texinfo *ti,
16861689                 float y0, float y1,
16871690                 float xl, float xr,
16881691                 float ul, float ur,
src/mame/video/mcatadv.c
r4878r4879
253253   tilemap_set_transparent_pen(mcatadv_tilemap2,0);
254254
255255   spriteram_old = auto_alloc_array_clear(machine, UINT16, spriteram_size/2);
256   vidregs_old = auto_alloc_array(machine, UINT16, 0xf/2);
256   vidregs_old = auto_alloc_array(machine, UINT16, (0xf+1)/2);
257257
258258   palette_bank1 = 0;
259259   palette_bank2 = 0;
src/mame/video/namcos22.c
r4878r4879
13141314
13151315         {
13161316            struct SceneNode *node = NewSceneNode(machine, zcoord,eSCENENODE_SPRITE);
1317
1318//              printf("[%02d]: tile %x pri %x color %x flipX %d flipY %d cols %d rows %d link %d X %d Y %d sX %d sY %d trans %d cz %d\n",
1319//                  i, tile, cz&0x80, color&0x7f, flipx, flipy, numcols, numrows, linkType, xpos, ypos, sizex, sizey, translucency, cz);
1320
1321            if (color == 0) color = 0x67;   // extreme hack for Tokyo Wars
1322
13171323            node->data.sprite.tile = tile;
13181324            node->data.sprite.pri = cz&0x80;
13191325            //              node->data.sprite.pri = (color&0x80);
r4878r4879
14141420   int deltay = spriteram32[0x18/4]>>16;
14151421   int enable = spriteram32[0]>>16;
14161422
1423   /* HACK for Tokyo Wars */
1424   if (deltax == 0 && deltay == 0)
1425   {
1426      deltax = 190;
1427      deltay = 250;
1428   }
1429
14171430   if( spriteram32[0x14/4] == 0x000002ff &&
14181431   spriteram32[0x18/4] == 0x000007ff )
14191432   { /* HACK (fixes alpine racer and self test) */
r4878r4879
22382251   namcos22_czram[1] = auto_alloc_array(machine, UINT16, 0x200/2 );
22392252   namcos22_czram[2] = auto_alloc_array(machine, UINT16, 0x200/2 );
22402253   namcos22_czram[3] = auto_alloc_array(machine, UINT16, 0x200/2 );
2254
2255   memset(namcos22_czram[0], 0, 0x200);
2256   memset(namcos22_czram[1], 0, 0x200);
2257   memset(namcos22_czram[2], 0, 0x200);
2258   memset(namcos22_czram[3], 0, 0x200);
2259
22412260   VIDEO_START_CALL(common);
22422261}
22432262
src/mame/video/cheekyms.c
r4878r4879
1717UINT8 *cheekyms_port_80;
1818
1919static tilemap *cheekyms_tilemap;
20static bitmap_t *bitmap_buffer;
2021
21
2222/* bit 3 and 7 of the char color PROMs are used for something -- not currently emulated -
2323   thus GAME_IMPERFECT_GRAPHICS */
2424
r4878r4879
9797   SET_TILE_INFO(0, code, color, 0);
9898}
9999
100
101100VIDEO_START( cheekyms )
102101{
102   int width, height;
103
104   width = video_screen_get_width(machine->primary_screen);
105   height = video_screen_get_height(machine->primary_screen);
106   bitmap_buffer = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_INDEXED16);
107
103108   cheekyms_tilemap = tilemap_create(machine, cheekyms_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
104109   tilemap_set_transparent_pen(cheekyms_tilemap, 0);
105110}
r4878r4879
146151
147152VIDEO_UPDATE( cheekyms )
148153{
149   #define SCROLL_X_MIN  8
150   #define SCROLL_X_MAX  12
151   #define SCROLL_Y_MIN  6
152   #define SCROLL_Y_MAX  25
153
154   const rectangle clip_no_scroll_top      = {                   0*8,                  32*8-1,                0*8,     SCROLL_Y_MIN*8-1 };
155   const rectangle clip_no_scroll_bottom   = {                   0*8,                  32*8-1, (SCROLL_Y_MAX+1)*8,               32*8-1 };
156   const rectangle clip_no_scroll_left_nf  = {                   0*8,        SCROLL_X_MIN*8-1,     SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
157   const rectangle clip_no_scroll_right_nf = {    (SCROLL_X_MAX+1)*8,                  32*8-1,     SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
158   const rectangle clip_no_scroll_left_f   = {   (32-SCROLL_X_MIN)*8,                  32*8-1,     SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
159   const rectangle clip_no_scroll_right_f  = {                   0*8, (32-SCROLL_X_MAX-1)*8-1,     SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
160   const rectangle clip_scroll_nf          = {        SCROLL_X_MIN*8,                  13*8-1,     SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
161   const rectangle clip_scroll_f           = { (32-SCROLL_X_MAX-1)*8,   (32-SCROLL_X_MIN)*8-1,     SCROLL_Y_MIN*8, (SCROLL_Y_MAX+1)*8-1 };
162
154   int y,x;
155   int scrolly = ((*cheekyms_port_80 >> 3) & 0x07);
163156   int flip = *cheekyms_port_80 & 0x80;
164157
165158   tilemap_mark_all_tiles_dirty(ALL_TILEMAPS);
166159   tilemap_set_flip(ALL_TILEMAPS, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0);
167160
168161   bitmap_fill(bitmap, cliprect, 0);
162   bitmap_fill(bitmap_buffer, cliprect, 0);
169163
170164   /* sprites go under the playfield */
171165   draw_sprites(screen->machine->gfx, bitmap, cliprect, flip);
172166
173   /* draw the non-scrolling parts of the playfield first */
174   tilemap_set_scrolly(cheekyms_tilemap, 0, 0);
175   tilemap_draw(bitmap, &clip_no_scroll_top,    cheekyms_tilemap, 0, 0);
176   tilemap_draw(bitmap, &clip_no_scroll_bottom, cheekyms_tilemap, 0, 0);
167   /* draw the tilemap to a temp bitmap */
168   tilemap_draw(bitmap_buffer, cliprect, cheekyms_tilemap, 0, 0);
177169
178   if (flip)
170   /* draw the tilemap to the final bitmap applying the scroll to the man character */
171   for(y = cliprect->min_y; y <= cliprect->max_y; y++)
179172   {
180      tilemap_draw(bitmap, &clip_no_scroll_left_f,   cheekyms_tilemap, 0, 0);
181      tilemap_draw(bitmap, &clip_no_scroll_right_f,  cheekyms_tilemap, 0, 0);
182   }
183   else
184   {
185      tilemap_draw(bitmap, &clip_no_scroll_left_nf,  cheekyms_tilemap, 0, 0);
186      tilemap_draw(bitmap, &clip_no_scroll_right_nf, cheekyms_tilemap, 0, 0);
187   }
173      for(x = cliprect->min_x; x <= cliprect->max_x; x++)
174      {
175         int in_man_area;
188176
189   /* now the scrolling part */
190   if (flip)
191   {
192      tilemap_set_scrolly(cheekyms_tilemap, 0, -((*cheekyms_port_80 >> 3) & 0x07));
193      tilemap_draw(bitmap, &clip_scroll_f,  cheekyms_tilemap, 0, 0);
177         if(flip)
178         {
179            in_man_area = (x >= (32-12-1)*8 && x < (32-8)*8 && y > 5*8 && y < 27*8);
180         }
181         else
182         {
183            in_man_area = (x >= 8*8 && x < 12*8 && y > 5*8 && y < 27*8);
184         }
185
186         if(in_man_area)
187         {
188            if ((y + scrolly) < 27*8 && *BITMAP_ADDR16(bitmap_buffer, y + scrolly, x) != 0)
189               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(bitmap_buffer, y + scrolly, x);
190         }
191         else
192         {
193            if(*BITMAP_ADDR16(bitmap_buffer, y, x) != 0)
194               *BITMAP_ADDR16(bitmap, y, x) = *BITMAP_ADDR16(bitmap_buffer, y, x);
195         }
196      }
194197   }
195   else
196   {
197      tilemap_set_scrolly(cheekyms_tilemap, 0, (*cheekyms_port_80 >> 3) & 0x07);
198      tilemap_draw(bitmap, &clip_scroll_nf, cheekyms_tilemap, 0, 0);
199   }
200198
199
201200   return 0;
202201}
src/mame/video/tx1.c
r4878r4879
14781478
14791479***************************************************************************/
14801480
1481void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev,
1481static void buggyboy_get_roadpix(int screen, int ls161, UINT8 rva0_6, UINT8 sld, UINT32 *_rorev,
14821482                    UINT8 *rc0, UINT8 *rc1, UINT8 *rc2, UINT8 *rc3,
14831483                    const UINT8 *rom, const UINT8 *prom0, const UINT8 *prom1, const UINT8 *prom2)
14841484{
src/mame/video/konamiic.c
r4878r4879
79967996
79977997   UINT32 src_wrapmask;
79987998   UINT8  *src_base;
7999   int src_x;
7999   //int src_x;
80008000   int src_fx, src_fdx;
80018001   int pix_data, dst_offset;
80028002   const pen_t  *pal_base;
r4878r4879
81048104
81058105   // generalized
81068106   src_base = source;
8107   src_x = 0;
8107   //src_x = 0;
81088108
81098109   // there is no need to wrap source offsets along with source clipping
81108110   // so we set all bits of the wrapmask to one
src/mame/video/runaway.c
r4878r4879
7777VIDEO_START( runaway )
7878{
7979   bg_tilemap = tilemap_create(machine, runaway_get_tile_info, tilemap_scan_rows,  8, 8, 32, 30);
80
81   state_save_register_global(machine, tile_bank);
8082}
8183
8284
8385VIDEO_START( qwak )
8486{
8587   bg_tilemap = tilemap_create(machine, qwak_get_tile_info, tilemap_scan_rows,  8, 8, 32, 30);
88
89   state_save_register_global(machine, tile_bank);
8690}
8791
8892
src/mame/video/taito_z.c
r4878r4879
831831   if (ACCESSING_BITS_0_7)
832832   {
833833      /* bit 0 = reset sub CPU */
834      cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
834      cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
835835
836836      /* bits 1-3 n.c. */
837837
src/mame/video/ppu2c0x.c
r4878r4879
199199   /* Loop through the emphasis modes (8 total) */
200200   for (colorEmphasis = 0; colorEmphasis < 8; colorEmphasis ++)
201201   {
202      double r_mod = 0.0;
203      double g_mod = 0.0;
204      double b_mod = 0.0;
202      /*
203        double r_mod = 0.0;
204        double g_mod = 0.0;
205        double b_mod = 0.0;
205206
206      switch (colorEmphasis)
207      {
208         case 0: r_mod = 1.0; g_mod = 1.0; b_mod = 1.0; break;
209         case 1: r_mod = 1.24; g_mod = .915; b_mod = .743; break;
210         case 2: r_mod = .794; g_mod = 1.09; b_mod = .882; break;
211         case 3: r_mod = .905; g_mod = 1.03; b_mod = 1.28; break;
212         case 4: r_mod = .741; g_mod = .987; b_mod = 1.0; break;
213         case 5: r_mod = 1.02; g_mod = .908; b_mod = .979; break;
214         case 6: r_mod = 1.02; g_mod = .98; b_mod = .653; break;
215         case 7: r_mod = .75; g_mod = .75; b_mod = .75; break;
216      }
207        switch (colorEmphasis)
208        {
209            case 0: r_mod = 1.0; g_mod = 1.0; b_mod = 1.0; break;
210            case 1: r_mod = 1.24; g_mod = .915; b_mod = .743; break;
211            case 2: r_mod = .794; g_mod = 1.09; b_mod = .882; break;
212            case 3: r_mod = .905; g_mod = 1.03; b_mod = 1.28; break;
213            case 4: r_mod = .741; g_mod = .987; b_mod = 1.0; break;
214            case 5: r_mod = 1.02; g_mod = .908; b_mod = .979; break;
215            case 6: r_mod = 1.02; g_mod = .98; b_mod = .653; break;
216            case 7: r_mod = .75; g_mod = .75; b_mod = .75; break;
217        }
218        */
217219
218220      /* loop through the 4 intensities */
219221      for (colorIntensity = 0; colorIntensity < 4; colorIntensity++)
r4878r4879
894896         // a game can read the high bit of $2002 before the NMI is called (potentially resetting the bit
895897         // via a read from $2002 in the NMI handler).
896898         // B-Wings is an example game that needs this.
897         timer_adjust_oneshot(this_ppu->nmi_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 4), 0);
899         timer_adjust_oneshot(this_ppu->nmi_timer, cputag_clocks_to_attotime(device->machine, "maincpu", 4), 0);
898900      }
899901   }
900902
r4878r4879
922924      next_scanline = 0;
923925
924926   // Call us back when the hblank starts for this scanline
925   timer_adjust_oneshot(this_ppu->hblank_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation
927   timer_adjust_oneshot(this_ppu->hblank_timer, cputag_clocks_to_attotime(device->machine, "maincpu", 86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation
926928
927929   // trigger again at the start of the next scanline
928930   timer_adjust_oneshot(this_ppu->scanline_timer, video_screen_get_time_until_pos(device->machine->primary_screen, next_scanline * this_ppu->scan_scale, 0), 0);
r4878r4879
950952   timer_adjust_oneshot(this_ppu->nmi_timer, attotime_never, 0);
951953
952954   // Call us back when the hblank starts for this scanline
953   timer_adjust_oneshot(this_ppu->hblank_timer, cpu_clocks_to_attotime(device->machine->cpu[0], 86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation
955   timer_adjust_oneshot(this_ppu->hblank_timer, cputag_clocks_to_attotime(device->machine, "maincpu", 86.67), 0); // ??? FIXME - hardcoding NTSC, need better calculation
954956
955957   // Call us back at the start of the next scanline
956958   timer_adjust_oneshot(this_ppu->scanline_timer, video_screen_get_time_until_pos(device->machine->primary_screen, 1, 0), 0);
src/mame/video/n64.c
r4878r4879
18141814
18151815         if (x >= clipx1 && x < clipx2)
18161816         {
1817                int alpha_out = 0;
1817                //int alpha_out = 0;
18181818            COLOR c1, c2;
18191819            c1.r = c1.g = c1.b = c1.a = 0;
18201820            c2.r = c2.g = c2.b = c2.a = 0;
r4878r4879
19011901               c1 = COLOR_COMBINER(0);
19021902                    if( c1.a == 0 )
19031903                    {
1904                        alpha_out = 1;
1904                        //alpha_out = 1;
19051905                    }
19061906            }
19071907            else if (other_modes.cycle_type == CYCLE_TYPE_2)
r4878r4879
19101910               c2 = COLOR_COMBINER(1);
19111911                    if( c2.a == 0 )
19121912                    {
1913                        alpha_out = 1;
1913                        //alpha_out = 1;
19141914                    }
19151915            }
19161916
r4878r4879
21202120         UINT16 sz = z >> 16;
21212121         int oz;
21222122         int sss = 0, sst = 0;
2123            int alpha_out = 0;
2123            //int alpha_out = 0;
21242124         COLOR c1, c2;
21252125         c1.r = c1.g = c1.b = c1.a = 0;
21262126         c2.r = c2.g = c2.b = c2.a = 0;
r4878r4879
22092209               c1 = COLOR_COMBINER(0);
22102210                    if( c1.a == 0 )
22112211                    {
2212                        alpha_out = 1;
2212                        //alpha_out = 1;
22132213                    }
22142214            }
22152215            else if (other_modes.cycle_type == CYCLE_TYPE_2)
r4878r4879
22182218               c2 = COLOR_COMBINER(1);
22192219                    if( c2.a == 0 )
22202220                    {
2221                        alpha_out = 1;
2221                        //alpha_out = 1;
22222222                    }
22232223            }
22242224
r4878r4879
22922292   int xleft, xright, xleft_inc, xright_inc;
22932293   int xstart, xend;
22942294   int r, g, b, a, z, s, t, w;
2295   int dr, dg, db, da;
2295   //int dr, dg, db, da;
22962296   int drdx = 0, dgdx = 0, dbdx = 0, dadx = 0, dzdx = 0, dsdx = 0, dtdx = 0, dwdx = 0;
2297   int drdy = 0, dgdy = 0, dbdy = 0, dady = 0, dzdy = 0, dsdy = 0, dtdy = 0, dwdy = 0;
2297   //int drdy = 0, dgdy = 0, dbdy = 0, dady = 0, dzdy = 0, dsdy = 0, dtdy = 0, dwdy = 0;
22982298   int drde = 0, dgde = 0, dbde = 0, dade = 0, dzde = 0, dsde = 0, dtde = 0, dwde = 0;
22992299   int tile;
23002300   int flip = (w1 & 0x800000) ? 1 : 0;
r4878r4879
23452345   tile = (w1 >> 16) & 0x7;
23462346
23472347   r = 0xff;   g = 0xff;   b = 0xff;   a = 0xff;   z = 0;   s = 0;   t = 0;   w = 0;
2348   dr = 0;      dg = 0;      db = 0;      da = 0;
2348   //dr = 0;       dg = 0;     db = 0;     da = 0;
23492349
23502350   if (shade)
23512351   {
r4878r4879
23612361      dgde = ((rdp_cmd_data[shade_base+8 ] << 16) & 0xffff0000) | (rdp_cmd_data[shade_base+12] & 0x0000ffff);
23622362      dbde = (rdp_cmd_data[shade_base+9 ] & 0xffff0000) | ((rdp_cmd_data[shade_base+13] >> 16) & 0x0000ffff);
23632363      dade = ((rdp_cmd_data[shade_base+9 ] << 16) & 0xffff0000) | (rdp_cmd_data[shade_base+13] & 0x0000ffff);
2364      drdy = (rdp_cmd_data[shade_base+10] & 0xffff0000) | ((rdp_cmd_data[shade_base+14] >> 16) & 0x0000ffff);
2365      dgdy = ((rdp_cmd_data[shade_base+10] << 16) & 0xffff0000) | (rdp_cmd_data[shade_base+14] & 0x0000ffff);
2366      dbdy = (rdp_cmd_data[shade_base+11] & 0xffff0000) | ((rdp_cmd_data[shade_base+15] >> 16) & 0x0000ffff);
2367      dady = ((rdp_cmd_data[shade_base+11] << 16) & 0xffff0000) | (rdp_cmd_data[shade_base+15] & 0x0000ffff);
2364      //drdy = (rdp_cmd_data[shade_base+10] & 0xffff0000) | ((rdp_cmd_data[shade_base+14] >> 16) & 0x0000ffff);
2365      //dgdy = ((rdp_cmd_data[shade_base+10] << 16) & 0xffff0000) | (rdp_cmd_data[shade_base+14] & 0x0000ffff);
2366      //dbdy = (rdp_cmd_data[shade_base+11] & 0xffff0000) | ((rdp_cmd_data[shade_base+15] >> 16) & 0x0000ffff);
2367      //dady = ((rdp_cmd_data[shade_base+11] << 16) & 0xffff0000) | (rdp_cmd_data[shade_base+15] & 0x0000ffff);
23682368   }
23692369   if (texture)
23702370   {
r4878r4879
23772377      dsde = (rdp_cmd_data[texture_base+8 ] & 0xffff0000) | ((rdp_cmd_data[texture_base+12] >> 16) & 0x0000ffff);
23782378      dtde = ((rdp_cmd_data[texture_base+8 ] << 16) & 0xffff0000)   | (rdp_cmd_data[texture_base+12] & 0x0000ffff);
23792379      dwde = (rdp_cmd_data[texture_base+9 ] & 0xffff0000) | ((rdp_cmd_data[texture_base+13] >> 16) & 0x0000ffff);
2380      dsdy = (rdp_cmd_data[texture_base+10] & 0xffff0000) | ((rdp_cmd_data[texture_base+14] >> 16) & 0x0000ffff);
2381      dtdy = ((rdp_cmd_data[texture_base+10] << 16) & 0xffff0000)   | (rdp_cmd_data[texture_base+14] & 0x0000ffff);
2382      dwdy = (rdp_cmd_data[texture_base+11] & 0xffff0000) | ((rdp_cmd_data[texture_base+15] >> 16) & 0x0000ffff);
2380      //dsdy = (rdp_cmd_data[texture_base+10] & 0xffff0000) | ((rdp_cmd_data[texture_base+14] >> 16) & 0x0000ffff);
2381      //dtdy = ((rdp_cmd_data[texture_base+10] << 16) & 0xffff0000)   | (rdp_cmd_data[texture_base+14] & 0x0000ffff);
2382      //dwdy = (rdp_cmd_data[texture_base+11] & 0xffff0000) | ((rdp_cmd_data[texture_base+15] >> 16) & 0x0000ffff);
23832383   }
23842384   if (zbuffer)
23852385   {
23862386      z    = rdp_cmd_data[zbuffer_base+0];
23872387      dzdx = rdp_cmd_data[zbuffer_base+1];
23882388      dzde = rdp_cmd_data[zbuffer_base+2];
2389      dzdy = rdp_cmd_data[zbuffer_base+3];
2389      //dzdy = rdp_cmd_data[zbuffer_base+3];
23902390   }
23912391
23922392   xleft = xm;
src/mame/video/tubep.c
r4878r4879
183183   double weights_g[3*6];
184184   double weights_b[2*6];
185185
186   double output_scaler;
186   //double output_scaler;
187187
188188   /* text palette variables */
189189
r4878r4879
251251   for (i=0; i<6; i++) active_resistors_b[ 6+i] = resistors_2[i];
252252
253253   /* calculate and store the scaler */
254   output_scaler = compute_resistor_weights(0,   255,   -1.0,
255            3*6,   active_resistors_r,   weights_r,   470,   0,
256            3*6,   active_resistors_g,   weights_g,   470,   0,
257            2*6,   active_resistors_b,   weights_b,   470,   0);
254/*
255    output_scaler = compute_resistor_weights(0, 255,    -1.0,
256                3*6,    active_resistors_r, weights_r,  470,    0,
257                3*6,    active_resistors_g, weights_g,  470,    0,
258                2*6,    active_resistors_b, weights_b,  470,    0);
259*/
258260
259261/*  compute_resistor_weights(0, 255,    output_scaler,
260262                3*6,    active_resistors_r, weights_r,  470,    0,
r4878r4879
278280         double out;
279281         int c;
280282
281         int active_r = 3*6;
282         int active_g = 3*6;
283         int active_b = 2*6;
283         //int active_r = 3*6;
284         //int active_g = 3*6;
285         //int active_b = 2*6;
284286
285287         for (c=0; c<6; c++)
286288         {
r4878r4879
302304         if ((j >> 0) & 0x01)   /* if LS368 @E9  is disabled */
303305         {
304306            for (c=0; c<6; c++) bits_r[0 +c] = 0;
305            active_r-=6;
307            //active_r-=6;
306308         }
307309         if ((j >> 1) & 0x01)   /* if LS368 @E10 is disabled */
308310         {
309311            for (c=0; c<6; c++) bits_r[6 +c] = 0;
310            active_r-=6;
312            //active_r-=6;
311313         }
312314         if ((j >> 2) & 0x01)   /* if LS368 @E11 is disabled */
313315         {
314316            for (c=0; c<6; c++) bits_r[12 +c] = 0;
315            active_r-=6;
317            //active_r-=6;
316318         }
317319
318320         /* green component */
319321         if ((j >> 3) & 0x01)   /* if LS368 @E12 is disabled */
320322         {
321323            for (c=0; c<6; c++) bits_g[0 +c] = 0;
322            active_g-=6;
324            //active_g-=6;
323325         }
324326         if ((j >> 4) & 0x01)   /* if LS368 @E13 is disabled */
325327         {
326328            for (c=0; c<6; c++) bits_g[6 +c] = 0;
327            active_g-=6;
329            //active_g-=6;
328330         }
329331         if ((j >> 5) & 0x01)   /* if LS368 @E14 is disabled */
330332         {
331333            for (c=0; c<6; c++) bits_g[12+c] = 0;
332            active_g-=6;
334            //active_g-=6;
333335         }
334336
335337         /* blue component */
336338         if ((j >> 6) & 0x01)   /* if LS368 @E15 is disabled */
337339         {
338340            for (c=0; c<6; c++) bits_b[0 +c] = 0;
339            active_b-=6;
341            //active_b-=6;
340342         }
341343         if ((j >> 7) & 0x01)   /* if LS368 @E16 is disabled */
342344         {
343345            for (c=0; c<6; c++) bits_b[6 +c] = 0;
344            active_b-=6;
346            //active_b-=6;
345347         }
346348
347349         out = 0.0;
src/mame/video/arkanoid.c
r4878r4879
7373      cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
7474}
7575
76/* different hook-up, everything except for bits 0-1 and 7 aren't tested afaik. */
77WRITE8_HANDLER( tetrsark_d008_w )
78{
79   int bank;
80
81   /* bits 0 and 1 flip X and Y, I don't know which is which */
82   if (flip_screen_x_get(space->machine) != (data & 0x01))
83   {
84      flip_screen_x_set(space->machine, data & 0x01);
85      tilemap_mark_all_tiles_dirty(bg_tilemap);
86   }
87
88   if (flip_screen_y_get(space->machine) != (data & 0x02))
89   {
90      flip_screen_y_set(space->machine, data & 0x02);
91      tilemap_mark_all_tiles_dirty(bg_tilemap);
92   }
93
94   /* bit 2 selects the input paddle? */
95   arkanoid_paddle_select = data & 0x04;
96
97   /* bit 3-4 is unknown? */
98
99   /* bits 5 and 6 control gfx bank and palette bank. They are used together */
100   /* so I don't know which is which.? */
101   bank = (data & 0x20) >> 5;
102
103   if (gfxbank != bank)
104   {
105      gfxbank = bank;
106      tilemap_mark_all_tiles_dirty(bg_tilemap);
107   }
108
109   bank = (data & 0x40) >> 6;
110
111   if (palettebank != bank)
112   {
113      palettebank = bank;
114      tilemap_mark_all_tiles_dirty(bg_tilemap);
115   }
116
117   /* bit 7 is coin lockout (but not the service coin) */
118   coin_lockout_w(0, !(data & 0x80));
119   coin_lockout_w(1, !(data & 0x80));
120}
121
122
76123static TILE_GET_INFO( get_bg_tile_info )
77124{
78125   int offs = tile_index * 2;
src/mame/video/megasys1.c
r4878r4879
216216
217217static void create_tilemaps(running_machine *machine);
218218
219static UINT16 *megasys1_buffer_objectram,*megasys1_buffer2_objectram,*megasys1_buffer_spriteram16,*megasys1_buffer2_spriteram16;
219220
220221
222
221223#ifdef MAME_DEBUG
222224
223225#define SHOW_WRITE_ERROR(_format_,_offset_,_data_)\
r4878r4879
247249
248250   spriteram16 = &megasys1_ram[0x8000/2];
249251
252   megasys1_buffer_objectram = auto_alloc_array(machine, UINT16, 0x2000);
253   megasys1_buffer_spriteram16 = auto_alloc_array(machine, UINT16, 0x2000);
254   megasys1_buffer2_objectram = auto_alloc_array(machine, UINT16, 0x2000);
255   megasys1_buffer2_spriteram16 = auto_alloc_array(machine, UINT16, 0x2000);
256
250257   create_tilemaps(machine);
251258   megasys1_tmap[0] = megasys1_tilemap[0][0][0];
252259   megasys1_tmap[1] = megasys1_tilemap[1][0][0];
r4878r4879
587594      {
588595         for (sprite = 0; sprite < 4 ; sprite ++)
589596         {
590            UINT16 *objectdata = &megasys1_objectram[offs + (0x800/2) * sprite];
591            UINT16 *spritedata = &spriteram16[ (objectdata[ 0 ] & 0x7f) * 0x10/2];
597            UINT16 *objectdata = &megasys1_buffer2_objectram[offs + (0x800/2) * sprite];
598            UINT16 *spritedata = &megasys1_buffer2_spriteram16[ (objectdata[ 0 ] & 0x7f) * 0x10/2];
592599
593600            attr = spritedata[ 8/2 ];
594601            if (((attr & 0xc0)>>6) != sprite)   continue;   // flipping
r4878r4879
10201027      draw_sprites(screen->machine,bitmap,cliprect);
10211028   return 0;
10221029}
1030
1031VIDEO_EOF( megasys1 )
1032{
1033   /* Sprite are TWO frames ahead, like NMK16 HW. */
1034//megasys1_objectram
1035   memcpy(megasys1_buffer2_objectram,megasys1_buffer_objectram, 0x2000);
1036   memcpy(megasys1_buffer_objectram, megasys1_objectram, 0x2000);
1037//spriteram16
1038   memcpy(megasys1_buffer2_spriteram16, megasys1_buffer_spriteram16, 0x2000);
1039   memcpy(megasys1_buffer_spriteram16, spriteram16, 0x2000);
1040
1041}
1042
src/mame/etc/jrcrypt.c
r4878r4879
327327{
328328   int i;
329329   int encrypted=0;
330   int last_used=-1;
330   //int last_used=-1;
331331   int unmapped_encrypted=0;
332332   int unmapped=0;
333333   printf("statistics: \n");
r4878r4879
341341            encrypted = 1;
342342         else
343343            encrypted = 0;
344         last_used = i;
344         //last_used = i;
345345      }
346346      else
347347      {
r4878r4879
368368      if (c=='d')
369369      {
370370         char line[100],*l;
371         int i;
371         //int i;
372372         printf("Enter file prefix (files will be named 'prefix'.8d 'prefix'.8e, etc.\n");
373373         gets(line);
374374         // kill newline:
src/mame/layout/connect4.lay
r4878r4879
7474         <color red="0.1" green="0.1" blue="0.1" />
7575      </disk>
7676   </element>
77   <element name="arrow" defstate="0">
78      <text string="->" state="1">
77
78   <element name="C" defstate="0">
79      <text string="C" state="1">
7980         <color red="1.0" green="1.0" blue="0.0" />
8081         <bounds x="0" y="0.1" width="1" height="0.8" />
8182      </text>
8283   </element>
83   <element name="target" defstate="0">
84
85   <element name="O" defstate="0">
8486      <text string="O" state="1">
8587         <color red="1.0" green="0.0" blue="0.0" />
8688         <bounds x="0" y="0.1" width="1" height="0.8" />
8789      </text>
8890   </element>
91
92   <element name="N" defstate="0">
93      <text string="N" state="1">
94         <color red="1.0" green="0.0" blue="0.0" />
95         <bounds x="0" y="0.1" width="1" height="0.8" />
96      </text>
97   </element>
98
99   <element name="E" defstate="0">
100      <text string="E" state="1">
101         <color red="1.0" green="0.0" blue="0.0" />
102         <bounds x="0" y="0.1" width="1" height="0.8" />
103      </text>
104   </element>
105
106   <element name="T" defstate="0">
107      <text string="T" state="1">
108         <color red="1.0" green="0.0" blue="0.0" />
109         <bounds x="0" y="0.1" width="1" height="0.8" />
110      </text>
111   </element>
112
113   <element name="4" defstate="0">
114      <text string="4" state="1">
115         <color red="1.0" green="0.0" blue="0.0" />
116         <bounds x="0" y="0.1" width="1" height="0.8" />
117      </text>
118   </element>
119
89120   <element name="vfd0">
90121   <led16segsc>
91122         <color red="0" green="0.6" blue="1.0" />
r4878r4879
493524         <bounds x="48" y="42" width="7" height="7"/>
494525      </backdrop>
495526
496      <backdrop name="lamp7" element="arrow" state="0">
527      <backdrop name="lamp7" element="C" state="0">
497528         <bounds x="0" y="48" width="7" height="7"/>
498529      </backdrop>
499      <backdrop name="lamp15" element="arrow" state="0">
530      <backdrop name="lamp15" element="O" state="0">
500531         <bounds x="8" y="48" width="7" height="7"/>
501532      </backdrop>
502      <backdrop name="lamp23" element="arrow" state="0">
533      <backdrop name="lamp23" element="N" state="0">
503534         <bounds x="16" y="48" width="7" height="7"/>
504535      </backdrop>
505      <backdrop name="lamp31" element="arrow" state="0">
536      <backdrop name="lamp31" element="N" state="0">
506537         <bounds x="24" y="48" width="7" height="7"/>
507538      </backdrop>
508      <backdrop name="lamp39" element="arrow" state="0">
539      <backdrop name="lamp39" element="E" state="0">
509540         <bounds x="32" y="48" width="7" height="7"/>
510541      </backdrop>
511      <backdrop name="lamp47" element="arrow" state="0">
542      <backdrop name="lamp47" element="C" state="0">
512543         <bounds x="40" y="48" width="7" height="7"/>
513544      </backdrop>
514      <backdrop name="lamp55" element="arrow" state="0">
545      <backdrop name="lamp55" element="T" state="0">
515546         <bounds x="48" y="48" width="7" height="7"/>
516547      </backdrop>
517      <backdrop name="lamp63" element="target" state="0">
548      <backdrop name="lamp63" element="4" state="0">
518549         <bounds x="56" y="48" width="7" height="7"/>
519550      </backdrop>
520551
src/mame/layout/polepos.lay
r4878r4879
5151      <screen index="0">
5252         <bounds x="0" y="0" width="640" height="480" />
5353      </screen>     
54      <bezel element="shifter" inputtag="IN0" inputmask="0x02">
54      <bezel element="shifter" inputtag="IN0L" inputmask="0x02">
5555         <bounds x="606" y="414" width="32" height="64" />
5656         <color alpha="0.9" />
5757      </bezel>
r4878r4879
6060      <screen index="0">
6161         <bounds x="0" y="0" width="640" height="480" />
6262      </screen>     
63      <bezel element="shifter" inputtag="IN0" inputmask="0x02">
63      <bezel element="shifter" inputtag="IN0L" inputmask="0x02">
6464         <bounds x="2" y="414" width="32" height="64" />
6565         <color alpha="0.9" />
6666      </bezel>
src/mame/drivers/bfcobra.c
r4878r4879
13061306***************************************************************************/
13071307
13081308static ADDRESS_MAP_START( z80_prog_map, ADDRESS_SPACE_PROGRAM, 8 )
1309   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_BANK(4))
1310   AM_RANGE(0x4000, 0x7fff) AM_READWRITE(SMH_BANK(1), SMH_BANK(1))
1311   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(SMH_BANK(2), SMH_BANK(2))
1312   AM_RANGE(0xc000, 0xffff) AM_READWRITE(SMH_BANK(3), SMH_BANK(3))
1309   AM_RANGE(0x0000, 0x3fff) AM_ROMBANK(4)
1310   AM_RANGE(0x4000, 0x7fff) AM_RAMBANK(1)
1311   AM_RANGE(0x8000, 0xbfff) AM_RAMBANK(2)
1312   AM_RANGE(0xc000, 0xffff) AM_RAMBANK(3)
13131313ADDRESS_MAP_END
13141314
13151315static ADDRESS_MAP_START( z80_io_map, ADDRESS_SPACE_IO, 8 )
r4878r4879
14541454//  AM_RANGE(0x340A, 0x340A) AM_NOP
14551455//  AM_RANGE(0x3600, 0x3600) AM_NOP
14561456   AM_RANGE(0x3801, 0x3801) AM_DEVREADWRITE("upd", upd_r, upd_w)
1457   AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM)
1457   AM_RANGE(0x8000, 0xffff) AM_ROM
14581458   AM_RANGE(0xf000, 0xf000) AM_WRITENOP   /* Watchdog */
14591459ADDRESS_MAP_END
14601460
src/mame/drivers/nycaptor.c
r4878r4879
446446static ADDRESS_MAP_START( bronx_master_map, ADDRESS_SPACE_PROGRAM, 8 )
447447   AM_RANGE(0x0000, 0x7fff) AM_ROM
448448   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
449   AM_RANGE(0xc000, 0xc7ff) AM_READ(nycaptor_videoram_r) AM_WRITE(nycaptor_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
449   AM_RANGE(0xc000, 0xcfff) AM_READ(nycaptor_videoram_r) AM_WRITE(nycaptor_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
450450   AM_RANGE(0xd000, 0xd000) AM_READ(cyclshtg_mcu_r) AM_WRITENOP
451451   AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w)
452452   AM_RANGE(0xd002, 0xd002) AM_READ(nycaptor_generic_control_r) AM_WRITE(cyclshtg_generic_control_w)
r4878r4879
462462   AM_RANGE(0xd806, 0xd806) AM_READNOP
463463   AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r)
464464   AM_RANGE(0xdc00, 0xdc9f) AM_READ(nycaptor_spriteram_r) AM_WRITE(nycaptor_spriteram_w)
465   AM_RANGE(0xdca0, 0xdcbf) AM_READ(nycaptor_scrlram_r) AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram)
465   AM_RANGE(0xdca0, 0xdcbf) AM_READ(nycaptor_scrlram_r) AM_WRITE(nycaptor_scrlram_w) AM_BASE(&nycaptor_scrlram)
466466   AM_RANGE(0xdd00, 0xdeff) AM_READ(nycaptor_palette_r) AM_WRITE(nycaptor_palette_w)
467467   AM_RANGE(0xdf03, 0xdf03) AM_READ(nycaptor_gfxctrl_r) AM_WRITE(nycaptor_gfxctrl_w)
468468   AM_RANGE(0xe000, 0xffff) AM_READ(nycaptor_sharedram_r) AM_WRITE(nycaptor_sharedram_w) AM_BASE(&nycaptor_sharedram)
r4878r4879
470470
471471static ADDRESS_MAP_START( bronx_slave_map, ADDRESS_SPACE_PROGRAM, 8 )
472472    AM_RANGE(0x0000, 0x7fff) AM_ROM
473    AM_RANGE(0xc000, 0xc7ff) AM_READ(nycaptor_videoram_r) AM_WRITE(nycaptor_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
473    AM_RANGE(0xc000, 0xcfff) AM_READ(nycaptor_videoram_r) AM_WRITE(nycaptor_videoram_w) AM_BASE(&videoram) AM_SIZE(&videoram_size)
474474   AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSW0")
475475   AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSW1")
476476   AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2")
src/mame/drivers/mitchell.c
r4878r4879
447447
448448static WRITE8_HANDLER(mstworld_sound_w)
449449{
450   soundlatch_w(space,0,data);
451   cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
450   soundlatch_w(space, 0, data);
451   cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
452452}
453453
454454extern WRITE8_HANDLER( mstworld_gfxctrl_w );
r4878r4879
11821182   sample_buffer >>= 4;
11831183   sample_select ^= 1;
11841184   if(sample_select == 0)
1185      cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
1185      cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
11861186}
11871187
11881188
src/mame/drivers/rainbow.c
r4878r4879
1010
1111                            ***
1212
13Rainbow Islands & Rainbow Islands Extra
14Taito, 1987
15
16PCB Layout
17----------
18
19MAIN PCB
20J1100128A
21K1100277A
22|----------------------------------------------------|
23| MB3735 Z80 B22-14.43    16MHz      DIP28    DIP28  |
24|       YM2151  5563                                 |
25|VOL          PC060HA    B22-05.33          B22-01.2 |
26| 4556  TL074 YM3012               |-------|         |
27|Y   6116 6116                     |TAITO  |   43256 |
28|                                  |PC080SN|         |
29|J    TC0070RGB  2018   |-------|  |-------|   43256 |
30|A               2018   |TAITO  |                    |
31|M     PC050CM   2018   |PC0900J|           B22-02.5 |
32|M               2018   |-------|           B22-13.6 |
33|A                                          B22-12.7 |
34|        TC0030CMD  12MHz                        3771|
35|  26.686MHz                   B39-02.20  B22-01.19  |
36|        68000                 B39-04.22  B39-03.21  |
37|        B22-07.56  B22-06.41  B22-04.24  B22-03.23  |
38|   DSWB   DSWA                8464       8464       |
39|----------------------------------------------------|
40Notes:
41      68000       - clock 8.000MHz [16/2]
42      Z80         - clock 4.000MHz [16/4]
43      YM2151      - clock 4.000MHz [16/4]
44      6116        - 2kx8 SRAM (color RAM)
45      43256       - 32kx8 SRAM (tile RAM)
46      8464        - 8kx8 SRAM (68000 work RAM)
47      5563        - 8kx8 SRAM (Z80 work RAM)
48      2018        - 2kx8 SRAM (sprite RAM)
49      4556        - NEC uPC4556 dual operational amplifier IC (DIP8)
50      TL074       - Texas Instruments TL074 low noise j-fet quad operational amplifier (DIP14)
51      YM3102      - Yamaha YM3012 2-channel serial input floating DAC (DIP16)
52      MB3735      - Fujitsu MB3735 20 watt BTL audio power amplifier (SIP9)
53      PC080SN     - Taito custom tilemap generator IC (connected to 43256 SRAM)
54      PC0900J     - Taito custom sprite generator IC (connected to 2018 SRAM)
55      PC060HA     - Taito custom IC (sound-related)
56      TC0030CMD   - Taito custom C-Chip marked 'TC0030CMD, clock input 12.000MHz on pin 20
57                      - For Rainbow Islands with sticker 'B22-15' at IC53
58                      - For Rainbow Islands Extra with sticker 'B39-05' at IC53
59      TC0070RGB   - Taito custom ceramic module RGB mixer IC
60      PC050CM     - Taito custom ceramic module (input related functions)
61      3771        - Fujitsu MB3771 master reset IC (DIP8)
62      Y           - 3 pin connector for 2nd speaker output
63      DIP28       - unpopulated DIP28 socket(s)
64
65      ROMs -
66         |----------------------------------------------------------------------|
67         | Common to Rainbow Islands and Rainbow Islands Extra                  |
68         |--------------|---------------|---------------|-----------------------|
69         |   234000     |   23C1000     |   27C512      |   PALs                |
70         |--------------|---------------|---------------|-----------------------|
71         |   B22-01.2   |   B22-03.23   |   B22-12.7    |   B22-05.33 (PAL16L8) |
72         |   B22-02.5   |   B22-04.24   |   B22-13.6    |   B22-06.41 (PAL16L8) |
73         |              |               |   B22-14.43   |   B22-07.56 (PAL20L8) |
74         |--------------|---------------|---------------|-----------------------|
75         |---------------------------------------|------------------------------|
76         | Used only on Rainbow Islands Extra    | Used only on Rainbow Islands |
77         |--------------|------------------------|--------------|---------------|
78         |   27C512     |  C-Chip                |   27C512     |  C-Chip       |
79         |--------------|------------------------|--------------|---------------|
80         |   B39-01.19  |  B39-05.53             |   B22-10.19  |  B22-15.53    |
81         |   B39-02.20  |                        |   B22-11.20  |               |
82         |   B39-03.21  |                        |   B22-08.21  |               |
83         |   B39-04.22  |                        |   B22-09.22  |               |
84         |--------------|------------------------|--------------|---------------|
85
86      Measurements
87      ------------
88      XTAL1 - 26.68599MHz
89      XTAL2 - 16.00000MHz
90      XTAL3 - 12.00000MHz
91      VSync - 60.0559Hz
92      HSync - 15.6745kHz
93
1394Notes on Rainbow Islands romsets by Robert Gallagher
1495----------------------------------------------------
1596
r4878r4879
662743   ROM_LOAD( "b22-01.2",             0x00000, 0x80000, CRC(b76c9168) SHA1(e924be0c8294b930488bb04583784254a840a52e) )   /* tiles */
663744
664745   ROM_REGION( 0xa0000, "gfx2", ROMREGION_DISPOSE )
665   ROM_LOAD( "b22-01.5",             0x00000, 0x80000, CRC(1b87ecf0) SHA1(37a463184f4064fe0565367236e289d57639614c) )   /* sprites */
746   ROM_LOAD( "b22-02.5",             0x00000, 0x80000, CRC(1b87ecf0) SHA1(37a463184f4064fe0565367236e289d57639614c) )   /* sprites */
666747   ROM_LOAD16_BYTE( "b22-12.7",      0x80000, 0x10000, CRC(67a76dc6) SHA1(626ee684eb3ea859c695ffe03344ccaa442da4af) )
667748   ROM_LOAD16_BYTE( "b22-13.6",      0x80001, 0x10000, CRC(2fda099f) SHA1(a1e27a4497f6733608be924d69d965b19f725b99) )
668749ROM_END
r4878r4879
684765   ROM_LOAD( "b22-01.2",             0x00000, 0x80000, CRC(b76c9168) SHA1(e924be0c8294b930488bb04583784254a840a52e) )   /* tiles */
685766
686767   ROM_REGION( 0xa0000, "gfx2", ROMREGION_DISPOSE )
687     ROM_LOAD( "b22-01.5",             0x00000, 0x80000, CRC(1b87ecf0) SHA1(37a463184f4064fe0565367236e289d57639614c) )   /* sprites */
768     ROM_LOAD( "b22-02.5",             0x00000, 0x80000, CRC(1b87ecf0) SHA1(37a463184f4064fe0565367236e289d57639614c) )   /* sprites */
688769   ROM_LOAD16_BYTE( "b22-12.7",      0x80000, 0x10000, CRC(67a76dc6) SHA1(626ee684eb3ea859c695ffe03344ccaa442da4af) )
689770   ROM_LOAD16_BYTE( "b22-13.6",      0x80001, 0x10000, CRC(2fda099f) SHA1(a1e27a4497f6733608be924d69d965b19f725b99) )
690771ROM_END
r4878r4879
706787   ROM_LOAD( "b22-01.2",             0x00000, 0x80000, CRC(b76c9168) SHA1(e924be0c8294b930488bb04583784254a840a52e) )   /* tiles */
707788
708789   ROM_REGION( 0xa0000, "gfx2", ROMREGION_DISPOSE )
709     ROM_LOAD( "b22-01.5",             0x00000, 0x80000, CRC(1b87ecf0) SHA1(37a463184f4064fe0565367236e289d57639614c) )   /* sprites */
790     ROM_LOAD( "b22-02.5",             0x00000, 0x80000, CRC(1b87ecf0) SHA1(37a463184f4064fe0565367236e289d57639614c) )   /* sprites */
710791   ROM_LOAD16_BYTE( "b22-12.7",      0x80000, 0x10000, CRC(67a76dc6) SHA1(626ee684eb3ea859c695ffe03344ccaa442da4af) )
711792   ROM_LOAD16_BYTE( "b22-13.6",      0x80001, 0x10000, CRC(2fda099f) SHA1(a1e27a4497f6733608be924d69d965b19f725b99) )
712793ROM_END
src/mame/drivers/blktiger.c
r4878r4879
8888
8989static ADDRESS_MAP_START( blktiger_map, ADDRESS_SPACE_PROGRAM, 8 )
9090   AM_RANGE(0x0000, 0x7fff) AM_ROM
91   AM_RANGE(0x8000, 0xbfff) AM_READWRITE(SMH_BANK(1), SMH_ROM)
91   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(1)
9292   AM_RANGE(0xc000, 0xcfff) AM_READWRITE(blktiger_bgvideoram_r, blktiger_bgvideoram_w)
9393   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(blktiger_txvideoram_w) AM_BASE(&blktiger_txvideoram)
9494   AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_split1_w) AM_BASE(&paletteram)
r4878r4879
371371   ROM_LOAD( "bd-06.1l",  0x0000, 0x8000, CRC(2cf54274) SHA1(87df100c65999ba1e9d358ffd0fe4bba23ae0efb) )
372372
373373   ROM_REGION( 0x10000, "mcu", 0 )
374   ROM_LOAD( "bd.5k",  0x0000, 0x1000, CRC(ac7d14f1) SHA1(46fd6b43f10312e3e8d3c9e0c0fd616af98fdbad) )
374   ROM_LOAD( "bd.6k",  0x0000, 0x1000, CRC(ac7d14f1) SHA1(46fd6b43f10312e3e8d3c9e0c0fd616af98fdbad) )
375375
376376   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
377377   ROM_LOAD( "bd-15.2n",  0x00000, 0x08000, CRC(70175d78) SHA1(2f02be2785d1824002145ea20db79821d0393929) )   /* characters */
r4878r4879
473473   ROM_LOAD( "bd-06.1l",  0x0000, 0x8000, CRC(2cf54274) SHA1(87df100c65999ba1e9d358ffd0fe4bba23ae0efb) )
474474
475475   ROM_REGION( 0x10000, "mcu", 0 )
476   ROM_LOAD( "bd.5k",  0x0000, 0x1000, CRC(ac7d14f1) SHA1(46fd6b43f10312e3e8d3c9e0c0fd616af98fdbad) )
476   ROM_LOAD( "bd.6k",  0x0000, 0x1000, CRC(ac7d14f1) SHA1(46fd6b43f10312e3e8d3c9e0c0fd616af98fdbad) )
477477
478478   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
479479   ROM_LOAD( "blkdrgon.2n",  0x00000, 0x08000, CRC(3821ab29) SHA1(576f1839f63b0cad6b851d6e6a3e9dec21ac811d) )   /* characters */
src/mame/drivers/tryout.c
r4878r4879
66 Driver by Pierpaolo Prazzoli and Bryan McPhail
77
88 TODO:
9 - Fix the scroll properly
10 - Some colors problems
119 - Fix sprite position in cocktail mode
1210
11=================================================================
12Debug cheats:
13
14*tryout
15Pitching stage (3)
16$201 remaining ball counter
17$208 strikes count
18(note: put a wpset 20x,1,w and modify the value AFTER that the
19       game modifies it)
20
1321****************************************************************/
1422
1523#include "driver.h"
r4878r4879
7078   AM_RANGE(0xe301, 0xe301) AM_WRITE(tryout_flipscreen_w)
7179   AM_RANGE(0xe302, 0xe302) AM_WRITE(tryout_bankswitch_w)
7280   AM_RANGE(0xe401, 0xe401) AM_WRITE(tryout_vram_bankswitch_w)
73   AM_RANGE(0xe402, 0xe404) AM_WRITE(SMH_RAM) AM_BASE(&tryout_gfx_control)
81   AM_RANGE(0xe402, 0xe404) AM_WRITEONLY AM_BASE(&tryout_gfx_control)
7482   AM_RANGE(0xe414, 0xe414) AM_WRITE(tryout_sound_w)
7583   AM_RANGE(0xe417, 0xe417) AM_WRITE(tryout_nmi_ack_w)
7684   AM_RANGE(0xfff0, 0xffff) AM_ROM AM_REGION("maincpu", 0xbff0) /* resect vectors */
r4878r4879
8492   AM_RANGE(0xc000, 0xffff) AM_ROM
8593ADDRESS_MAP_END
8694
95static INPUT_CHANGED( coin_inserted )
96{
97   if(newval != oldval)
98      cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
99}
100
87101static INPUT_PORTS_START( tryout )
88102   PORT_START("DSW")
89103   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
r4878r4879
120134   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
121135
122136   PORT_START("P2")
123   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT   ) PORT_4WAY PORT_COCKTAIL
124   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT   ) PORT_4WAY PORT_COCKTAIL
125   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP   ) PORT_4WAY PORT_COCKTAIL
126   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN   ) PORT_4WAY PORT_COCKTAIL
127   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1    ) PORT_COCKTAIL
128   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2    ) PORT_COCKTAIL
137   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
138   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
139   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
140   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
141   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
142   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
129143   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
130144   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
131145
r4878r4879
133147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
134148   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
135149   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_IMPULSE(2)
136   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
137   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
150   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED(coin_inserted, 0)
151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED(coin_inserted, 0)
138152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
139153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
140154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_VBLANK )
r4878r4879
156170   16, 16,
157171   128,
158172   3,
159   { 0, 0x2000 * 8, 0x4000 * 8 },
173   { 0x0000 * 8, 0x2000 * 8, 0x4000 * 8 },
160174   { 7, 6, 5, 4, 128+7, 128+6, 128+5, 128+4, 256+7, 256+6, 256+5, 256+4, 384+7, 384+6, 384+5, 384+4  },
161175   { 15*8, 14*8, 13*8, 12*8, 11*8, 10*8, 9*8, 8*8,
162176     7*8, 6*8,5*8,4*8,3*8,2*8,1*8,0*8 },
r4878r4879
177191};
178192
179193static GFXDECODE_START( tryout )
180   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 0x20 )
181   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 0x20 )
182   GFXDECODE_ENTRY( NULL,         0, vramlayout,   0, 0x20 )
194   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0, 8 )
195   GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0, 4 )
196   GFXDECODE_ENTRY( NULL,    0, vramlayout,   0, 4 )
183197GFXDECODE_END
184198
185static INTERRUPT_GEN( tryout_interrupt )
186{
187   if ((input_port_read(device->machine, "SYSTEM") & 0x1c) != 0x1c)
188      cpu_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
189}
190
191199static MACHINE_DRIVER_START( tryout )
192200   /* basic machine hardware */
193201   MDRV_CPU_ADD("maincpu", M6502, 2000000)       /* ? */
194202   MDRV_CPU_PROGRAM_MAP(main_cpu)
195   MDRV_CPU_VBLANK_INT("screen", tryout_interrupt)
196203
197204   MDRV_CPU_ADD("audiocpu", M6502, 1500000)      /* ? */
198205   MDRV_CPU_PROGRAM_MAP(sound_cpu)
r4878r4879
247254   ROM_LOAD( "ch14.bpr",     0x00000, 0x0020, CRC(8ce19925) SHA1(12f8f6022f1148b6ba1d019a34247452637063a7) )
248255ROM_END
249256
250GAME( 1985, tryout, 0, tryout, tryout, 0, ROT90, "Data East Corporation", "Pro Baseball Skill Tryout (Japan)", GAME_IMPERFECT_GRAPHICS )
257GAME( 1985, tryout, 0, tryout, tryout, 0, ROT90, "Data East Corporation", "Pro Baseball Skill Tryout (Japan)", GAME_NO_COCKTAIL )
src/mame/drivers/chinsan.c
r4878r4879
33
44ToDo:
55Improve Inputs
6Add Sample Playback (M5205)
76
7Notes:
8-ADPCM hook-up is virtually identical to the other Sanritsu games (Jantotsu, Appoooh, Dr. Micro etc.).
9
810*/
911
1012/*
r4878r4879
4345#include "cpu/z80/z80.h"
4446#include "machine/mc8123.h"
4547#include "sound/2203intf.h"
48#include "sound/msm5205.h"
4649
4750static UINT8* chinsan_video;
4851static UINT8 chinsan_port_select;
4952
53static UINT32 adpcm_pos;
54static UINT8 adpcm_idle,adpcm_data;
55
5056static VIDEO_START(chinsan)
5157{
5258}
r4878r4879
7581static MACHINE_RESET( chinsan )
7682{
7783   memory_configure_bank(machine, 1, 0, 4, memory_region(machine, "maincpu") + 0x10000, 0x4000);
84
85   adpcm_idle = 1;
7886}
7987
8088
r4878r4879
185193   return mame_rand(space->machine);
186194}
187195
196static WRITE8_DEVICE_HANDLER( chin_adpcm_w )
197{
198   adpcm_pos = (data & 0xff) * 0x100;
199   adpcm_idle = 0;
200   msm5205_reset_w(device,0);
201}
188202
189203static ADDRESS_MAP_START( chinsan_map, ADDRESS_SPACE_PROGRAM, 8 )
190204   AM_RANGE(0x0000, 0x7fff) AM_ROM
r4878r4879
199213   AM_RANGE(0x01, 0x01) AM_READ(chinsan_input_port_0_r)
200214   AM_RANGE(0x02, 0x02) AM_READ(chinsan_input_port_1_r)
201215   AM_RANGE(0x10, 0x11) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
216   AM_RANGE(0x20, 0x20) AM_DEVWRITE("adpcm", chin_adpcm_w)
202217   AM_RANGE(0x30, 0x30) AM_WRITE(ctrl_w)   // ROM bank + unknown stuff (input mutliplex?)
203218ADDRESS_MAP_END
204219
r4878r4879
281296   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
282297   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) // adds coins?, but maybe its the service switch?
283298
284
285299   PORT_START("MAHJONG_P1_2")
286300   PORT_DIPNAME( 0x01, 0x01, "1-2" )
287301   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
r4878r4879
458472   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 32 )
459473GFXDECODE_END
460474
475static void chin_adpcm_int(const device_config *device)
476{
477   static UINT8 trigger;
461478
479   if (adpcm_pos >= 0x10000 || adpcm_idle)
480   {
481      //adpcm_idle = 1;
482      msm5205_reset_w(device,1);
483      trigger = 0;
484   }
485   else
486   {
487      UINT8 *ROM = memory_region(device->machine, "adpcm");
488
489      adpcm_data = ((trigger ? (ROM[adpcm_pos] & 0x0f) : (ROM[adpcm_pos] & 0xf0)>>4) );
490      msm5205_data_w(device,adpcm_data & 0xf);
491      trigger^=1;
492      if(trigger == 0)
493      {
494         adpcm_pos++;
495         if((ROM[adpcm_pos] & 0xff) == 0x70)
496            adpcm_idle = 1;
497      }
498   }
499}
500
501static const msm5205_interface msm5205_config =
502{
503   chin_adpcm_int,   /* interrupt function */
504   MSM5205_S64_4B   /* 8kHz */
505};
506
507static PALETTE_INIT( chinsan )
508{
509   UINT8 *src = memory_region( machine, "color_proms" );
510   int i;
511
512   for (i=0;i<0x100;i++)
513   {
514      palette_set_color_rgb(machine,i,pal4bit(src[i+0x200]),pal4bit(src[i+0x100]),pal4bit(src[i+0x000]));
515   }
516}
517
462518static MACHINE_DRIVER_START( chinsan )
463519   /* basic machine hardware */
464520   MDRV_CPU_ADD("maincpu", Z80,10000000/2)       /* ? MHz */
r4878r4879
478534
479535   MDRV_GFXDECODE(chinsan)
480536   MDRV_PALETTE_LENGTH(0x100)
537   MDRV_PALETTE_INIT(chinsan)
481538
482539   MDRV_VIDEO_START(chinsan)
483540   MDRV_VIDEO_UPDATE(chinsan)
r4878r4879
491548   MDRV_SOUND_ROUTE(1, "mono", 0.15)
492549   MDRV_SOUND_ROUTE(2, "mono", 0.15)
493550   MDRV_SOUND_ROUTE(3, "mono", 0.10)
551
552   MDRV_SOUND_ADD("adpcm", MSM5205, 384000)
553   MDRV_SOUND_CONFIG(msm5205_config)
554   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
494555MACHINE_DRIVER_END
495556
496557
r4878r4879
515576   ROM_REGION( 0x20, "user2", 0 )
516577   ROM_LOAD( "mm60.2c", 0x000, 0x020, CRC(88477178) SHA1(03c1c9e3e88a5ae9970cb4b872ad4b6e4d77a6da) )
517578
518   ROM_REGION( 0x300, "user3", 0 )
579   ROM_REGION( 0x300, "color_proms", 0 )
519580   ROM_LOAD( "mm61.9m",  0x000, 0x100, CRC(57024262) SHA1(e084e6baa3c529217f6f8e37c9dd5f0687ba2fc4) ) // b
520581   ROM_LOAD( "mm62.9n",  0x100, 0x100, CRC(b5a1dbe5) SHA1(770a791c061ce422f860bb8d32f82bbbf9b4d12a) ) // g
521582   ROM_LOAD( "mm63.10n", 0x200, 0x100, CRC(b65e3567) SHA1(f146af51dfaa5b4bf44c4e27f1a0292f8fd07ce9) ) // r
r4878r4879
524585
525586static DRIVER_INIT( chinsan )
526587{
527
528   int i;
529   UINT8 *src = memory_region( machine, "user3" );
530
531588   mc8123_decrypt_rom(machine, "maincpu", "user1", 1, 4);
532
533   for (i=0;i<0x100;i++)
534   {
535      palette_set_color_rgb(machine,i,pal4bit(src[i+0x200]),pal4bit(src[i+0x100]),pal4bit(src[i+0x000]));
536   }
537589}
538590
539591
540GAME( 1987, chinsan,  0,    chinsan, chinsan, chinsan, ROT0, "Sanritsu", "Ganbare Chinsan Ooshoubu (MC-8123A, 317-5012)", GAME_IMPERFECT_SOUND )
592GAME( 1987, chinsan,  0,    chinsan, chinsan, chinsan, ROT0, "Sanritsu", "Ganbare Chinsan Ooshoubu (MC-8123A, 317-5012)", 0 )
src/mame/drivers/aerofgt.c
r4878r4879
311311   AM_RANGE(0xffffa4, 0xffffa5) AM_READ_PORT("SYSTEM")
312312   AM_RANGE(0xffffa6, 0xffffa7) AM_READ_PORT("DSW1")
313313   AM_RANGE(0xffffa8, 0xffffa9) AM_READ_PORT("DSW2")
314   AM_RANGE(0xffffac, 0xffffad) AM_READWRITE(pending_command_r, SMH_NOP)   /* ??? */
314   AM_RANGE(0xffffac, 0xffffad) AM_READ(pending_command_r) AM_WRITENOP /* ??? */
315315   AM_RANGE(0xffffae, 0xffffaf) AM_READ_PORT("DSW3")
316316   AM_RANGE(0xffffc0, 0xffffc1) AM_WRITE(sound_command_w)
317317ADDRESS_MAP_END
r4878r4879
385385   AM_RANGE(0xfff000, 0xfff001) AM_READ_PORT("IN0") AM_WRITE(pspikes_palette_bank_w)
386386   AM_RANGE(0xfff002, 0xfff003) AM_READ_PORT("IN1") AM_WRITE(pspikes_gfxbank_w)
387387   AM_RANGE(0xfff004, 0xfff005) AM_READ_PORT("DSW") AM_WRITE(aerofgt_bg1scrolly_w)
388   AM_RANGE(0xfff006, 0xfff007) AM_READWRITE(SMH_NOP, sound_command_w)
388   AM_RANGE(0xfff006, 0xfff007) AM_READNOP AM_WRITE(sound_command_w)
389389   AM_RANGE(0xfff00e, 0xfff00f) AM_WRITE(wbbc97_bitmap_enable_w)
390390ADDRESS_MAP_END
391391
src/mame/drivers/docastle.c
r4878r4879
362362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
363363   PORT_DIPNAME( 0x10, 0x10, "Difficulty of EXTRA" ) PORT_DIPLOCATION("SWA:4")
364364   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
365   PORT_DIPSETTING(    0x00, "Difficult" )
365   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
366366   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SWA:3")
367367   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
368368   PORT_DIPSETTING(    0x20, DEF_STR( Cocktail ) )
src/mame/drivers/midyunit.c
r4878r4879
16211621   ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
16221622
16231623   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
1624   ROM_LOAD16_BYTE( "u105-la5",  0xc0000, 0x20000, CRC(104c30e7) SHA1(62b48b9c20730ffbaa1810650ff55aba14b6880d) )
1625   ROM_LOAD16_BYTE( "u89-la5",   0xc0001, 0x20000, CRC(07aa0010) SHA1(7dfd34028afeea4444e70c40fa30c6576ff22f7d) )
1626
1627   ROM_REGION( 0x800000, "gfx1", ROMREGION_DISPOSE )
1628   ROM_LOAD ( "la1u111.bin",  0x000000, 0x20000, CRC(49560560) SHA1(03d51e6019afa9a396c91a484969be4922fa4c99) )
1629   ROM_LOAD ( "la1u112.bin",  0x020000, 0x20000, CRC(4dd879dc) SHA1(ac4f02fcb933df38f1ebf51b109092b77563b684) )
1630   ROM_LOAD ( "la1u113.bin",  0x040000, 0x20000, CRC(b67aeb70) SHA1(dd1512329c46da4254712712b6f847544f4487bd) )
1631   ROM_LOAD ( "la1u114.bin",  0x060000, 0x20000, CRC(9a4bc44b) SHA1(309eb5214fe5e1fe64d724d515190a31fc524aae) )
1632
1633   ROM_LOAD (  "la1u95.bin",  0x200000, 0x20000, CRC(e1352dc0) SHA1(7faa2cfa9ebaf2d99b243232316221b672869703) )
1634   ROM_LOAD (  "la1u96.bin",  0x220000, 0x20000, CRC(197d0f34) SHA1(2d544588c3241423188ac7fb7aff87043fdd063d) )
1635   ROM_LOAD (  "la1u97.bin",  0x240000, 0x20000, CRC(908ea575) SHA1(79802d8df4e016d178be98333d2b1d047a27eccc) )
1636   ROM_LOAD (  "la1u98.bin",  0x260000, 0x20000, CRC(6dcbab11) SHA1(7432172810fd4b922b61769c68d86f24769a42cf) )
1637
1638    ROM_LOAD ( "la1u106.bin",  0x400000, 0x20000, CRC(7d0ead0d) SHA1(1e65b6e7e629021d70603df37db5fa89cfe93175) )
1639   ROM_LOAD ( "la1u107.bin",  0x420000, 0x20000, CRC(ef48e8fa) SHA1(538de37cd8342085ec27f67292a7eeb1007e3b1f) )
1640   ROM_LOAD ( "la1u108.bin",  0x440000, 0x20000, CRC(5f363e12) SHA1(da398c0204f785aad4c52007d2f25031ecc1c63f) )
1641   ROM_LOAD ( "la1u109.bin",  0x460000, 0x20000, CRC(3689fbbc) SHA1(d95c0a2e3abf977ba7a899e419c22d004020c560) )
1642
1643   ROM_REGION( 0x1100, "plds", ROMREGION_DISPOSE )
1644   ROM_LOAD( "ep610.u8",    0x0000, 0x032f, NO_DUMP ) /* PAL is read protected */
1645   ROM_LOAD( "pls153a.u40", 0x0400, 0x00eb, CRC(69e5143f) SHA1(1a1e7b3233f7d5a1c161564710e8e984a9b0a16c) )
1646   ROM_LOAD( "ep610.u51",   0x0500, 0x032f, NO_DUMP ) /* PAL is read protected */
1647   ROM_LOAD( "ep610.u52",   0x0900, 0x032f, NO_DUMP ) /* PAL is read protected */
1648   ROM_LOAD( "ep610.u65",   0x0d00, 0x032f, NO_DUMP ) /* PAL is read protected */
1649ROM_END
1650
1651
1652ROM_START( hiimpac4 )
1653   ROM_REGION( 0x90000, "cvsdcpu", 0 )   /* sound CPU */
1654   ROM_LOAD (  "sl1u4.bin", 0x10000, 0x20000, CRC(28effd6a) SHA1(4a839f15e1b453a22fdef7b1801b8cc5cfdf3c29) )
1655   ROM_LOAD ( "sl1u19.bin", 0x30000, 0x20000, CRC(0ea22c89) SHA1(6d4579f6b10cac685be01348451b3537a0626034) )
1656   ROM_LOAD ( "sl1u20.bin", 0x50000, 0x20000, CRC(4e747ab5) SHA1(82040f40aac7dae577376a742eadaaa9644500c1) )
1657
1658   ROM_REGION16_LE( 0x100000, "user1", 0 )   /* 34010 code */
16241659   ROM_LOAD16_BYTE( "u105-la4",  0xc0000, 0x20000, CRC(5f67f823) SHA1(4171b6949682d1b2180e39d44c4e0033c4c07149) )
16251660   ROM_LOAD16_BYTE( "u89-la4",   0xc0001, 0x20000, CRC(404d260b) SHA1(46bb44b3f1895d3424dba7664f198bce7dee911d) )
16261661
r4878r4879
22772312GAME( 1990, smashtv6, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 6.00)", GAME_SUPPORTS_SAVE )
22782313GAME( 1990, smashtv5, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 5.00)", GAME_SUPPORTS_SAVE )
22792314GAME( 1990, smashtv4, smashtv,  yunit_cvsd_6bit_slow,  smashtv,  smashtv,  ROT0, "Williams", "Smash T.V. (rev 4.00)", GAME_SUPPORTS_SAVE )
2280GAME( 1990, hiimpact, 0,        yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE )
2315GAME( 1990, hiimpact, 0,        yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA5 02/15/91)", GAME_SUPPORTS_SAVE )
2316GAME( 1990, hiimpac4, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA4 02/04/91)", GAME_SUPPORTS_SAVE )
22812317GAME( 1990, hiimpac3, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (rev LA3 12/27/90)", GAME_SUPPORTS_SAVE )
22822318GAME( 1990, hiimpacp, hiimpact, yunit_cvsd_6bit_slow,  trog,     hiimpact, ROT0, "Williams", "High Impact Football (prototype, rev 8.6 12/09/90)", GAME_SUPPORTS_SAVE )
22832319GAME( 1991, shimpact, 0,        yunit_cvsd_6bit_slow,  trog,     shimpact, ROT0, "Midway",   "Super High Impact (rev LA1 09/30/91)", GAME_SUPPORTS_SAVE )
src/mame/drivers/senjyo.c
r4878r4879
376376   PORT_DIPSETTING(    0x00, DEF_STR( Easiest ) )
377377   PORT_DIPSETTING(    0x08, DEF_STR( Easy ) )
378378   PORT_DIPSETTING(    0x10, DEF_STR( Medium ) )
379   PORT_DIPSETTING(    0x18, "Difficult" )
379   PORT_DIPSETTING(    0x18, DEF_STR( Difficult ) )
380380   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
381381   PORT_DIPSETTING(    0x28, DEF_STR( Hardest ) )
382382   /* 0x30 and x038 are unused */
src/mame/drivers/yiear.c
r4878r4879
138138   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )
139139   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
140140   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
141   PORT_DIPSETTING(    0x20, "Difficult" )
142   PORT_DIPSETTING(    0x00, "Very Difficult" )
141   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
142   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
143143   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
144144   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
145145   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
src/mame/drivers/bfm_sc1.c
r4878r4879
766766static ADDRESS_MAP_START( memmap, ADDRESS_SPACE_PROGRAM, 8 )
767767
768768   AM_RANGE(0x0000, 0x1FFF) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size) //8k RAM
769   AM_RANGE(0x2000, 0x21FF) AM_WRITE(reel34_w)     // reel 2+3 latch
770   AM_RANGE(0x2200, 0x23FF) AM_WRITE(reel12_w)     // reel 1+2 latch
771   AM_RANGE(0x2400, 0x25FF) AM_WRITE(vfd_w)     // vfd latch
769   AM_RANGE(0x2000, 0x21FF) AM_WRITE(reel34_w)              // reel 2+3 latch
770   AM_RANGE(0x2200, 0x23FF) AM_WRITE(reel12_w)              // reel 1+2 latch
771   AM_RANGE(0x2400, 0x25FF) AM_WRITE(vfd_w)              // vfd latch
772772
773   AM_RANGE(0x2600, 0x27FF) AM_READWRITE(mmtr_r,mmtr_w)      // mechanical meters
774   AM_RANGE(0x2800, 0x2800) AM_READWRITE(triac_r,triac_w)     // payslide triacs
773   AM_RANGE(0x2600, 0x27FF) AM_READWRITE(mmtr_r,mmtr_w)   // mechanical meters
774   AM_RANGE(0x2800, 0x2800) AM_READWRITE(triac_r,triac_w)   // payslide triacs
775775
776776   AM_RANGE(0x2A00, 0x2A00) AM_READWRITE(mux1latch_r,mux1latch_w) // mux1
777777   AM_RANGE(0x2A01, 0x2A01) AM_READWRITE(mux1datlo_r,mux1datlo_w)
778778   AM_RANGE(0x2A02, 0x2A02) AM_READWRITE(mux1dathi_r,mux1dathi_w)
779779
780   AM_RANGE(0x2E00, 0x2E00) AM_READ(irqlatch_r)  // irq latch
780   AM_RANGE(0x2E00, 0x2E00) AM_READ(irqlatch_r)         // irq latch
781781
782782   AM_RANGE(0x3001, 0x3001) AM_READ(soundlatch_r)
783783   AM_RANGE(0x3001, 0x3001) AM_DEVWRITE("ay", ay8910_data_w)
r4878r4879
790790   AM_RANGE(0x3409, 0x3409) AM_READWRITE(mux2datlo_r,mux2datlo_w)
791791   AM_RANGE(0x340A, 0x340A) AM_READWRITE(mux2dathi_r,mux2dathi_w)
792792
793   AM_RANGE(0x3404, 0x3404) AM_READ(dipcoin_r ) // coin input on gamecard
794   AM_RANGE(0x3801, 0x3801) AM_READNOP       // uPD5579 status on soundcard (not installed)
793   AM_RANGE(0x3404, 0x3404) AM_READ(dipcoin_r )         // coin input on gamecard
794   AM_RANGE(0x3801, 0x3801) AM_READNOP                  // uPD5579 status on soundcard (not installed)
795795
796   AM_RANGE(0x3600, 0x3600) AM_WRITE(bankswitch_w) // write bank
797   AM_RANGE(0x3800, 0x39FF) AM_WRITE(reel56_w)    // reel 5+6 latch
796   AM_RANGE(0x3600, 0x3600) AM_WRITE(bankswitch_w)       // write bank
797   AM_RANGE(0x3800, 0x39FF) AM_WRITE(reel56_w)             // reel 5+6 latch
798798
799   AM_RANGE(0x4000, 0x5FFF) AM_ROM            // 8k  ROM
800   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1)) // 8k  paged ROM (4 pages)
801   AM_RANGE(0x8000, 0xFFFF) AM_READWRITE(SMH_ROM,watchdog_w)    // 32k ROM
799   AM_RANGE(0x4000, 0x5FFF) AM_ROM                     // 8k  ROM
800   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)               // 8k  paged ROM (4 pages)
801   AM_RANGE(0x8000, 0xFFFF) AM_RAM AM_WRITE(watchdog_w)   // 32k ROM
802802
803803ADDRESS_MAP_END
804804
r4878r4879
844844   AM_RANGE(0x3E00, 0x3E00) AM_READWRITE(vid_uart_ctrl_r,vid_uart_ctrl_w)   // video uart control reg read
845845   AM_RANGE(0x3E01, 0x3E01) AM_READWRITE(vid_uart_rx_r,vid_uart_tx_w)      // video uart receive  reg
846846
847   AM_RANGE(0x4000, 0x5FFF) AM_ROM            // 8k  ROM
848   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1)) // 8k  paged ROM (4 pages)
849   AM_RANGE(0x8000, 0xFFFF) AM_READWRITE(SMH_ROM,watchdog_w)    // 32k ROM
847   AM_RANGE(0x4000, 0x5FFF) AM_ROM                     // 8k  ROM
848   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)               // 8k  paged ROM (4 pages)
849   AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE(watchdog_w)   // 32k ROM
850850
851851ADDRESS_MAP_END
852852
r4878r4879
890890   AM_RANGE(0x3800, 0x39FF) AM_DEVWRITE("upd", nec_latch_w)
891891
892892   AM_RANGE(0x4000, 0x5FFF) AM_ROM                     // 8k  ROM
893   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1))            // 8k  paged ROM (4 pages)
894   AM_RANGE(0x8000, 0xFFFF) AM_READWRITE(SMH_ROM,watchdog_w)   // 32k ROM
893   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)               // 8k  paged ROM (4 pages)
894   AM_RANGE(0x8000, 0xFFFF) AM_ROM AM_WRITE(watchdog_w)   // 32k ROM
895895
896896ADDRESS_MAP_END
897897
src/mame/drivers/bzone.c
r4878r4879
626626
627627ROM_START( bzone )
628628   ROM_REGION( 0x8000, "maincpu", 0 )
629   ROM_LOAD( "036414.01",  0x5000, 0x0800, CRC(efbc3fa0) SHA1(6d284fab34b09dde8aa0df7088711d4723f07970) )
630   ROM_LOAD( "036413.01",  0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) )
631   ROM_LOAD( "036412.01",  0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) )
632   ROM_LOAD( "036411.01",  0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) )
633   ROM_LOAD( "036410.01",  0x7000, 0x0800, CRC(0b7bfaa4) SHA1(33ae0f68b4e2eae9f3aecbee2d0b29003ce460b2) )
634   ROM_LOAD( "036409.01",  0x7800, 0x0800, CRC(1e14e919) SHA1(448fab30535e6fad7e0ab4427bc06bbbe075e797) )
629   ROM_LOAD( "036414-01.e1",  0x5000, 0x0800, CRC(efbc3fa0) SHA1(6d284fab34b09dde8aa0df7088711d4723f07970) )
630   ROM_LOAD( "036413-01.h1",  0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) )
631   ROM_LOAD( "036412-01.j1",  0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) )
632   ROM_LOAD( "036411-01.k1",  0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) )
633   ROM_LOAD( "036410-01.lm1", 0x7000, 0x0800, CRC(0b7bfaa4) SHA1(33ae0f68b4e2eae9f3aecbee2d0b29003ce460b2) )
634   ROM_LOAD( "036409-01.n1",  0x7800, 0x0800, CRC(1e14e919) SHA1(448fab30535e6fad7e0ab4427bc06bbbe075e797) )
635635   /* Vector Generator ROMs */
636   ROM_LOAD( "036422.01",  0x3000, 0x0800, CRC(7414177b) SHA1(147d97a3b475e738ce00b1a7909bbd787ad06eda) )
637   ROM_LOAD( "036421.01",  0x3800, 0x0800, CRC(8ea8f939) SHA1(b71e0ab0e220c3e64dc2b094c701fb1a960b64e4) )
636   ROM_LOAD( "036422-01.bc3", 0x3000, 0x0800, CRC(7414177b) SHA1(147d97a3b475e738ce00b1a7909bbd787ad06eda) )
637   ROM_LOAD( "036421-01.a3",  0x3800, 0x0800, CRC(8ea8f939) SHA1(b71e0ab0e220c3e64dc2b094c701fb1a960b64e4) )
638638
639639   /* AVG PROM */
640640   ROM_REGION( 0x100, "user1", 0 )
641   ROM_LOAD( "036498-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
641   ROM_LOAD( "036408-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
642642
643643   /* Mathbox PROMs */
644644   ROM_REGION( 0x20, "user2", 0 )
645   ROM_LOAD( "036174.01",   0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
645   ROM_LOAD( "036174-01.b1",   0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
646646
647647   ROM_REGION32_BE( 0x400, "user3", 0 )
648   ROMX_LOAD( "036175.01", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
649   ROMX_LOAD( "036176.01", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
650   ROMX_LOAD( "036177.01", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
651   ROMX_LOAD( "036178.01", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
652   ROMX_LOAD( "036179.01", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
653   ROMX_LOAD( "036180.01", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
648   ROMX_LOAD( "036175-01.m1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
649   ROMX_LOAD( "036176-01.l1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
650   ROMX_LOAD( "036177-01.k1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
651   ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
652   ROMX_LOAD( "036179-01.h1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
653   ROMX_LOAD( "036180-01.f1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
654654ROM_END
655655
656656
657657ROM_START( bzone2 )
658658   ROM_REGION( 0x8000, "maincpu", 0 )
659   ROM_LOAD( "036414a.01", 0x5000, 0x0800, CRC(13de36d5) SHA1(40e356ddc5c042bc1ce0b71f51e8b6de72daf1e4) )
660   ROM_LOAD( "036413.01",  0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) )
661   ROM_LOAD( "036412.01",  0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) )
662   ROM_LOAD( "036411.01",  0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) )
663   ROM_LOAD( "036410.01",  0x7000, 0x0800, CRC(0b7bfaa4) SHA1(33ae0f68b4e2eae9f3aecbee2d0b29003ce460b2) )
664   ROM_LOAD( "036409.01",  0x7800, 0x0800, CRC(1e14e919) SHA1(448fab30535e6fad7e0ab4427bc06bbbe075e797) )
659   ROM_LOAD( "036414-02.e1", 0x5000, 0x0800, CRC(13de36d5) SHA1(40e356ddc5c042bc1ce0b71f51e8b6de72daf1e4) )
660   ROM_LOAD( "036413-01.h1",  0x5800, 0x0800, CRC(5d9d9111) SHA1(42638cff53a9791a0f18d316f62a0ea8eea4e194) )
661   ROM_LOAD( "036412-01.j1",  0x6000, 0x0800, CRC(ab55cbd2) SHA1(6bbb8316d9f8588ea0893932f9174788292b8edc) )
662   ROM_LOAD( "036411-01.k1",  0x6800, 0x0800, CRC(ad281297) SHA1(54c5e06b2e69eb731a6c9b1704e4340f493e7ea5) )
663   ROM_LOAD( "036410-01.lm1", 0x7000, 0x0800, CRC(0b7bfaa4) SHA1(33ae0f68b4e2eae9f3aecbee2d0b29003ce460b2) )
664   ROM_LOAD( "036409-01.n1",  0x7800, 0x0800, CRC(1e14e919) SHA1(448fab30535e6fad7e0ab4427bc06bbbe075e797) )
665665   /* Vector Generator ROMs */
666   ROM_LOAD( "036422.01",  0x3000, 0x0800, CRC(7414177b) SHA1(147d97a3b475e738ce00b1a7909bbd787ad06eda) )
667   ROM_LOAD( "036421.01",  0x3800, 0x0800, CRC(8ea8f939) SHA1(b71e0ab0e220c3e64dc2b094c701fb1a960b64e4) )
666   ROM_LOAD( "036422-01.bc3", 0x3000, 0x0800, CRC(7414177b) SHA1(147d97a3b475e738ce00b1a7909bbd787ad06eda) )
667   ROM_LOAD( "036421-01.a3",  0x3800, 0x0800, CRC(8ea8f939) SHA1(b71e0ab0e220c3e64dc2b094c701fb1a960b64e4) )
668668
669669   /* AVG PROM */
670670   ROM_REGION( 0x100, "user1", 0 )
671   ROM_LOAD( "036498-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
671   ROM_LOAD( "036408-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
672672
673673   /* Mathbox PROMs */
674674   ROM_REGION( 0x20, "user2", 0 )
675   ROM_LOAD( "036174.01",    0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
675   ROM_LOAD( "036174-01.b1",  0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
676676
677677   ROM_REGION32_BE( 0x400, "user3", 0 )
678   ROMX_LOAD( "036175.01", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
679   ROMX_LOAD( "036176.01", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
680   ROMX_LOAD( "036177.01", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
681   ROMX_LOAD( "036178.01", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
682   ROMX_LOAD( "036179.01", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
683   ROMX_LOAD( "036180.01", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
678   ROMX_LOAD( "036175-01.m1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
679   ROMX_LOAD( "036176-01.l1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
680   ROMX_LOAD( "036177-01.k1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
681   ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
682   ROMX_LOAD( "036179-01.h1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
683   ROMX_LOAD( "036180-01.f1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
684684ROM_END
685685
686686
r4878r4879
694694   ROM_LOAD( "bz1b7000",   0x7000, 0x0800, CRC(ed8a860e) SHA1(316a3c4870ba44bb3e9cb9fc5200eb081318facf) )
695695   ROM_LOAD( "bz1a7800",   0x7800, 0x0800, CRC(04babf45) SHA1(a59da5ff49fc398ca4a948e28f05250af776b898) )
696696   /* Vector Generator ROMs */
697   ROM_LOAD( "036422.01",  0x3000, 0x0800, CRC(7414177b) SHA1(147d97a3b475e738ce00b1a7909bbd787ad06eda) )   // bz3a3000
697   ROM_LOAD( "036422-01.bc3",  0x3000, 0x0800, CRC(7414177b) SHA1(147d97a3b475e738ce00b1a7909bbd787ad06eda) )   // bz3a3000
698698   ROM_LOAD( "bz3b3800",   0x3800, 0x0800, CRC(76cf57f6) SHA1(1b8f3fcd664ed04ce60d94fdf27e56b20d52bdbd) )
699699
700700   /* AVG PROM */
701701   ROM_REGION( 0x100, "user1", 0 )
702   ROM_LOAD( "036498-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
702   ROM_LOAD( "036408-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
703703
704704   /* Mathbox PROMs */
705705   ROM_REGION( 0x20, "user2", 0 )
706   ROM_LOAD( "036174.01",    0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
706   ROM_LOAD( "036174-01.b1",  0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
707707
708708   ROM_REGION32_BE( 0x400, "user3", 0 )
709   ROMX_LOAD( "036175.01", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
710   ROMX_LOAD( "036176.01", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
711   ROMX_LOAD( "036177.01", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
712   ROMX_LOAD( "036178.01", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
713   ROMX_LOAD( "036179.01", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
714   ROMX_LOAD( "036180.01", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
709   ROMX_LOAD( "036175-01.m1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
710   ROMX_LOAD( "036176-01.l1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
711   ROMX_LOAD( "036177-01.k1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
712   ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
713   ROMX_LOAD( "036179-01.h1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
714   ROMX_LOAD( "036180-01.f1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
715715ROM_END
716716
717717
r4878r4879
731731
732732   /* AVG PROM */
733733   ROM_REGION( 0x100, "user1", 0 )
734   ROM_LOAD( "036498-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
734   ROM_LOAD( "036408-01.k7",   0x0000, 0x0100, CRC(5903af03) SHA1(24bc0366f394ad0ec486919212e38be0f08d0239) )
735735
736736   /* Mathbox PROMs */
737737   ROM_REGION( 0x20, "user2", 0 )
738   ROM_LOAD( "036174.01",    0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
738   ROM_LOAD( "036174-01.b1",  0x0000, 0x0020, CRC(8b04f921) SHA1(317b3397482f13b2d1bc21f296d3b3f9a118787b) )
739739
740740   ROM_REGION32_BE( 0x400, "user3", 0 )
741   ROMX_LOAD( "036175.01", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
742   ROMX_LOAD( "036176.01", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
743   ROMX_LOAD( "036177.01", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
744   ROMX_LOAD( "036178.01", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
745   ROMX_LOAD( "036179.01", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
746   ROMX_LOAD( "036180.01", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
741   ROMX_LOAD( "036175-01.m1", 0, 0x100, CRC(2af82e87) SHA1(3816835a9ccf99a76d246adf204989d9261bb065), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
742   ROMX_LOAD( "036176-01.l1", 0, 0x100, CRC(b31f6e24) SHA1(ce5f8ca34d06a5cfa0076b47400e61e0130ffe74), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
743   ROMX_LOAD( "036177-01.k1", 1, 0x100, CRC(8119b847) SHA1(c4fbaedd4ce1ad6a4128cbe902b297743edb606a), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
744   ROMX_LOAD( "036178-01.j1", 1, 0x100, CRC(09f5a4d5) SHA1(d6f2ac07ca9ee385c08831098b0dcaf56808993b), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
745   ROMX_LOAD( "036179-01.h1", 2, 0x100, CRC(823b61ae) SHA1(d99a839874b45f64e14dae92a036e47a53705d16), ROM_NIBBLE | ROM_SHIFT_NIBBLE_LO | ROM_SKIP(3))
746   ROMX_LOAD( "036180-01.f1", 2, 0x100, CRC(276eadd5) SHA1(55718cd8ec4bcf75076d5ef0ee1ed2551e19d9ba), ROM_NIBBLE | ROM_SHIFT_NIBBLE_HI | ROM_SKIP(3))
747747ROM_END
748748
749749
src/mame/drivers/twinkle.c
r0r4879
1/*
2
3Twinkle System
4
5driver by smf
6
7TODO:
8
9sound
10dvd
11hard drive
1216seg led font
13
14
15
16Konami Twinkle Hardware Overview
17Konami 1999-2002
18
19The following games are known to exist on this hardware (there may be more)
20                                                                  Video CD      Security
21Game Title                       Year            Program CD     6/7/8 use DVD   Dongle      HDD label
22-----------------------------------------------------------------------------------------------------
23beatmania IIDX                 - Konami 1999     GQ863 A01        GQ863 A04    863 A02     ?
24beatmania IIDX (Japan)         - Konami 1999     GQ863-JA B01     GQ863 A04     "   "      C44 JA A03*
25beatmania IIDX + DDR Club Kit  - Konami 1999     896 JA ABM       ?            ?           ?
26beatmania IIDX Substream       - Konami 1999     ?                GC983 A04    ?           ?
27beatmania IIDX Club Version 2  - Konami 1999     GE984 A01(BM)    ?            984 A02     ?
28                                               + GE984 A01(DDR)
29beatmania IIDX 2nd Style       - Konami 1999     GC985 A01        GC985 A04    ?           ?
30beatmania IIDX 3rd Style       - Konami 2000     ?                ?            ?           ?
31beatmania IIDX 4th Style       - Konami 2000     A03 JA A01       A03 JA A02   A03         ?
32beatmania IIDX 5th Style       - Konami 2001     ?                ?            ?           ?
33beatmania IIDX 6th Style       - Konami 2001     B4U JA A01       ?            ?           ?
34beatmania IIDX 7th Style       - Konami 2002     B44 JA A01       ?            ?           ?
35beatmania IIDX 8th Style       - Konami 2002     C44 JA A01       ?            C44         ?
36
37? = Undumped pieces. * = Came with beatmania IIDX main board but might be for 8th Style (i.e. game C44)?
38If you can help, please contact us at http://guru.mameworld.info or http://mamedev.org/contact.html
39
40
41The Konami Twinkle hardware basically consists of the following parts....
423 PCBs sandwiched together in a metal box
43SCSI CDROM drive (for main program CD)
44External DVD player (plays VCD)
45CD disc (for main program)
46Security dongle
47IDE HDD (for audio)
48VCD disc (for video)
49
50The top board appears to be the main CPU/graphics board.
51The middle board appears to be for the video output/overlay.
52The bottom board appears to be for sound.
53
54
55PCB Layouts
56-----------
57
58(Top)
59
60TWINKLE/MAIN
61GQ751 PWB(A2)0000039085
62|-----------------------------------------------------------------------------|
63|CN11      CN1           CN8                   CN7      CN5                   |
64|PQ30RV21      32MHz                                                          |
65|      53CF96-2.13M              24MHz            TD62083         ADM238LJR   |
66|SW                                   SMC                         ADM238LJR   |
67|  LTC1232.10P          M66011FP      FDC37C665GT.12G                         |
68|                                                           MACH111.11C DSW(8)|
69|                                                                             |
70|                                                              RTC-65271.9B   |
71|                          |----------|                                       |
72|                          |          |                        863A03.7B      |
73|                          |SONY      |          D481850GF-A12.8E             |
74|              KM48V514.8L |CXD8561Q  |                                       |
75|                          |@8J       |                                       |
76|              KM48V514.7L |----------|          D481850GF-A12.6E             |
77|                      67.737MHz                                              |
78|              KM48V514.6L                                                    |
79|                     53.693MHz|----------|                                   |
80|              KM48V514.5L     |          |                                   |
81|                              |SONY      |      KM416V256BT-7.4E          LED|
82|              KM48V514.4L     |CXD8530CQ |                                LED|
83|                              |@4J       |                                LED|
84|78L05         KM48V514.3L     |----------|                                LED|
85|                                          |-------|           TD62083     LED|
86|     MC44200  KM48V514.2L                 |SONY   |           TD62083     LED|
87|                                          |CXD2925|                       LED|
88|              KM48V514.1L                 |-------|                       LED|
89|     CN12                          CNx     @3F                     CN9    LED|
90|-----------------------------------------------------------------------------|
91Notes:
92      CN1        - 50 pin SCSI connector for CDROM drive
93      CN5        - 9 pin DSUB RS-232 connector
94      CN7        - Panel/controls connector
95      CN8        - RJ45 network connector
96      CN9        - 40 pin flat cable I/O connector
97      CNx        - Security card connector. The security cart contains only
98                   one IC, a ST 2402W 2kbit serial I2C bus EEPROM (TSSOP8)
99                   It appears only the first 12 bytes are actually used in this chip. The earlier games
100                   (possibly from BMIIDX 2nd Style and before) use a similar IC but it is not directly
101                   readable like the 2402W. The chip is covered with epoxy so the actual type is unknown.
102      CN11       - DC power input connector
103      CN12       - 15 pin DSUB connector (computer-generated video graphics output)
104      SW         - Reset or test switch
105      MACH111    - AMD MACH111 high-performance electrically erasable CMOS programmable logic device, stamped '38471'
106      53CF96     - Symbios Logic 53CF96 SCSI chip
107      PQ30RV21   - Sharp PQ30RV21 voltage regulator
108      TD62083    - Toshiba TD62083 8ch darlington sink driver
109      ADM238LJR  - Analog Devices ADM238LJR 5V CMOS RS-232 driver/receiver
110      LTC1232    - Linear Technology Corporation LTC1232 microprocessor supervisory circuit (DIP8)
111      M66011FP   - Renesas M66011FP serial bus controller
112      FDC37C665GT- SMC FDC37C665/666GT high-performance multi-mode parallel port super I/O floppy disk controller
113      RTC-65271  - Epson Toyocom RTC-65271 real-time clock
114      D481850GF  - NEC D481850GF-A12 128k x 32Bit x 2 Banks SGRAM (QFP100)
115      CXD2925Q   - Sony CXD2925Q SPU (QFP100)
116      CXD8561Q   - Sony CXD8561Q GTE (QFP208)
117      CXD8530CQ  - Sony CXD8530CQ R3000-based CPU (QFP208)
118      MC44200FT  - Motorola MC44200FT Triple 8-bit Video DAC (QFP44)
119      KM48V514   - Samsung Electronics KM48V514BJ-6 512kx8 EDO DRAM (SOJ28)
120      KM416V256  - Samsung Electronics KM416V256BT-7 256kx16 DRAM (TSOP44/40)
121      863A03.7B  - 27C040 EPROM (DIP32)
122
123
124(Middle)
125
126TWINKLE/SUB2
127GQ860 PWB(A1)0000053591
128|-----------------------------------------------------------------------------|
129|  CN1                     CN11           RCA   CN7           RCA             |
130|                                                                             |
131|                             MC141685  MC141685      AD817  |--------| AD817 |
132|                                            AD724JR         |Bt812KPF|       |
133|                                                14.3182MHz  |VIDEO   |       |
134|                                                            |DECODER |       |
135|                                                            |--------|       |
136|                                                                   26.8465MHz|
137|                                                                             |
138|                                                            D42280GU-30.11B  |
139|                                                            D42280GU-30.11A  |
140|                                                            D42280GU-30.9B   |
141|                                                            D42280GU-30.9A   |
142|                 M5118165B-60J.9G                           D42280GU-30.7B   |
143|                                                            D42280GU-30.7A   |
144|                                                                             |
145|                 M5118165B-60J.7G                                            |
146|                                                                             |
147|                                                                             |
148|                                                                             |
149|                                                                             |
150|                                                                             |
151|                                       XC9572.5D                             |
152|                                                         XC9572.5B  XC9572.5A|
153|                                                                             |
154|                       XC9572.2F                                    XC9536.3A|
155|                 XC9436.2G    XC9536.2E                                      |
156|-----------------------------------------------------------------------------|
157Notes:
158      CN1      - DC power input connector
159      CN7      - 5 pin plug for connection and control of external DVD player for background video
160      CN11     - 15 pin DSUB connector
161      RCA      - Yellow RCA connectors for video (input and/or output?) from external DVD player
162      MC141685 - Motorola MC141685 low cost 3CH D/A convertor
163      AD817    - Analog Devices 18V high speed low power wide supply range amplifier
164      AD724JR  - Analog Devices 6V 800mW 250MHz RGB to NTSC/PAL encoder
165      Bt812KPF - Conexant Systems Inc. Bt812KPF NTSC/PAL to RGB/YCrCb decoder / video codec (QFP160)
166      D42280GU - NEC uPD42280 high-speed field buffer with 256kx8 FIFO memory (SOP28)
167      M5118165B- Oki Semiconductor M5118165B-60J 1M x 16 EDO DRAM
168      XC9572   - Xilinx XC9572 in-system-programmable CPLD (PLCC44)
169      XC9536   - Xilinx XC9536 in-system-programmable CPLD (PLCC44)
170
171
172(Bottom)
173
174TWINKLE/SPU
175GQ863 PWB(A2)0000057606
176|-----------------------------------------------------------------------------|
177|  CN5    7805       CN7   CN1                GM76C8128CLLFW70.18J            |
178|                                             GM76C8128CLLFW70.16J      DSW(8)|
179|               SM5875  SM5875 |-------|                                      |
180|SW                            |RICOH  |                                      |
181|                              |RF5C400|           HY5117404BJ-60.15J         |
182|                |-------|     |-------|           HY5117404BJ-60.15F         |
183|                |M65851 |      @16L               HY5117404BJ-60.15C         |
184|                |@14R   |                         HY5117404BJ-60.14J         |
185|                |-------|    33.8688MHz           HY5117404BJ-60.14F         |
186|                                                  HY5117404BJ-60.14C         |
187|                                                  HY5117404BJ-60.13J         |
188|                                                  HY5117404BJ-60.13F         |
189|                                                  HY5117404BJ-60.13C         |
190|                               CY7C131.10M        HY5117404BJ-60.12J         |
191|                                                  HY5117404BJ-60.12F         |
192|                                                  HY5117404BJ-60.12C         |
193|                                                                             |
194|                                                                             |
195|                                                                          LED|
196|                                                                          LED|
197|                               XC9572.6L                                  LED|
198|                                                                          LED|
199|       LTC1232.5W         XC9536.4N  XC9536.4K                            LED|
200|                32MHz                                                     LED|
201|GM76C8128CLLFW70.4Y  68000-16.3S                                          LED|
202|GM76C8128CLLFW70.4W                                                       LED|
203|863A05.2X                                                        CN4         |
204|-----------------------------------------------------------------------------|
205Notes:
206      CN1      - RCA left/right audio output
207      CN4      - 40 pin flat cable connector for HDD data cable
208      CN5      - DC power input connector
209      CN7      - RCA left/right audio output
210      SM5875   - Nippon Precision Circuits SM5875 2-channel D/A convertor (SSOP24)
211      RF5C400  - Ricoh RF5C400 PCM 32Ch, 44.1 kHz Stereo, 3D Effect Spatializer, clock input 16.9344MHz [33.8688/2]
212      M65851   - Mitsubishi M65851 single chip karaoke sound processor IC (QFP80)
213      HY5117404- Hyundai Semiconductor HY5117404BJ-60 4M x 4-Bit CMOS EDO DRAM
214      CY7C131  - Cypress Semiconductor CY7C131 1kx8 dual-port static RAM
215      XC9572   - Xilinx XC9572 in-system-programmable CPLD (PLCC44)
216      XC9536   - Xilinx XC9536 in-system-programmable CPLD (PLCC44)
217      LTC1232  - Linear Technology Corporation LTC1232 microprocessor supervisory circuit (DIP8)
218      68000    - Clock input 16.000MHz [32/2]
219      GM76C8128- LG GM76C8128CLLFW70 128kx8 low power CMOS static RAM
220      863A05.2X- 27C4096 EPROM (DIP40)
221
222
223*/
224
225#include "driver.h"
226#include "cpu/mips/psx.h"
227#include "cpu/m68000/m68000.h"
228#include "includes/psx.h"
229#include "machine/am53cf96.h"
230#include "machine/rtc65271.h"
231#include "machine/i2cmem.h"
232#include "sound/psx.h"
233#include "sound/cdda.h"
234
235
236/* RTC */
237
238static UINT8 xram[ 4096 ];
239
240static NVRAM_HANDLER(twinkle)
241{
242   if (read_or_write)
243   {
244      rtc65271_file_save(file);
245   }
246   else
247   {
248      if (file != NULL)
249      {
250         rtc65271_file_load(machine, file);
251      }
252   }
253
254   nvram_handler_i2cmem_0( machine, file, read_or_write );
255}
256
257static UINT32 twinkle_unknown;
258
259static WRITE32_HANDLER( twinkle_unknown_w )
260{
261/*  printf( "set unknown data=%08x\n", data ); */
262
263   twinkle_unknown = data;
264}
265
266static READ32_HANDLER( twinkle_unknown_r )
267{
268   UINT32 data = twinkle_unknown;
269
270/*  printf( "get unknown data=%08x\n", data ); */
271
272   return data;
273}
274
275static int io_offset;
276static int output_last[ 0x100 ];
277static int last_io_offset;
278
279#define LED_A1 0x0001
280#define LED_A2 0x0002
281#define LED_B 0x0004
282#define LED_C 0x0008
283#define LED_D1 0x0010
284#define LED_D2 0x0020
285#define LED_E 0x0040
286#define LED_F 0x0080
287#define LED_G1 0x0100
288#define LED_G2 0x0200
289#define LED_H 0x2000
290#define LED_I 0x0400
291#define LED_J 0x4000
292#define LED_K 0x8000
293#define LED_L 0x0800
294#define LED_M 0x1000
295
296//   A1  A2
297//  F H I J B
298//   G1  G2
299//  E M L K C
300//   D2  D1
301
302
303static const UINT16 asciicharset[]=
304{
305   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_J | LED_M, // 0
306   LED_B | LED_C, // 1
307   LED_A1 | LED_A2 | LED_B | LED_D1 | LED_D2 | LED_E | LED_G1  | LED_G2, // 2
308   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_G2, // 3
309   LED_B | LED_C | LED_F | LED_G1 | LED_G2 , // 4
310   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_F | LED_G1 | LED_K, // 5
311   LED_A1 | LED_A2 | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_G1 | LED_G2, // 6
312   LED_A1 | LED_A2 | LED_B | LED_C, // 7
313   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // 8
314   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_F, // 9
315   LED_A1 | LED_A2 | LED_B | LED_C | LED_E | LED_F, // A
316   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_G2 | LED_I | LED_L, // B
317   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_E | LED_F, // C
318   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_I | LED_L, // D
319   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_E | LED_F | LED_G1 | LED_G2, // E
320   LED_A1 | LED_A2 | LED_E | LED_F | LED_G1, // F
321// 16
322   0,
323   0,
324   0,
325   0,
326   0,
327   0,
328   0,
329   0,
330   0,
331   0,
332   0,
333   0,
334   0,
335   0,
336   0,
337   0,
338// 32
339   0, // space
340   0, // !
341   0, // "
342   0, // #
343   0, // $
344   0, // %
345   0, // &
346   0, // '
347   0, // (
348   0, // )
349   0, // *
350   0, // +
351   0, // ,
352   0, // -
353   0, // .
354   0, // /
355// 48
356   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_J | LED_M, // 0
357   LED_B | LED_C, // 1
358   LED_A1 | LED_A2 | LED_B | LED_D1 | LED_D2 | LED_E | LED_G1  | LED_G2, // 2
359   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_G2, // 3
360   LED_B | LED_C | LED_F | LED_G1 | LED_G2 , // 4
361   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_F | LED_G1 | LED_K, // 5
362   LED_A1 | LED_A2 | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // 6
363   LED_A1 | LED_A2 | LED_B | LED_C, // 7
364   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // 8
365   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_F, // 9
366   0, // :
367   0, // ;
368   0, // <
369   0, // =
370   0, // >
371   0, // ?
372// 64
373   0, // @
374   LED_A1 | LED_A2 | LED_B | LED_C | LED_E | LED_F, // A
375   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_G2 | LED_I | LED_L, // B
376   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_E | LED_F, // C
377   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_I | LED_L, // D
378   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_E | LED_F | LED_G1 | LED_G2, // E
379   LED_A1 | LED_A2 | LED_E | LED_F | LED_G1, // F
380   LED_A1 | LED_A2 | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_G2, // G
381   LED_B | LED_C | LED_E | LED_F | LED_G1 | LED_G2, // H
382   LED_I | LED_L, // I
383   LED_B | LED_C | LED_D1 | LED_D2 | LED_E, // J
384   LED_E | LED_F | LED_G1 | LED_J | LED_K, // K
385   LED_D1 | LED_D2 | LED_E | LED_F, // L
386   LED_B | LED_C | LED_E | LED_F | LED_H | LED_J, // M
387   LED_B | LED_C | LED_E | LED_F | LED_H | LED_K, // N
388   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // O
389   LED_A1 | LED_A2 | LED_B | LED_E | LED_F, // P
390   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_K, // Q
391   LED_A1 | LED_A2 | LED_B | LED_E | LED_F | LED_K, // R
392   LED_A1 | LED_A2 | LED_C | LED_D1 | LED_D2 | LED_F | LED_G1 | LED_G2, // S
393   LED_A1 | LED_A2 | LED_I | LED_L, // T
394   LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // O
395   LED_E | LED_F | LED_M | LED_J, // V
396   LED_B | LED_C | LED_E | LED_F | LED_M | LED_K, // W
397   LED_H | LED_J | LED_K | LED_M, // X
398   LED_H | LED_J | LED_L, // Y
399   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_J | LED_M, // Z
400   0, // [
401   0, // "\"
402   0, // ]
403   0, // ^
404   0, // _
405   0, // `
406   LED_A1 | LED_A2 | LED_B | LED_C | LED_E | LED_F, // A
407   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_G2 | LED_I | LED_L, // B
408   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_E | LED_F, // C
409   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_I | LED_L, // D
410   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_E | LED_F | LED_G1 | LED_G2, // E
411   LED_A1 | LED_A2 | LED_E | LED_F | LED_G1, // F
412   LED_A1 | LED_A2 | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_G2, // G
413   LED_B | LED_C | LED_E | LED_F | LED_G1 | LED_G2, // H
414   LED_I | LED_L, // I
415   LED_B | LED_C | LED_D1 | LED_D2 | LED_E, // J
416   LED_E | LED_F | LED_G1 | LED_J | LED_K, // K
417   LED_D1 | LED_D2 | LED_E | LED_F, // L
418   LED_B | LED_C | LED_E | LED_F | LED_H | LED_J, // M
419   LED_B | LED_C | LED_E | LED_F | LED_H | LED_K, // N
420   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // O
421   LED_A1 | LED_A2 | LED_B | LED_E | LED_F, // P
422   LED_A1 | LED_A2 | LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F | LED_K, // Q
423   LED_A1 | LED_A2 | LED_B | LED_E | LED_F | LED_K, // R
424   LED_A1 | LED_A2 | LED_C | LED_D1 | LED_D2 | LED_F | LED_G1 | LED_G2, // S
425   LED_A1 | LED_A2 | LED_I | LED_L, // T
426   LED_B | LED_C | LED_D1 | LED_D2 | LED_E | LED_F, // O
427   LED_E | LED_F | LED_M | LED_J, // V
428   LED_B | LED_C | LED_E | LED_F | LED_M | LED_K, // W
429   LED_H | LED_J | LED_K | LED_M, // X
430   LED_H | LED_J | LED_L, // Y
431   LED_A1 | LED_A2 | LED_D1 | LED_D2 | LED_J | LED_M, // Z
432   0, // {
433   0, // |
434   0, // }
435   0, // ~
436   0, //
437};
438
439static WRITE32_HANDLER( twinkle_io_w )
440{
441   if( ACCESSING_BITS_16_23 )
442   {
443      io_offset = ( data >> 16 ) & 0xff;
444   }
445   if( ACCESSING_BITS_0_7 )
446   {
447      if( output_last[ io_offset ] != ( data & 0xff ) )
448      {
449         output_last[ io_offset ] = ( data & 0xff );
450
451         switch( io_offset )
452         {
453            /* ? */
454         case 0x07:
455         case 0x0f:
456         case 0x17:
457         case 0x1f:
458         case 0x27:
459         case 0x2f:
460         case 0x37:
461
462            /* led */
463         case 0x3f:
464         case 0x47:
465         case 0x4f:
466         case 0x57:
467         case 0x5f:
468         case 0x67:
469         case 0x6f:
470         case 0x77:
471         case 0x7f:
472            output_set_indexed_value( "led", ( io_offset - 7 ) / 8, asciicharset[ ( data ^ 0xff ) & 0x7f ] );
473            break;
474
475         case 0x87:
476            output_set_indexed_value( "spotlight", 0, ( ~data >> 3 ) & 1 );
477            output_set_indexed_value( "spotlight", 1, ( ~data >> 2 ) & 1 );
478            output_set_indexed_value( "spotlight", 2, ( ~data >> 1 ) & 1 );
479            output_set_indexed_value( "spotlight", 3, ( ~data >> 0 ) & 1 );
480            output_set_indexed_value( "spotlight", 4, ( ~data >> 4 ) & 1 );
481            output_set_indexed_value( "spotlight", 5, ( ~data >> 5 ) & 1 );
482            output_set_indexed_value( "spotlight", 6, ( ~data >> 6 ) & 1 );
483            output_set_indexed_value( "spotlight", 7, ( ~data >> 7 ) & 1 );
484            break;
485
486         case 0x8f:
487            output_set_value( "neonlamp", ~data & 1 );
488
489            if( ( data & 0xfe ) != 0xfe )
490            {
491               printf("%02x = %02x\n", io_offset, data & 0xff );
492            }
493            break;
494
495         default:
496            printf( "unknown io %02x = %02x\n", io_offset, data & 0xff );
497            break;
498         }
499      }
500   }
501}
502
503static READ32_HANDLER(twinkle_io_r)
504{
505   UINT32 data = 0;
506
507   if( ACCESSING_BITS_0_7 )
508   {
509      switch( io_offset )
510      {
511         case 0x07:
512            data |= input_port_read( space->machine, "IN0" );
513            break;
514
515         case 0x0f:
516            data |= input_port_read( space->machine, "IN1" );
517            break;
518
519         case 0x17:
520            data |= input_port_read( space->machine, "IN2" );
521            break;
522
523         case 0x1f:
524            data |= input_port_read( space->machine, "IN3" );
525            break;
526
527         case 0x27:
528            data |= input_port_read( space->machine, "IN4" );
529            break;
530
531         case 0x2f:
532            data |= input_port_read( space->machine, "IN5" );
533            break;
534
535         default:
536            if( last_io_offset != io_offset )
537            {
538               last_io_offset = io_offset;
539               printf( "io_offset=%02x\n", io_offset );
540            }
541
542            break;
543      }
544   }
545
546   if( ACCESSING_BITS_8_15 )
547   {
548      /* led status? 1100 */
549   }
550
551   return data;
552}
553
554static WRITE32_HANDLER(twinkle_output_w)
555{
556   switch( offset )
557   {
558   case 0x00:
559      /* offset */
560      break;
561   case 0x02:
562      /* data */
563      break;
564   case 0x04:
565      /* ?? */
566      break;
567   case 0x08:
568      /* bit 0 = clock?? */
569      /* bit 1 = data?? */
570      /* bit 2 = reset?? */
571      break;
572   case 0x0c:
573      /* ?? */
574      break;
575   case 0x15:
576      /* ?? */
577      break;
578   case 0x24:
579      /* ?? */
580      break;
581   }
582}
583
584static WRITE32_HANDLER(serial_w)
585{
586/*
587    int _do = ( data >> 4 ) & 1;
588    int clock = ( data >> 5 ) & 1;
589    int reset = ( data >> 6 ) & 1;
590
591    printf( "serial_w do=%d clock=%d reset=%d\n", _do, clock, reset );
592*/
593}
594
595static WRITE32_HANDLER(security_w)
596{
597   i2cmem_write( space->machine, 0, I2CMEM_SCL, ( data >> 4 ) & 1 );
598   i2cmem_write( space->machine, 0, I2CMEM_SDA, ( data >> 3 ) & 1 );
599}
600
601static READ32_HANDLER(security_r)
602{
603   /* 0x4000 ?? */
604   return i2cmem_read( space->machine, 0, I2CMEM_SDA ) << 12;
605}
606
607static WRITE32_HANDLER(xx_w)
608{
609/*
610printf( "xx %08x %08x %08x\n", offset, mem_mask, data );
611*/
612}
613
614static READ32_HANDLER(xx_r)
615{
616/*
617    printf( "xx %08x %08x\n", offset, mem_mask );
618*/
619   return 0;
620}
621
622static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 32 )
623   AM_RANGE(0x00000000, 0x003fffff) AM_RAM   AM_SHARE(1) AM_BASE(&g_p_n_psxram) AM_SIZE(&g_n_psxramsize) /* ram */
624   AM_RANGE(0x1f000000, 0x1f0007ff) AM_READWRITE(xx_r, xx_w)
625//  AM_RANGE(0x1f000400, 0x1f0007ff) AM_RAM AM_SHARE(3) /* shared ram */
626   AM_RANGE(0x1f200000, 0x1f20001f) AM_READWRITE(am53cf96_r, am53cf96_w)
627   AM_RANGE(0x1f20a01c, 0x1f20a01f) AM_WRITENOP /* scsi? */
628   AM_RANGE(0x1f210400, 0x1f2107ff) AM_READNOP
629   AM_RANGE(0x1f218000, 0x1f218003) AM_WRITENOP /* sound irq? */
630   AM_RANGE(0x1f220000, 0x1f220003) AM_WRITE(twinkle_io_w)
631   AM_RANGE(0x1f220004, 0x1f220007) AM_READ(twinkle_io_r)
632   AM_RANGE(0x1f230000, 0x1f230003) AM_WRITENOP
633   AM_RANGE(0x1f240000, 0x1f240003) AM_READ_PORT("IN6")
634   AM_RANGE(0x1f250000, 0x1f250003) AM_WRITENOP
635
636
637   AM_RANGE(0x1f260000, 0x1f260003) AM_WRITE(serial_w)
638   AM_RANGE(0x1f270000, 0x1f270003) AM_WRITE(security_w)
639   AM_RANGE(0x1f280000, 0x1f280003) AM_READ(security_r)
640   AM_RANGE(0x1f290000, 0x1f29007f) AM_READWRITE8(rtc65271_rtc_r, rtc65271_rtc_w, 0x00ff00ff)
641   AM_RANGE(0x1f2a0000, 0x1f2a007f) AM_READWRITE8(rtc65271_xram_r, rtc65271_xram_w, 0x00ff00ff)
642   AM_RANGE(0x1f2b0000, 0x1f2b00ff) AM_WRITE(twinkle_output_w)
643   AM_RANGE(0x1f800000, 0x1f8003ff) AM_RAM /* scratchpad */
644   AM_RANGE(0x1f801000, 0x1f801007) AM_WRITENOP
645   AM_RANGE(0x1f801008, 0x1f80100b) AM_RAM /* ?? */
646   AM_RANGE(0x1f80100c, 0x1f80100f) AM_WRITENOP
647   AM_RANGE(0x1f801010, 0x1f801013) AM_READNOP
648   AM_RANGE(0x1f801014, 0x1f801017) AM_DEVREAD("spu", psx_spu_delay_r)
649   AM_RANGE(0x1f801020, 0x1f801023) AM_READWRITE(twinkle_unknown_r, twinkle_unknown_w)
650   AM_RANGE(0x1f801040, 0x1f80105f) AM_READWRITE(psx_sio_r, psx_sio_w)
651   AM_RANGE(0x1f801060, 0x1f80106f) AM_WRITENOP
652   AM_RANGE(0x1f801070, 0x1f801077) AM_READWRITE(psx_irq_r, psx_irq_w)
653   AM_RANGE(0x1f801080, 0x1f8010ff) AM_READWRITE(psx_dma_r, psx_dma_w)
654   AM_RANGE(0x1f801100, 0x1f80112f) AM_READWRITE(psx_counter_r, psx_counter_w)
655   AM_RANGE(0x1f801810, 0x1f801817) AM_READWRITE(psx_gpu_r, psx_gpu_w)
656   AM_RANGE(0x1f801820, 0x1f801827) AM_READWRITE(psx_mdec_r, psx_mdec_w)
657   AM_RANGE(0x1f801c00, 0x1f801dff) AM_DEVREADWRITE("spu", psx_spu_r, psx_spu_w)
658   AM_RANGE(0x1f802020, 0x1f802033) AM_RAM /* ?? */
659   AM_RANGE(0x1f802040, 0x1f802043) AM_WRITENOP
660   AM_RANGE(0x1fc00000, 0x1fc7ffff) AM_ROM AM_SHARE(2) AM_REGION("user1", 0) /* bios */
661   AM_RANGE(0x80000000, 0x803fffff) AM_RAM AM_SHARE(1) /* ram mirror */
662   AM_RANGE(0x9fc00000, 0x9fc7ffff) AM_ROM AM_SHARE(2) /* bios mirror */
663   AM_RANGE(0xa0000000, 0xa03fffff) AM_RAM AM_SHARE(1) /* ram mirror */
664   AM_RANGE(0xbfc00000, 0xbfc7ffff) AM_ROM AM_SHARE(2) /* bios mirror */
665   AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP
666ADDRESS_MAP_END
667
668static READ32_HANDLER(yy_r)
669{
670   printf( "yy %08x %08x\n", offset, mem_mask );
671   return 0;
672}
673
674
675static READ32_HANDLER(zz_r)
676{
677//  printf( "zz %08x %08x\n", offset, mem_mask );
678   return 0;
679}
680
681static WRITE32_HANDLER(ww_w)
682{
683   printf( "ww %08x %08x %08x\n", offset, mem_mask, data );
684}
685
686static READ32_HANDLER(ww_r)
687{
688   printf( "ww %08x %08x\n", offset, mem_mask );
689   return 0;
690}
691
692
693static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 32 )
694   AM_RANGE(0x000000, 0x07ffff) AM_ROM
695   AM_RANGE(0x100000, 0x17ffff) AM_RAM
696   AM_RANGE(0x200000, 0x200003) AM_READ( yy_r )
697   AM_RANGE(0x220000, 0x220003) AM_WRITENOP
698   AM_RANGE(0x230000, 0x230003) AM_WRITENOP
699   AM_RANGE(0x280400, 0x2807ff) AM_READWRITE( ww_r, ww_w )
700//  AM_RANGE(0x280400, 0x2807ff) AM_RAM AM_SHARE(3) /* shared ram? */
701   AM_RANGE(0x30000c, 0x30000f) AM_READ( zz_r )
702   AM_RANGE(0x400000, 0x400fff) AM_WRITENOP /* ide? */
703ADDRESS_MAP_END
704
705/* SCSI */
706
707static UINT8 sector_buffer[ 4096 ];
708
709static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
710{
711   int i;
712   int n_this;
713
714   while( n_size > 0 )
715   {
716      if( n_size > sizeof( sector_buffer ) / 4 )
717      {
718         n_this = sizeof( sector_buffer ) / 4;
719      }
720      else
721      {
722         n_this = n_size;
723      }
724      if( n_this < 2048 / 4 )
725      {
726         /* non-READ commands */
727         am53cf96_read_data( n_this * 4, sector_buffer );
728      }
729      else
730      {
731         /* assume normal 2048 byte data for now */
732         am53cf96_read_data( 2048, sector_buffer );
733         n_this = 2048 / 4;
734      }
735      n_size -= n_this;
736
737      i = 0;
738      while( n_this > 0 )
739      {
740         g_p_n_psxram[ n_address / 4 ] =
741            ( sector_buffer[ i + 0 ] << 0 ) |
742            ( sector_buffer[ i + 1 ] << 8 ) |
743            ( sector_buffer[ i + 2 ] << 16 ) |
744            ( sector_buffer[ i + 3 ] << 24 );
745         n_address += 4;
746         i += 4;
747         n_this--;
748      }
749   }
750}
751
752static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
753{
754   int i;
755   int n_this;
756
757   while( n_size > 0 )
758   {
759      if( n_size > sizeof( sector_buffer ) / 4 )
760      {
761         n_this = sizeof( sector_buffer ) / 4;
762      }
763      else
764      {
765         n_this = n_size;
766      }
767      n_size -= n_this;
768
769      i = 0;
770      while( n_this > 0 )
771      {
772         sector_buffer[ i + 0 ] = ( g_p_n_psxram[ n_address / 4 ] >> 0 ) & 0xff;
773         sector_buffer[ i + 1 ] = ( g_p_n_psxram[ n_address / 4 ] >> 8 ) & 0xff;
774         sector_buffer[ i + 2 ] = ( g_p_n_psxram[ n_address / 4 ] >> 16 ) & 0xff;
775         sector_buffer[ i + 3 ] = ( g_p_n_psxram[ n_address / 4 ] >> 24 ) & 0xff;
776         n_address += 4;
777         i += 4;
778         n_this--;
779      }
780
781      am53cf96_write_data( n_this * 4, sector_buffer );
782   }
783}
784
785static void scsi_irq(running_machine *machine)
786{
787   psx_irq_set(machine, 0x400);
788}
789
790static SCSIConfigTable dev_table =
791{
792   1, /* 1 SCSI device */
793   {
794      { SCSI_ID_4, "cdrom0", SCSI_DEVICE_CDROM } /* SCSI ID 4, using CHD 0, and it's a CD-ROM */
795   }
796};
797
798static struct AM53CF96interface scsi_intf =
799{
800   &dev_table,      /* SCSI device table */
801   &scsi_irq,      /* command completion IRQ */
802};
803
804static DRIVER_INIT( twinkle )
805{
806   psx_driver_init(machine);
807   am53cf96_init(machine, &scsi_intf);
808   psx_dma_install_read_handler(5, scsi_dma_read);
809   psx_dma_install_write_handler(5, scsi_dma_write);
810
811   rtc65271_init(machine, xram, NULL);
812
813   i2cmem_init( machine, 0, I2CMEM_SLAVE_ADDRESS, 0, memory_region_length( machine, "user2" ), memory_region( machine, "user2" ) );
814   i2cmem_write( machine, 0, I2CMEM_E0, 0 );
815   i2cmem_write( machine, 0, I2CMEM_E1, 0 );
816   i2cmem_write( machine, 0, I2CMEM_E2, 0 );
817   i2cmem_write( machine, 0, I2CMEM_WC, 0 );
818}
819
820static MACHINE_RESET( twinkle )
821{
822   psx_machine_init(machine);
823
824   /* also hook up CDDA audio to the CD-ROM drive */
825   cdda_set_cdrom(devtag_get_device(machine, "cdda"), am53cf96_get_device(SCSI_ID_4));
826}
827
828static void spu_irq(const device_config *device, UINT32 data)
829{
830   psx_irq_set(device->machine, data);
831}
832
833static const psx_spu_interface twinkle_psxspu_interface =
834{
835   &g_p_n_psxram,
836   spu_irq,
837   psx_dma_install_read_handler,
838   psx_dma_install_write_handler
839};
840
841static MACHINE_DRIVER_START( twinkle )
842   /* basic machine hardware */
843   MDRV_CPU_ADD("maincpu",  PSXCPU, XTAL_67_7376MHz )
844   MDRV_CPU_PROGRAM_MAP( main_map )
845   MDRV_CPU_VBLANK_INT( "mainscreen", psx_vblank )
846
847   MDRV_CPU_ADD("audiocpu", M68EC020, 32000000/4)   /*  8.000 MHz!? */
848   MDRV_CPU_PROGRAM_MAP( sound_map )
849
850   MDRV_MACHINE_RESET( twinkle )
851   MDRV_NVRAM_HANDLER( twinkle )
852
853   /* video hardware */
854   MDRV_SCREEN_ADD("mainscreen", RASTER)
855   MDRV_SCREEN_REFRESH_RATE( 60 )
856   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC( 0 ))
857   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
858   MDRV_SCREEN_SIZE( 1024, 1024 )
859   MDRV_SCREEN_VISIBLE_AREA( 0, 639, 0, 479 )
860
861   MDRV_PALETTE_LENGTH( 65536 )
862
863   MDRV_PALETTE_INIT( psx )
864   MDRV_VIDEO_START( psx_type2 )
865   MDRV_VIDEO_UPDATE( psx )
866
867   /* sound hardware */
868   MDRV_SPEAKER_STANDARD_STEREO("speakerleft", "speakerright")
869
870   MDRV_SOUND_ADD( "spu", PSXSPU, 0 )
871   MDRV_SOUND_CONFIG( twinkle_psxspu_interface )
872   MDRV_SOUND_ROUTE( 0, "speakerleft", 0.75 )
873   MDRV_SOUND_ROUTE( 1, "speakerright", 0.75 )
874
875   MDRV_SOUND_ADD( "cdda", CDDA, 0 )
876   MDRV_SOUND_ROUTE( 0, "speakerleft", 1.0 )
877   MDRV_SOUND_ROUTE( 1, "speakerright", 1.0 )
878MACHINE_DRIVER_END
879
880INPUT_PORTS_START( twinkle )
881
882   PORT_START("IN0")
883   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1)
884   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2)
885   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON8) PORT_NAME("VEFX")
886   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON9) PORT_NAME("Effect")
887   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE) PORT_NAME(DEF_STR(Test))
888   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1)
889   PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN)
890
891   PORT_START("IN1")
892   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_PLAYER(2) PORT_NAME("2P Table") PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
893
894   PORT_START("IN2")
895   PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X) PORT_PLAYER(1) PORT_NAME("1P Table") PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
896
897   PORT_START("IN3")
898   PORT_BIT( 0x0f, 0x00, IPT_AD_STICK_Y) PORT_NAME("Volume 1") PORT_MINMAX(0x00,0x0f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
899   PORT_BIT( 0xf0, 0x00, IPT_AD_STICK_Y) PORT_NAME("Volume 2") PORT_MINMAX(0x00,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
900
901   PORT_START("IN4")
902   PORT_BIT( 0x0f, 0x00, IPT_AD_STICK_Y) PORT_NAME("Volume 3") PORT_MINMAX(0x00,0x0f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
903   PORT_BIT( 0xf0, 0x00, IPT_AD_STICK_Y) PORT_NAME("Volume 4") PORT_MINMAX(0x00,0xf0) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
904
905   PORT_START("IN5")
906   PORT_BIT( 0x0f, 0x00, IPT_AD_STICK_Y) PORT_NAME("Volume 5") PORT_MINMAX(0x00,0x0f) PORT_SENSITIVITY(100) PORT_KEYDELTA(10) PORT_CENTERDELTA(0)
907
908   PORT_START("IN6")
909   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(1) PORT_NAME("P1-1 (SW1)" )
910   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(1) PORT_NAME("P1-2 (SW2)" )
911   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(1) PORT_NAME("P1-3 (SW3)" )
912   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(1) PORT_NAME("P1-4 (SW4)" )
913   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_PLAYER(1) PORT_NAME("P1-5 (SW5)" )
914   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_PLAYER(1) PORT_NAME("P1-6 (SW6)" )
915   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON7) PORT_PLAYER(1) PORT_NAME("P1-7 (SW7)" )
916   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_PLAYER(2) PORT_NAME("P2-1 (SW8)" )
917   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_PLAYER(2) PORT_NAME("P2-2 (SW9)" )
918   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_PLAYER(2) PORT_NAME("P2-3 (SW10)" )
919   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_PLAYER(2) PORT_NAME("P2-4 (SW11)" )
920   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_PLAYER(2) PORT_NAME("P2-5 (SW12)" )
921   PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_PLAYER(2) PORT_NAME("P2-6 (SW13)" )
922   PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON7) PORT_PLAYER(2) PORT_NAME("P2-7 (SW14)" )
923   PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN1)
924   PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN)
925
926INPUT_PORTS_END
927
928#define TWINKLE_BIOS   \
929   ROM_REGION32_LE( 0x080000, "user1", 0 )\
930   ROM_LOAD( "863a03.7b",    0x000000, 0x080000, CRC(81498f73) SHA1(3599b40a5872eab3a00d345287635355fcb25a71) )\
931\
932   ROM_REGION32_LE( 0x080000, "audiocpu", 0 )\
933   ROM_LOAD16_WORD_SWAP( "863a05.2x",    0x000000, 0x080000, CRC(6f42a09e) SHA1(cab5209f90f47b9ee6e721479913ad74e3ba84b1) )
934
935ROM_START( gq863 )
936   TWINKLE_BIOS
937ROM_END
938
939ROM_START( bmiidx4 )
940   TWINKLE_BIOS
941
942   ROM_REGION( 0x100, "user2", 0 )
943   ROM_LOAD( "a03j.pd",      0x000000, 0x000100, BAD_DUMP CRC(1faf8d1b) SHA1(e8d9d216a8f5459598ff68692f9197e226a231e6) )
944
945   DISK_REGION( "cdrom0" )
946   DISK_IMAGE_READONLY( "a03jaa01", 0, BAD_DUMP MD5(dccbe0158236453c27a9768d185ee275) SHA1(ee0f5989ed2bec3d174150a072e188bc10c15dcb) )
947//  DISK_IMAGE_READONLY( "a03jaahd", 1, NO_DUMP )
948//  DISK_IMAGE_READONLY( "a03jaa02", 2, NO_DUMP )
949ROM_END
950
951ROM_START( bmiidx6 )
952   TWINKLE_BIOS
953
954   ROM_REGION( 0x100, "user2", 0 )
955   ROM_LOAD( "b4uj.pd",      0x000000, 0x000100, BAD_DUMP CRC(0ab15633) SHA1(df004ff41f35b16089f69808ccf53a5e5cc13ac3) )
956
957   DISK_REGION( "cdrom0" )
958   DISK_IMAGE_READONLY( "b4ujaa01", 0, BAD_DUMP MD5(c9397ff1399b268ceac98732e4d7b16d) SHA1(1e723c74fd93140881c00c5af402249e0a8b3f2f) )
959//  DISK_IMAGE_READONLY( "b4ujaahd", 1, NO_DUMP )
960//  DISK_IMAGE_READONLY( "b4ujaa02", 2, NO_DUMP )
961ROM_END
962
963ROM_START( bmiidx7 )
964   TWINKLE_BIOS
965
966   ROM_REGION( 0x100, "user2", 0 )
967   ROM_LOAD( "b44j.pd",      0x000000, 0x000100, BAD_DUMP CRC(5baf4761) SHA1(aa7e07eb2cada03b85bdf11ac6a3de65f4253eef) )
968
969   DISK_REGION( "cdrom0" )
970   DISK_IMAGE_READONLY( "b44jaa01", 0, BAD_DUMP MD5(3078c73d050bb6a513b329f3844e1208) SHA1(5910e557816ced2c5162c5458b5ccf6f8e6839f0) )
971//  DISK_IMAGE_READONLY( "b44jaahd", 1, NO_DUMP )
972//  DISK_IMAGE_READONLY( "b44jaa02", 2, NO_DUMP )
973ROM_END
974
975ROM_START( bmiidx8 )
976   TWINKLE_BIOS
977
978   ROM_REGION( 0x100, "user2", 0 )
979   ROM_LOAD( "c44j.pd",      0x000000, 0x000100, BAD_DUMP CRC(04c22349) SHA1(d1cb78911cb1ca660d393a81ed3ed07b24c51525) )
980
981   DISK_REGION( "cdrom0" )
982   DISK_IMAGE_READONLY( "c44jaa01", 0, BAD_DUMP MD5(43ae8f40ba8974d7d135e83c8e09112a) SHA1(b116775e47c7d5e2578b92811dccdc84f1cafe43) )
983//  DISK_IMAGE_READONLY( "c44jaahd", 1, NO_DUMP )
984//  DISK_IMAGE_READONLY( "c44jaa02", 2, NO_DUMP )
985ROM_END
986
987ROM_START( bmiidxc )
988   TWINKLE_BIOS
989
990   ROM_REGION( 0x100, "user2", 0 )
991   ROM_LOAD( "896j.pd",      0x000000, 0x000100, BAD_DUMP CRC(1e5caf37) SHA1(75b378662b651cb322e41564d3bae68cc9edadc5) )
992
993   DISK_REGION( "cdrom0" )
994   DISK_IMAGE_READONLY( "896jaabm", 0, MD5(f842277762e330d500fa3eb6755c1547) SHA1(965772160177df43ce7a94f0e12d8cf676e57228) )
995//  DISK_IMAGE_READONLY( "abmjaahd", 1, NO_DUMP )
996//  DISK_IMAGE_READONLY( "abmjaa02", 2, NO_DUMP )
997ROM_END
998
999ROM_START( bmiidxc2 )
1000   TWINKLE_BIOS
1001
1002   ROM_REGION( 0x100, "user2", 0 )
1003   ROM_LOAD( "984j.pd",      0x000000, 0x000100, BAD_DUMP CRC(213843e5) SHA1(5571db155a60fa4087dd996af48e8e27fc1c518c) )
1004
1005   DISK_REGION( "cdrom0" )
1006   DISK_IMAGE_READONLY( "984a01bm", 0, MD5(61ada5db9fcbfa01971c5f06253ab5e1) SHA1(98d5e120d0cd08e8598bfde75b16ba62bf67a15b) )
1007//  DISK_IMAGE_READONLY( "abmjaahd", 1, NO_DUMP )
1008//  DISK_IMAGE_READONLY( "abmjaa02", 2, NO_DUMP )
1009ROM_END
1010
1011ROM_START( bmiidxca )
1012   TWINKLE_BIOS
1013
1014   ROM_REGION( 0x100, "user2", 0 )
1015   ROM_LOAD( "896j.pd",      0x000000, 0x000100, BAD_DUMP CRC(1e5caf37) SHA1(75b378662b651cb322e41564d3bae68cc9edadc5) )
1016
1017   DISK_REGION( "cdrom0" )
1018   DISK_IMAGE_READONLY( "896jabbm", 0, MD5(46f8bd83e8fbe527f6e4512804b2ce1e) SHA1(b7fcf3e6b9c1cebedacbc65c77aa3509c66984a9) )
1019//  DISK_IMAGE_READONLY( "abmjaahd", 1, NO_DUMP )
1020//  DISK_IMAGE_READONLY( "abmjaa02", 2, NO_DUMP )
1021ROM_END
1022
1023GAME( 1999, gq863,   0,     twinkle, twinkle, twinkle, ROT0, "Konami", "Twinkle System", GAME_IS_BIOS_ROOT )
1024
1025/* VCD */
1026/* 1999 - beatmania IIDX */
1027/* find out what these use for security */
1028GAME( 1999, bmiidxc,  gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX with DDR 2nd Club Version (896 JAB)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1029GAME( 1999, bmiidxca, bmiidxc, twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX with DDR 2nd Club Version (896 JAA)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1030/* 1999 - beatmania IIDX substream */
1031GAME( 1999, bmiidxc2, gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX Substream 2 with DDR 2nd Club Version (984 A01 BM)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1032
1033/* 1999 - beatmania IIDX 2nd style */
1034/* 2000 - beatmania IIDX 3rd style */
1035/* these use i2c for security */
1036GAME( 2000, bmiidx4,  gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX 4th style (GCA03 JA)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1037/* 2001 - beatmania IIDX 5th style */
1038
1039/* DVD */
1040GAME( 2001, bmiidx6,  gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX 6th style (GCB4U JA)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1041GAME( 2002, bmiidx7,  gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX 7th style (GCB44 JA)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
1042GAME( 2002, bmiidx8,  gq863,   twinkle, twinkle, twinkle, ROT0, "Konami", "beatmania IIDX 8th style (GCC44 JA)", GAME_IMPERFECT_SOUND | GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/simpl156.c
r4878r4879
176176
177177static WRITE32_HANDLER( simpl156_eeprom_w )
178178{
179   int okibank;
179   //int okibank;
180180
181   okibank = data & 0x07;
181   //okibank = data & 0x07;
182182
183183   okim6295_set_bank_base(devtag_get_device(space->machine, "okimusic"), 0x40000 * (data & 0x7) );
184184
src/mame/drivers/artmagic.c
r4878r4879
7676 *
7777 *************************************/
7878
79static MACHINE_START( artmagic )
80{
81   state_save_register_global(machine, tms_irq);
82   state_save_register_global(machine, hack_irq);
83   state_save_register_global(machine, prot_input_index);
84   state_save_register_global(machine, prot_output_index);
85   state_save_register_global(machine, prot_output_bit);
86   state_save_register_global(machine, prot_bit_index);
87   state_save_register_global(machine, prot_save);
88   state_save_register_global_array(machine, prot_input);
89   state_save_register_global_array(machine, prot_output);
90}
91
7992static MACHINE_RESET( artmagic )
8093{
8194   tms_irq = hack_irq = 0;
8295   update_irq_state(machine);
8396   tlc34076_reset(6);
97   tlc34076_state_save(machine);
8498}
8599
86100
r4878r4879
699713   MDRV_CPU_CONFIG(tms_config)
700714   MDRV_CPU_PROGRAM_MAP(tms_map)
701715
716   MDRV_MACHINE_START(artmagic)
702717   MDRV_MACHINE_RESET(artmagic)
703718   MDRV_QUANTUM_TIME(HZ(6000))
704719   MDRV_NVRAM_HANDLER(generic_1fill)
r4878r4879
917932 *
918933 *************************************/
919934
920GAME( 1993, ultennis, 0,        artmagic, ultennis, ultennis, ROT0, "Art & Magic", "Ultimate Tennis",       0 )
921GAME( 1994, cheesech, 0,        cheesech, cheesech, cheesech, ROT0, "Art & Magic", "Cheese Chase",          0 )
922GAME( 1994, stonebal, 0,        stonebal, stonebal, stonebal, ROT0, "Art & Magic", "Stone Ball (4 Players)", 0 )
923GAME( 1994, stoneba2, stonebal, stonebal, stoneba2, stonebal, ROT0, "Art & Magic", "Stone Ball (2 Players)", 0 )
935GAME( 1993, ultennis, 0,        artmagic, ultennis, ultennis, ROT0, "Art & Magic", "Ultimate Tennis",       GAME_SUPPORTS_SAVE )
936GAME( 1994, cheesech, 0,        cheesech, cheesech, cheesech, ROT0, "Art & Magic", "Cheese Chase",          GAME_SUPPORTS_SAVE )
937GAME( 1994, stonebal, 0,        stonebal, stonebal, stonebal, ROT0, "Art & Magic", "Stone Ball (4 Players)", GAME_SUPPORTS_SAVE )
938GAME( 1994, stoneba2, stonebal, stonebal, stoneba2, stonebal, ROT0, "Art & Magic", "Stone Ball (2 Players)", GAME_SUPPORTS_SAVE )
src/mame/drivers/hexion.c
r4878r4879
161161   PORT_DIPSETTING(    0x60, DEF_STR( Very_Easy) )
162162   PORT_DIPSETTING(    0x50, DEF_STR( Easy ) )
163163   PORT_DIPSETTING(    0x40, DEF_STR( Medium ) )
164   PORT_DIPSETTING(    0x30, "Medium Hard" )
164   PORT_DIPSETTING(    0x30, DEF_STR( Medium_Hard ) )
165165   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
166166   PORT_DIPSETTING(    0x10, DEF_STR( Very_Hard ) )
167167   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
src/mame/drivers/battlnts.c
r4878r4879
105105   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
106106   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
107107   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
108   PORT_DIPSETTING(   0x20, "Difficult" )
109   PORT_DIPSETTING(   0x00, "Very Difficult" )
108   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
109   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
110110   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
111111   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
112112   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/galpani2.c
r4878r4879
229229
230230static void galpani2_mcu_nmi2(running_machine *machine)
231231{
232      galpani2_write_kaneko(machine->cpu[0]);
233      //logerror("%s : MCU executes CHECKs synchro\n",cpuexec_describe_context(machine));
232      galpani2_write_kaneko(cputag_get_cpu(machine, "maincpu"));
233      //logerror("%s : MCU executes CHECKs synchro\n", cpuexec_describe_context(machine));
234234}
235235
236236static WRITE8_HANDLER( galpani2_mcu_nmi1_w ) //driven by CPU1's int5 ISR
src/mame/drivers/arabian.c
r4878r4879
217217   AM_RANGE(0xc000, 0xc000) AM_MIRROR(0x01ff) AM_READ_PORT("IN0")
218218   AM_RANGE(0xc200, 0xc200) AM_MIRROR(0x01ff) AM_READ_PORT("DSW1")
219219   AM_RANGE(0xd000, 0xd7ef) AM_RAM AM_BASE(&custom_cpu_ram)
220   AM_RANGE(0xd7f0, 0xd7ff) AM_READWRITE(custom_cpu_r, SMH_RAM)
220   AM_RANGE(0xd7f0, 0xd7ff) AM_READ(custom_cpu_r) AM_WRITENOP
221221   AM_RANGE(0xe000, 0xe007) AM_MIRROR(0x0ff8) AM_WRITE(arabian_blitter_w) AM_BASE(&arabian_blitter)
222222ADDRESS_MAP_END
223223
src/mame/drivers/hornet.c
r4878r4879
568568
569569static void voodoo_vblank_0(const device_config *device, int param)
570570{
571   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_IRQ0, ASSERT_LINE);
571   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
572572}
573573
574574static void voodoo_vblank_1(const device_config *device, int param)
575575{
576   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_IRQ1, ASSERT_LINE);
576   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
577577}
578578
579579static VIDEO_START( hornet )
r4878r4879
704704                0x02 = ADDI (ADC DI)
705705                0x01 = ADDSCLK (ADC SCLK)
706706            */
707         cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
707         cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
708708         mame_printf_debug("System register 1 = %02X\n", data);
709709         break;
710710
r4878r4879
739739                0x01 = EXRGB
740740            */
741741         if (data & 0x80)
742            cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ1, CLEAR_LINE);
742            cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
743743         if (data & 0x40)
744            cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ0, CLEAR_LINE);
744            cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
745745         set_cgboard_id((data >> 4) & 3);
746746         break;
747747   }
r4878r4879
968968   jvs_sdata = auto_alloc_array_clear(machine, UINT8, 1024);
969969
970970   /* set conservative DRC options */
971   ppcdrc_set_options(machine->cpu[0], PPCDRC_COMPATIBLE_OPTIONS);
971   ppcdrc_set_options(cputag_get_cpu(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
972972
973973   /* configure fast RAM regions for DRC */
974   ppcdrc_add_fastram(machine->cpu[0], 0x00000000, 0x003fffff, FALSE, workram);
974   ppcdrc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x003fffff, FALSE, workram);
975975
976976   state_save_register_global(machine, led_reg0);
977977   state_save_register_global(machine, led_reg1);
r4878r4879
989989      memory_set_bank(machine, 1, 0);
990990   }
991991
992   cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE);
992   cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
993993
994994   if (usr5)
995995      memory_set_bankptr(machine, 5, usr5);
r4878r4879
10561056      memory_configure_bank(machine, 1, 0, memory_region_length(machine, "user3") / 0x40000, usr3, 0x40000);
10571057      memory_set_bank(machine, 1, 0);
10581058   }
1059   cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE);
1060   cpu_set_input_line(machine->cpu[3], INPUT_LINE_RESET, ASSERT_LINE);
1059   cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
1060   cputag_set_input_line(machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE);
10611061
10621062   if (usr5)
10631063      memory_set_bankptr(machine, 5, usr5);
r4878r4879
11481148      if (b == 0xe0)
11491149      {
11501150         sum += 0xd0 + 0xdf;
1151         ppc4xx_spu_receive_byte(machine->cpu[0], 0xd0);
1152         ppc4xx_spu_receive_byte(machine->cpu[0], 0xdf);
1151         ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xd0);
1152         ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xdf);
11531153      }
11541154      else if (b == 0xd0)
11551155      {
11561156         sum += 0xd0 + 0xcf;
1157         ppc4xx_spu_receive_byte(machine->cpu[0], 0xd0);
1158         ppc4xx_spu_receive_byte(machine->cpu[0], 0xcf);
1157         ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xd0);
1158         ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xcf);
11591159      }
11601160      else
11611161      {
11621162         sum += b;
1163         ppc4xx_spu_receive_byte(machine->cpu[0], b);
1163         ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), b);
11641164      }
11651165   }
11661166   return sum;
r4878r4879
11921192{
11931193   UINT8 sync, node, byte_num;
11941194   UINT8 data[1024], rdata[1024];
1195#if 0
11951196   int length;
1197#endif
11961198   int rdata_ptr;
11971199   int sum;
11981200
r4878r4879
12001202   node = jvs_sdata[1];
12011203   byte_num = jvs_sdata[2];
12021204
1203   length = jvs_decode_data(&jvs_sdata[3], data, byte_num-1);
1204
12051205#if 0
1206   length =
1207#endif
1208      jvs_decode_data(&jvs_sdata[3], data, byte_num-1);
1209#if 0
12061210    printf("jvs input data:\n");
12071211    for (i=0; i < byte_num; i++)
12081212    {
r4878r4879
12491253
12501254   // write jvs return data
12511255   sum = 0x00 + (rdata_ptr+1);
1252   ppc4xx_spu_receive_byte(machine->cpu[0], 0xe0);         // sync
1253   ppc4xx_spu_receive_byte(machine->cpu[0], 0x00);         // node
1254   ppc4xx_spu_receive_byte(machine->cpu[0], rdata_ptr+1);   // num of bytes
1256   ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0xe0);         // sync
1257   ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), 0x00);         // node
1258   ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), rdata_ptr + 1);   // num of bytes
12551259   sum += jvs_encode_data(machine, rdata, rdata_ptr);
1256   ppc4xx_spu_receive_byte(machine->cpu[0], sum - 1);      // checksum
1260   ppc4xx_spu_receive_byte(cputag_get_cpu(machine, "maincpu"), sum - 1);      // checksum
12571261
12581262   jvs_sdata_ptr = 0;
12591263}
r4878r4879
12631267
12641268static TIMER_CALLBACK( irq_off )
12651269{
1266   cpu_set_input_line(machine->cpu[1], param, CLEAR_LINE);
1270   cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
12671271}
12681272
12691273static void sound_irq_callback(running_machine *machine, int irq)
12701274{
12711275   int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
1272   cpu_set_input_line(machine->cpu[1], line, ASSERT_LINE);
1276   cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
12731277   timer_set(machine, ATTOTIME_IN_USEC(1), NULL, line, irq_off);
12741278}
12751279
r4878r4879
12831287
12841288   led_reg0 = led_reg1 = 0x7f;
12851289
1286   ppc4xx_spu_set_tx_handler(machine->cpu[0], jamma_jvs_w);
1290   ppc4xx_spu_set_tx_handler(cputag_get_cpu(machine, "maincpu"), jamma_jvs_w);
12871291}
12881292
12891293static DRIVER_INIT(hornet_2board)
r4878r4879
12971301
12981302   led_reg0 = led_reg1 = 0x7f;
12991303
1300   ppc4xx_spu_set_tx_handler(machine->cpu[0], jamma_jvs_w);
1304   ppc4xx_spu_set_tx_handler(cputag_get_cpu(machine, "maincpu"), jamma_jvs_w);
13011305}
13021306
13031307/*****************************************************************************/
src/mame/drivers/86lions.c
r4878r4879
1616TODO:
1717    - Understand inputs / via mapping properly;
1818    - Finish the mc6845 conversion;
19    - Colors? This shoudn't use a color prom.
2019
2120*******************************************************************************************/
2221
r4878r4879
194193   8,8,
195194   RGN_FRAC(1,3),
196195   3,
197   {
198      RGN_FRAC(0,3),
199      RGN_FRAC(1,3),
200      RGN_FRAC(2,3),
201   },
196   { RGN_FRAC(2,3), RGN_FRAC(1,3), RGN_FRAC(0,3), }, // Trusted, see MT 03190
202197   { STEP8(0,1) },
203198   { STEP8(0,8) },
204199   8*8
src/mame/drivers/ambush.c
r4878r4879
6969   AM_RANGE(0xc800, 0xc800) AM_READ_PORT("DSW1")
7070   AM_RANGE(0xcc00, 0xcc03) AM_WRITENOP
7171   AM_RANGE(0xcc04, 0xcc04) AM_WRITE(flip_screen_w)
72   AM_RANGE(0xcc05, 0xcc05) AM_WRITE(SMH_RAM) AM_BASE(&ambush_colorbank)
72   AM_RANGE(0xcc05, 0xcc05) AM_WRITEONLY AM_BASE(&ambush_colorbank)
7373   AM_RANGE(0xcc07, 0xcc07) AM_WRITE(ambush_coin_counter_w)
7474ADDRESS_MAP_END
7575
src/mame/drivers/skimaxx.c
r4878r4879
3737 *
3838 *************************************/
3939
40VIDEO_START( skimaxx )
40static VIDEO_START( skimaxx )
4141{
4242
4343}
r4878r4879
5050 *************************************/
5151
5252// TODO: Might not be used
53void skimaxx_to_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg)
53static void skimaxx_to_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg)
5454{
5555   memcpy(shiftreg, &frame_buffer[TOWORD(address)], 512 * sizeof(UINT16));
5656}
5757
58void skimaxx_from_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg)
58static void skimaxx_from_shiftreg(const address_space *space, UINT32 address, UINT16 *shiftreg)
5959{
6060   memcpy(&frame_buffer[TOWORD(address)], shiftreg, 512 * sizeof(UINT16));
6161}
r4878r4879
6767 *
6868 *************************************/
6969
70void skimaxx_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
70static void skimaxx_scanline_update(const device_config *screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
7171{
7272   // TODO: This isn't correct. I just hacked it together quickly so I could see something!
7373   if (params->rowaddr >= 0x220)
src/mame/drivers/gaplus.c
r4878r4879
207207static DRIVER_INIT( 56_58 )
208208{
209209   unpack_gfx(machine);
210   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0);
211   namcoio_init(machine, 1, NAMCOIO_58XX, &intf1);
210   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0, NULL);
211   namcoio_init(machine, 1, NAMCOIO_58XX, &intf1, NULL);
212212}
213213
214214static DRIVER_INIT( 56_58l )
215215{
216216   unpack_gfx(machine);
217   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps);
218   namcoio_init(machine, 1, NAMCOIO_58XX, &intf1);
217   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps, NULL);
218   namcoio_init(machine, 1, NAMCOIO_58XX, &intf1, NULL);
219219}
220220
221221static DRIVER_INIT( 58_56 )
222222{
223223   unpack_gfx(machine);
224   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
225   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
224   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0, NULL);
225   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1, NULL);
226226}
227227
228228
r4878r4879
255255
256256static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
257257{
258   int bit = !BIT(offset,11);
259   cpu_interrupt_enable(space->machine->cpu[0],bit);
258   int bit = !BIT(offset, 11);
259   cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
260260   if (!bit)
261      cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE);
261      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
262262}
263263
264264static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
265265{
266   int bit = !BIT(offset,13);
267   cpu_interrupt_enable(space->machine->cpu[2],bit);
266   int bit = !BIT(offset, 13);
267   cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), bit);
268268   if (!bit)
269      cpu_set_input_line(space->machine->cpu[2], 0, CLEAR_LINE);
269      cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
270270}
271271
272272static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
273273{
274274   int bit = offset & 1;
275   cpu_interrupt_enable(space->machine->cpu[1],bit);
275   cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
276276   if (!bit)
277      cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE);
277      cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
278278}
279279
280280static WRITE8_HANDLER( gaplus_sreset_w )
281281{
282   int bit = !BIT(offset,11);
283    cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
284    cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
282   int bit = !BIT(offset, 11);
283    cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
284    cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
285285   mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit);
286286}
287287
288288static WRITE8_HANDLER( gaplus_freset_w )
289289{
290   int bit = !BIT(offset,11);
291logerror("%04x: freset %d\n",cpu_get_pc(space->cpu),bit);
290   int bit = !BIT(offset, 11);
291   logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit);
292292   namcoio_set_reset_line(0, bit ? CLEAR_LINE : ASSERT_LINE);
293293   namcoio_set_reset_line(1, bit ? CLEAR_LINE : ASSERT_LINE);
294294}
r4878r4879
296296static MACHINE_RESET( gaplus )
297297{
298298   /* on reset, VINTON is reset, while the other flags don't seem to be affected */
299   cpu_interrupt_enable(machine->cpu[1],0);
300   cpu_set_input_line(machine->cpu[1], 0, CLEAR_LINE);
299   cpu_interrupt_enable(cputag_get_cpu(machine, "sub"), 0);
300   cputag_set_input_line(machine, "sub", 0, CLEAR_LINE);
301301}
302302
303303static INTERRUPT_GEN( gaplus_interrupt_1 )
304304{
305305   irq0_line_assert(device);   // this also checks if irq is enabled - IMPORTANT!
306                  // so don't replace with cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE);
306                        // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
307307
308   namcoio_set_irq_line(device->machine,0,PULSE_LINE);
309   namcoio_set_irq_line(device->machine,1,PULSE_LINE);
308   namcoio_set_irq_line(device->machine, 0, PULSE_LINE);
309   namcoio_set_irq_line(device->machine, 1, PULSE_LINE);
310310}
311311
312312
src/mame/drivers/system1.c
r4878r4879
203203#define SOUND_CLOCK      XTAL_8MHz
204204
205205
206/* driver config */
206207static void (*videomode_custom)(running_machine *machine, UINT8 data, UINT8 prevdata);
208static UINT8 mute_xor;
207209
208210static UINT8 *system1_ram;
209211static UINT8 dakkochn_mux_data;
r4878r4879
357359
358360   z80_set_cycle_tables(cputag_get_cpu(machine, "maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex);
359361
362   mute_xor = 0x00;
363
360364   state_save_register_global(machine, dakkochn_mux_data);
361365   state_save_register_global(machine, videomode_prev);
362366   state_save_register_global(machine, mcu_control);
r4878r4879
364368}
365369
366370
371static MACHINE_START( system2 )
372{
373   MACHINE_START_CALL(system1);
374   mute_xor = 0x01;
375}
376
377
367378static MACHINE_RESET( system1 )
368379{
369380   dakkochn_mux_data = 0;
r4878r4879
453464
454465static WRITE8_DEVICE_HANDLER( sound_control_w )
455466{
456   /* bit 0 = MUTE */
457   sound_global_enable(~data & 1);
467   /* bit 0 = MUTE (inverted sense on System 2) */
468   sound_global_enable(~(data ^ mute_xor) & 1);
458469
459470   /* bit 6 = feedback from sound board that read occurrred */
460471
r4878r4879
21932204static MACHINE_DRIVER_START( sys2 )
21942205   MDRV_IMPORT_FROM( sys1ppi )
21952206
2207   MDRV_MACHINE_START(system2)
2208
21962209   /* video hardware */
21972210   MDRV_VIDEO_START(system2)
21982211   MDRV_VIDEO_UPDATE(system2)
r4878r4879
46864699}
46874700
46884701
4689static DRIVER_INIT( bootlegb )
4702static DRIVER_INIT( bootsys2 )
46904703{
46914704   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
46924705   memory_set_decrypted_region(space, 0x0000, 0x7fff, memory_region(machine, "maincpu") + 0x20000);
r4878r4879
47944807GAME( 1987, tokisens,   0,        sys2,     tokisens,  bank0c,   ROT90,  "Sega",            "Toki no Senshi - Chrono Soldier", GAME_SUPPORTS_SAVE )
47954808GAME( 1987, wbml,       0,        sys2,     wbml,      wbml,     ROT0,   "Sega / Westone",  "Wonder Boy in Monster Land (Japan New Ver., MC-8123, 317-0043)", GAME_SUPPORTS_SAVE )
47964809GAME( 1987, wbmljo,     wbml,     sys2,     wbml,      wbml,     ROT0,   "Sega / Westone",  "Wonder Boy in Monster Land (Japan Old Ver., MC-8123, 317-0043)", GAME_SUPPORTS_SAVE )
4797GAME( 1987, wbmljb,     wbml,     sys2,     wbml,      bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Japan not encrypted)", GAME_SUPPORTS_SAVE )
4798GAME( 1987, wbmlb,      wbml,     sys2,     wbml,      bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (English bootleg)", GAME_SUPPORTS_SAVE)
4799GAME( 1987, wbmlbg,     wbml,     sys2,     wbml,      bootlegb, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Galaxy Electronics English bootleg)", GAME_SUPPORTS_SAVE)
4810GAME( 1987, wbmljb,     wbml,     sys2,     wbml,      bootsys2, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Japan not encrypted)", GAME_SUPPORTS_SAVE )
4811GAME( 1987, wbmlb,      wbml,     sys2,     wbml,      bootsys2, ROT0,   "bootleg",         "Wonder Boy in Monster Land (English bootleg)", GAME_SUPPORTS_SAVE)
4812GAME( 1987, wbmlbg,     wbml,     sys2,     wbml,      bootsys2, ROT0,   "bootleg",         "Wonder Boy in Monster Land (Galaxy Electronics English bootleg)", GAME_SUPPORTS_SAVE)
48004813GAME( 1987, dakkochn,   0,        sys2,     dakkochn,  dakkochn, ROT0,   "Whiteboard",      "DakkoChan House (MC-8123, 317-0014)", GAME_SUPPORTS_SAVE )
48014814GAME( 1987, blockgalb,  blockgal, sys2,     blockgal,  bootleg,  ROT90,  "bootleg",         "Block Gal (bootleg)", GAME_SUPPORTS_SAVE )
48024815GAME( 1988, ufosensi,   0,        sys2row,  ufosensi,  ufosensi, ROT0,   "Sega",            "Ufo Senshi Yohko Chan (MC-8123, 317-0064)", GAME_SUPPORTS_SAVE )
4803GAME( 1988, ufosensib,  ufosensi, sys2row,  ufosensi,  bootlegb, ROT0,   "bootleg",         "Ufo Senshi Yohko Chan (not encrypted)", GAME_SUPPORTS_SAVE )
4816GAME( 1988, ufosensib,  ufosensi, sys2row,  ufosensi,  bootsys2, ROT0,   "bootleg",         "Ufo Senshi Yohko Chan (not encrypted)", GAME_SUPPORTS_SAVE )
src/mame/drivers/bfm_sc2.c
r4878r4879
15561556   AM_RANGE(0x3FFF, 0x3FFF) AM_READ(coin_input_r)
15571557   AM_RANGE(0x4000, 0x5fff) AM_ROM                     // 8k  fixed ROM
15581558   AM_RANGE(0x4000, 0xFFFF) AM_WRITE(unknown_w)         // contains unknown I/O registers
1559   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1))         // 8k  paged ROM (4 pages)
1559   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)               // 8k  paged ROM (4 pages)
15601560   AM_RANGE(0x8000, 0xFFFF) AM_ROM                     // 32k ROM
15611561
15621562ADDRESS_MAP_END
r4878r4879
27902790
27912791   AM_RANGE(0x3FFF, 0x3FFF) AM_READ( coin_input_r)
27922792   AM_RANGE(0x4000, 0x5FFF) AM_ROM                           /* 8k  fixed ROM */
2793   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1))                  /* 8k  paged ROM (4 pages) */
2793   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)                     /* 8k  paged ROM (4 pages) */
27942794   AM_RANGE(0x8000, 0xFFFF) AM_ROM                           /* 32k ROM */
27952795ADDRESS_MAP_END
27962796
r4878r4879
28392839   AM_RANGE(0x3FFF, 0x3FFF) AM_READ( coin_input_r)
28402840   AM_RANGE(0x4000, 0x5FFF) AM_ROM
28412841//  AM_RANGE(0x4000, 0xFFFF) AM_WRITE(unknown_w)
2842   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1))
2842   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)
28432843   AM_RANGE(0x8000, 0xFFFF) AM_ROM
28442844ADDRESS_MAP_END
28452845
r4878r4879
28892889   AM_RANGE(0x3FFF, 0x3FFF) AM_READ( coin_input_r)
28902890   AM_RANGE(0x4000, 0x5FFF) AM_ROM
28912891//  AM_RANGE(0x4000, 0xFFFF) AM_WRITE(unknown_w)
2892   AM_RANGE(0x6000, 0x7FFF) AM_READ(SMH_BANK(1))
2892   AM_RANGE(0x6000, 0x7FFF) AM_ROMBANK(1)
28932893   AM_RANGE(0x8000, 0xFFFF) AM_ROM
28942894ADDRESS_MAP_END
28952895
src/mame/drivers/seta2.c
r4878r4879
27232723   ROM_LOAD( "asx905m01.u18", 0x100000, 0x400000, CRC(8d9dd9a9) SHA1(1fc2f3688d2c24c720dca7357bca6bf5f4016c53) )
27242724ROM_END
27252725
2726ROM_START( wschamp ) /* V2.0 */
2726ROM_START( wschamp ) /* Wing Shootiong Championship V2.00 (01/23/2002) */
27272727   ROM_REGION( 0x200000, "maincpu", 0 )      /* TMP68301 Code */
27282728   ROM_LOAD16_BYTE( "as1006e02.u06", 0x000000, 0x100000, CRC(0ad01677) SHA1(63e09b9f7cc8b781af1756f86caa0cc0962ae584) ) /* checksum 421E printed on label */
27292729   ROM_LOAD16_BYTE( "as1007e02.u07", 0x000001, 0x100000, CRC(572624f0) SHA1(0c2f67daa22f4edd66a2be990dc6cd999faff0fa) ) /* checksum A48F printed on label */
r4878r4879
27392739   ROM_LOAD( "as1005m01.u18", 0x100000, 0x400000, CRC(e4b137b8) SHA1(4d8d15073c51f7d383282cc5755ae5b2eab6226c) )
27402740ROM_END
27412741
2742ROM_START( wschampa ) /* V1.01 */
2742ROM_START( wschampa ) /* Wing Shootiong Championship V1.01 */
27432743   ROM_REGION( 0x200000, "maincpu", 0 )      /* TMP68301 Code */
27442744   ROM_LOAD16_BYTE( "as1006e01.u06", 0x000000, 0x100000, CRC(d3d3b2b5) SHA1(2d036d795b40a4ed78bb9f7751f875cfc76276a9) )
27452745   ROM_LOAD16_BYTE( "as1007e01.u07", 0x000001, 0x100000, CRC(78ede6d9) SHA1(e6d10f52cd4c6bf97288df44911f23bb64fc012c) )
src/mame/drivers/flkatck.c
r4878r4879
152152   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
153153   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
154154   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
155   PORT_DIPSETTING(   0x20, "Difficult" )
156   PORT_DIPSETTING(   0x00, "Very difficult" )
155   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
156   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
157157   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
158158   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
159159   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/zn.c
r4878r4879
141141   { "stridr2a", cp10, cp13 }, /* OK ( random crashes on bosses ) */
142142   { "shiryu2",  cp10, cp13 }, /* OK ( random crashes on bosses ) */
143143   { "beastrzr", et01, et02 }, /* OK */
144   { "bldyroar", et01, et02 }, /* OK */
144145   { "beastrzb", et01, et02 }, /* OK */
145146   { "bldyror2", et01, et03 }, /* OK */
146147   { "bam2",     et01, et05 },
r4878r4879
167168   { "raystorm", tt01, tt04 }, /* OK */
168169   { "raystorj", tt01, tt04 }, /* OK */
169170   { "ftimpact", tt01, tt05 }, /* OK */
171   { "ftimpactj",tt01, tt05 }, /* OK */
170172   { "ftimpcta", tt01, tt05 }, /* OK */
171173   { "mgcldate", tt01, tt06 }, /* OK */
172174   { "mgcldtex", tt01, tt06 }, /* OK */
r4878r4879
37783780   ROM_LOAD( "e25-05.28",    0x0040000, 0x200000, CRC(3fb57636) SHA1(aa38bfac11ecf10fd55143cf4525a2a529be8bb6) )
37793781ROM_END
37803782
3783ROM_START( ftimpactj )
3784   TAITOFX1_BIOS
3785
3786   ROM_REGION32_LE( 0x01000000, "user2", 0 )
3787   ROM_LOAD16_BYTE( "e25-06.4",     0x0000001, 0x080000, CRC(3a59deeb) SHA1(4377c5829fb5b6f5d0120caf992b1ee714897641) )
3788   ROM_LOAD16_BYTE( "e25-07.3",     0x0000000, 0x080000, CRC(829be1cc) SHA1(64b139d7c3696ab2f0b9a4842c19a38fe6a8cede) )
3789   ROM_LOAD( "e25-01.1",            0x0400000, 0x400000, CRC(8cc4be0c) SHA1(9ca15558a83b7e332e50accf1f7852444a7ce730) )
3790   ROM_LOAD( "e25-02.2",            0x0800000, 0x400000, CRC(8e8b4c82) SHA1(55c9d4d3a08fc3226a75ab3a674be433af83e289) )
3791   ROM_LOAD( "e25-03.12",           0x0c00000, 0x400000, CRC(43b1c085) SHA1(6e53550e9be0d2f415fc6b4f3b8a71185c5370b2) )
3792
3793   ROM_REGION( 0x080000, "cpu1", 0 )
3794   ROM_LOAD( "e25-10.14",    0x0000000, 0x080000, CRC(2b2ad1b1) SHA1(6d064d0b6805d43ce42929ac8f5645b56384f53c) )
3795
3796   ROM_REGION( 0x600000, "unknown", 0 )
3797   ROM_LOAD( "e25-04.27",    0x0000000, 0x400000, CRC(09a66d35) SHA1(f0df24bc9bfc9eb0f5150dc035c19fc5b8a39bf9) )
3798   ROM_LOAD( "e25-05.28",    0x0040000, 0x200000, CRC(3fb57636) SHA1(aa38bfac11ecf10fd55143cf4525a2a529be8bb6) )
3799ROM_END
3800
37813801ROM_START( ftimpcta )
37823802   TAITOFX1_BIOS
37833803
r4878r4879
38583878   ROM_LOAD( "e32-03.12",           0x0c00000, 0x200000, CRC(190d1618) SHA1(838a651d32752015baa7e8caea62fd739631b8be) )
38593879
38603880   ROM_REGION( 0x2c000, "audiocpu", 0 )     /* 64k for Z80 code */
3861   ROM_LOAD( "e32-10.22",           0x0000000, 0x004000, CRC(adf3feb5) SHA1(bae5bc3fad99a92a3492be1b775dab861007eb3b) )
3881   ROM_LOAD( "e32-07.22",           0x0000000, 0x004000, CRC(adf3feb5) SHA1(bae5bc3fad99a92a3492be1b775dab861007eb3b) )
38623882   ROM_CONTINUE(                    0x0010000, 0x01c000 ) /* banked stuff */
38633883
38643884   ROM_REGION( 0x400000, "ym", 0 )
r4878r4879
40234043   PSARC95_BIOS
40244044
40254045   ROM_REGION32_LE( 0x1800000, "user2", 0 )
4026   ROM_LOAD16_BYTE( "broar.213",    0x000001, 0x080000, CRC(2c586534) SHA1(a38dfc3a45446d24a1caac89b0f560989d46ded5) )
4027   ROM_LOAD16_BYTE( "broar.212",    0x000000, 0x080000, CRC(1c85d7fb) SHA1(aa406a42c424cc16a9e5330c68dda9acf8760088) )
4028   ROM_LOAD16_BYTE( "broar.215",    0x100001, 0x080000, CRC(31c8e055) SHA1(2811789ab6221b972d1e3ffe98916587990f7564) )
4029   ROM_LOAD16_BYTE( "broar.214",    0x100000, 0x080000, CRC(1cdc450a) SHA1(9215e5fec52f7c5c0070feb621eb9c77f98e2362) )
4030   ROM_LOAD( "rabroar1.217",        0x400000, 0x400000, CRC(11f1ba36) SHA1(d41ae686c2c607640cbadf906215c89134758050) )
4031   ROM_LOAD( "rabroar2.216",        0x800000, 0x400000, CRC(d46d46b7) SHA1(1c42cb5dcda4b26c08c4ecf95efeadaf3a1d1dd2) )
4046   ROM_LOAD16_BYTE( "b.roar_u0213",   0x000001, 0x080000, CRC(2c586534) SHA1(a38dfc3a45446d24a1caac89b0f560989d46ded5) ) /* For U0212 & U0213, 8ing used indentical rom labels */
4047   ROM_LOAD16_BYTE( "b.roar_u0212",   0x000000, 0x080000, CRC(1c85d7fb) SHA1(aa406a42c424cc16a9e5330c68dda9acf8760088) ) /* even though the content changes between versions   */
4048   ROM_LOAD16_BYTE( "b.roar-u0215",   0x100001, 0x080000, CRC(31c8e055) SHA1(2811789ab6221b972d1e3ffe98916587990f7564) )
4049   ROM_LOAD16_BYTE( "b.roar-u0214",   0x100000, 0x080000, CRC(1cdc450a) SHA1(9215e5fec52f7c5c0070feb621eb9c77f98e2362) )
4050   ROM_LOAD( "ra-b-roar_rom-1.u0217", 0x400000, 0x400000, CRC(11f1ba36) SHA1(d41ae686c2c607640cbadf906215c89134758050) )
4051   ROM_LOAD( "ra-b.roar_rom-2.u0216", 0x800000, 0x400000, CRC(d46d46b7) SHA1(1c42cb5dcda4b26c08c4ecf95efeadaf3a1d1dd2) )
40324052
40334053   ROM_REGION( 0x080000, "audiocpu", 0 )
4034   ROM_LOAD16_BYTE( "broar.046",    0x000001, 0x040000, CRC(d4bb261a) SHA1(9a295b1354ef15f37ea09bb209cf0cb98437c462) )
4035   ROM_LOAD16_BYTE( "broar.042",    0x000000, 0x040000, CRC(4d537f88) SHA1(1760367d70a81606e29885ea315185d2c2a9409b) )
4054   ROM_LOAD16_BYTE( "b.roar-u046",  0x000001, 0x040000, CRC(d4bb261a) SHA1(9a295b1354ef15f37ea09bb209cf0cb98437c462) )
4055   ROM_LOAD16_BYTE( "b.roar-u042",  0x000000, 0x040000, CRC(4d537f88) SHA1(1760367d70a81606e29885ea315185d2c2a9409b) )
40364056
40374057   ROM_REGION( 0x400000, "ymf", 0 )
4038   ROM_LOAD( "rabroar3.snd",        0x000000, 0x400000, CRC(b74cc4d1) SHA1(eb5485582a12959ae06927a2f1d8a7e63e0f956f) )
4058   ROM_LOAD( "ra-b.roar3_rom-3.u0326", 0x000000, 0x400000, CRC(b74cc4d1) SHA1(eb5485582a12959ae06927a2f1d8a7e63e0f956f) )
40394059ROM_END
40404060
4041ROM_START( beastrzb )
4061ROM_START( bldyroar )
40424062   PSARC95_BIOS
40434063
40444064   ROM_REGION32_LE( 0x1800000, "user2", 0 )
4065   ROM_LOAD16_BYTE( "b.roar-u0213",   0x000001, 0x080000, CRC(63769342) SHA1(7231188073b997b039467db85ce7c85383daf591) ) /* For U0212 & U0213, 8ing used indentical rom labels */
4066   ROM_LOAD16_BYTE( "b.roar-u0212",   0x000000, 0x080000, CRC(966b7169) SHA1(63e025cacb84e89d30b40ed6cfa5c63d84c298c4) ) /* even though the content changes between versions   */
4067   ROM_LOAD16_BYTE( "b.roar-u0215",   0x100001, 0x080000, CRC(31c8e055) SHA1(2811789ab6221b972d1e3ffe98916587990f7564) )
4068   ROM_LOAD16_BYTE( "b.roar-u0214",   0x100000, 0x080000, CRC(1cdc450a) SHA1(9215e5fec52f7c5c0070feb621eb9c77f98e2362) )
4069   ROM_LOAD( "ra-b-roar_rom-1.u0217", 0x400000, 0x400000, CRC(11f1ba36) SHA1(d41ae686c2c607640cbadf906215c89134758050) )
4070   ROM_LOAD( "ra-b.roar_rom-2.u0216", 0x800000, 0x400000, CRC(d46d46b7) SHA1(1c42cb5dcda4b26c08c4ecf95efeadaf3a1d1dd2) )
4071
4072   ROM_REGION( 0x080000, "audiocpu", 0 )
4073   ROM_LOAD16_BYTE( "b.roar-u046",  0x000001, 0x040000, CRC(d4bb261a) SHA1(9a295b1354ef15f37ea09bb209cf0cb98437c462) )
4074   ROM_LOAD16_BYTE( "b.roar-u042",  0x000000, 0x040000, CRC(4d537f88) SHA1(1760367d70a81606e29885ea315185d2c2a9409b) )
4075
4076   ROM_REGION( 0x400000, "ymf", 0 )
4077   ROM_LOAD( "ra-b.roar3_rom-3.u0326", 0x000000, 0x400000, CRC(b74cc4d1) SHA1(eb5485582a12959ae06927a2f1d8a7e63e0f956f) )
4078ROM_END
4079
4080ROM_START( beastrzb ) /* bootleg board */
4081   PSARC95_BIOS
4082
4083   ROM_REGION32_LE( 0x1800000, "user2", 0 )
40454084   ROM_LOAD( "27c160.1",     0x000000, 0x200000, CRC(820855e2) SHA1(18bdd4d0b4a92ae4fde457e1f37c813be6eece71) )
40464085   ROM_LOAD( "27c160.4",     0x400000, 0x200000, CRC(2d2b25f4) SHA1(77d8ad94602e71f16b47de47bc2e0a97957c530b) )
40474086   ROM_LOAD( "27c160.5",     0x600000, 0x200000, CRC(10fe6f4d) SHA1(9faee2faa6d741e1caf25edd093644be5723aa5c) )
r4878r4879
43484387GAME( 1996, raystorm, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.06A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43494388GAME( 1996, raystorj, raystorm, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Ray Storm (Ver 2.05J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43504389GAME( 1996, ftimpact, ftimpcta, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02O)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4390GAME( 1996, ftimpactj,ftimpcta, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact (Ver 2.02J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43514391GAME( 1997, ftimpcta, taitofx1, coh1000tb,zn, coh1000tb, ROT0, "Taito", "Fighters' Impact A (Ver 2.00J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43524392GAME( 1997, mgcldtex, taitofx1, coh1000ta,zn, coh1000ta, ROT0, "Taito", "Magical Date EX / Magical Date - sotsugyou kokuhaku daisakusen (Ver 2.01J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43534393GAME( 1997, gdarius,  gdarius2, coh1000tb,zn, coh1000tb, ROT0, "Taito", "G-Darius (Ver 2.01J)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
r4878r4879
43624402GAME( 1997, psarc95,  0,        coh1002e, zn,   coh1002e, ROT0, "Sony/Eighting/Raizing", "PS Arcade 95", GAME_IS_BIOS_ROOT )
43634403
43644404GAME( 1997, beastrzr, psarc95,  coh1002e, zn,   coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
4405GAME( 1997, bldyroar, beastrzr, coh1002e, zn,   coh1002e, ROT0, "Eighting/Raizing", "Bloody Roar (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43654406GAME( 1997, beastrzb, psarc95,  coh1002e, zn,   coh1002e, ROT0, "Eighting/Raizing", "Beastorizer (USA Bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
43664407GAME( 1998, bldyror2, psarc95,  coh1002e, zn6b, coh1002e, ROT0, "Eighting/Raizing", "Bloody Roar 2 (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
43674408GAME( 2000, brvblade, tps,      coh1002e, zn,   coh1002e, ROT270, "Eighting/Raizing", "Brave Blade (JAPAN)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/megadriv.c
r4878r4879
39103910/****************************************** END SVP related *************************************/
39113911
39123912
3913static attotime time_elapsed_since_crap;
3913//static attotime time_elapsed_since_crap;
39143914
39153915
39163916VIDEO_START(megadriv)
r4878r4879
61426142
61436143   if (0)
61446144   {
6145      int xxx;
6145      //int xxx;
61466146      UINT64 frametime;
61476147
61486148   //  /* reference */
61496149      frametime = ATTOSECONDS_PER_SECOND/megadriv_framerate;
61506150
6151      time_elapsed_since_crap = timer_timeelapsed(frame_timer);
6152      xxx = cputag_attotime_to_clocks(machine, "maincpu",time_elapsed_since_crap);
6151      //time_elapsed_since_crap = timer_timeelapsed(frame_timer);
6152      //xxx = cputag_attotime_to_clocks(machine, "maincpu",time_elapsed_since_crap);
61536153      //mame_printf_debug("---------- cycles %d, %08x %08x\n",xxx, (UINT32)(time_elapsed_since_crap.attoseconds>>32),(UINT32)(time_elapsed_since_crap.attoseconds&0xffffffff));
61546154      //mame_printf_debug("---------- framet %d, %08x %08x\n",xxx, (UINT32)(frametime>>32),(UINT32)(frametime&0xffffffff));
61556155      timer_adjust_oneshot(frame_timer,  attotime_zero, 0);
src/mame/drivers/mexico86.c
r4878r4879
77
88Notes:
99- master/slave 4 players mode is not emulated at all.
10  To set it up, enable the Master/Slave Mode and set the two boards IDs with
11  different settings. Do NOT enable the Single board 4p mode, I don't think
12  that the main board is supposed to be still connected to the sub board.
1013
1114- Single board 4 players mode actually works but I'm not sure how the reset /
12  halt line is truly connected on the sub cpu, so I've disabled it by default.
15  halt line is truly connected on the sub cpu.
16  To set it up, just enable the single board 4p mode and keep the master/slave
17  mode to off and the board ID to master.
1318
1419- kicknrun does a PS4 STOP ERROR shortly after boot, but works afterwards.
1520  PS4 is the MC6801U4 mcu.
r4878r4879
150155   PORT_START("DSW0")
151156   /* When Bit 1 is On, the machine waits a signal from another one */
152157   /* Seems like if you can join two cabinets, one as master */
153   /* and the other as slave, probably to play four players */
154   PORT_DIPNAME( 0x01, 0x01, "System Selection" )
158   /* and the other as slave, probably to play four players. */
159   PORT_DIPNAME( 0x01, 0x01, "Master/Slave Mode" ) PORT_DIPLOCATION("SW1:1")
155160   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
156161   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
157   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) // Screen ?
162   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // Screen ?
158163   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
159164   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
160   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
161   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) // this should be Demo Sounds, but doesn't work?
165   PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:3")
166   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )  PORT_DIPLOCATION("SW1:4")// this should be Demo Sounds, but doesn't work?
162167   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
163168   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
164   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
169   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
165170   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
166171   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
167172   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
168173   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
169   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
174   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
170175   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
171176   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
172177   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
173178   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
174179
175180   PORT_START("DSW1")
176   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
181   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
177182   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
178183   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
179   PORT_DIPSETTING(    0x01, DEF_STR( Medium ) )
180   PORT_DIPSETTING(    0x00, DEF_STR( Hard ) )
181   PORT_DIPNAME( 0x0c, 0x08, "Playing Time" )
184   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
185   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
186   PORT_DIPNAME( 0x0c, 0x08, "Playing Time" ) PORT_DIPLOCATION("SW2:3,4")
182187   PORT_DIPSETTING(    0x00, "40 Seconds" )
183188   PORT_DIPSETTING(    0x0c, "One Minute" )
184189   PORT_DIPSETTING(    0x08, "One Minute and 20 Sec." )
185190   PORT_DIPSETTING(    0x04, "One Minute and 40 Sec." )
186   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
191   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5")
187192   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
188193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
189194   /* The following dip seems to be related with the first one */
190   PORT_DIPNAME( 0x20, 0x20, "System Selection" )
191   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
192   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
193   PORT_DIPNAME( 0x40, 0x00, "Number of Matches" )
195   PORT_DIPNAME( 0x20, 0x20, "Board ID" ) PORT_DIPLOCATION("SW2:6")
196   PORT_DIPSETTING(    0x20, "Master" )
197   PORT_DIPSETTING(    0x00, "Slave" )
198   PORT_DIPNAME( 0x40, 0x40, "Number of Matches" ) PORT_DIPLOCATION("SW2:7")
194199   PORT_DIPSETTING(    0x00, "2" )
195200   PORT_DIPSETTING(    0x40, "6" )
196   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Players ) )
197   PORT_DIPSETTING(    0x80, "2" )
198   PORT_DIPSETTING(    0x00, "4" )
201   PORT_DIPNAME( 0x80, 0x80, "Single board 4 Players Mode" ) PORT_DIPLOCATION("SW2:8")
202   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
203   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
199204
200205   PORT_START("IN3")
201206   /* the following is actually service coin 1 */
r4878r4879
274279
275280//AT
276281   PORT_START("DSW0")   /* DSW0 */
277   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) )
282   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:1")
278283   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
279284   PORT_DIPSETTING(    0x01, DEF_STR( Cocktail ) )
280   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
285   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
281286   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
282287   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
283   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
284   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
288   PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:3")
289   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:4")
285290   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
286291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
287292
r4878r4879
299304#endif
300305
301306   // coinage copied from Japanese manual but type B doesn't work
302   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
307   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6")
303308   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
304309   PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
305310   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
306311   PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
307   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
312   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
308313   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
309314   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
310315   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
311316   PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
312317
313318   PORT_START("DSW1")   /* DSW1 */
314   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
319   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )  PORT_DIPLOCATION("SW2:1,2")
315320   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
316321   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
317322   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
318323   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
319   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )
324   PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Bonus_Life ) )  PORT_DIPLOCATION("SW2:3,4")
320325   PORT_DIPSETTING(    0x00, "50000 100000" )
321326   PORT_DIPSETTING(    0x0c, "70000 150000" )
322327   PORT_DIPSETTING(    0x08, "70000 200000" )
323328   PORT_DIPSETTING(    0x04, "100000 300000" )
324   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
329   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )  PORT_DIPLOCATION("SW2:5,6")
325330   PORT_DIPSETTING(    0x00, "2" )
326331   PORT_DIPSETTING(    0x30, "3" )
327332   PORT_DIPSETTING(    0x20, "4" )
328333   PORT_DIPSETTING(    0x10, "5" )
329   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )
334   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW2:7")
330335   PORT_DIPSETTING(    0x40, "A" )
331336   PORT_DIPSETTING(    0x00, "B" )
332   PORT_DIPNAME( 0x80, 0x00, "Number Match" )
337   PORT_DIPNAME( 0x80, 0x00, "Number Match" )  PORT_DIPLOCATION("SW2:8")
333338   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
334339   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
335340//ZT
r4878r4879
382387{
383388   /*TODO: check the PCB and see how the halt / reset lines are connected. */
384389   if (cputag_get_cpu(machine, "sub") != NULL)
385      cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
386   //cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE);
390      cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (input_port_read(machine, "DSW1") & 0x80) ? ASSERT_LINE : CLEAR_LINE);
387391}
388392
389393static MACHINE_DRIVER_START( mexico86 )
src/mame/drivers/ashnojoe.c
r4878r4879
129129   AM_RANGE(0x04a000, 0x04a001) AM_READ_PORT("P1")
130130   AM_RANGE(0x04a002, 0x04a003) AM_READ_PORT("P2")
131131   AM_RANGE(0x04a004, 0x04a005) AM_READ_PORT("DSW")
132   AM_RANGE(0x04a006, 0x04a007) AM_WRITE(SMH_RAM) AM_BASE(&ashnojoe_tilemap_reg)
132   AM_RANGE(0x04a006, 0x04a007) AM_WRITEONLY AM_BASE(&ashnojoe_tilemap_reg)
133133   AM_RANGE(0x04a008, 0x04a009) AM_WRITE(ashnojoe_soundlatch_w)
134134   AM_RANGE(0x04a00a, 0x04a00b) AM_READ(fake_4a00a_r)   // ??
135135   AM_RANGE(0x04a010, 0x04a019) AM_WRITE(joe_tilemaps_xscroll_w)
src/mame/drivers/deco32.c
r4878r4879
788788   AM_RANGE(0x400000, 0x400003) AM_DEVREADWRITE8("oki3", okim6295_r, okim6295_w, 0x000000ff)
789789   AM_RANGE(0x410000, 0x410003) AM_WRITENOP /* Some kind of serial bit-stream - digital volume control? */
790790   AM_RANGE(0x420000, 0x420003) AM_READWRITE(dragngun_eeprom_r, dragngun_eeprom_w)
791   AM_RANGE(0x438000, 0x438003) AM_READWRITE(dragngun_lightgun_r, dragngun_lightgun_w)
791   AM_RANGE(0x438000, 0x438003) AM_READ(dragngun_lightgun_r)
792   AM_RANGE(0x430000, 0x43001f) AM_WRITE(dragngun_lightgun_w)
792793   AM_RANGE(0x440000, 0x440003) AM_READ(dragngun_service_r)
793794
794795   AM_RANGE(0x500000, 0x500003) AM_WRITE(dragngun_sprite_control_w)
src/mame/drivers/aleck64.c
r4878r4879
202202   AM_RANGE(0x1fc00000, 0x1fc007bf) AM_ROM AM_REGION("user1", 0)   // PIF ROM
203203   AM_RANGE(0x1fc007c0, 0x1fc007ff) AM_READWRITE(n64_pif_ram_r, n64_pif_ram_w)
204204
205   AM_RANGE(0xc0800000, 0xc08fffff) AM_READWRITE(aleck_dips_r, SMH_NOP)
205   AM_RANGE(0xc0800000, 0xc08fffff) AM_READ(aleck_dips_r) AM_WRITENOP
206206   AM_RANGE(0xd0000000, 0xd0000fff) AM_RAM
207207   AM_RANGE(0xd0010000, 0xd00109ff) AM_RAM
208208ADDRESS_MAP_END
src/mame/drivers/trackfld.c
r4878r4879
356356   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
357357   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
358358   PORT_DIPSETTING(    0x20, DEF_STR( Hard ) )
359   PORT_DIPSETTING(    0x00, "Difficult" )
359   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
360360   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
361361   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
362362   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/astrof.c
r4878r4879
498498   AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(astrof_videoram_w) AM_BASE(&astrof_videoram) AM_SIZE(&astrof_videoram_size)
499499   AM_RANGE(0x6000, 0x7fff) AM_NOP
500500   AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
501   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&astrof_color)
502   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, video_control_1_w)
503   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, astrof_video_control_2_w)
504   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, astrof_audio_1_w)
505   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, astrof_audio_2_w)
501   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(&astrof_color)
502   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w)
503   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_video_control_2_w)
504   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_audio_1_w)
505   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(astrof_audio_2_w)
506506   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP
507507   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP
508   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READWRITE(irq_clear_r, SMH_NOP)
508   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP
509509   AM_RANGE(0xa003, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
510510   AM_RANGE(0xc000, 0xffff) AM_ROM
511511ADDRESS_MAP_END
r4878r4879
517517   AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(astrof_videoram_w) AM_BASE(&astrof_videoram) AM_SIZE(&astrof_videoram_size)
518518   AM_RANGE(0x6000, 0x7fff) AM_NOP
519519   AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
520   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&astrof_color)
521   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, video_control_1_w)
522   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, spfghmk2_video_control_2_w)
523   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, spfghmk2_audio_w)
520   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(&astrof_color)
521   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w)
522   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(spfghmk2_video_control_2_w)
523   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(spfghmk2_audio_w)
524524   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_NOP
525525   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP
526526   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP
527   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READWRITE(irq_clear_r, SMH_NOP)
527   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP
528528   AM_RANGE(0xa003, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
529529   AM_RANGE(0xc000, 0xffff) AM_ROM
530530ADDRESS_MAP_END
r4878r4879
536536   AM_RANGE(0x4000, 0x5fff) AM_RAM_WRITE(tomahawk_videoram_w) AM_BASE(&astrof_videoram) AM_SIZE(&astrof_videoram_size)
537537   AM_RANGE(0x6000, 0x7fff) AM_NOP
538538   AM_RANGE(0x8000, 0x8002) AM_MIRROR(0x1ff8) AM_NOP
539   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&astrof_color)
540   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, video_control_1_w)
541   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, tomahawk_video_control_2_w)
542   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, tomahawk_audio_w)
543   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READWRITE(SMH_NOP, SMH_RAM) AM_BASE(&tomahawk_protection)
539   AM_RANGE(0x8003, 0x8003) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(&astrof_color)
540   AM_RANGE(0x8004, 0x8004) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(video_control_1_w)
541   AM_RANGE(0x8005, 0x8005) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(tomahawk_video_control_2_w)
542   AM_RANGE(0x8006, 0x8006) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITE(tomahawk_audio_w)
543   AM_RANGE(0x8007, 0x8007) AM_MIRROR(0x1ff8) AM_READNOP AM_WRITEONLY AM_BASE(&tomahawk_protection)
544544   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x1ff8) AM_READ_PORT("IN") AM_WRITENOP
545545   AM_RANGE(0xa001, 0xa001) AM_MIRROR(0x1ff8) AM_READ_PORT("DSW") AM_WRITENOP
546   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READWRITE(irq_clear_r, SMH_NOP)
547   AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x1ff8) AM_READWRITE(tomahawk_protection_r, SMH_NOP)
546   AM_RANGE(0xa002, 0xa002) AM_MIRROR(0x1ff8) AM_READ(irq_clear_r) AM_WRITENOP
547   AM_RANGE(0xa003, 0xa003) AM_MIRROR(0x1ff8) AM_READ(tomahawk_protection_r) AM_WRITENOP
548548   AM_RANGE(0xa004, 0xa007) AM_MIRROR(0x1ff8) AM_NOP
549549   AM_RANGE(0xc000, 0xffff) AM_ROM
550550ADDRESS_MAP_END
src/mame/drivers/gticlub.c
r4878r4879
256256
257257static void voodoo_vblank_0(const device_config *device, int param)
258258{
259   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_IRQ0, ASSERT_LINE);
259   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
260260}
261261
262262static void voodoo_vblank_1(const device_config *device, int param)
263263{
264   cpu_set_input_line(device->machine->cpu[0], INPUT_LINE_IRQ1, ASSERT_LINE);
264   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
265265}
266266
267267static VIDEO_START( hangplt )
r4878r4879
512512
513513      case 4:
514514         if (data & 0x80)   /* CG Board 1 IRQ Ack */
515            cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ1, CLEAR_LINE);
515            cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
516516
517517         if (data & 0x40)   /* CG Board 0 IRQ Ack */
518            cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ0, CLEAR_LINE);
518            cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
519519
520520         adc1038_di_w((data >> 0) & 1);
521521         adc1038_clk_w(space->machine, (data >> 1) & 1);
r4878r4879
543543
544544static TIMER_CALLBACK( network_irq_clear )
545545{
546   cpu_set_input_line(machine->cpu[0], INPUT_LINE_IRQ2, CLEAR_LINE);
546   cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ2, CLEAR_LINE);
547547}
548548
549549WRITE8_HANDLER( K056230_w )
r4878r4879
561561            // Thunder Hurricane breaks otherwise...
562562            if (mame_stricmp(space->machine->gamedrv->name, "thunderh") != 0)
563563            {
564               cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ2, ASSERT_LINE);
564               cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ2, ASSERT_LINE);
565565               timer_set(space->machine, ATTOTIME_IN_USEC(10), NULL, 0, network_irq_clear);
566566            }
567567         }
568568//          else
569//              cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_IRQ2, CLEAR_LINE);
569//              cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ2, CLEAR_LINE);
570570         break;
571571      }
572572      case 2:      // Sub ID register
r4878r4879
595595static MACHINE_START( gticlub )
596596{
597597   /* set conservative DRC options */
598   ppcdrc_set_options(machine->cpu[0], PPCDRC_COMPATIBLE_OPTIONS);
598   ppcdrc_set_options(cputag_get_cpu(machine, "maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
599599
600600   /* configure fast RAM regions for DRC */
601   ppcdrc_add_fastram(machine->cpu[0], 0x00000000, 0x000fffff, FALSE, work_ram);
601   ppcdrc_add_fastram(cputag_get_cpu(machine, "maincpu"), 0x00000000, 0x000fffff, FALSE, work_ram);
602602}
603603
604604static ADDRESS_MAP_START( gticlub_map, ADDRESS_SPACE_PROGRAM, 32 )
r4878r4879
900900
901901static MACHINE_RESET( gticlub )
902902{
903   cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE);
903   cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
904904}
905905
906906static MACHINE_DRIVER_START( gticlub )
r4878r4879
944944
945945static MACHINE_RESET( hangplt )
946946{
947   cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE);
948   cpu_set_input_line(machine->cpu[3], INPUT_LINE_RESET, ASSERT_LINE);
947   cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
948   cputag_set_input_line(machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE);
949949}
950950
951951static MACHINE_DRIVER_START( hangplt )
r4878r4879
957957   MDRV_CPU_ADD("audiocpu", M68000, 64000000/4)   /* 16MHz */
958958   MDRV_CPU_PROGRAM_MAP(sound_memmap)
959959
960   MDRV_CPU_ADD("dsp1", ADSP21062, 36000000)
960   MDRV_CPU_ADD("dsp", ADSP21062, 36000000)
961961   MDRV_CPU_CONFIG(sharc_cfg)
962962   MDRV_CPU_DATA_MAP(hangplt_sharc0_map)
963963
r4878r4879
972972   MDRV_MACHINE_RESET(hangplt)
973973
974974   MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "lscreen")
975   MDRV_3DFX_VOODOO_CPU("dsp1")
975   MDRV_3DFX_VOODOO_CPU("dsp")
976976   MDRV_3DFX_VOODOO_TMU_MEMORY(0, 2)
977977   MDRV_3DFX_VOODOO_TMU_MEMORY(1, 2)
978978   MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
r4878r4879
12031203
12041204static TIMER_CALLBACK( irq_off )
12051205{
1206   cpu_set_input_line(machine->cpu[1], param, CLEAR_LINE);
1206   cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
12071207}
12081208
12091209static void sound_irq_callback(running_machine *machine, int irq)
12101210{
12111211   int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
1212   cpu_set_input_line(machine->cpu[1], line, ASSERT_LINE);
1212   cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
12131213   timer_set(machine, ATTOTIME_IN_USEC(1), NULL, line, irq_off);
12141214}
12151215
src/mame/drivers/mazerbla.c
r4878r4879
3838#include "driver.h"
3939#include "cpu/z80/z80.h"
4040#include "sound/ay8910.h"
41#include "video/resnet.h"
4142
42static UINT8 *cfb_ram;
4343
44static UINT32 VCU_gfx_addr = 0;
45static UINT32 VCU_gfx_param_addr = 0;
46static UINT32 xpos=0, ypos=0, pix_xsize=0, pix_ysize=0;
47static UINT8 color=0, color2=0, mode=0, plane=0;
48static UINT8 vbank = 0; /* video page select signal, likely for double buffering ?*/
44#define MAZERBLA 0x01
45#define GREATGUN 0x02
46static UINT8 game_id = 0; /* hacks per game */
4947
50static UINT32 gfx_rom_bank = 0xff;   /* graphics ROMs are banked */
48#define MASTER_CLOCK XTAL_4MHz
49#define SOUND_CLOCK XTAL_14_31818MHz
5150
51static UINT8 *cfb_ram;
5252
53static UINT8 ls670_0[4];
54static UINT8 ls670_1[4];
5355
56static UINT8 zpu_int_vector;
5457
55#define MAZERBLA 0x01
56#define GREATGUN 0x02
57static UINT8 game_id = 0; /* hacks per game */
58static UINT8 bcd_7445 = 0;
5859
60static UINT8 vsb_ls273;
61static UINT8 soundlatch;
5962
6063
64/*************************************
65 *
66 *  Video Hardware
67 *
68 *************************************/
69
70static UINT8 bknd_col = 0xaa;
71static UINT8 port02_status = 0;
72static UINT8 VCU_video_reg[4];
73static UINT8 vbank = 0; /* video page select signal, likely for double buffering ?*/
74static UINT32 VCU_gfx_addr = 0;
75static UINT32 VCU_gfx_param_addr = 0;
76static UINT32 xpos=0, ypos=0, pix_xsize=0, pix_ysize=0;
77static UINT8 color=0, color2=0, mode=0, plane=0;
6178static UINT8 lookup_RAM[0x100*4];
79static UINT32 gfx_rom_bank = 0xff;   /* graphics ROMs are banked */
6280
6381
64
65#include "video/resnet.h"
6682/***************************************************************************
6783
6884  Convert the color PROMs into a more useable format.
r4878r4879
85101
86102static PALETTE_INIT( mazerbla )
87103{
88
89104   static const int resistances_r[2]  = { 4700, 2200 };
90105   static const int resistances_gb[3] = { 10000, 4700, 2200 };
91106
92
93/* just to calculate coefficients for later use */
94
107   /* just to calculate coefficients for later use */
95108   compute_resistor_weights(0,   255,   -1.0,
96109         3,   resistances_gb,   weights_g,   3600,   0,
97110         3,   resistances_gb,   weights_b,   3600,   0,
r4878r4879
110123   tmpbitmaps[3] = video_screen_auto_bitmap_alloc(machine->primary_screen);
111124}
112125
113#if 0
126#ifdef UNUSED_DEFINITION
114127static int dbg_info = 1;
115128static int dbg_gfx_e = 1;
116129static int dbg_clr_e = 0;
r4878r4879
118131static int dbg_lookup = 4;   //4= off
119132
120133static int planes_enabled[4] = {1,1,1,1}; //all enabled
121#endif
122134
123#if 0
124135VIDEO_UPDATE( test_vcu )
125136{
126137   int j;
r4878r4879
134145   if (game_id==GREATGUN)
135146      color_base = 0x0;
136147
137
138148   bitmap_fill(bitmap,NULL,0);
139//logerror("-->frame\n");
149//  logerror("-->frame\n");
140150
141
142151   if (planes_enabled[3])
143152      copybitmap(bitmap,tmpbitmaps[3],0,0,0,0,cliprect);
144153
145
146154   if (planes_enabled[2])
147155      copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,color_base);
156
148157   bitmap_fill(tmpbitmaps[2],NULL,color_base);
149158
150
151159   if (planes_enabled[1])
152160      copybitmap_trans(bitmap,tmpbitmaps[1],0,0,0,0,cliprect,color_base);
161
153162   bitmap_fill(tmpbitmaps[1],NULL,color_base);
154163
155
156164   if (planes_enabled[0])
157165      copybitmap_trans(bitmap,tmpbitmaps[0],0,0,0,0,cliprect,color_base);
166
158167   bitmap_fill(tmpbitmaps[0],NULL,color_base);
159168
160169   if (input_code_pressed_once(KEYCODE_1))   /* plane 1 */
161   {
162170      planes_enabled[0] ^= 1;
163   }
171
164172   if (input_code_pressed_once(KEYCODE_2))   /* plane 2 */
165   {
166173      planes_enabled[1] ^= 1;
167   }
174
168175   if (input_code_pressed_once(KEYCODE_3))   /* plane 3 */
169   {
170176      planes_enabled[2] ^= 1;
171   }
177
172178   if (input_code_pressed_once(KEYCODE_4))   /* plane 4 */
173   {
174179      planes_enabled[3] ^= 1;
175   }
176180
177181   if (input_code_pressed_once(KEYCODE_I))   /* show/hide debug info */
178   {
179182      dbg_info = !dbg_info;
180   }
181183
182184   if (input_code_pressed_once(KEYCODE_G))   /* enable gfx area handling */
183   {
184185      dbg_gfx_e = !dbg_gfx_e;
185   }
186186
187187   if (input_code_pressed_once(KEYCODE_C))   /* enable color area handling */
188   {
189188      dbg_clr_e = !dbg_clr_e;
190   }
191189
192190   if (input_code_pressed_once(KEYCODE_V))   /* draw only when vbank==dbg_vbank */
193   {
194191      dbg_vbank ^= 1;
195   }
196192
197193   if (input_code_pressed_once(KEYCODE_L))   /* showlookup ram */
198   {
199194      dbg_lookup = (dbg_lookup+1)%5;//0,1,2,3, 4-off
200   }
201195
202196
203197   if (dbg_info)
r4878r4879
239233/* these two VIDEO_UPDATE()s will be joined one day */
240234static VIDEO_UPDATE( greatgun )
241235{
242
243236   UINT32 color_base=0;
244237
245238   if (game_id==MAZERBLA)
r4878r4879
248241   if (game_id==GREATGUN)
249242      color_base = 0x0;
250243
251//bitmap_fill(bitmap,NULL,0);
244//  bitmap_fill(bitmap,NULL,0);
252245
253246   copybitmap      (bitmap,tmpbitmaps[3],0,0,0,0,cliprect);
254247   copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,color_base);
r4878r4879
259252
260253static VIDEO_UPDATE( mazerbla )
261254{
262
263255   UINT32 color_base=0;
264256
265257   if (game_id==MAZERBLA)
r4878r4879
268260   if (game_id==GREATGUN)
269261      color_base = 0x0;
270262
271//bitmap_fill(bitmap,NULL,0);
263//  bitmap_fill(bitmap,NULL,0);
272264
273265   copybitmap      (bitmap,tmpbitmaps[3],0,0,0,0,cliprect); //text
274266   copybitmap_trans(bitmap,tmpbitmaps[2],0,0,0,0,cliprect,0);
r4878r4879
278270}
279271
280272
281static UINT8 zpu_int_vector;
282
283static WRITE8_HANDLER( cfb_zpu_int_req_set_w )
273static WRITE8_HANDLER( cfb_backgnd_color_w )
284274{
285   zpu_int_vector &= ~2;   /* clear D1 on INTA (interrupt acknowledge) */
286
287   cputag_set_input_line(space->machine, "maincpu", 0, ASSERT_LINE);   /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */
288}
289
290static READ8_HANDLER( cfb_zpu_int_req_clr )
291{
292   zpu_int_vector |= 2;
293
294   /* clear the INT line when there are no more interrupt requests */
295   if (zpu_int_vector == 0xff)
296      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
297
298   return 0;
299}
300
301
302static IRQ_CALLBACK(irq_callback)
303{
304/* all data lines are tied to +5V via 10K resistors */
305/* D1 is set to GND when INT comes from CFB */
306/* D2 is set to GND when INT comes from ZPU board - from 6850 on schematics (RS232 controller) */
307
308/* resulting vectors:
3091111 11000 (0xf8)
3101111 11010 (0xfa)
3111111 11100 (0xfc)
312
313note:
3141111 11110 (0xfe) - cannot happen and is not handled by game */
315
316   return (zpu_int_vector & ~1);   /* D0->GND is performed on CFB board */
317}
318
319
320
321static UINT8 ls670_0[4];
322static UINT8 ls670_1[4];
323
324static READ8_HANDLER( ls670_0_r )
325{
326   /* set a timer to force synchronization after the read */
327   timer_call_after_resynch(space->machine, NULL, 0, NULL);
328
329   return ls670_0[offset];
330}
331
332static TIMER_CALLBACK( deferred_ls670_0_w )
333{
334   int offset = (param>>8) & 255;
335   int data = param & 255;
336
337   ls670_0[offset] = data;
338}
339
340static WRITE8_HANDLER( ls670_0_w )
341{
342   /* do this on a timer to let the CPUs synchronize */
343   timer_call_after_resynch(space->machine, NULL, (offset<<8) | data, deferred_ls670_0_w);
344}
345
346
347
348static READ8_HANDLER( ls670_1_r )
349{
350   /* set a timer to force synchronization after the read */
351   timer_call_after_resynch(space->machine, NULL, 0, NULL);
352
353   return ls670_1[offset];
354}
355
356static TIMER_CALLBACK( deferred_ls670_1_w )
357{
358   int offset = (param>>8) & 255;
359   int data = param & 255;
360
361   ls670_1[offset] = data;
362}
363
364static WRITE8_HANDLER( ls670_1_w )
365{
366   /* do this on a timer to let the CPUs synchronize */
367   timer_call_after_resynch(space->machine, NULL, (offset<<8) | data, deferred_ls670_1_w);
368}
369
370
371/* bcd decoder used a input select (a mux) for reads from port 0x62 */
372static UINT8 bcd_7445 = 0;
373
374static WRITE8_HANDLER(zpu_bcd_decoder_w)
375{
376
377/*
378name:           Strobe(bcd_value)   BIT
379---------------------------------------
380ZPU switch 1    0                   6
381ZPU switch 2    0                   7
382
383dipsw 35        1                   7
384dipsw 34        1                   6
385dipsw 33        1                   5
386dipsw 32        1                   4
387dipsw 31        1                   3
388dipsw 30        1                   2
389dipsw 29        1                   1
390dipsw 28        1                   0
391dipsw 27        2                   7
392dipsw 26        2                   6
393...
394dipsw 8         4                   4
395dipsw 7         4                   3
396dipsw 6         4                   2
397dipsw 5         4                   1
398dipsw 4         4                   0
399
400Right Coin Sw.  5                   0
401Left Coin Sw.   5                   1
402Player One      5                   2
403Player Two      5                   3
404Fire Button     5                   4
405
406Horizontal movement of gun is Strobe 6, Bits 0-7.
407    Movement is from 0000 0000 to 1111 1111
408
409Vertical movement of gun is Strobe 7, Bits 0-7.
410    Movement is from 0000 0000 to 1111 1111
411
412
413Great Guns has two guns and here is necessary support for second gun:
414
415Horizontal movement of gun is Strobe 8, Bits 0-7.
416    Movement is from 0000 0000 to 1111 1111
417
418Vertical movement of gun is Strobe 9, Bits 0-7.
419    Movement is from 0000 0000 to 1111 1111
420
421*/
422   bcd_7445 = data & 15;
423}
424
425static READ8_HANDLER( zpu_inputs_r )
426{
427   static const char *const strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y", "STICK1_X", "STICK1_Y" };
428   UINT8 ret = 0;
429
430   if (bcd_7445<10)
431   {
432      ret = input_port_read(space->machine, strobenames[bcd_7445]);
433   }
434   return ret;
435}
436
437
438
439
440
441static WRITE8_HANDLER(zpu_led_w)
442{
443   /* 0x6e - reset (offset = 0)*/
444   /* 0x6f - set */
445   set_led_status(0, offset&1 );
446}
447static WRITE8_HANDLER(zpu_lamps_w)
448{
449   /* bit 4 = /LAMP0 */
450   /* bit 5 = /LAMP1 */
451
452   /*set_led_status(0, (data&0x10)>>4 );*/
453   /*set_led_status(1, (data&0x20)>>4 );*/
454}
455
456static WRITE8_HANDLER(zpu_coin_counter_w)
457{
458   /* bit 6 = coin counter */
459   coin_counter_w(offset, (data&0x40)>>6 );
460}
461
462static ADDRESS_MAP_START( mazerbla_map, ADDRESS_SPACE_PROGRAM, 8 )
463   AM_RANGE(0x0000, 0x7fff) AM_ROM
464   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE(1)
465   AM_RANGE(0xd800, 0xd800) AM_READ(cfb_zpu_int_req_clr)
466   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
467   AM_RANGE(0xe800, 0xefff) AM_RAM
468ADDRESS_MAP_END
469
470static ADDRESS_MAP_START( mazerbla_io_map, ADDRESS_SPACE_IO, 8 )
471   ADDRESS_MAP_GLOBAL_MASK(0xff)
472   AM_RANGE(0x4c, 0x4f) AM_READWRITE(ls670_1_r, ls670_0_w)
473   AM_RANGE(0x60, 0x60) AM_WRITE(zpu_bcd_decoder_w)
474   AM_RANGE(0x62, 0x62) AM_READ(zpu_inputs_r)
475   AM_RANGE(0x68, 0x68) AM_WRITE(zpu_coin_counter_w)
476   AM_RANGE(0x6a, 0x6a) AM_WRITE(zpu_lamps_w)
477   AM_RANGE(0x6e, 0x6f) AM_WRITE(zpu_led_w)
478ADDRESS_MAP_END
479
480
481static UINT8 vsb_ls273;
482static WRITE8_HANDLER( vsb_ls273_audio_control_w )
483{
484   vsb_ls273 = data;
485
486   /* bit 5 - led on */
487   set_led_status(1,(data&0x20)>>5);
488}
489
490
491
492
493static ADDRESS_MAP_START( mazerbla_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
494   AM_RANGE(0x0000, 0x1fff) AM_ROM
495   AM_RANGE(0x4000, 0x43ff) AM_RAM /* main RAM (stack) */
496   AM_RANGE(0x8000, 0x83ff) AM_RAM /* waveform ???*/
497ADDRESS_MAP_END
498
499static ADDRESS_MAP_START( mazerbla_cpu2_io_map, ADDRESS_SPACE_IO, 8 )
500   ADDRESS_MAP_GLOBAL_MASK(0xff)
501   AM_RANGE(0x00, 0x00) AM_WRITE(vsb_ls273_audio_control_w)
502   AM_RANGE(0x80, 0x83) AM_READWRITE(ls670_0_r, ls670_1_w)
503ADDRESS_MAP_END
504
505static WRITE8_HANDLER(cfb_led_w)
506{
507   /* bit 7 - led on */
508   set_led_status(2,(data&0x80)>>7);
509}
510
511
512static UINT8 bknd_col = 0xaa;
513static WRITE8_HANDLER(cfb_backgnd_color_w)
514{
515
516275   if (bknd_col != data)
517276   {
518277      int r,g,b, bit0, bit1, bit2;
r4878r4879
544303
545304static WRITE8_HANDLER(cfb_vbank_w)
546305{
547   data = (data & 0x40)>>6;   /* only bit 6 connected */
548   if (vbank != data)
549   {
550      vbank = data;
551      //logerror("vbank=%1x\n",vbank);
552   }
306   /* only bit 6 connected */
307   vbank = (data & 0x40)>>6;
553308}
554309
555310
r4878r4879
559314
560315   memory_set_bankptr(space->machine,  1, memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000 );
561316}
317
562318static WRITE8_HANDLER(cfb_rom_bank_sel_w_gg)   /* great guns */
563319{
564320   gfx_rom_bank = data>>1;
r4878r4879
567323}
568324
569325
570/* ????????????? */
571static UINT8 port02_status = 0;
326/* VCU status? */
572327static READ8_HANDLER( cfb_port_02_r )
573328{
574329   port02_status ^= 0xff;
575330   return (port02_status);
576331}
577332
578static UINT8 VCU_video_reg[4];
333
579334static WRITE8_HANDLER( VCU_video_reg_w )
580335{
581336   if (VCU_video_reg[offset] != data)
r4878r4879
590345{
591346   VCU_gfx_param_addr = offset;
592347
593                        /* offset  = 0 is not known */
348   /* offset  = 0 is not known */
594349   xpos      = cfb_ram[VCU_gfx_param_addr + 1] | (cfb_ram[VCU_gfx_param_addr + 2]<<8);
595350   ypos      = cfb_ram[VCU_gfx_param_addr + 3] | (cfb_ram[VCU_gfx_param_addr + 4]<<8);
596351   color     = cfb_ram[VCU_gfx_param_addr + 5];
r4878r4879
607362
608363static READ8_HANDLER( VCU_set_gfx_addr_r )
609364{
610int offs;
611int x,y;
612int bits = 0;
365   int offs;
366   int x,y;
367   int bits = 0;
613368
614UINT8 color_base=0;
369   UINT8 color_base=0;
615370
616UINT8 * rom = memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000;
371   UINT8 * rom = memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000;
617372
618373/*
619374    if ((mode<=0x07) || (mode>=0x10))
r4878r4879
636391
637392   VCU_gfx_addr = offset;
638393
639
640/* draw */
394   /* draw */
641395   offs = VCU_gfx_addr;
642396
643397   switch(mode)
644398   {
645   /* 2 bits per pixel */
646   case 0x0f:
647   case 0x0e:
648   case 0x0d:
649   case 0x0c:
650//if (dbg_gfx_e)
651//{
652   //if (vbank==dbg_vbank)
653   {
654      if (game_id==MAZERBLA)
655         color_base = 0x80;   /* 0x80 constant: matches Mazer Blazer movie */
399      /* 2 bits per pixel */
400      case 0x0f:
401      case 0x0e:
402      case 0x0d:
403      case 0x0c:
404//      if (dbg_gfx_e)
405//      {
406//          if (vbank==dbg_vbank)
407      {
408         if (game_id==MAZERBLA)
409            color_base = 0x80;   /* 0x80 constant: matches Mazer Blazer movie */
656410
657      if (game_id==GREATGUN)
658         color_base = 0x0;
411         if (game_id==GREATGUN)
412            color_base = 0x00;
659413
660      for (y = 0; y <= pix_ysize; y++)
661      {
662         for (x = 0; x <= pix_xsize; x++)
414         for (y = 0; y <= pix_ysize; y++)
663415         {
664            UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
665            UINT8 data = (pixeldata>>(6-(bits&7))) & 3;
666            UINT8 col = 0;
667
668            switch(data)
416            for (x = 0; x <= pix_xsize; x++)
669417            {
670            case 0:
671               col = color_base | ((color &0x0f));      //background PEN
672               break;
673            case 1:
674               col = color_base | ((color &0xf0)>>4);   //foreground PEN
675               break;
676            case 2:
677               col = color_base | ((color2 &0x0f));   //background PEN2
678               break;
679            case 3:
680               col = color_base | ((color2 &0xf0)>>4);   //foreground PEN2
681               break;
682            }
418               UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
419               UINT8 data = (pixeldata>>(6-(bits&7))) & 3;
420               UINT8 col = 0;
683421
684            if ( ((xpos+x)<256) && ((ypos+y)<256) )
685            {
686               *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col;
687            }
422               switch(data)
423               {
424                  case 0:
425                     col = color_base | ((color &0x0f));      //background PEN
426                     break;
427                  case 1:
428                     col = color_base | ((color &0xf0)>>4);   //foreground PEN
429                     break;
430                  case 2:
431                     col = color_base | ((color2 &0x0f));   //background PEN2
432                     break;
433                  case 3:
434                     col = color_base | ((color2 &0xf0)>>4);   //foreground PEN2
435                     break;
436               }
688437
689            bits+=2;
438               if ( ((xpos+x)<256) && ((ypos+y)<256) )
439                  *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col;
440
441               bits+=2;
442            }
690443         }
691444      }
692   }
693//}
694   break;
445//      }
446      break;
695447
696   /* 1 bit per pixel */
697   case 0x0b:/* verified - 1bpp ; used for 'cleaning' using color 0xff */
698   case 0x0a:/* verified - 1bpp */
699   case 0x09:/* verified - 1bpp: gun crosshair */
700   case 0x08:/* */
701//if (dbg_gfx_e)
702//{
703   //if (vbank==dbg_vbank)
704   {
705      if (game_id==MAZERBLA)
706         color_base = 0x80;   /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */
707
708      if (game_id==GREATGUN)
709         color_base = 0x0;   /* 0x00 - good for Great Guns: (both in game and CRT test mode) */
710      for (y = 0; y <= pix_ysize; y++)
448      /* 1 bit per pixel */
449      case 0x0b:/* verified - 1bpp ; used for 'cleaning' using color 0xff */
450      case 0x0a:/* verified - 1bpp */
451      case 0x09:/* verified - 1bpp: gun crosshair */
452      case 0x08:/* */
453//      if (dbg_gfx_e)
454//      {
455//          if (vbank==dbg_vbank)
711456      {
712         for (x = 0; x <= pix_xsize; x++)
713         {
714            UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
715            UINT8 data = (pixeldata>>(7-(bits&7))) & 1;
457         if (game_id==MAZERBLA)
458            color_base = 0x80;   /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */
716459
717            /* color = 4 MSB = front PEN, 4 LSB = background PEN */
460         if (game_id==GREATGUN)
461            color_base = 0x00;   /* 0x00 - good for Great Guns: (both in game and CRT test mode) */
718462
719            if ( ((xpos+x)<256) && ((ypos+y)<256) )
463         for (y = 0; y <= pix_ysize; y++)
464         {
465            for (x = 0; x <= pix_xsize; x++)
720466            {
721               *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = data? color_base | ((color&0xf0)>>4): color_base | ((color&0x0f));
722            }
467               UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
468               UINT8 data = (pixeldata>>(7-(bits&7))) & 1;
723469
724            bits+=1;
470               /* color = 4 MSB = front PEN, 4 LSB = background PEN */
471
472               if ( ((xpos+x)<256) && ((ypos+y)<256) )
473                  *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = data? color_base | ((color&0xf0)>>4): color_base | ((color&0x0f));
474
475               bits+=1;
476            }
725477         }
726478      }
727   }
728//}
729   break;
479//      }
480      break;
730481
731   /* 4 bits per pixel */
732   case 0x03:
733   case 0x01:
734   case 0x00:
735//if (dbg_gfx_e)
736//{
737   //if (vbank==dbg_vbank)
738   {
739      if (game_id==MAZERBLA)
740         color_base = 0x80;   /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */
482      /* 4 bits per pixel */
483      case 0x03:
484      case 0x01:
485      case 0x00:
486//      if (dbg_gfx_e)
487//      {
488//          if (vbank==dbg_vbank)
489      {
490         if (game_id==MAZERBLA)
491            color_base = 0x80;   /* 0x80 - good for Mazer Blazer: (only in game, CRT test mode is bad) */
741492
742      if (game_id==GREATGUN)
743         color_base = 0x0;   /* 0x00 - good for Great Guns: (both in game and CRT test mode) */
493         if (game_id==GREATGUN)
494            color_base = 0x00;   /* 0x00 - good for Great Guns: (both in game and CRT test mode) */
744495
745      for (y = 0; y <= pix_ysize; y++)
746      {
747         for (x = 0; x <= pix_xsize; x++)
496         for (y = 0; y <= pix_ysize; y++)
748497         {
749            UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
750            UINT8 data = (pixeldata>>(4-(bits&7))) & 15;
751            UINT8 col = 0;
498            for (x = 0; x <= pix_xsize; x++)
499            {
500               UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
501               UINT8 data = (pixeldata>>(4-(bits&7))) & 15;
502               UINT8 col = 0;
752503
753            col = color_base | data;
504               col = color_base | data;
754505
755            if ( ((xpos+x)<256) && ((ypos+y)<256) )
756            {
757               *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col;
758            }
506               if ( ((xpos+x)<256) && ((ypos+y)<256) )
507                  *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col;
759508
760            bits+=4;
509               bits+=4;
510            }
761511         }
762512      }
763   }
764//}
765   break;
513//      }
514      break;
766515   default:
767516      popmessage("not supported VCU drawing mode=%2x", mode);
768   break;
517      break;
769518   }
519
770520   return 0;
771521}
772522
773523static READ8_HANDLER( VCU_set_clr_addr_r )
774524{
775int offs;
776int x,y;
777int bits = 0;
525   int offs;
526   int x,y;
527   int bits = 0;
778528
779UINT8 color_base=0;
529   UINT8 color_base=0;
780530
781UINT8 * rom = memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000;
531   UINT8 * rom = memory_region(space->machine, "sub2") + (gfx_rom_bank * 0x2000) + 0x10000;
782532
783533/*
784534    //if (0) //(mode != 0x07)
r4878r4879
815565
816566   switch(mode)
817567   {
818   case 0x13: /* draws sprites?? in mazer blazer and ... wrong sprite in place of targeting-cross and UFO laser */
819   case 0x03:
820/* ... this may proove that there is really only one area and that
821 the draw command/palette selector is done via the 'mode' only ... */
822   //if (dbg_clr_e)
823   {
824      offs = VCU_gfx_addr;
568      case 0x13: /* draws sprites?? in mazer blazer and ... wrong sprite in place of targeting-cross and UFO laser */
569      case 0x03:
570      /* ... this may proove that there is really only one area and that
571           the draw command/palette selector is done via the 'mode' only ... */
572      //if (dbg_clr_e)
573      {
574         offs = VCU_gfx_addr;
825575
826      if (game_id==MAZERBLA)
827         color_base = 0x80;   /* 0x80 constant: matches Mazer Blazer movie */
576         if (game_id==MAZERBLA)
577            color_base = 0x80;   /* 0x80 constant: matches Mazer Blazer movie */
828578
829      if (game_id==GREATGUN)
830         color_base = 0x0;
579         if (game_id==GREATGUN)
580            color_base = 0x00;
831581
832      for (y = 0; y <= pix_ysize; y++)
833      {
834         for (x = 0; x <= pix_xsize; x++)
582         for (y = 0; y <= pix_ysize; y++)
835583         {
836            UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
837            UINT8 data = (pixeldata>>(6-(bits&7))) & 3;
838            UINT8 col = 0;
839
840            switch(data)
584            for (x = 0; x <= pix_xsize; x++)
841585            {
842            case 0:
843               col = color_base | ((color &0x0f));      //background PEN
844               break;
845            case 1:
846               col = color_base | ((color &0xf0)>>4);   //foreground PEN
847               break;
848            case 2:
849               col = color_base | ((color2 &0x0f));   //background PEN2
850               break;
851            case 3:
852               col = color_base | ((color2 &0xf0)>>4);   //foreground PEN2
853               break;
854            }
586               UINT8 pixeldata = rom[(offs + (bits>>3)) % 0x2000];
587               UINT8 data = (pixeldata>>(6-(bits&7))) & 3;
588               UINT8 col = 0;
855589
856            if ( ((xpos+x)<256) && ((ypos+y)<256) )
857            {
858               *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col;
859            }
590               switch(data)
591               {
592                  case 0:
593                     col = color_base | ((color &0x0f));      //background PEN
594                     break;
595                  case 1:
596                     col = color_base | ((color &0xf0)>>4);   //foreground PEN
597                     break;
598                  case 2:
599                     col = color_base | ((color2 &0x0f));   //background PEN2
600                     break;
601                  case 3:
602                     col = color_base | ((color2 &0xf0)>>4);   //foreground PEN2
603                     break;
604               }
860605
861            bits+=2;
606               if ( ((xpos+x)<256) && ((ypos+y)<256) )
607                  *BITMAP_ADDR16(tmpbitmaps[plane], ypos+y, xpos+x) = col;
608
609                  bits+=2;
610            }
862611         }
863612      }
864   }
865   break;
613      break;
866614
867/* Palette / "something else" write mode */
868   case 0x07:
869
615      /* Palette / "something else" write mode */
616      case 0x07:
870617      offs = offset;
871618
872619      switch(ypos)
873620      {
874      case 6: //seems to encode palete write
621         case 6: //seems to encode palette write
875622         {
876623            int r,g,b, bit0, bit1, bit2;
877624
878//pix_xsize and pix_ysize seem to be related to palette length ? (divide by 2)
625            //pix_xsize and pix_ysize seem to be related to palette length ? (divide by 2)
879626            int lookup_offs = (ypos>>1)*256; //=3*256
880627
881628            for (y=0; y<16; y++)
r4878r4879
908655               }
909656            }
910657         }
911      break;
912      case 4: //seems to encode lookup???? table write
658         break;
659         case 4: //seems to encode lookup???? table write
913660         {
914661            int lookup_offs = (ypos>>1)*256; //=2*256
915662
r4878r4879
922669               }
923670            }
924671         }
925      break;
926      case 2: //seems to encode lookup???? table write
672         break;
673         case 2: //seems to encode lookup???? table write
927674         {
928675            int lookup_offs = (ypos>>1)*256; //=1*256
929676
r4878r4879
936683               }
937684            }
938685         }
939      break;
940      case 0: //seems to encode lookup???? table write
686         break;
687         case 0: //seems to encode lookup???? table write
941688         {
942689            int lookup_offs = (ypos>>1)*256; //=0*256
943690
r4878r4879
950697               }
951698            }
952699         }
953      break;
700         break;
954701
955      default:
702         default:
956703         popmessage("not supported lookup/color write mode=%2x", ypos);
704         break;
705      }
957706      break;
958   }
959   break;
960707
961708   default:
962709      popmessage("not supported VCU color mode=%2x", mode);
963   break;
964
710      break;
965711   }
966712
967713   return 0;
968714}
969715
970static ADDRESS_MAP_START( mazerbla_cpu3_map, ADDRESS_SPACE_PROGRAM, 8 )
971   AM_RANGE(0x0000, 0x37ff) AM_ROM
972   AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE(1)
973   AM_RANGE(0x4000, 0x5fff) AM_ROMBANK(1)               /* GFX roms */
974   AM_RANGE(0x4000, 0x4003) AM_WRITE(VCU_video_reg_w)
975   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&cfb_ram)      /* Color Frame Buffer PCB, a.k.a. RAM for VCU commands and parameters */
976   AM_RANGE(0xa000, 0xa7ff) AM_READ(VCU_set_cmd_param_r)   /* VCU command and parameters LOAD */
977   AM_RANGE(0xc000, 0xdfff) AM_READ(VCU_set_gfx_addr_r)   /* gfx LOAD (blit) */
978   AM_RANGE(0xe000, 0xffff) AM_READ(VCU_set_clr_addr_r)   /* palette? LOAD */
979ADDRESS_MAP_END
716/*************************************
717 *
718 *  IRQ & Timer handlers
719 *
720 *************************************/
980721
981static ADDRESS_MAP_START( mazerbla_cpu3_io_map, ADDRESS_SPACE_IO, 8 )
982   ADDRESS_MAP_GLOBAL_MASK(0xff)
983   AM_RANGE(0x01, 0x01) AM_WRITE(cfb_backgnd_color_w)
984   AM_RANGE(0x02, 0x02) AM_READWRITE(cfb_port_02_r, cfb_led_w)   /* Read = VCU status ? */
985   AM_RANGE(0x03, 0x03) AM_WRITE(cfb_zpu_int_req_set_w)
986   AM_RANGE(0x04, 0x04) AM_WRITE(cfb_rom_bank_sel_w)
987   AM_RANGE(0x05, 0x05) AM_WRITE(cfb_vbank_w)   //visible/writable videopage select?
988ADDRESS_MAP_END
722static WRITE8_HANDLER( cfb_zpu_int_req_set_w )
723{
724   zpu_int_vector &= ~2;   /* clear D1 on INTA (interrupt acknowledge) */
989725
726   cputag_set_input_line(space->machine, "maincpu", 0, ASSERT_LINE);   /* main cpu interrupt (comes from CFB (generated at the start of INT routine on CFB) - vblank?) */
727}
990728
991/* Great Guns */
729static READ8_HANDLER( cfb_zpu_int_req_clr )
730{
731   zpu_int_vector |= 2;
992732
993static UINT8 soundlatch;
733   /* clear the INT line when there are no more interrupt requests */
734   if (zpu_int_vector == 0xff)
735      cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
994736
737   return 0;
738}
739
740static READ8_HANDLER( ls670_0_r )
741{
742   /* set a timer to force synchronization after the read */
743   timer_call_after_resynch(space->machine, NULL, 0, NULL);
744
745   return ls670_0[offset];
746}
747
748static TIMER_CALLBACK( deferred_ls670_0_w )
749{
750   int offset = (param>>8) & 255;
751   int data = param & 255;
752
753   ls670_0[offset] = data;
754}
755
756static WRITE8_HANDLER( ls670_0_w )
757{
758   /* do this on a timer to let the CPUs synchronize */
759   timer_call_after_resynch(space->machine, NULL, (offset<<8) | data, deferred_ls670_0_w);
760}
761
762static READ8_HANDLER( ls670_1_r )
763{
764   /* set a timer to force synchronization after the read */
765   timer_call_after_resynch(space->machine, NULL, 0, NULL);
766
767   return ls670_1[offset];
768}
769
770static TIMER_CALLBACK( deferred_ls670_1_w )
771{
772   int offset = (param>>8) & 255;
773   int data = param & 255;
774
775   ls670_1[offset] = data;
776}
777
778static WRITE8_HANDLER( ls670_1_w )
779{
780   /* do this on a timer to let the CPUs synchronize */
781   timer_call_after_resynch(space->machine, NULL, (offset<<8) | data, deferred_ls670_1_w);
782}
783
784
785/*************************************
786 *
787 *  I/O
788 *
789 *************************************/
790
791/*
792name:           Strobe(bcd_value)   BIT
793---------------------------------------
794ZPU switch 1    0                   6
795ZPU switch 2    0                   7
796
797dipsw 35        1                   7
798dipsw 34        1                   6
799dipsw 33        1                   5
800dipsw 32        1                   4
801dipsw 31        1                   3
802dipsw 30        1                   2
803dipsw 29        1                   1
804dipsw 28        1                   0
805dipsw 27        2                   7
806dipsw 26        2                   6
807...
808dipsw 8         4                   4
809dipsw 7         4                   3
810dipsw 6         4                   2
811dipsw 5         4                   1
812dipsw 4         4                   0
813
814Right Coin Sw.  5                   0
815Left Coin Sw.   5                   1
816Player One      5                   2
817Player Two      5                   3
818Fire Button     5                   4
819
820Horizontal movement of gun is Strobe 6, Bits 0-7.
821    Movement is from 0000 0000 to 1111 1111
822
823Vertical movement of gun is Strobe 7, Bits 0-7.
824    Movement is from 0000 0000 to 1111 1111
825
826
827Great Guns has two guns and here is necessary support for second gun:
828
829Horizontal movement of gun is Strobe 8, Bits 0-7.
830    Movement is from 0000 0000 to 1111 1111
831
832Vertical movement of gun is Strobe 9, Bits 0-7.
833    Movement is from 0000 0000 to 1111 1111
834
835*/
836
837static WRITE8_HANDLER( zpu_bcd_decoder_w )
838{
839   /* bcd decoder used a input select (a mux) for reads from port 0x62 */
840   bcd_7445 = data & 0xf;
841}
842
843static READ8_HANDLER( zpu_inputs_r )
844{
845   static const char *const strobenames[] = { "ZPU", "DSW0", "DSW1", "DSW2", "DSW3", "BUTTONS", "STICK0_X", "STICK0_Y",
846                                              "STICK1_X", "STICK1_Y", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED", "UNUSED" };
847
848   UINT8 ret = 0;
849
850   ret = input_port_read(space->machine, strobenames[bcd_7445]);
851
852   return ret;
853}
854
855static WRITE8_HANDLER( zpu_led_w )
856{
857   /* 0x6e - reset (offset = 0)*/
858   /* 0x6f - set */
859   set_led_status(0, offset&1 );
860}
861
862static WRITE8_HANDLER( zpu_lamps_w)
863{
864   /* bit 4 = /LAMP0 */
865   /* bit 5 = /LAMP1 */
866
867   /*set_led_status(0, (data&0x10)>>4 );*/
868   /*set_led_status(1, (data&0x20)>>4 );*/
869}
870
871static WRITE8_HANDLER( zpu_coin_counter_w )
872{
873   /* bit 6 = coin counter */
874   coin_counter_w(offset, (data&0x40)>>6 );
875}
876
877static WRITE8_HANDLER(cfb_led_w)
878{
879   /* bit 7 - led on */
880   set_led_status(2,(data&0x80)>>7);
881}
882
883static WRITE8_DEVICE_HANDLER( gg_led_ctrl_w )
884{
885   /* bit 0, bit 1 - led on */
886   set_led_status(1,data&0x01);
887}
888
889
890/*************************************
891 *
892 *  Sound comms
893 *
894 *************************************/
895
896static WRITE8_HANDLER( vsb_ls273_audio_control_w )
897{
898   vsb_ls273 = data;
899
900   /* bit 5 - led on */
901   set_led_status(1,(data&0x20)>>5);
902}
903
995904static READ8_DEVICE_HANDLER( soundcommand_r )
996905{
997906   return soundlatch;
r4878r4879
1005914   cputag_set_input_line(machine, "sub", INPUT_LINE_NMI, ASSERT_LINE);
1006915}
1007916
1008
1009917static WRITE8_HANDLER( main_sound_w )
1010918{
1011919   timer_call_after_resynch(space->machine, NULL, data & 0xff, delayed_sound_w);
1012920}
1013921
922static WRITE8_HANDLER( sound_int_clear_w )
923{
924   cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
925}
1014926
927static WRITE8_HANDLER( sound_nmi_clear_w )
928{
929   cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE);
930}
931
932
933/*************************************
934 *
935 *  Memory Maps (Mazer Blazer)
936 *
937 *************************************/
938
939static ADDRESS_MAP_START( mazerbla_map, ADDRESS_SPACE_PROGRAM, 8 )
940   AM_RANGE(0x0000, 0x7fff) AM_ROM
941   AM_RANGE(0xc000, 0xc7ff) AM_RAM AM_SHARE(1)
942   AM_RANGE(0xd800, 0xd800) AM_READ(cfb_zpu_int_req_clr)
943   AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
944   AM_RANGE(0xe800, 0xefff) AM_RAM
945ADDRESS_MAP_END
946
947static ADDRESS_MAP_START( mazerbla_io_map, ADDRESS_SPACE_IO, 8 )
948   ADDRESS_MAP_GLOBAL_MASK(0xff)
949   AM_RANGE(0x4c, 0x4f) AM_READWRITE(ls670_1_r, ls670_0_w)
950   AM_RANGE(0x60, 0x60) AM_WRITE(zpu_bcd_decoder_w)
951   AM_RANGE(0x62, 0x62) AM_READ(zpu_inputs_r)
952   AM_RANGE(0x68, 0x68) AM_WRITE(zpu_coin_counter_w)
953   AM_RANGE(0x6a, 0x6a) AM_WRITE(zpu_lamps_w)
954   AM_RANGE(0x6e, 0x6f) AM_WRITE(zpu_led_w)
955ADDRESS_MAP_END
956
957static ADDRESS_MAP_START( mazerbla_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 )
958   AM_RANGE(0x0000, 0x1fff) AM_ROM
959   AM_RANGE(0x4000, 0x43ff) AM_RAM /* main RAM (stack) */
960   AM_RANGE(0x8000, 0x83ff) AM_RAM /* waveform ???*/
961ADDRESS_MAP_END
962
963static ADDRESS_MAP_START( mazerbla_cpu2_io_map, ADDRESS_SPACE_IO, 8 )
964   ADDRESS_MAP_GLOBAL_MASK(0xff)
965   AM_RANGE(0x00, 0x00) AM_WRITE(vsb_ls273_audio_control_w)
966   AM_RANGE(0x80, 0x83) AM_READWRITE(ls670_0_r, ls670_1_w)
967ADDRESS_MAP_END
968
969static ADDRESS_MAP_START( mazerbla_cpu3_map, ADDRESS_SPACE_PROGRAM, 8 )
970   AM_RANGE(0x0000, 0x37ff) AM_ROM
971   AM_RANGE(0x3800, 0x3fff) AM_RAM AM_SHARE(1)
972   AM_RANGE(0x4000, 0x5fff) AM_ROMBANK(1)               /* GFX roms */
973   AM_RANGE(0x4000, 0x4003) AM_WRITE(VCU_video_reg_w)
974   AM_RANGE(0x6000, 0x67ff) AM_RAM AM_BASE(&cfb_ram)      /* Color Frame Buffer PCB, a.k.a. RAM for VCU commands and parameters */
975   AM_RANGE(0xa000, 0xa7ff) AM_READ(VCU_set_cmd_param_r)   /* VCU command and parameters LOAD */
976   AM_RANGE(0xc000, 0xdfff) AM_READ(VCU_set_gfx_addr_r)   /* gfx LOAD (blit) */
977   AM_RANGE(0xe000, 0xffff) AM_READ(VCU_set_clr_addr_r)   /* palette? LOAD */
978ADDRESS_MAP_END
979
980static ADDRESS_MAP_START( mazerbla_cpu3_io_map, ADDRESS_SPACE_IO, 8 )
981   ADDRESS_MAP_GLOBAL_MASK(0xff)
982   AM_RANGE(0x01, 0x01) AM_WRITE(cfb_backgnd_color_w)
983   AM_RANGE(0x02, 0x02) AM_READWRITE(cfb_port_02_r, cfb_led_w)   /* Read = VCU status ? */
984   AM_RANGE(0x03, 0x03) AM_WRITE(cfb_zpu_int_req_set_w)
985   AM_RANGE(0x04, 0x04) AM_WRITE(cfb_rom_bank_sel_w)
986   AM_RANGE(0x05, 0x05) AM_WRITE(cfb_vbank_w)   //visible/writable videopage select?
987ADDRESS_MAP_END
988
989
990/*************************************
991 *
992 *  Memory Maps (Great Guns)
993 *
994 *************************************/
995
1015996static ADDRESS_MAP_START( greatgun_io_map, ADDRESS_SPACE_IO, 8 )
1016997   ADDRESS_MAP_GLOBAL_MASK(0xff)
1017998   AM_RANGE(0x4c, 0x4c) AM_WRITE(main_sound_w)
r4878r4879
10331014   AM_RANGE(0x05, 0x05) AM_WRITE(cfb_vbank_w)   //visible/writable videopage select?
10341015ADDRESS_MAP_END
10351016
1036/* frequency is 14.318 MHz/16/16/16/16 */
1037static INTERRUPT_GEN( sound_interrupt )
1038{
1039   cpu_set_input_line(device, 0, ASSERT_LINE);
1040}
1041
1042static WRITE8_HANDLER( sound_int_clear_w )
1043{
1044   cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
1045}
1046static WRITE8_HANDLER( sound_nmi_clear_w )
1047{
1048   cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE);
1049}
1050
1051static WRITE8_DEVICE_HANDLER( gg_led_ctrl_w )
1052{
1053   /* bit 0, bit 1 - led on */
1054   set_led_status(1,data&0x01);
1055}
1056
10571017static ADDRESS_MAP_START( greatgun_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
10581018   AM_RANGE(0x0000, 0x1fff) AM_ROM
10591019   AM_RANGE(0x2000, 0x27ff) AM_RAM
r4878r4879
10651025ADDRESS_MAP_END
10661026
10671027
1028/*************************************
1029 *
1030 *  Input Port Definitions
1031 *
1032 *************************************/
10681033
10691034static INPUT_PORTS_START( mazerbla )
10701035   PORT_START("ZPU")   /* Strobe 0: ZPU Switches */
r4878r4879
12061171   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_REVERSE PORT_PLAYER(2)
12071172   PORT_START("STICK1_Y")   /* Strobe 9: vertical movement of gun */
12081173   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(2)
1174
1175   PORT_START("UNUSED")
1176   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
12091177INPUT_PORTS_END
12101178
12111179static INPUT_PORTS_START( greatgun )
r4878r4879
13531321   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(2)
13541322   PORT_START("STICK1_Y")   /* Strobe 9: vertical movement of gun */
13551323   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(25) PORT_KEYDELTA(7) PORT_PLAYER(2)
1324
1325   PORT_START("UNUSED")
1326   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
13561327INPUT_PORTS_END
13571328
1329/*************************************
1330 *
1331 *  Sound HW Configs
1332 *
1333 *************************************/
13581334
1335/* only Great Guns */
1336static const ay8910_interface ay8912_interface_1 =
1337{
1338   AY8910_LEGACY_OUTPUT,
1339   AY8910_DEFAULT_LOADS,
1340   DEVCB_NULL,
1341   DEVCB_HANDLER(soundcommand_r),
1342   DEVCB_NULL,
1343   DEVCB_NULL
1344};
13591345
1346static const ay8910_interface ay8912_interface_2 =
1347{
1348   AY8910_LEGACY_OUTPUT,
1349   AY8910_DEFAULT_LOADS,
1350   DEVCB_NULL,
1351   DEVCB_NULL,
1352   DEVCB_NULL,
1353   DEVCB_HANDLER(gg_led_ctrl_w)
1354};
13601355
1356static IRQ_CALLBACK(irq_callback)
1357{
1358   /* all data lines are tied to +5V via 10K resistors */
1359   /* D1 is set to GND when INT comes from CFB */
1360   /* D2 is set to GND when INT comes from ZPU board - from 6850 on schematics (RS232 controller) */
1361
1362   /* resulting vectors:
1363    1111 11000 (0xf8)
1364    1111 11010 (0xfa)
1365    1111 11100 (0xfc)
1366
1367    note:
1368    1111 11110 (0xfe) - cannot happen and is not handled by game */
1369
1370   return (zpu_int_vector & ~1);   /* D0->GND is performed on CFB board */
1371}
1372
1373/* frequency is 14.318 MHz/16/16/16/16 */
1374static INTERRUPT_GEN( sound_interrupt )
1375{
1376   cpu_set_input_line(device, 0, ASSERT_LINE);
1377}
1378
1379
1380/*************************************
1381 *
1382 *  Machine driver definitions
1383 *
1384 *************************************/
1385
13611386static MACHINE_RESET( mazerbla )
13621387{
13631388   game_id = MAZERBLA;
r4878r4879
13741399   cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback);
13751400
13761401
1377//patch VCU test
1378//VCU test starts at PC=0x56f
1402//  patch VCU test
1403//  VCU test starts at PC=0x56f
13791404   rom[0x05b6] = 0;
13801405   rom[0x05b7] = 0;
1381//so we also need to patch ROM checksum test
1406//  so we also need to patch ROM checksum test
13821407   rom[0x037f] = 0;
13831408   rom[0x0380] = 0;
13841409}
13851410
1386
1387/* only Great Guns */
1388static const ay8910_interface ay8912_interface_1 =
1389{
1390   AY8910_LEGACY_OUTPUT,
1391   AY8910_DEFAULT_LOADS,
1392   DEVCB_NULL,
1393   DEVCB_HANDLER(soundcommand_r),
1394   DEVCB_NULL,
1395   DEVCB_NULL
1396};
1397
1398static const ay8910_interface ay8912_interface_2 =
1399{
1400   AY8910_LEGACY_OUTPUT,
1401   AY8910_DEFAULT_LOADS,
1402   DEVCB_NULL,
1403   DEVCB_NULL,
1404   DEVCB_NULL,
1405   DEVCB_HANDLER(gg_led_ctrl_w)
1406};
1407
1408
14091411static MACHINE_DRIVER_START( mazerbla )
14101412   /* basic machine hardware */
1411   MDRV_CPU_ADD("maincpu", Z80, 4000000)   /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */
1413   MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK)   /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */
14121414   MDRV_CPU_PROGRAM_MAP(mazerbla_map)
14131415   MDRV_CPU_IO_MAP(mazerbla_io_map)
14141416
1415   MDRV_CPU_ADD("sub", Z80, 4000000)   /* 4 MHz, NMI, IM1 INT */
1417   MDRV_CPU_ADD("sub", Z80, MASTER_CLOCK)   /* 4 MHz, NMI, IM1 INT */
14161418   MDRV_CPU_PROGRAM_MAP(mazerbla_cpu2_map)
14171419   MDRV_CPU_IO_MAP(mazerbla_cpu2_io_map)
1418//MDRV_CPU_PERIODIC_INT(irq0_line_hold, 400 ) /* frequency in Hz */
1420//  MDRV_CPU_PERIODIC_INT(irq0_line_hold, 400 ) /* frequency in Hz */
14191421
1420   MDRV_CPU_ADD("sub2", Z80, 4000000)   /* 4 MHz, no  NMI, IM1 INT */
1422   MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK)   /* 4 MHz, no  NMI, IM1 INT */
14211423   MDRV_CPU_PROGRAM_MAP(mazerbla_cpu3_map)
14221424   MDRV_CPU_IO_MAP(mazerbla_cpu3_io_map)
14231425/* (vblank related ??) int generated by a custom video processor
1424and cleared on ANY port access.
1425but handled differently for now
1426*/
1426    and cleared on ANY port access.
1427    but handled differently for now
1428    */
14271429   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
14281430
14291431   /* synchronization forced on the fly */
1430
14311432   MDRV_MACHINE_RESET(mazerbla)
14321433
14331434   /* video hardware */
r4878r4879
14511452static MACHINE_DRIVER_START( greatgun )
14521453
14531454   /* basic machine hardware */
1454   MDRV_CPU_ADD("maincpu", Z80, 4000000)   /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */
1455   MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK)   /* 4 MHz, no NMI, IM2 - vectors at 0xf8, 0xfa, 0xfc */
14551456   MDRV_CPU_PROGRAM_MAP(mazerbla_map)
14561457   MDRV_CPU_IO_MAP(greatgun_io_map)
14571458
1458   MDRV_CPU_ADD("sub", Z80, 14318000 / 4)   /* 3.579500 MHz, NMI - caused by sound command write, periodic INT */
1459   MDRV_CPU_ADD("sub", Z80, SOUND_CLOCK / 4)   /* 3.579500 MHz, NMI - caused by sound command write, periodic INT */
14591460   MDRV_CPU_PROGRAM_MAP(greatgun_sound_map)
14601461   MDRV_CPU_PERIODIC_INT(sound_interrupt, (double)14318180/16/16/16/16 )
14611462
1462   MDRV_CPU_ADD("sub2", Z80, 4000000)   /* 4 MHz, no  NMI, IM1 INT */
1463   MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK)   /* 4 MHz, no  NMI, IM1 INT */
14631464   MDRV_CPU_PROGRAM_MAP(mazerbla_cpu3_map)
14641465   MDRV_CPU_IO_MAP(greatgun_cpu3_io_map)
14651466/* (vblank related ??) int generated by a custom video processor
1466and cleared on ANY port access.
1467but handled differently for now
1468*/
1467    and cleared on ANY port access.
1468    but handled differently for now
1469    */
14691470   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
14701471
14711472   MDRV_MACHINE_RESET(greatgun)
r4878r4879
14871488   /* sound hardware */
14881489   MDRV_SPEAKER_STANDARD_MONO("mono")
14891490
1490   MDRV_SOUND_ADD("ay1", AY8910, 14318000 / 8)
1491   MDRV_SOUND_ADD("ay1", AY8910, SOUND_CLOCK / 8)
14911492   MDRV_SOUND_CONFIG(ay8912_interface_1)
14921493   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
14931494
1494   MDRV_SOUND_ADD("ay2", AY8910, 14318000 / 8)
1495   MDRV_SOUND_ADD("ay2", AY8910, SOUND_CLOCK / 8)
14951496   MDRV_SOUND_CONFIG(ay8912_interface_2)
14961497   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
14971498MACHINE_DRIVER_END
14981499
1500/*************************************
1501 *
1502 *  Game driver(s)
1503 *
1504 *************************************/
14991505
1500/***************************************************************************
1501
1502  Game driver(s)
1503
1504***************************************************************************/
1505
15061506ROM_START( mazerbla )
15071507   ROM_REGION( 0x10000, "maincpu", 0 )     /* 64k for main CPU (ZPU board) */
15081508   ROM_LOAD( "mblzpu0.1h",0x0000, 0x2000, CRC(82766187) SHA1(cfc425c87cccb84180f1091998eafeaede126d9d) )
r4878r4879
15351535
15361536   ROM_REGION( 0x00240, "pals", 0 )
15371537   ROM_LOAD( "pal16r8.7d", 0x0000, 0x098, NO_DUMP ) /* pal on zpu board, for ?protection? (similar to bagman?) */
1538
15391538ROM_END
15401539
15411540ROM_START( mzrblzra )
r4878r4879
16071606   ROM_LOAD( "psb17",0x32000,0x2000, CRC(d9778e85) SHA1(2998f0a08cdba8a75e687a54cb9a03edeb4b22cd) )
16081607   ROM_LOAD( "psb18",0x34000,0x2000, CRC(ef61b6c0) SHA1(7e8a82beefb9fd8e219fc4d7d25a3a43ab8aadf7) )
16091608   ROM_LOAD( "psb19",0x36000,0x2000, CRC(68752e0d) SHA1(58a4921e4f774af5e1ef7af67f06e9b43643ffab) )
1610
16111609ROM_END
16121610
16131611
1614GAME( 1983, mazerbla, 0,        mazerbla,  mazerbla, 0, ROT0, "Stern", "Mazer Blazer (set 1)", GAME_IMPERFECT_GRAPHICS |GAME_NO_SOUND | GAME_NOT_WORKING )
1615GAME( 1983, mzrblzra, mazerbla, mazerbla,  mazerbla, 0, ROT0, "Stern", "Mazer Blazer (set 2)", GAME_IMPERFECT_GRAPHICS |GAME_NO_SOUND | GAME_NOT_WORKING )
1612GAME( 1983, mazerbla, 0,        mazerbla,  mazerbla, 0, ROT0, "Stern", "Mazer Blazer (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING )
1613GAME( 1983, mzrblzra, mazerbla, mazerbla,  mazerbla, 0, ROT0, "Stern", "Mazer Blazer (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING )
16161614GAME( 1983, greatgun, 0,        greatgun,  greatgun, 0, ROT0, "Stern", "Great Guns", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
src/mame/drivers/goldstar.c
r4878r4879
1212  Driver by Mirko Buffoni.
1313  Additional Work: David Haywood & Roberto Fresca.
1414
15  The vast majority of the sets in here are probably bootlegs and hacks
16  hence the slightly different PCBs, rom layouts, slightly hacked program roms
17  etc.
1518
1619****************************************************************************
1720
r4878r4879
195198//      popmessage("ncb3_port81_w %02x\n",data);
196199}
197200
198// where is colour bank for 'all blue' in attract?
201
199202static ADDRESS_MAP_START( ncb3_map, ADDRESS_SPACE_PROGRAM, 8 )
200203   AM_RANGE(0x0000, 0xb7ff) AM_ROM
201204   AM_RANGE(0xb800, 0xbfff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
r4878r4879
211214
212215   AM_RANGE(0xf800, 0xf803) AM_DEVREADWRITE("ppi8255_0", ppi8255_r, ppi8255_w)   /* Input Ports */
213216   AM_RANGE(0xf810, 0xf813) AM_DEVREADWRITE("ppi8255_1", ppi8255_r, ppi8255_w)   /* Input Ports */
217   AM_RANGE(0xf822, 0xf822) AM_WRITE(goldstar_fa00_w) // hack (connected to ppi output port?, needed for colour banking)
214218   AM_RANGE(0xf820, 0xf823) AM_DEVREADWRITE("ppi8255_2", ppi8255_r, ppi8255_w)   /* Input/Output Ports */
219
215220   AM_RANGE(0xf830, 0xf830) AM_DEVREADWRITE("ay", ay8910_r, ay8910_data_w)
216221   AM_RANGE(0xf840, 0xf840) AM_DEVWRITE("ay", ay8910_address_w)
217222//  AM_RANGE(0xf850, 0xf850) AM_WRITE(ncb3_p1_flip_w)   // need flip?
r4878r4879
449454ADDRESS_MAP_END
450455
451456
457static ADDRESS_MAP_START( unkch_map, ADDRESS_SPACE_PROGRAM, 8 )
458   AM_RANGE(0x0000, 0x9fff) AM_ROM
459   AM_RANGE(0xc000, 0xc1ff) AM_READWRITE(SMH_RAM,paletteram_xBBBBBGGGGGRRRRR_split1_w) AM_BASE(&paletteram)
460   AM_RANGE(0xc800, 0xc9ff) AM_READWRITE(SMH_RAM,paletteram_xBBBBBGGGGGRRRRR_split2_w) AM_BASE(&paletteram_2)
461   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&nvram) AM_SIZE(&nvram_size)
462   AM_RANGE(0xe000, 0xffff) AM_RAM
463ADDRESS_MAP_END
464
465
452466static INPUT_PORTS_START( cmv801 )
453467   PORT_START("IN0")
454468   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
r4878r4879
41934207   GFXDECODE_ENTRY( "reelgfx", 0, tiles8x32_4bpp_layout, 0, 16 )
41944208GFXDECODE_END
41954209
4210static const gfx_layout tiles8x8x3_miss1bpp_layout =
4211{
4212   8,8,
4213   RGN_FRAC(1,1),
4214   3,
4215   { 1,2,3 },
4216   {  8,12,0,4,24,28,16,20 },
4217   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
4218   8*32
4219};
41964220
4221static const gfx_layout tiles8x8x4alt_layout =
4222{
4223   8,8,
4224   RGN_FRAC(1,1),
4225   4,
4226   { 0, 1,2,3 },
4227   {  4,0,12,8,20,16,28,24 },
4228   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 },
4229   8*32
4230};
4231
4232static const gfx_layout tiles8x32x4alt2_layout =
4233{
4234   8,32,
4235   RGN_FRAC(1,1),
4236   4,
4237   { 0, 1,2,3 },
4238   {  4,0,12,8,20,16,28,24 },
4239   { STEP32(0,32) },
4240   32*32
4241};
4242
4243
4244static GFXDECODE_START( unkch )
4245   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x4alt_layout, 0, 16 )
4246   GFXDECODE_ENTRY( "gfx2", 0, tiles8x32x4alt2_layout, 128, 8 )
4247GFXDECODE_END
4248
4249static const gfx_layout tilescherrys_layout =
4250{
4251   8,32,
4252   RGN_FRAC(1,1),
4253   4,
4254   { 3,2,1,0 },
4255   {  8,12,0,4,24,28,16,20 },
4256   { STEP32(0,32) },
4257   32*32
4258};
4259
4260static GFXDECODE_START(cherrys )
4261   GFXDECODE_ENTRY( "gfx1", 0, tiles8x8x3_miss1bpp_layout,   0, 16 )
4262   GFXDECODE_ENTRY( "gfx2", 0, tilescherrys_layout, 128,  8 )
4263GFXDECODE_END
4264
4265
4266
41974267/*************************************
41984268*      PPI 8255 (x3) Interfaces      *
41994269*************************************/
r4878r4879
49995069MACHINE_DRIVER_END
50005070
50015071
5072VIDEO_START( unkch )
5073{
5074
5075}
5076
5077VIDEO_UPDATE( unkch )
5078{
5079   return 0;
5080}
5081
5082static MACHINE_DRIVER_START( unkch )
5083
5084   /* basic machine hardware */
5085   MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK)
5086   MDRV_CPU_PROGRAM_MAP(unkch_map)
5087   //MDRV_CPU_IO_MAP(ncb3_readwriteport)
5088   //MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
5089   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
5090
5091   /* video hardware */
5092   MDRV_SCREEN_ADD("screen", RASTER)
5093   MDRV_SCREEN_REFRESH_RATE(60)
5094//  MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
5095   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
5096   MDRV_SCREEN_SIZE(64*8, 32*8)
5097   MDRV_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 2*8, 30*8-1)
5098
5099   MDRV_GFXDECODE(unkch)
5100   MDRV_PALETTE_LENGTH(512)
5101
5102   //MDRV_NVRAM_HANDLER(goldstar)
5103
5104   MDRV_VIDEO_START(unkch)
5105   MDRV_VIDEO_UPDATE(unkch)
5106
5107   /* sound hardware */
5108   MDRV_SPEAKER_STANDARD_MONO("mono")
5109
5110   MDRV_SOUND_ADD("ay", AY8910, AY_CLOCK)
5111   MDRV_SOUND_CONFIG(ay8910_config)
5112   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
5113MACHINE_DRIVER_END
5114
5115static MACHINE_DRIVER_START( cherrys )
5116
5117   MDRV_IMPORT_FROM(ncb3)
5118   MDRV_GFXDECODE(cherrys)
5119
5120MACHINE_DRIVER_END
5121
50025122/***************************************************************************
50035123
50045124  Game driver(s)
r4878r4879
52575377ROM_END
52585378
52595379
5380ROM_START( cb3b )
5381   ROM_REGION( 0x10000, "maincpu", 0 )
5382   ROM_LOAD( "adatabin.bin",   0x00000, 0x10000,  CRC(db583c1b) SHA1(ea733e625922d6064ee4d8ceee4acfa6c1c7337e) )
52605383
5384   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE )
5385   ROM_LOAD( "adatabin_2.bin",   0x00000, 0x10000, CRC(48fd96fb) SHA1(193ed2be51555af80a9f0478139f28963e9d0c5e) )
5386   ROM_LOAD( "adatabin_3.bin",   0x10000, 0x10000, CRC(010462df) SHA1(53dd3060097f964c516d1cc5be2403a9bd5ee434) )
5387
5388   ROM_REGION( 0x08000, "gfx2", ROMREGION_DISPOSE )
5389   ROM_LOAD( "adatabin_4.bin",   0x00000, 0x08000, CRC(3cb4642a) SHA1(8db03c0227836d988e99f6fe4719d871ea3749ca) )
5390
5391   ROM_REGION( 0x0200, "proms", ROMREGION_DISPOSE )   /* PROM from chrygld - wasn't in this set, is it correct?, none of the other proms have the colours? */
5392   ROM_LOAD( "82s147.u2",      0x00000, 0x0200, BAD_DUMP CRC(5c8f2b8f) SHA1(67d2121e75813dd85d83858c5fc5ec6ad9cc2a7d) )
5393
5394   ROM_REGION( 0x0200, "proms2", ROMREGION_DISPOSE )   /* other roms */
5395   ROM_LOAD( "adatabin_1.bin",      0x00000, 0x020, CRC(87dbc339) SHA1(e5c67bc29612c8ab93857639e46608a814d471f5) )
5396   ROM_LOAD( "adatabin_5.bin",      0x00000, 0x180, CRC(ad267b0c) SHA1(a4cfec15ae0cde7d4fb8c278e977995680779058) )
5397   ROM_LOAD( "adatabin_6.bin",      0x00000, 0x010, CRC(f3d9ed7a) SHA1(594fef6323530f68c7303dcdea77b44c331e5113) )
5398   ROM_LOAD( "adatabin_0.bin",      0x00000, 0x100, CRC(f566e5e0) SHA1(754f04521b9eb73b34fe3de07e8f3679d1034870) )
5399ROM_END
5400
5401
5402
52615403ROM_START( cmv801 )
52625404   ROM_REGION( 0x10000, "maincpu", 0 )
52635405   ROM_LOAD( "prg512",   0x0000, 0x10000, CRC(2f6e3fe9) SHA1(c5ffa51478a0dc2d8ff6a0f286cfb461011bb55d) )
r4878r4879
70907232ROM_END
70917233
70927234
7235
7236ROM_START( unkch1 )
7237   ROM_REGION( 0x10000, "maincpu", 0 )
7238   ROM_LOAD( "u6.bin",  0x0000, 0x10000, CRC(30309996) SHA1(290f35f587fdf78dcb4f09403c510deec533c9c2) )
7239
7240   ROM_REGION( 0x20000, "gfx1", 0 )
7241   ROM_LOAD( "u29.bin", 0x00000, 0x20000, CRC(6db245a1) SHA1(e9f85ba29b0af483eae6f999f49f1e431d9d2e27) )
7242
7243   ROM_REGION( 0x40000, "gfx2", 0 )
7244   ROM_LOAD( "u41.bin", 0x00000, 0x40000, CRC(b2bca15d) SHA1(57747c9c05e5ab54e40cbded2e420dfbfc929ce5) )
7245ROM_END
7246
7247ROM_START( unkch2 ) // only gfx2 differs from unkch1
7248   ROM_REGION( 0x10000, "maincpu", 0 )
7249   ROM_LOAD( "u6.bin",  0x0000, 0x10000, CRC(30309996) SHA1(290f35f587fdf78dcb4f09403c510deec533c9c2) )
7250
7251   ROM_REGION( 0x20000, "gfx1", 0 )
7252   ROM_LOAD( "u29.bin", 0x00000, 0x20000, CRC(6db245a1) SHA1(e9f85ba29b0af483eae6f999f49f1e431d9d2e27) )
7253
7254   ROM_REGION( 0x40000, "gfx2", 0 )
7255   ROM_LOAD( "u41.1", 0x00000, 0x40000, CRC(725b48c7) SHA1(2f21c33fb7d23ad9411e926130a65b75029b9112) )
7256ROM_END
7257
7258ROM_START( unkch3 )  // gfx2 is the same as unkch1, others differ
7259   ROM_REGION( 0x10000, "maincpu", 0 )
7260   ROM_LOAD( "u6.3",  0x0000, 0x10000, CRC(902f9e42) SHA1(ac5843089748d457f70ea52d15285a0ccda705ad) )
7261
7262   ROM_REGION( 0x20000, "gfx1", 0 )
7263   ROM_LOAD( "u29.3", 0x00000, 0x20000, CRC(546929e6) SHA1(f97fe5687f8776f0abe68962a0246c9bbeb6acd1) )
7264
7265   ROM_REGION( 0x40000, "gfx2", 0 )
7266   ROM_LOAD( "u41.bin", 0x00000, 0x40000, CRC(b2bca15d) SHA1(57747c9c05e5ab54e40cbded2e420dfbfc929ce5) )
7267ROM_END
7268
7269ROM_START( unkch4 )  // all roms unique
7270   ROM_REGION( 0x10000, "maincpu", 0 )
7271   ROM_LOAD( "u6.4",  0x0000, 0x10000, CRC(eb191efa) SHA1(3004f26f9af7633df572f609647716cc4ac75990) )
7272
7273   ROM_REGION( 0x20000, "gfx1", 0 )
7274   ROM_LOAD( "u29.4", 0x00000, 0x20000, CRC(eaec0034) SHA1(6b2d3922873979eafcd4c71c52017263482b82ab) )
7275
7276   ROM_REGION( 0x40000, "gfx2", 0 )
7277   ROM_LOAD( "u41.4", 0x00000, 0x40000, CRC(ef586512) SHA1(a720e40903dd04b2c498efad40d583618596e048) )
7278ROM_END
7279
7280
70937281static DRIVER_INIT(goldstar)
70947282{
70957283   int A;
r4878r4879
76677855   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x1a, 0x1a, 0, 0, fixedvale4_r);
76687856}
76697857
7858DRIVER_INIT(cherrys)
7859{
7860   int i;
7861   UINT8 *ROM = memory_region(machine, "maincpu");
76707862
7863   unsigned char rawData[256] = {
7864      0xCC, 0xCD, 0xCE, 0xCF, 0xC8, 0xC9, 0xCA, 0xCB, 0xC4, 0xC5, 0xC6, 0xC7,
7865      0xC0, 0xC1, 0xC2, 0xC3, 0xDC, 0xDD, 0xDE, 0xDF, 0xD8, 0xD9, 0xDA, 0xDB,
7866      0xD4, 0xD5, 0xD6, 0xD7, 0xD0, 0xD1, 0xD2, 0xD3, 0xEC, 0xED, 0xEE, 0xEF,
7867      0xE8, 0xE9, 0xEA, 0xEB, 0xE4, 0xE5, 0xE6, 0xE7, 0xE0, 0xE1, 0xE2, 0xE3,
7868      0xFC, 0xFD, 0xFE, 0xFF, 0xF8, 0xF9, 0xFA, 0xFB, 0xF4, 0xF5, 0xF6, 0xF7,
7869      0xF0, 0xF1, 0xF2, 0xF3, 0x8C, 0x8D, 0x8E, 0x8F, 0x88, 0x89, 0x8A, 0x8B,
7870      0x84, 0x85, 0x86, 0x87, 0x80, 0x81, 0x82, 0x83, 0x9C, 0x9D, 0x9E, 0x9F,
7871      0x98, 0x99, 0x9A, 0x9B, 0x94, 0x95, 0x96, 0x97, 0x90, 0x91, 0x92, 0x93,
7872      0xAC, 0xAD, 0xAE, 0xAF, 0xA8, 0xA9, 0xAA, 0xAB, 0xA4, 0xA5, 0xA6, 0xA7,
7873      0xA0, 0xA1, 0xA2, 0xA3, 0xBC, 0xBD, 0xBE, 0xBF, 0xB8, 0xB9, 0xBA, 0xBB,
7874      0xB4, 0xB5, 0xB6, 0xB7, 0xB0, 0xB1, 0xB2, 0xB3, 0x4C, 0x4D, 0x4E, 0x4F,
7875      0x48, 0x49, 0x4A, 0x4B, 0x44, 0x45, 0x46, 0x47, 0x40, 0x41, 0x42, 0x43,
7876      0x5C, 0x5D, 0x5E, 0x5F, 0x58, 0x59, 0x5A, 0x5B, 0x54, 0x55, 0x56, 0x57,
7877      0x50, 0x51, 0x52, 0x53, 0x6C, 0x6D, 0x6E, 0x6F, 0x68, 0x69, 0x6A, 0x6B,
7878      0x64, 0x65, 0x66, 0x67, 0x60, 0x61, 0x62, 0x63, 0x7C, 0x7D, 0x7E, 0x7F,
7879      0x78, 0x79, 0x7A, 0x7B, 0x74, 0x75, 0x76, 0x77, 0x70, 0x71, 0x72, 0x73,
7880      0x0C, 0x0D, 0x0E, 0x0F, 0x08, 0x09, 0x0A, 0x0B, 0x04, 0x05, 0x06, 0x07,
7881      0x00, 0x01, 0x02, 0x03, 0x1C, 0x1D, 0x1E, 0x1F, 0x18, 0x19, 0x1A, 0x1B,
7882      0x14, 0x15, 0x16, 0x17, 0x10, 0x11, 0x12, 0x13, 0x2C, 0x2D, 0x2E, 0x2F,
7883      0x28, 0x29, 0x2A, 0x2B, 0x24, 0x25, 0x26, 0x27, 0x20, 0x21, 0x22, 0x23,
7884      0x3C, 0x3D, 0x3E, 0x3F, 0x38, 0x39, 0x3A, 0x3B, 0x34, 0x35, 0x36, 0x37,
7885      0x30, 0x31, 0x32, 0x33
7886   };
76717887
7888   for (i = 0;i < 0x10000;i++)
7889   {
7890      ROM[i] = ROM[i] ^ rawData[i&0xff];
7891   }
76727892
7893}
7894
7895
76737896/*********************************************
76747897*                Game Drivers                *
76757898**********************************************
r4878r4879
76857908GAME( 199?, ncb3,      0,        ncb3,     ncb3,     0,         ROT0, "Dyna",              "Cherry Bonus III (ver.1.40, set 1)",          0 )
76867909GAME( 199?, cb3a,      ncb3,     ncb3,     cb3a,     0,         ROT0, "Dyna",              "Cherry Bonus III (ver.1.40, set 2)",          0 )
76877910GAME( 199?, cb3,       ncb3,     ncb3,     ncb3,     cb3,       ROT0, "Dyna",              "Cherry Bonus III (ver.1.40, encrypted)",      0 )
7911GAME( 199?, cb3b,      ncb3,     cherrys,  ncb3,     cherrys,   ROT0, "Dyna",              "Cherry Bonus III (alt)",           0 )
76887912
76897913// cherry master hardware has a rather different mem map, but is basically the same
76907914GAME( 198?, cmv801,    0,        cm,       cmv801,   cm,        ROT0, "Corsica",           "Cherry Master (Corsica, ver.8.01)",           0 ) /* says ED-96 where the manufacturer is on some games.. */
r4878r4879
77457969
77467970GAME( 2003, nfm, 0, nfm, nfb96bl, 0, ROT0, "Ming-Yang Electronic",         "New Fruit Machine (Ming-Yang Electronic)", GAME_NOT_WORKING )
77477971
7972// these have 'cherry 1994' in the program roms, but also "Super Cherry / New Cherry Gold '99" probably hacks of a 1994 version of Cherry Bonus / Cherry Master (Super Cherry Master?)
7973GAME( 1999, unkch1,   0,      unkch, ncb3, 0,         ROT0, "bootleg",               "Super Cherry Master / New Cherry Gold '99 (set 1)",                  GAME_NOT_WORKING )
7974GAME( 1999, unkch2,   unkch1, unkch, ncb3, 0,         ROT0, "bootleg",               "Super Cherry Master / Super Cherry Gold",                  GAME_NOT_WORKING )
7975GAME( 1999, unkch3,   unkch1, unkch, ncb3, 0,         ROT0, "bootleg",               "Super Cherry Master / New Cherry Gold '99 (set 2)",    GAME_NOT_WORKING )
7976GAME( 1999, unkch4,   unkch1, unkch, ncb3, 0,         ROT0, "bootleg",               "Super Cherry Master / Grand Cherry Master",      GAME_NOT_WORKING )
7977
7978
7979
77487980/* possible stealth sets:
77497981
77507982 - cmv4a    ---> see the 1fxx zone. put a bp in 1f9f to see the loop.
src/mame/drivers/wc90.c
r4878r4879
5757#include "includes/wc90.h"
5858
5959
60static UINT8 *wc90_shared;
61
62static READ8_HANDLER( wc90_shared_r )
63{
64   return wc90_shared[offset];
65}
66
67static WRITE8_HANDLER( wc90_shared_w )
68{
69   wc90_shared[offset] = data;
70}
71
7260static WRITE8_HANDLER( wc90_bankswitch_w )
7361{
7462   int bankaddress;
r4878r4879
10593   AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(wc90_bgvideoram_w) AM_BASE(&wc90_bgvideoram)
10694   AM_RANGE(0xd000, 0xdfff) AM_RAM
10795   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(wc90_txvideoram_w) AM_BASE(&wc90_txvideoram)   /* tx video ram */
108   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_BANK(1), SMH_ROM)
109   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90_shared_r, wc90_shared_w) AM_BASE(&wc90_shared)
96   AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(1)
97   AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE(1)
11098   AM_RANGE(0xfc00, 0xfc00) AM_READ_PORT("P1")
11199   AM_RANGE(0xfc02, 0xfc02) AM_READ_PORT("P2")
112100   AM_RANGE(0xfc05, 0xfc05) AM_READ_PORT("SYSTEM")
113101   AM_RANGE(0xfc06, 0xfc06) AM_READ_PORT("DSW1")
114102   AM_RANGE(0xfc07, 0xfc07) AM_READ_PORT("DSW2")
115   AM_RANGE(0xfc02, 0xfc02) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0ylo)
116   AM_RANGE(0xfc03, 0xfc03) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0yhi)
117   AM_RANGE(0xfc06, 0xfc06) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0xlo)
118   AM_RANGE(0xfc07, 0xfc07) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll0xhi)
119   AM_RANGE(0xfc22, 0xfc22) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll1ylo)
120   AM_RANGE(0xfc23, 0xfc23) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll1yhi)
121   AM_RANGE(0xfc26, 0xfc26) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll1xlo)
122   AM_RANGE(0xfc27, 0xfc27) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll1xhi)
123   AM_RANGE(0xfc42, 0xfc42) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll2ylo)
124   AM_RANGE(0xfc43, 0xfc43) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll2yhi)
125   AM_RANGE(0xfc46, 0xfc46) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll2xlo)
126   AM_RANGE(0xfc47, 0xfc47) AM_WRITE(SMH_RAM) AM_BASE(&wc90_scroll2xhi)
103   AM_RANGE(0xfc02, 0xfc02) AM_WRITEONLY AM_BASE(&wc90_scroll0ylo)
104   AM_RANGE(0xfc03, 0xfc03) AM_WRITEONLY AM_BASE(&wc90_scroll0yhi)
105   AM_RANGE(0xfc06, 0xfc06) AM_WRITEONLY AM_BASE(&wc90_scroll0xlo)
106   AM_RANGE(0xfc07, 0xfc07) AM_WRITEONLY AM_BASE(&wc90_scroll0xhi)
107   AM_RANGE(0xfc22, 0xfc22) AM_WRITEONLY AM_BASE(&wc90_scroll1ylo)
108   AM_RANGE(0xfc23, 0xfc23) AM_WRITEONLY AM_BASE(&wc90_scroll1yhi)
109   AM_RANGE(0xfc26, 0xfc26) AM_WRITEONLY AM_BASE(&wc90_scroll1xlo)
110   AM_RANGE(0xfc27, 0xfc27) AM_WRITEONLY AM_BASE(&wc90_scroll1xhi)
111   AM_RANGE(0xfc42, 0xfc42) AM_WRITEONLY AM_BASE(&wc90_scroll2ylo)
112   AM_RANGE(0xfc43, 0xfc43) AM_WRITEONLY AM_BASE(&wc90_scroll2yhi)
113   AM_RANGE(0xfc46, 0xfc46) AM_WRITEONLY AM_BASE(&wc90_scroll2xlo)
114   AM_RANGE(0xfc47, 0xfc47) AM_WRITEONLY AM_BASE(&wc90_scroll2xhi)
127115   AM_RANGE(0xfcc0, 0xfcc0) AM_WRITE(wc90_sound_command_w)
128116   AM_RANGE(0xfcd0, 0xfcd0) AM_WRITE(watchdog_reset_w)
129117   AM_RANGE(0xfce0, 0xfce0) AM_WRITE(wc90_bankswitch_w)
r4878r4879
132120static ADDRESS_MAP_START( wc90_map_2, ADDRESS_SPACE_PROGRAM, 8 )
133121   AM_RANGE(0x0000, 0xbfff) AM_ROM
134122   AM_RANGE(0xc000, 0xcfff) AM_RAM
135   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
123   AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
136124   AM_RANGE(0xd800, 0xdfff) AM_RAM
137125   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_be_w) AM_BASE(&paletteram)
138   AM_RANGE(0xf000, 0xf7ff) AM_READWRITE(SMH_BANK(2), SMH_ROM)
139   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90_shared_r, wc90_shared_w)
126   AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(2)
127   AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE(1)
140128   AM_RANGE(0xfc00, 0xfc00) AM_WRITE(wc90_bankswitch1_w)
141129   AM_RANGE(0xfc01, 0xfc01) AM_WRITE(watchdog_reset_w)
142130ADDRESS_MAP_END
src/mame/drivers/mpu4.c
r4878r4879
44  This is the core driver, no video specific stuff should go in here.
55  This driver holds all the mechanical games.
66
7     05-2009: Miscellaneous lamp fixes, based on data from FME Forever.
78     09-2007: Haze: Added Deal 'Em video support.
89  03-08-2007: J Wallace: Removed audio filter for now, since sound is more accurate without them.
910                         Connect 4 now has the right sound.
r4878r4879
294295static int ic23_active;
295296static int led_extend;
296297static int serial_card_connected;
298static int multiplex_smooth;
297299static emu_timer *ic24_timer;
298300static TIMER_CALLBACK( ic24_timeout );
299301
r4878r4879
394396      mpu4_draw_led(8, pled_segs[0]);
395397      mpu4_draw_led(9, pled_segs[1]);
396398   }
397   draw_lamps();
399
400   /* Lamp smoothing, this draws lamps only at the peaks of the AC power that would light them */
401   if ((multiplex_smooth == (input_strobe - 1))||((multiplex_smooth == 7) && (input_strobe == 0))||(multiplex_smooth == input_strobe))
402   {
403      draw_lamps();
404      mpu4_draw_led(input_strobe, led_segs[input_strobe]);
405      multiplex_smooth = input_strobe;
406   }
407
398408}
399409
400410
r4878r4879
540550   if(ic23_active)
541551   {
542552      lamp_strobe = data;
543      update_lamps();
544553   }
545554}
546555
r4878r4879
552561   if(ic23_active)
553562   {
554563      lamp_strobe2 = data;
555      update_lamps();
556564   }
557565}
558566
r4878r4879
17311739static TIMER_DEVICE_CALLBACK( gen_50hz )
17321740{
17331741   /* Although reported as a '50Hz' signal, the fact that both rising and
1734    falling edges of the pulse are used, the timer actually gives a 100Hz
1742    falling edges of the pulse are used means the timer actually gives a 100Hz
17351743    oscillating signal.*/
17361744   signal_50hz = signal_50hz?0:1;
1737
1745   update_lamps();
17381746   pia6821_ca1_w(devtag_get_device(timer->machine, "pia_ic4"), 0,  signal_50hz);   /* signal is connected to IC4 CA1 */
17391747}
17401748
src/mame/drivers/20pacgal.c
r4878r4879
202202   AM_RANGE(0x45040, 0x4505f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs)
203203   AM_RANGE(0x44800, 0x45eff) AM_RAM
204204   AM_RANGE(0x45f00, 0x45fff) AM_DEVWRITE("namco", _20pacgal_wavedata_w) AM_BASE(&namco_wavedata)
205   AM_RANGE(0x46000, 0x46fff) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(_20pacgal_state, char_gfx_ram)
205   AM_RANGE(0x46000, 0x46fff) AM_WRITEONLY AM_BASE_MEMBER(_20pacgal_state, char_gfx_ram)
206206   AM_RANGE(0x47100, 0x47100) AM_RAM   /* leftover from original Galaga code */
207   AM_RANGE(0x48000, 0x49fff) AM_READWRITE(SMH_ROM, rom_48000_w)   /* this should be a mirror of 08000-09ffff */
207   AM_RANGE(0x48000, 0x49fff) AM_ROM AM_WRITE(rom_48000_w)   /* this should be a mirror of 08000-09ffff */
208208   AM_RANGE(0x4c000, 0x4dfff) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(_20pacgal_state, sprite_gfx_ram)
209209   AM_RANGE(0x4e000, 0x4e17f) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(_20pacgal_state, sprite_ram)
210210   AM_RANGE(0x4ff00, 0x4ffff) AM_WRITE(SMH_RAM) AM_BASE_MEMBER(_20pacgal_state, sprite_color_lookup)
src/mame/drivers/spbactn.c
r4878r4879
271271   PORT_DIPSETTING(    0x00, DEF_STR( None ) )
272272   PORT_DIPNAME( 0x10, 0x10, "Hit Difficulty" )      // From .xls file - WHAT does that mean ?
273273   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
274   PORT_DIPSETTING(    0x00, "Difficult" )
274   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
275275   PORT_DIPNAME( 0x20, 0x20, "Display Instructions" )   // "Change Software" in .xls file
276276   PORT_DIPSETTING(    0x00, DEF_STR( No ) )
277277   PORT_DIPSETTING(    0x20, DEF_STR( Yes ) )
src/mame/drivers/system16.c
r4878r4879
11/*
2    Sega System16 Hardware
3    major cleanup in progress - still a lot to do!
2    System 16 / 18 bootlegs
43
5    see video/system16.c for more information
4    Sega's System 16 and System 18 hardware was heavily bootlegged.
65
7Changes:
6    Most of these bootlegs had significant modifications compared to the real hardware.
7    They still roughly reflect which system they have been bootlegged from however.
88
904/28/04  Charles MacDonald
10- Added MSM5205 sample playback to tturfbl.
119
1203/17/04
13- Added correctly dumped ROM set for eswat to replace the old one. Game is encrypted and unplayable.
14- Moved Ace Attacker here from System 18 driver. Game is encrypted and unplayable.
15- Added sound support for tturf, tturfu, tturfbl (no samples), fpointbl, fpointbj
16- Fixed toryumon RAM test
17- Cleaned up timscannr, toryumon drivers
1803/11/04
19- Cleaned up riotcity, aurail, altbeast, bayroute drivers
20- Added missing coin control to sys16_coinctrl_w
21- Removed 'extra' RAM in some drivers and replaced with sys16_tilebank_w
10    Bootlegs
2211
23To do:
24- tturf and tturfu have some invalid data written to the UPD7759. I think this causes the 'pop' sound when level 1 starts.
25- tturfbl has some serious problems with tilemap scrolling
26- bayroute has a bad sprite in the door of the level 1 boss
27- altbeast writes to mirrored sprite RAM at $441000
28- tturfu has bad single sprite frame when main character walks
29- dduxbl has some 'stuck' sprites
12    Type 16B:
13    --------
3014
31Notes:
32- toryumon RAM test accesses mirrored work RAM. Maybe there's a better way to support this than using AM_MASK.
33- I separated the fpoint and fpointbl,fpointbj machine drivers as the latter two have different sound hardware,
34  but the original does not. I think this creates a dependancy where fpointbl.zip needs flpoint.001 from fpointbj.zip,
35  as fpointbl uses fpoint ROMs (it's parent), it's own, and the sound ROM from fpointbj.
36  So add fpoint.001 to fpointbl.zip for it to work.
37  I made fpointbl the parent of fpointbj so it would use the proper memory map for the sound hardware.
15    Encrypted / Protected bootlegs
16     - Bay Route (set 1)
17     - Golden Axe (set 1)
3818
39DIP locations verified from manual for:
40- aliensyn
41- bayroute
42- ddux
43- eswat
44- fpoint
45- goldnaxe
46- passsht
47- shinobi
48- tetris
49- wb3
19    These share a common encryption, Bay Route is also proteceted, the Golden Axe set has a strange
20    unknown rom, maybe it's related to an MCU that isn't present on the GA board?
5021
51  */
22    ---
5223
53/***************************************************************************/
54/*
55  ASTORMBL
56          3. In the ending, the 3 heroes are floating into a half bubble. (see picture).
57          Also colour problems during ending as well.
58          4. In the later Shooting gallery stage (like inside the car shop and the factory (mission 3)),
59          there is some garbage graphics (sprite of death monsters that appear where they should not)
24    Datsu bootlegs
25     - Bay Route (set 2)
26     - Flash Point (2 sets)
27     - Dynamite Dux
28     - Tough Turf
6029
61    working:
62        Alex Kidd
63        Alien Storm (bootleg)
64        Alien Syndrome
65        Altered Beast (Ver 1)
66        Altered Beast (Ver 2)   (No Sound)
67        Atomic Point            (No Sound)
68        Aurail                  (Speech quality sounds poor)
69        Aurail (317-0168)
70        Bay Route
71        Body Slam
72        Dump Matsumoto (Japan, Body Slam)
73        Dynamite Dux (bootleg)
74        Enduro Racer (bootleg)
75        Enduro Racer (custom bootleg)
76        E-Swat (bootleg)
77        Fantasy Zone (Old Ver.)
78        Fantasy Zone (New Ver.)
79        Flash Point  (bootleg)
80        Golden Axe (Ver 1)
81        Golden Axe (Ver 2)
82        Hang-on
83        Heavyweight Champ: some minor graphics glitches
84        Major League: No game over.
85        Moonwalker (bootleg): Music Speed varies
86        Outrun (set 1)
87        Outrun (set 2)
88        Outrun (custom bootleg)
89        Passing Shot (bootleg)
90        Passing Shot (4 player bootleg)
91        Quartet: Glitch on highscore list
92        Quartet (Japan): Glitch on highscore list
93        Quartet 2: Glitch on highscore list
94        Riot City
95        SDI
96        Shadow Dancer
97        Shadow Dancer (Japan)
98        Shinobi
99        Shinobi (Sys16A Bootleg?)
100        Space Harrier
101        Super Hangon (bootleg)
102        Tetris (bootleg)
103        Time Scanner
104        Toryumon
105        Tough Turf (Japan)          (No Sound)
106        Tough Turf (US)             (No Sound)
107        Tough Turf (bootleg)    (No Speech Roms)
108        Wonderboy 3 - Monster Lair
109        Wonderboy 3 - Monster Lair (bootleg)
110        Wrestle War
30    The tilemap page select writes have been split across 4 8-bit registers on these
11131
112    not really working:
113        Shadow Dancer (bootleg)
32    ---
11433
115    protected:
116        Alex Kidd (jpn?)
117        Alien Syndrome
118        Alien Syndrome
119        Alien Syndrome (Japan)
120        Alien Storm
121        Alien Storm (2 Player)
122        Bay Route (317-0116)
123        Bay Route (protected bootleg 1)
124        Bay Route (protected bootleg 2)
125        Enduro Racer
126        E-Swat
127        Flash Point
128        Golden Axe (Ver 1 317-0121 Japan)
129        Golden Axe (Ver 2 317-0110)
130        Golden Axe (Ver 2 317-0122)
131        Golden Axe (protected bootleg)
132        Jyuohki (Japan, altered beast)
133        Moonwalker (317-0158)
134        Moonwalker (317-0159)
135        Passing Shot (317-0080)
136        Shinobi (Sys16B 317-0049)
137        Shinobi (Sys16A 317-0050)
138        SDI (Japan, old version)
139        Super Hangon
140        Tetris (Type A)
141        Tetris (Type B 317-0092)
142        Wonderboy 3 - Monster Lair (317-0089)
34    Other bootegs
35     - Tetris
36     - E-Swat
14337
144    protected (No driver):
145        Ace Attacker
146        Action Fighter
147        Bloxeed
148        Clutch Hitter
149        Cotton (Japan)
150        Cotton
151        DD Crew
152        Dunk Shot
153        Excite League
154        Laser Ghost
155        MVP
156        Ryukyu
157        Super Leagu
158        Turbo Outrun (set 1)
159        Turbo Outrun (set 2)
38    These appear to be a variation no the encrypted / protected bootlegs, but without the encryption
39    or protection
40
41    - Golden Axe (set 2)
42
43    Unique bootleg, tilemap paging is split across 8 registers, bits are inverted etc.
44
45    ---
46
47    Type 16A:
48    ---------
49
50    Shinobi
51    Passing Shot (2 sets)
52    Wonderboy 3
53
54    System 18 (more commplex tilemaps)
55    ----------------------------------
56
57    Alien Storm
58    Shadow Dancer
59    Moonwalker
60
61
62
63    AMT Games
64    ---------
65
66    these aren't strictly bootlegs, but are clearly based on bootleg Tetris hardware with additional protection
67    - Beauty Block
68    - IQ Pipe
69
70
71
72    ToDo
73    ----
74
75    Fully fix the tilemap banking and scrolling for all sets
76    Fix sprites (and check for bad roms)
77    Add support for custom sound HW used by the various bootlegs
78    Look at the system18 bootlegs
79
80    Partially Done
81    --------------
82
83    Strip out old hacks & obsolete comments (many related to the *original* system16/18 sets which have their own
84    driver now)
85
86
16087*/
16188
16289#include "driver.h"
16390#include "cpu/z80/z80.h"
164#include "cpu/mcs48/mcs48.h"
16591#include "system16.h"
16692#include "cpu/m68000/m68000.h"
167#include "machine/fd1094.h"
16893#include "sound/msm5205.h"
16994#include "sound/2151intf.h"
17095#include "sound/upd7759.h"
96#include "sound/2612intf.h"
97#include "sound/rf5c68.h"
17198
172static void sys16_video_config(void (*update)(void), int sprxoffs, const int *bank)
173{
174   static const int bank_default[16] =
175   {
176      0x0,0x1,0x2,0x3,
177      0x4,0x5,0x6,0x7,
178      0x8,0x9,0xa,0xb,
179      0xc,0xd,0xe,0xf
180   };
99extern VIDEO_START( system16a_bootleg );
100extern VIDEO_UPDATE( system16a_bootleg );
101extern VIDEO_UPDATE( system16a_bootleg_passht4b );
102extern WRITE16_HANDLER( system16a_bootleg_tilemapselect_w );
103extern WRITE16_HANDLER( system16a_bootleg_bgscrolly_w );
104extern WRITE16_HANDLER( system16a_bootleg_bgscrollx_w );
105extern WRITE16_HANDLER( system16a_bootleg_fgscrolly_w );
106extern WRITE16_HANDLER( system16a_bootleg_fgscrollx_w );
107extern UINT16* system16a_bootleg_bg0_tileram;
108extern UINT16* system16a_bootleg_bg1_tileram;
181109
182   sys16_update_proc = update;
183   sys16_sprxoffset = sprxoffs;
184   sys16_obj_bank = bank ? bank : bank_default;
185}
186
187110/***************************************************************************/
188111
189112static UINT16 coinctrl;
190113
191static WRITE16_HANDLER( sys16_3d_coinctrl_w )
192{
193   if( ACCESSING_BITS_0_7 )
194{
195      coinctrl = data&0xff;
196      sys16_refreshenable = coinctrl & 0x10;
197      coin_counter_w(0,coinctrl & 0x01);
198      /* bit 6 is also used (0 in fantzone) */
199
200      /* Hang-On, Super Hang-On, Space Harrier, Enduro Racer */
201      set_led_status(0,coinctrl & 0x04);
202
203      /* Space Harrier */
204      set_led_status(1,coinctrl & 0x08);
205   }
206}
207
208114static INTERRUPT_GEN( sys16_interrupt )
209115{
210116   cpu_set_input_line(device, 4, HOLD_LINE); /* Interrupt vector 4, used by VBlank */
r4878r4879
244150static int sample_buffer = 0;
245151static int sample_select = 0;
246152
153static WRITE16_HANDLER( sound_command_nmi_w )
154{
155   if( ACCESSING_BITS_0_7 )
156   {
157      soundlatch_w( space, 0, data & 0xff );
158      cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
159   }
160}
161
162
247163static WRITE8_HANDLER( tturfbl_msm5205_data_w )
248164{
249165   sample_buffer = data;
r4878r4879
372288   }
373289}
374290
375static WRITE16_HANDLER( sound_command_nmi_w )
376{
377   if( ACCESSING_BITS_0_7 )
378   {
379      soundlatch_w( space, 0, data & 0xff );
380      cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
381   }
382}
383291
384292//static UINT16 coinctrl;
385293
r4878r4879
474382   sys16_tile_bank0 = (data>>4)&0xf;
475383}
476384
477#if 0
478static void set_tile_bank18( int data )
479{
480   sys16_tile_bank0 = data&0xf;
481   sys16_tile_bank1 = (data>>4)&0xf;
482}
483#endif
484
485385static void set_fg_page( int data )
486386{
487387   sys16_fg_page[0] = data>>12;
r4878r4879
601501static ADDRESS_MAP_START( bayroute_map, ADDRESS_SPACE_PROGRAM, 16 )
602502   AM_RANGE(0x000000, 0x0bffff) AM_ROM
603503   AM_RANGE(0x100000, 0x100003) AM_WRITENOP // tilebank control?
604   AM_RANGE(0x500000, 0x503fff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
605   AM_RANGE(0x600000, 0x600fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
606   AM_RANGE(0x700000, 0x70ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
607   AM_RANGE(0x710000, 0x710fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
608   AM_RANGE(0x800000, 0x800fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
504   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
505   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE(&sys16_spriteram)
506   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
507   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
508   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
609509   AM_RANGE(0x900000, 0x900001) AM_WRITE(sys16_coinctrl_w)
610510   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
611511   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
r4878r4879
618518
619519/***************************************************************************/
620520
621static void bayroute_update_proc( void )
622{
623   set_fg_page( sys16_textram[0x740] );
624   set_bg_page( sys16_textram[0x741] );
625   sys16_fg_scrolly = sys16_textram[0x748];
626   sys16_bg_scrolly = sys16_textram[0x749];
627   sys16_fg_scrollx = sys16_textram[0x74c];
628   sys16_bg_scrollx = sys16_textram[0x74d];
629}
630
631static MACHINE_RESET( bayroute )
632{
633   static const int bank[16] = {
634      0,0,0,0,
635      0,0,0,3,
636      0,0,0,2,
637      0,1,0,0
638   };
639   sys16_obj_bank = bank;
640   sys16_update_proc = bayroute_update_proc;
641   sys16_spritesystem = sys16_sprite_shinobi;
642}
643
644static DRIVER_INIT( bayrtbl1 )
645{
646   MACHINE_RESET_CALL(sys16_onetime);
647}
648
649/***************************************************************************/
650
651521static INPUT_PORTS_START( bayroute )
652522   PORT_INCLUDE( sys16_common )
653523
r4878r4879
677547
678548/***************************************************************************/
679549
680static MACHINE_DRIVER_START( bayroute )
681550
682   /* basic machine hardware */
683   MDRV_IMPORT_FROM(system16_7759)
684   MDRV_CPU_MODIFY("maincpu")
685   MDRV_CPU_PROGRAM_MAP(bayroute_map)
686551
687   MDRV_MACHINE_RESET(bayroute)
688MACHINE_DRIVER_END
689552
690553/***************************************************************************/
691554
692static ADDRESS_MAP_START( dduxbl_map, ADDRESS_SPACE_PROGRAM, 16 )
693   AM_RANGE(0x000000, 0x0bffff) AM_ROM
694   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
695   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
696   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
697   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
698   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
699   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
700   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
701   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
702   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
703   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
704   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
705   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
706   AM_RANGE(0xc46000, 0xc4603f) AM_WRITE(SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
707   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
708   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
709ADDRESS_MAP_END
710
711/***************************************************************************/
712
713static void dduxbl_update_proc( void )
714{
715   sys16_fg_scrollx = (sys16_extraram2[0x0018/2] ^ 0xffff) & 0x01ff;
716   sys16_bg_scrollx = (sys16_extraram2[0x0008/2] ^ 0xffff) & 0x01ff;
717   sys16_fg_scrolly = sys16_extraram2[0x0010/2] & 0x00ff;
718   sys16_bg_scrolly = sys16_extraram2[0x0000/2];
719
720   {
721      UINT8 lu = sys16_extraram2[0x0020/2] & 0xff;
722      UINT8 ru = sys16_extraram2[0x0022/2] & 0xff;
723      UINT8 ld = sys16_extraram2[0x0024/2] & 0xff;
724      UINT8 rd = sys16_extraram2[0x0026/2] & 0xff;
725
726      if (lu==4 && ld==4 && ru==5 && rd==5)
727      { // fix a bug in chicago round (un-tested in MAME)
728         int vs=(*(UINT16 *)(&sys16_workingram[0x36ec]));
729         sys16_bg_scrolly = vs & 0xff;
730         sys16_fg_scrolly = vs & 0xff;
731         if (vs >= 0x100)
732         {
733            lu=0x26; ru=0x37;
734            ld=0x04; rd=0x15;
735         } else {
736            ld=0x26; rd=0x37;
737            lu=0x04; ru=0x15;
738         }
739      }
740      sys16_fg_page[0] = ld&0xf;
741      sys16_fg_page[1] = rd&0xf;
742      sys16_fg_page[2] = lu&0xf;
743      sys16_fg_page[3] = ru&0xf;
744
745      sys16_bg_page[0] = ld>>4;
746      sys16_bg_page[1] = rd>>4;
747      sys16_bg_page[2] = lu>>4;
748      sys16_bg_page[3] = ru>>4;
749   }
750}
751
752static MACHINE_RESET( dduxbl )
753{
754   static const sys16_patch patch[] =
755   {
756      { 0x1eb2e, 0x01 },
757      { 0x1eb2f, 0x01 },
758      { 0x1eb3c, 0x00 },
759      { 0x1eb3d, 0x00 },
760      { 0x23132, 0x01 },
761      { 0x23133, 0x01 },
762      { 0x23140, 0x00 },
763      { 0x23141, 0x00 },
764      { 0x24a9a, 0x01 },
765      { 0x24a9b, 0x01 },
766      { 0x24aa8, 0x00 },
767      { 0x24aa9, 0x00 }
768   };
769
770   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
771}
772
773555static DRIVER_INIT( dduxbl )
774556{
775   static const int bank[16] = { //*
776      0,0,0,0,
777      0,0,0,4,
778      0,0,0,3,
779      0,2,0,0
780   };
781
782557   MACHINE_RESET_CALL(sys16_onetime);
783   sys16_video_config(dduxbl_update_proc, -0x48, bank);
784558}
785559
786560/***************************************************************************/
r4878r4879
812586
813587/***************************************************************************/
814588
815static MACHINE_DRIVER_START( dduxbl )
816589
817   /* basic machine hardware */
818   MDRV_IMPORT_FROM(system16)
819   MDRV_CPU_MODIFY("maincpu")
820   MDRV_CPU_PROGRAM_MAP(dduxbl_map)
821590
822   MDRV_MACHINE_RESET(dduxbl)
823MACHINE_DRIVER_END
824
825591/***************************************************************************/
826592
827593static int eswat_tilebank0;
r4878r4879
835601}
836602
837603
838static ADDRESS_MAP_START( eswatbl_map, ADDRESS_SPACE_PROGRAM, 16 )
839   AM_RANGE(0x000000, 0x07ffff) AM_ROM
840   AM_RANGE(0x3e2000, 0x3e2001) AM_WRITE(eswat_tilebank0_w)
841   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
842   AM_RANGE(0x410000, 0x418fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
843   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
844   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
845   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
846   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
847   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
848   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
849   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
850   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
851   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
852   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
853   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
854ADDRESS_MAP_END
855604
856605/***************************************************************************/
857606
858static void eswatbl_update_proc( void )
859{
860   sys16_fg_scrollx = sys16_textram[0x8008/2] ^ 0xffff;
861   sys16_bg_scrollx = sys16_textram[0x8018/2] ^ 0xffff;
862   sys16_fg_scrolly = sys16_textram[0x8000/2];
863   sys16_bg_scrolly = sys16_textram[0x8010/2];
864607
865   set_fg_page( sys16_textram[0x8020/2] );
866   set_bg_page( sys16_textram[0x8028/2] );
867
868   sys16_tile_bank1 = (sys16_textram[0x8030/2])&0xf;
869   sys16_tile_bank0 = eswat_tilebank0;
870}
871
872608static MACHINE_RESET( eswatbl )
873609{
874610   static const int bank[16] = {
r4878r4879
877613      2,3,   6,7,
878614      10,11,   14,15
879615   };
880   static const sys16_patch patch[] =
881   {
882      { 0x3897, 0x11 }
883   };
884616
885   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
886617
887618   sys16_obj_bank = bank;
888619   sys16_sprxoffset = -0x23c;
889
890
891   sys16_update_proc = eswatbl_update_proc;
892620}
893621
894622
r4878r4879
896624{
897625   MACHINE_RESET_CALL(sys16_onetime);
898626   sys16_rowscroll_scroll=0x8000;
899   sys18_splittab_fg_x=&sys16_textram[0x0f80];
627   //sys18_splittab_fg_x=&sys16_textram[0x0f80];
900628}
901629
902630/***************************************************************************/
r4878r4879
931659
932660/***************************************************************************/
933661
934static MACHINE_DRIVER_START( eswatbl )
935
936   /* basic machine hardware */
937   MDRV_IMPORT_FROM(system16_7759)
938   MDRV_CPU_MODIFY("maincpu")
939   MDRV_CPU_PROGRAM_MAP(eswatbl_map)
940
941   MDRV_MACHINE_RESET(eswatbl)
942MACHINE_DRIVER_END
943
944662/***************************************************************************/
945663
946static ADDRESS_MAP_START( fpointbl_map, ADDRESS_SPACE_PROGRAM, 16 )
947   AM_RANGE(0x000000, 0x01ffff) AM_ROM
948//  AM_RANGE(0x02002e, 0x020049) AM_READ(fp_io_service_dummy_r)
949   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
950   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
951   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
952   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
953   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
954   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
955   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
956   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
957   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
958//  AM_RANGE(0x44302a, 0x44304d) AM_READ(fp_io_service_dummy_r)
959   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
960//  AM_RANGE(0xfe0006, 0xfe0007) AM_WRITE(sound_command_w) // original
961//  AM_RANGE(0xfe003e, 0xfe003f) AM_READ(fp_io_service_dummy_r)
962   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
963ADDRESS_MAP_END
964
965664/***************************************************************************/
966665
967static void fpoint_update_proc( void )
968{
969   set_fg_page( sys16_textram[0x740] );
970   set_bg_page( sys16_textram[0x741] );
971   sys16_fg_scrolly = sys16_textram[0x748];
972   sys16_bg_scrolly = sys16_textram[0x749];
973   sys16_fg_scrollx = sys16_textram[0x74c];
974   sys16_bg_scrollx = sys16_textram[0x74d];
975}
976666
977static MACHINE_RESET( fpointbl )
978{
979   static const sys16_patch patch[] =
980   {
981      { 0x454, 0x33 },
982      { 0x455, 0xf8 },
983      { 0x456, 0xe0 },
984      { 0x457, 0xe2 },
985      { 0x8ce8, 0x16 },
986      { 0x8ce9, 0x66 },
987      { 0x17687, 0x00 },
988      { 0x7bed, 0x04 },
989
990      { 0x7ea8, 0x61 },
991      { 0x7ea9, 0x00 },
992      { 0x7eaa, 0x84 },
993      { 0x7eab, 0x16 },
994      { 0x2c0, 0xe7 },
995      { 0x2c1, 0x48 },
996      { 0x2c2, 0xe7 },
997      { 0x2c3, 0x49 },
998      { 0x2c4, 0x04 },
999      { 0x2c5, 0x40 },
1000      { 0x2c6, 0x00 },
1001      { 0x2c7, 0x10 },
1002      { 0x2c8, 0x4e },
1003      { 0x2c9, 0x75 }
1004   };
1005
1006   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
1007   sys16_update_proc = fpoint_update_proc;
1008}
1009
1010static DRIVER_INIT( fpointbl )
1011{
1012   MACHINE_RESET_CALL(sys16_onetime);
1013   sys16_video_config(fpoint_update_proc, -0xb8, NULL);
1014}
1015
1016/***************************************************************************/
1017
1018
1019667static INPUT_PORTS_START( fpointbl )
1020668   PORT_START("SERVICE")
1021669   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
r4878r4879
1116764   AM_RANGE(0xf800, 0xffff) AM_RAM
1117765ADDRESS_MAP_END
1118766
1119static MACHINE_DRIVER_START( fpointbl )
767/***************************************************************************/
1120768
1121   /* basic machine hardware */
1122   MDRV_IMPORT_FROM(system16)
1123   MDRV_CPU_MODIFY("maincpu")
1124   MDRV_CPU_PROGRAM_MAP(fpointbl_map)
1125769
1126   MDRV_CPU_MODIFY("soundcpu")
1127   MDRV_CPU_PROGRAM_MAP(fpointbl_sound_map)
1128770
1129   MDRV_MACHINE_RESET(fpointbl)
1130MACHINE_DRIVER_END
1131771
1132/***************************************************************************/
772static WRITE16_HANDLER( sys16bootleg_bgpage_w )
773{
774   set_bg_page( data );
775}
1133776
1134static READ16_HANDLER( ga_io_players_r ) {
1135   return (input_port_read(space->machine, "P1") << 8) | input_port_read(space->machine, "P2");
777static WRITE16_HANDLER( sys16bootleg_fgpage_w )
778{
779   set_fg_page( data );
1136780}
1137static READ16_HANDLER( ga_io_service_r )
781
782static WRITE16_HANDLER( sys16bootleg_fgscrollx_bank_w )
1138783{
1139   return (input_port_read(space->machine,"SERVICE") << 8) | (sys16_workingram[0x2c96/2] & 0x00ff);
784
785   int scroll = data & 0x1ff;
786   int bank = (data&0xc000)>>14;
787   scroll+=0x200;
788   set_tile_bank( bank );
789
790   scroll+=3; // so that the character portraits in attract mode are properly aligned (alighnment on character select no longer matches original tho?)
791   sys16_fg_scrollx = -scroll;
1140792}
1141793
1142static WRITE16_HANDLER( ga_sound_command_w )
794static WRITE16_HANDLER( sys16bootleg_fgscrollx_w )
1143795{
1144   COMBINE_DATA( &sys16_workingram[(0xecfc - 0xc000) / 2] );
1145   if( ACCESSING_BITS_8_15 )
1146   {
1147      soundlatch_w( space, 0, data >> 8 );
1148      cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE );
1149   }
796
797   //data ^= 0x7; // 4 player passing shot
798
799   int scroll = data & 0x1ff;
800   scroll+=0x200;
801   scroll+=3;
802
803
804   sys16_fg_scrollx = -scroll;
1150805}
1151806
1152static WRITE16_HANDLER( goldnaxe_prot_w )
807
808static WRITE16_HANDLER( sys16bootleg_fgscrolly_w )
1153809{
1154   sys16_workingram[(0xecd8 - 0xc000)/2] = 0x048c;
1155   sys16_workingram[(0xecda - 0xc000)/2] = 0x159d;
1156   sys16_workingram[(0xecdc - 0xc000)/2] = 0x26ae;
1157   sys16_workingram[(0xecde - 0xc000)/2] = 0x37bf;
1158   COMBINE_DATA( &sys16_workingram[(0xec1c-0xc000)/2] );
810   int scroll = data & 0xff;
811   sys16_fg_scrolly = scroll;
1159812}
1160813
1161static ADDRESS_MAP_START( goldnaxe_map, ADDRESS_SPACE_PROGRAM, 16 )
814static WRITE16_HANDLER( sys16bootleg_bgscrollx_w )
815{
816
817   int scroll = data & 0x1ff;
818   scroll+=0x200;
819   scroll+=1; // so that the background fo the select screen is properly aligned
820   sys16_bg_scrollx = -scroll;
821}
822
823static WRITE16_HANDLER( sys16bootleg_bgscrolly_w )
824{
825   int scroll = data & 0xff;
826   sys16_bg_scrolly = scroll;
827}
828
829
830static ADDRESS_MAP_START( goldnaxe_b1_map, ADDRESS_SPACE_PROGRAM, 16 )
1162831   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1163   AM_RANGE(0x100000, 0x10ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1164   AM_RANGE(0x110000, 0x110fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1165   AM_RANGE(0x140000, 0x140fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1166   AM_RANGE(0x1f0000, 0x1f0003) AM_READWRITE(SYS16_MRA16_EXTRAM, SYS16_MWA16_EXTRAM) AM_BASE(&sys16_extraram)
1167   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
832   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
833   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
834   AM_RANGE(0x118000, 0x118001) AM_WRITE(sys16bootleg_fgscrolly_w)
835   AM_RANGE(0x118008, 0x118009) AM_WRITE(sys16bootleg_fgscrollx_bank_w) // and tile bank
836   AM_RANGE(0x118010, 0x118011) AM_WRITE(sys16bootleg_bgscrolly_w)
837   AM_RANGE(0x118018, 0x118019) AM_WRITE(sys16bootleg_bgscrollx_w)
838   AM_RANGE(0x118020, 0x118021) AM_WRITE(sys16bootleg_fgpage_w)
839   AM_RANGE(0x118028, 0x118029) AM_WRITE(sys16bootleg_bgpage_w)
840   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
841   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&sys16_spriteram)
1168842   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1169843   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1170844   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1171845   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1172846   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1173847   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1174   AM_RANGE(0xc43000, 0xc43001) AM_WRITENOP // ?
1175//  AM_RANGE(0xfe0006, 0xfe0007) AM_WRITENOP I think this is the real sound out
1176   AM_RANGE(0xffec1c, 0xffec1d) AM_WRITE(goldnaxe_prot_w)// how does this really work?
1177   AM_RANGE(0xffecd0, 0xffecd1) AM_READ(ga_io_players_r)
1178   AM_RANGE(0xffec96, 0xffec97) AM_READ(ga_io_service_r)
1179   AM_RANGE(0xffecfc, 0xffecfd) AM_WRITE(ga_sound_command_w)// probably just a buffer
1180   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram) /* fails SCRATCH RAM test because of hacks */
1181//  AM_RANGE(0xfffc00, 0xffffff) AM_WRITE(MWA15_NOP) /* 0x400 bytes; battery backed up */
848   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(SMH_NOP) // sound related?
849   AM_RANGE(0xc43000, 0xc43001) AM_WRITE(SMH_NOP)
850   AM_RANGE(0xc43034, 0xc43035) AM_WRITE(SMH_NOP)
851   AM_RANGE(0xc80000, 0xc80001) AM_WRITE(SMH_NOP)
852   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1182853ADDRESS_MAP_END
1183854
1184/***************************************************************************/
855static ADDRESS_MAP_START( bayroute_b1_map, ADDRESS_SPACE_PROGRAM, 16 )
856   AM_RANGE(0x000000, 0x0bffff) AM_ROM
857   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
858   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE(&sys16_spriteram)
859   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
860   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
861   AM_RANGE(0x718000, 0x718001) AM_WRITE(sys16bootleg_fgscrolly_w)
862   AM_RANGE(0x718008, 0x718009) AM_WRITE(sys16bootleg_fgscrollx_bank_w) // and tile bank
863   AM_RANGE(0x718010, 0x718011) AM_WRITE(sys16bootleg_bgscrolly_w)
864   AM_RANGE(0x718018, 0x718019) AM_WRITE(sys16bootleg_bgscrollx_w)
865   AM_RANGE(0x718020, 0x718021) AM_WRITE(sys16bootleg_fgpage_w)
866   AM_RANGE(0x718028, 0x718029) AM_WRITE(sys16bootleg_bgpage_w)
867   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
868   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w)
869   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
870   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
871   AM_RANGE(0x902000, 0x902001) AM_READ_PORT("DSW2")
872   AM_RANGE(0x902002, 0x902003) AM_READ_PORT("DSW1")
873ADDRESS_MAP_END
1185874
1186static void goldnaxe_update_proc( void )
875
876static UINT16 datsu_page[4];
877
878void datsu_set_pages(void)
1187879{
1188   set_fg_page( sys16_textram[0x740] );
1189   set_bg_page( sys16_textram[0x741] );
1190   sys16_fg_scrolly = sys16_textram[0x748];
1191   sys16_bg_scrolly = sys16_textram[0x749];
1192   sys16_fg_scrollx = sys16_textram[0x74c];
1193   sys16_bg_scrollx = sys16_textram[0x74d];
880   UINT16 page;
1194881
1195   set_tile_bank( sys16_workingram[0x2c94/2] );
882   page = ((datsu_page[0] & 0x00f0) >>0) |
883         ((datsu_page[1] & 0x00f0) >>4) |
884         ((datsu_page[2] & 0x00f0) <<8) |
885         ((datsu_page[3] & 0x00f0) <<4);
886
887
888   set_fg_page( page );
889
890   page = ((datsu_page[0] & 0x000f) <<4) |
891         ((datsu_page[1] & 0x000f) <<0) |
892         ((datsu_page[2] & 0x000f) <<12) |
893         ((datsu_page[3] & 0x000f) <<8);
894
895   set_bg_page( page );
1196896}
1197897
898static WRITE16_HANDLER( datsu_page0_w )
899{
900   COMBINE_DATA(&datsu_page[0]);
901   datsu_set_pages();
902}
903
904static WRITE16_HANDLER( datsu_page1_w )
905{
906   COMBINE_DATA(&datsu_page[1]);
907   datsu_set_pages();
908}
909
910static WRITE16_HANDLER( datsu_page2_w )
911{
912   COMBINE_DATA(&datsu_page[2]);
913   datsu_set_pages();
914}
915
916static WRITE16_HANDLER( datsu_page3_w )
917{
918   COMBINE_DATA(&datsu_page[3]);
919   datsu_set_pages();
920}
921
922static ADDRESS_MAP_START( bayroute_b2_map, ADDRESS_SPACE_PROGRAM, 16 )
923   AM_RANGE(0x000000, 0x0bffff) AM_ROM
924   AM_RANGE(0x500000, 0x503fff) AM_RAM // work ram
925   AM_RANGE(0x600000, 0x600fff) AM_RAM AM_BASE(&sys16_spriteram)
926   AM_RANGE(0x700000, 0x70ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
927   AM_RANGE(0x710000, 0x710fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
928   AM_RANGE(0x718000, 0x718001) AM_WRITE(sys16bootleg_fgscrolly_w)
929   AM_RANGE(0x718008, 0x718009) AM_WRITE(sys16bootleg_fgscrollx_bank_w) // and tile bank
930   AM_RANGE(0x718010, 0x718011) AM_WRITE(sys16bootleg_bgscrolly_w)
931   AM_RANGE(0x718018, 0x718019) AM_WRITE(sys16bootleg_bgscrollx_w)
932   AM_RANGE(0x718020, 0x718021) AM_WRITE(datsu_page0_w)
933   AM_RANGE(0x718022, 0x718023) AM_WRITE(datsu_page1_w)
934   AM_RANGE(0x718024, 0x718025) AM_WRITE(datsu_page2_w)
935   AM_RANGE(0x718026, 0x718027) AM_WRITE(datsu_page3_w)
936
937   AM_RANGE(0x800000, 0x800fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
938   AM_RANGE(0x900000, 0x900001) AM_READ_PORT("DSW1")
939   AM_RANGE(0x900002, 0x900003) AM_READ_PORT("DSW2")
940   AM_RANGE(0x901000, 0x901001) AM_READ_PORT("SERVICE") AM_WRITE(sys16_coinctrl_w)
941   AM_RANGE(0x901002, 0x901003) AM_READ_PORT("P1")
942   AM_RANGE(0x901006, 0x901007) AM_READ_PORT("P2")
943ADDRESS_MAP_END
944
945static ADDRESS_MAP_START( dduxbl_map, ADDRESS_SPACE_PROGRAM, 16 )
946   AM_RANGE(0x000000, 0x0bffff) AM_ROM
947   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
948   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
949   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
950   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
951   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
952   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
953   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_w)
954   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
955   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
956   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
957   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
958   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
959
960   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(sys16bootleg_fgscrolly_w)
961   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(sys16bootleg_fgscrollx_w)
962   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(sys16bootleg_bgscrolly_w)
963   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(sys16bootleg_bgscrollx_w)
964   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
965   AM_RANGE(0xC46022, 0xC46023) AM_WRITE(datsu_page1_w)
966   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
967   AM_RANGE(0xC46026, 0xC46027) AM_WRITE(datsu_page3_w)
968
969   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
970ADDRESS_MAP_END
971
972static UINT16* goldnax_b2_fgpage;
973static UINT16* goldnax_b2_bgpage;
974
975static WRITE16_HANDLER( goldnax_b2_fgscrollx_w )
976{
977   int scroll = data & 0x1ff;
978   int bank = (data&0xc000)>>14;
979   set_tile_bank( bank );
980   scroll +=0x1f6;
981   scroll &= 0x3ff;
982   sys16_fg_scrollx = -scroll;
983}
984
985static WRITE16_HANDLER( goldnax_b2_bgscrollx_w )
986{
987   int scroll = data & 0x1ff;
988   scroll +=0x1f4;
989   scroll &= 0x3ff;
990   sys16_bg_scrollx = -scroll;
991}
992
993
994static WRITE16_HANDLER( goldnax_b2_fgscrolly_w )
995{
996   int scroll = data & 0xff;
997   scroll += 0x1;
998   sys16_fg_scrolly = scroll;
999}
1000
1001static WRITE16_HANDLER( goldnax_b2_bgscrolly_w )
1002{
1003   int scroll = data & 0xff;
1004   scroll += 0x1;
1005
1006   sys16_bg_scrolly = scroll;
1007}
1008
1009static WRITE16_HANDLER( goldnax_b2_fgpage_w )
1010{
1011   UINT16 page;
1012   COMBINE_DATA(&goldnax_b2_fgpage[offset]);
1013
1014   page = ((goldnax_b2_fgpage[1] & 0xf) << 0) |
1015         ((goldnax_b2_fgpage[0] & 0xf) << 4) |
1016         ((goldnax_b2_fgpage[3] & 0xf) << 8) |
1017         ((goldnax_b2_fgpage[2] & 0xf) << 12);
1018
1019   set_fg_page( page^0xffff );
1020
1021}
1022
1023static WRITE16_HANDLER( goldnax_b2_bgpage_w )
1024{
1025   UINT16 page;
1026   COMBINE_DATA(&goldnax_b2_bgpage[offset]);
1027
1028   page = ((goldnax_b2_bgpage[1] & 0xf) << 0) |
1029         ((goldnax_b2_bgpage[0] & 0xf) << 4) |
1030         ((goldnax_b2_bgpage[3] & 0xf) << 8) |
1031         ((goldnax_b2_bgpage[2] & 0xf) << 12);
1032
1033   set_bg_page( page^0xffff );
1034}
1035
1036static ADDRESS_MAP_START( goldnaxe_b2_map, ADDRESS_SPACE_PROGRAM, 16 )
1037   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1038   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1039   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1040   AM_RANGE(0x140000, 0x143fff) AM_RAM_WRITE( sys16_paletteram_w ) AM_BASE(&paletteram16)
1041   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&sys16_spriteram)
1042   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("DSW2") AM_WRITE(SMH_NOP)
1043   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
1044   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1045   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1046   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
1047   AM_RANGE(0xc43000, 0xc43001) AM_WRITE(SMH_NOP)
1048   AM_RANGE(0xc44000, 0xc44001) AM_WRITE(goldnax_b2_fgscrolly_w)
1049   AM_RANGE(0xc44008, 0xc44009) AM_WRITE(goldnax_b2_fgscrollx_w) // and tile bank
1050   AM_RANGE(0xc44010, 0xc44011) AM_WRITE(goldnax_b2_bgscrolly_w)
1051   AM_RANGE(0xc44018, 0xc44019) AM_WRITE(goldnax_b2_bgscrollx_w)
1052   AM_RANGE(0xc44020, 0xc44027) AM_WRITE(goldnax_b2_bgpage_w) AM_BASE(&goldnax_b2_bgpage)
1053   AM_RANGE(0xc44060, 0xc44067) AM_WRITE(goldnax_b2_fgpage_w) AM_BASE(&goldnax_b2_fgpage)
1054   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(SMH_NOP)
1055   AM_RANGE(0xc43034, 0xc43035) AM_WRITE(SMH_NOP)
1056   AM_RANGE(0xfe0006, 0xfe0007) AM_WRITE(SMH_NOP)
1057   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1058ADDRESS_MAP_END
1059
1060
1061/***************************************************************************/
1062
1063
11981064static MACHINE_RESET( goldnaxe )
11991065{
12001066   static const int bank[16] = {
r4878r4879
12031069      2,3,6,7,
12041070      10,11,0,0
12051071   };
1206#if 0
1207   // protection patch; no longer needed
1208   static const sys16_patch patch =
1209   {
1210      { 0x3CB2, 0x60 },
1211      { 0x3CB3, 0x1e }
1212   };
1213   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
1214#endif
12151072
12161073   sys16_obj_bank = bank;
1217
1218
1219   sys16_sprxoffset = -0xb8;
1220   sys16_update_proc = goldnaxe_update_proc;
12211074}
12221075
1223static DRIVER_INIT( goldnabl )
1076static DRIVER_INIT( goldnab2 )
12241077{
12251078   MACHINE_RESET_CALL(sys16_onetime);
12261079}
r4878r4879
12641117
12651118/***************************************************************************/
12661119
1267static MACHINE_DRIVER_START( goldnaxe )
1120static MACHINE_DRIVER_START( goldnaxe_b1 )
12681121
12691122   /* basic machine hardware */
1123   MDRV_CPU_ADD("maincpu", M68000, 10000000)
1124   MDRV_CPU_PROGRAM_MAP(goldnaxe_b1_map)
1125   MDRV_CPU_VBLANK_INT("screen", sys16_interrupt)
1126
1127   /* video hardware */
1128   MDRV_SCREEN_ADD("screen", RASTER)
1129   MDRV_SCREEN_REFRESH_RATE(60)
1130   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1131   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1132   MDRV_SCREEN_SIZE(40*8, 28*8)
1133   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1134
1135   MDRV_GFXDECODE(sys16)
1136   MDRV_PALETTE_LENGTH(2048*ShadowColorsMultiplier)
1137
1138   MDRV_PALETTE_INIT( all_black )
1139   MDRV_VIDEO_START(system16)
1140   MDRV_VIDEO_UPDATE(system16)
1141
1142   MDRV_MACHINE_RESET(goldnaxe)
1143MACHINE_DRIVER_END
1144
1145
1146static MACHINE_DRIVER_START( goldnaxe_b2 )
1147   /* basic machine hardware */
1148   MDRV_IMPORT_FROM(goldnaxe_b1)
1149   MDRV_CPU_MODIFY("maincpu")
1150   MDRV_CPU_PROGRAM_MAP(goldnaxe_b2_map)
1151MACHINE_DRIVER_END
1152
1153static MACHINE_DRIVER_START( bayrouteb1 )
1154   /* basic machine hardware */
1155   MDRV_IMPORT_FROM(goldnaxe_b1)
1156   MDRV_CPU_MODIFY("maincpu")
1157   MDRV_CPU_PROGRAM_MAP(bayroute_b1_map)
1158MACHINE_DRIVER_END
1159
1160static MACHINE_DRIVER_START( bayrouteb2 )
1161   /* basic machine hardware */
1162   MDRV_IMPORT_FROM(goldnaxe_b1)
1163   MDRV_CPU_MODIFY("maincpu")
1164   MDRV_CPU_PROGRAM_MAP(bayroute_b2_map)
1165MACHINE_DRIVER_END
1166
1167static MACHINE_DRIVER_START( dduxbl )
1168
1169   /* basic machine hardware */
1170   MDRV_IMPORT_FROM(system16)
1171   MDRV_CPU_MODIFY("maincpu")
1172   MDRV_CPU_PROGRAM_MAP(dduxbl_map)
1173MACHINE_DRIVER_END
1174
1175
1176static ADDRESS_MAP_START( fpointbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1177   AM_RANGE(0x000000, 0x0bffff) AM_ROM
1178
1179   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1180   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1181   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1182
1183   AM_RANGE(0x600006, 0x600007) AM_WRITE(sound_command_w)
1184   AM_RANGE(0x601000, 0x601001) AM_READ_PORT("SERVICE")
1185   AM_RANGE(0x601002, 0x601003) AM_READ_PORT("P1")
1186   AM_RANGE(0x601004, 0x601005) AM_READ_PORT("P2")
1187   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
1188   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
1189
1190   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
1191   AM_RANGE(0x843000, 0x843001) AM_WRITENOP
1192
1193   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(sys16bootleg_fgscrolly_w)
1194   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(sys16bootleg_fgscrollx_w)
1195   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(sys16bootleg_bgscrolly_w)
1196   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(sys16bootleg_bgscrollx_w)
1197
1198   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
1199   AM_RANGE(0xc46022, 0xc46023) AM_WRITE(datsu_page1_w)
1200   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
1201   AM_RANGE(0xC46026, 0xC46027) AM_WRITE(datsu_page3_w)
1202
1203   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1204ADDRESS_MAP_END
1205
1206
1207static MACHINE_RESET( fpointbl )
1208{
1209}
1210
1211static DRIVER_INIT( fpointbl )
1212{
1213   MACHINE_RESET_CALL(sys16_onetime);
1214   //sys16_video_config(fpoint_update_proc, -0xb8, NULL);
1215}
1216
1217
1218
1219static MACHINE_DRIVER_START( fpointbl )
1220
1221   /* basic machine hardware */
1222   MDRV_IMPORT_FROM(system16)
1223   MDRV_CPU_MODIFY("maincpu")
1224   MDRV_CPU_PROGRAM_MAP(fpointbl_map)
1225
1226   MDRV_CPU_MODIFY("soundcpu")
1227   MDRV_CPU_PROGRAM_MAP(fpointbl_sound_map)
1228
1229   MDRV_MACHINE_RESET(fpointbl)
1230MACHINE_DRIVER_END
1231
1232
1233
1234static ADDRESS_MAP_START( eswatbl_map, ADDRESS_SPACE_PROGRAM, 16 )
1235   AM_RANGE(0x000000, 0x07ffff) AM_ROM
1236
1237   AM_RANGE(0x3e2000, 0x3e2001) AM_WRITE(eswat_tilebank0_w) // external tile bank ( > 0x4000 tiles )
1238
1239   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1240   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1241   AM_RANGE(0x418000, 0x418001) AM_WRITE(sys16bootleg_bgscrolly_w)
1242   AM_RANGE(0x418008, 0x418009) AM_WRITE(sys16bootleg_bgscrollx_w) // and tile bank
1243   AM_RANGE(0x418010, 0x418011) AM_WRITE(sys16bootleg_fgscrolly_w)
1244   AM_RANGE(0x418018, 0x418019) AM_WRITE(sys16bootleg_fgscrollx_bank_w)
1245   AM_RANGE(0x418020, 0x418021) AM_WRITE(sys16bootleg_bgpage_w)
1246   AM_RANGE(0x418028, 0x418029) AM_WRITE(sys16bootleg_fgpage_w)
1247
1248   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1249   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
1250   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
1251   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
1252   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
1253   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
1254   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
1255   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
1256   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1257   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
1258   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
1259ADDRESS_MAP_END
1260
1261
1262static MACHINE_DRIVER_START( eswatbl )
1263
1264   /* basic machine hardware */
12701265   MDRV_IMPORT_FROM(system16_7759)
12711266   MDRV_CPU_MODIFY("maincpu")
1272   MDRV_CPU_PROGRAM_MAP(goldnaxe_map)
1267   MDRV_CPU_PROGRAM_MAP(eswatbl_map)
12731268
1274   MDRV_MACHINE_RESET(goldnaxe)
1269   MDRV_MACHINE_RESET(eswatbl)
12751270MACHINE_DRIVER_END
12761271
1272
12771273/***************************************************************************/
12781274
1279static ADDRESS_MAP_START( passsht_map, ADDRESS_SPACE_PROGRAM, 16 )
1275
1276/***************************************************************************/
1277
1278
1279static ADDRESS_MAP_START( system16a_bootleg_passsht_map, ADDRESS_SPACE_PROGRAM, 16 )
12801280   AM_RANGE(0x000000, 0x01ffff) AM_ROM
1281   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1282   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1283   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1284   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1281
1282   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on original, buffer on bootleg
1283   AM_RANGE(0x409000, 0x409fff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1284   AM_RANGE(0x40a000, 0x40afff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1285   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1286
1287   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1288   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w ) AM_BASE(&paletteram16)
12851289   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
12861290   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
12871291   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
r4878r4879
12891293   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
12901294   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
12911295   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1292   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1296   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1297   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1298   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1299   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1300   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1301
1302   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
12931303ADDRESS_MAP_END
12941304
12951305static int passht4b_io1_val;
r4878r4879
13471357   return passht4b_io3_val;
13481358}
13491359
1350static ADDRESS_MAP_START( passht4b_map, ADDRESS_SPACE_PROGRAM, 16 )
1360static ADDRESS_MAP_START( system16a_bootleg_passht4b_map, ADDRESS_SPACE_PROGRAM, 16 )
13511361   AM_RANGE(0x000000, 0x01ffff) AM_ROM
1352   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1353   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1354   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1355   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1362   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on original, buffer on bootleg
1363   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1364   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1365   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1366   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1367   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
13561368   AM_RANGE(0xc41000, 0xc41001) AM_READ(passht4b_service_r)
13571369   AM_RANGE(0xc41002, 0xc41003) AM_READ(passht4b_io1_r)
13581370   AM_RANGE(0xc41004, 0xc41005) AM_READ(passht4b_io2_r)
r4878r4879
13651377   AM_RANGE(0xc43004, 0xc43005) AM_READ_PORT("P3")
13661378   AM_RANGE(0xc43006, 0xc43007) AM_READ_PORT("P4")
13671379   AM_RANGE(0xc4600a, 0xc4600b) AM_WRITE(sys16_coinctrl_w)   /* coin counter doesn't work */
1368   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1380   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1381   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1382   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1383   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1384   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1385
1386   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
13691387ADDRESS_MAP_END
13701388
13711389/***************************************************************************/
13721390
1373static void passsht_update_proc( void )
1374{
1375   sys16_fg_scrollx = sys16_workingram[0x34be/2];
1376   sys16_bg_scrollx = sys16_workingram[0x34c2/2];
1377   sys16_fg_scrolly = sys16_workingram[0x34bc/2];
1378   sys16_bg_scrolly = sys16_workingram[0x34c0/2];
13791391
1380   set_fg_page( sys16_textram[0x0ff6/2] );
1381   set_bg_page( sys16_textram[0x0ff4/2] );
1382}
1383
1384static void passht4b_update_proc( void )
1385{
1386   sys16_fg_scrollx = sys16_workingram[0x34ce/2];
1387   sys16_bg_scrollx = sys16_workingram[0x34d2/2];
1388   sys16_fg_scrolly = sys16_workingram[0x34cc/2];
1389   sys16_bg_scrolly = sys16_workingram[0x34d0/2];
1390
1391   set_fg_page( sys16_textram[0x0ff6/2] );
1392   set_bg_page( sys16_textram[0x0ff4/2] );
1393}
1394
13951392static MACHINE_RESET( passsht )
13961393{
1397   // fix name entry
1398   static const sys16_patch patch[] =
1399   {
1400      { 0x13a8,0xc0 }
1401   };
1402
1403   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
14041394   sys16_sprxoffset = -0x48;
1405   sys16_spritesystem = sys16_sprite_passshot;
1406
1407   sys16_update_proc = passsht_update_proc;
14081395}
14091396
14101397static MACHINE_RESET( passht4b )
14111398{
1412   // fix name entry
1413   static const sys16_patch patch[] =
1414   {
1415      { 0x138a,0xc0 }
1416   };
1417
1418   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
14191399   sys16_sprxoffset = -0xb8;
1420   sys16_spritesystem = sys16_sprite_passshot;
1421
1422   sys16_update_proc = passht4b_update_proc;
14231400}
14241401
14251402static DRIVER_INIT( passsht )
r4878r4879
15231500   /* basic machine hardware */
15241501   MDRV_IMPORT_FROM(system16_7759)
15251502   MDRV_CPU_MODIFY("maincpu")
1526   MDRV_CPU_PROGRAM_MAP(passsht_map)
1503   MDRV_CPU_PROGRAM_MAP(system16a_bootleg_passsht_map)
15271504
1505   MDRV_VIDEO_START( system16a_bootleg )
1506   MDRV_VIDEO_UPDATE( system16a_bootleg )
1507
15281508   MDRV_MACHINE_RESET(passsht)
15291509MACHINE_DRIVER_END
15301510
r4878r4879
15341514   /* basic machine hardware */
15351515   MDRV_IMPORT_FROM(system16_7759)
15361516   MDRV_CPU_MODIFY("maincpu")
1537   MDRV_CPU_PROGRAM_MAP(passht4b_map)
1517   MDRV_CPU_PROGRAM_MAP(system16a_bootleg_passht4b_map)
15381518
1519   MDRV_VIDEO_START( system16a_bootleg )
1520   MDRV_VIDEO_UPDATE( system16a_bootleg_passht4b )
1521
15391522   MDRV_MACHINE_RESET(passht4b)
15401523MACHINE_DRIVER_END
15411524
r4878r4879
15711554
15721555/***************************************************************************/
15731556
1574static ADDRESS_MAP_START( shinobl_map, ADDRESS_SPACE_PROGRAM, 16 )
1557static ADDRESS_MAP_START( system16a_bootleg_shinobi_map, ADDRESS_SPACE_PROGRAM, 16 )
15751558   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1576   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1577   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1578   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1579   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1559   AM_RANGE(0x400000, 0x40ffff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
1560   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1561   AM_RANGE(0x411000, 0x411fff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1562   AM_RANGE(0x412000, 0x412fff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1563   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1564   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
15801565   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sound_command_nmi_w)
1581   AM_RANGE(0xc40002, 0xc40003) AM_WRITE(sys16_3d_coinctrl_w)
15821566   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
15831567   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
15841568   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P2")
15851569   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW1")
15861570   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW2")
1587   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1571   AM_RANGE(0xC43000, 0xC43001) AM_WRITENOP
1572   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
1573   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1574   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1575   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1576   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1577   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1578   AM_RANGE(0xC60000, 0xC60001) AM_READNOP
1579   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
15881580ADDRESS_MAP_END
15891581
15901582/***************************************************************************/
15911583
1592static void shinobl_update_proc( void )
1593{
1594   set_bg_page( sys16_textram[0x74e] );
1595   set_fg_page( sys16_textram[0x74f] );
1596   sys16_fg_scrolly = sys16_textram[0x792] & 0x00ff;
1597   sys16_bg_scrolly = sys16_textram[0x793] & 0x01ff;
1598   sys16_fg_scrollx = sys16_textram[0x7fc] & 0x01ff;
1599   sys16_bg_scrollx = sys16_textram[0x7fd] & 0x01ff;
1600}
16011584
1585
16021586static MACHINE_RESET( shinobl )
16031587{
16041588   static const int bank[16] = {
r4878r4879
16101594   sys16_sprxoffset = -0xbc;
16111595   sys16_fgxoffset = sys16_bgxoffset = 7;
16121596   sys16_tilebank_switch=0x2000;
1613
1614   sys16_update_proc = shinobl_update_proc;
16151597}
16161598
16171599static DRIVER_INIT( shinobl )
r4878r4879
16221604
16231605/***************************************************************************/
16241606
1625static MACHINE_DRIVER_START( shinob2 )
1607static MACHINE_DRIVER_START( system16a_bootleg_shinobi )
16261608
16271609   /* basic machine hardware */
16281610   MDRV_IMPORT_FROM(system16)
16291611   MDRV_CPU_MODIFY("maincpu")
1630   MDRV_CPU_PROGRAM_MAP(shinobl_map)
1612   MDRV_CPU_PROGRAM_MAP(system16a_bootleg_shinobi_map)
16311613
1614   MDRV_VIDEO_START( system16a_bootleg )
1615   MDRV_VIDEO_UPDATE( system16a_bootleg )
1616
16321617   MDRV_MACHINE_RESET(shinobl)
16331618MACHINE_DRIVER_END
16341619
16351620/***************************************************************************/
16361621
1637/* bootleg has extra ram for regs? */
16381622
16391623static ADDRESS_MAP_START( tetrisbl_map, ADDRESS_SPACE_PROGRAM, 16 )
16401624   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1641   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1642   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1643   AM_RANGE(0x418000, 0x41803f) AM_READWRITE(SYS16_MRA16_EXTRAM2, SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
1644   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1645   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1625   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1626   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1627
1628   AM_RANGE(0x418000, 0x418001) AM_WRITE(sys16bootleg_fgscrolly_w)
1629   AM_RANGE(0x418008, 0x418009) AM_WRITE(sys16bootleg_fgscrollx_w)
1630   AM_RANGE(0x418010, 0x418011) AM_WRITE(sys16bootleg_bgscrolly_w)
1631   AM_RANGE(0x418018, 0x418019) AM_WRITE(sys16bootleg_bgscrollx_w)
1632   AM_RANGE(0x418020, 0x418021) AM_WRITE(sys16bootleg_fgpage_w)
1633   AM_RANGE(0x418028, 0x418029) AM_WRITE(sys16bootleg_bgpage_w)
1634
1635   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1636   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
16461637   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
16471638   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
16481639   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r4878r4879
16521643   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
16531644   AM_RANGE(0xc43034, 0xc43035) AM_WRITENOP
16541645   AM_RANGE(0xc80000, 0xc80001) AM_NOP
1655   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1646   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
16561647ADDRESS_MAP_END
16571648
16581649
1659static READ16_HANDLER(beautyb_unk1_r)
1650static READ16_HANDLER( beautyb_unkx_r )
16601651{
1661
1662   return mame_rand(space->machine);;
1652   static int x = 0;
1653   x++;
1654   x&=0x7f;
1655   return x;
16631656}
16641657
1665
1666static READ16_HANDLER(beautyb_unk2_r)
1667{
1668   return mame_rand(space->machine);
1669}
1670
16711658static ADDRESS_MAP_START( beautyb_map, ADDRESS_SPACE_PROGRAM, 16 )
16721659   AM_RANGE(0x000000, 0x00ffff) AM_ROM AM_WRITENOP
1673   //AM_RANGE(0x010000, 0x03ffff) AM_WRITENOP
1660   AM_RANGE(0x010000, 0x03ffff) AM_WRITENOP
16741661
1675   AM_RANGE(0x0280D6, 0x0280D7) AM_READ(beautyb_unk2_r)
1676   AM_RANGE(0x0280D8, 0x0280D9) AM_READ(beautyb_unk2_r)
1662   AM_RANGE(0x0280D6, 0x0280D7) AM_READ(beautyb_unkx_r)
1663   AM_RANGE(0x0280D8, 0x0280D9) AM_READ(beautyb_unkx_r)
16771664
1678   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1679   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1680   AM_RANGE(0x418000, 0x41803f) AM_READWRITE(SYS16_MRA16_EXTRAM2, SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
1681   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1682   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1665   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1666   AM_RANGE(0x410000, 0x413fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
16831667
1684   AM_RANGE(0xC41000, 0xC41001) AM_READ(beautyb_unk1_r )
1685   AM_RANGE(0xC41002, 0xC41003) AM_READ(beautyb_unk1_r )
1668   AM_RANGE(0x418000, 0x418001) AM_WRITE(sys16bootleg_bgscrolly_w)
1669   AM_RANGE(0x418008, 0x418009) AM_WRITE(sys16bootleg_bgscrollx_w)
1670   AM_RANGE(0x418010, 0x418011) AM_WRITE(sys16bootleg_fgscrolly_w)
1671   AM_RANGE(0x418018, 0x418019) AM_WRITE(sys16bootleg_fgscrollx_w)
1672   AM_RANGE(0x418020, 0x418021) AM_WRITE(sys16bootleg_bgpage_w)
1673   AM_RANGE(0x418028, 0x418029) AM_WRITE(sys16bootleg_fgpage_w)
16861674
1675   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1676   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
1677
1678   AM_RANGE(0xC41000, 0xC41001) AM_READ(beautyb_unkx_r )
1679   AM_RANGE(0xC41002, 0xC41003) AM_READ(beautyb_unkx_r )
1680
16871681   AM_RANGE(0xc40000, 0xc40001) AM_WRITENOP
16881682   AM_RANGE(0xc80000, 0xc80001) AM_WRITENOP
16891683
1690   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1684   AM_RANGE(0xffc000, 0xffffff) AM_RAM // work ram
16911685ADDRESS_MAP_END
16921686
16931687/***************************************************************************/
16941688
1695static void tetris_bootleg_update_proc( void )
1696{
1697   sys16_fg_scrolly = sys16_textram[0x748];
1698   sys16_bg_scrolly = sys16_textram[0x749];
1699   sys16_fg_scrollx = sys16_textram[0x74c];
1700   sys16_bg_scrollx = sys16_textram[0x74d];
1701
1702   set_fg_page( sys16_extraram2[0x38/2] );
1703   set_bg_page( sys16_extraram2[0x28/2] );
1704}
1705
1706
17071689static MACHINE_RESET( tetrisbl )
17081690{
1709#if 0
1710   static const sys16_patch patch[] =
1711   {
1712      { 0xba6, 0x4e },
1713      { 0xba7, 0x71 }
1714   };
1715
1716   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
1717#endif
1718
17191691   sys16_sprxoffset = -0x40;
1720   sys16_update_proc = tetris_bootleg_update_proc;
17211692}
17221693
1723
17241694static DRIVER_INIT( tetrisbl )
17251695{
17261696   MACHINE_RESET_CALL(sys16_onetime);
r4878r4879
17751745
17761746/***************************************************************************/
17771747
1778static READ16_HANDLER( tt_io_player1_r )
1779{
1780   return input_port_read(space->machine, "P1") << 8;
1781}
1782
1783static READ16_HANDLER( tt_io_player2_r )
1784{
1785   return input_port_read(space->machine, "P2") << 8;
1786}
1787
1788static READ16_HANDLER( tt_io_service_r )
1789{
1790   return input_port_read(space->machine, "SERVICE") << 8;
1791}
1792
1793/*
1794    This game has a MCU which does the following:
1795    - Get Z80 sound command out of work RAM and write to Z80 sound command register
1796    - Read input ports and store to work RAM
1797
1798    The routine which stores the sound code in RAM looks like this:
1799
1800    ; D0 = sound command
1801    movem.l    d0-d1/a0, -(a7)
1802    lea        $2001d6, a0         ; base of 16-byte circular buffer
1803    move.w     $2001d4, d1         ; get buffer index
1804    move.b     d0, (a0, d1.w)      ; write sound command to buffer
1805    addq.w     #1, d1              ; next buffer index
1806    andi.w     #$000f, d1          ; wrap buffer index
1807    move.w     d1, $2001d4         ; save buffer index
1808    addq.w     #1, $2001d2         ; bump 'sound code written' flag
1809    movem.l    (a7)+, d0-d1/a0
1810    rts
1811
1812    Most likely the MCU reads $2001D2 and copies the sound byte from $2001D6+$2001D4 to the sound command register.
1813    In tturfbl, a JSR is inserted over the first LEA instruction to a subroutine which copies D0 to the sound command
1814    register at $600007, and restores a0 to $2001D6 before returning.
1815
1816    If the circular buffer is to prioritize sound requests, then this effect is lost in tturfbl. If it's just to
1817    be tricky, tturfbl handles it correctly.
1818*/
1819
18201748static INPUT_PORTS_START( tturf )
18211749   PORT_INCLUDE( sys16_common )
18221750
r4878r4879
18491777
18501778static ADDRESS_MAP_START( tturfbl_map, ADDRESS_SPACE_PROGRAM, 16 )
18511779   AM_RANGE(0x000000, 0x03ffff) AM_ROM
1852   AM_RANGE(0x2001e6, 0x2001e7) AM_READ(tt_io_service_r)
1853   AM_RANGE(0x2001e8, 0x2001e9) AM_READ(tt_io_player1_r)
1854   AM_RANGE(0x2001ea, 0x2001eb) AM_READ(tt_io_player2_r)
1855   AM_RANGE(0x200000, 0x203fff) AM_READWRITE(SYS16_MRA16_EXTRAM, SYS16_MWA16_EXTRAM) AM_BASE(&sys16_extraram)
1856   AM_RANGE(0x300000, 0x300fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1857   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1858   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1859   AM_RANGE(0x500000, 0x500fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1780   AM_RANGE(0x200000, 0x203fff) AM_RAM // work ram
1781   AM_RANGE(0x300000, 0x300fff) AM_RAM AM_BASE(&sys16_spriteram)
1782   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
1783   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
1784   AM_RANGE(0x500000, 0x500fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
18601785   AM_RANGE(0x600000, 0x600001) AM_WRITE(sys16_coinctrl_w)
18611786   AM_RANGE(0x600000, 0x600001) AM_READ_PORT("DSW2")
18621787   AM_RANGE(0x600002, 0x600003) AM_READ_PORT("DSW1")
r4878r4879
18671792   AM_RANGE(0x602000, 0x602001) AM_READ_PORT("DSW2")
18681793   AM_RANGE(0x602002, 0x602003) AM_READ_PORT("DSW1")
18691794   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP
1870   AM_RANGE(0xc46000, 0xc4601f) AM_READWRITE(SYS16_MRA16_EXTRAM3, SYS16_MWA16_EXTRAM3) AM_BASE(&sys16_extraram3)
1871   AM_RANGE(0xff0020, 0xff003f) AM_WRITENOP // config regs
1795
1796   AM_RANGE(0xC46000, 0xC46001) AM_WRITE(sys16bootleg_fgscrolly_w)
1797   AM_RANGE(0xC46008, 0xC46009) AM_WRITE(sys16bootleg_fgscrollx_w)
1798   AM_RANGE(0xC46010, 0xC46011) AM_WRITE(sys16bootleg_bgscrolly_w)
1799   AM_RANGE(0xC46018, 0xC46019) AM_WRITE(sys16bootleg_bgscrollx_w)
1800   AM_RANGE(0xC46020, 0xC46021) AM_WRITE(datsu_page0_w)
1801   AM_RANGE(0xc46022, 0xc46023) AM_WRITE(datsu_page1_w)
1802   AM_RANGE(0xC46024, 0xC46025) AM_WRITE(datsu_page2_w)
1803   AM_RANGE(0xC46026, 0xC46027) AM_WRITE(datsu_page3_w)
18721804ADDRESS_MAP_END
18731805
18741806/***************************************************************************/
18751807
1876static void tturfbl_update_proc( void )
1877{
1878   sys16_fg_scrollx = sys16_textram[0x74c] & 0x01ff;
1879   sys16_bg_scrollx = sys16_textram[0x74d/2] & 0x01ff;
1880   sys16_fg_scrolly = sys16_textram[0x748];
1881   sys16_bg_scrolly = sys16_textram[0x749];
18821808
1883
1884   {
1885      int data1,data2;
1886
1887      data1 = sys16_textram[0x740];
1888      data2 = sys16_textram[0x741];
1889
1890      sys16_fg_page[3] = data1>>12;
1891      sys16_bg_page[3] = (data1>>8)&0xf;
1892      sys16_fg_page[1] = (data1>>4)&0xf;
1893      sys16_bg_page[1] = data1&0xf;
1894
1895      sys16_fg_page[2] = data2>>12;
1896      sys16_bg_page[2] = (data2>>8)&0xf;
1897      sys16_fg_page[0] = (data2>>4)&0xf;
1898      sys16_bg_page[0] = data2&0xf;
1899   }
1900}
1901
19021809static MACHINE_RESET( tturfbl )
19031810{
19041811   static const int bank[16] = {
r4878r4879
19091816   };
19101817   sys16_obj_bank = bank;
19111818   sys16_sprxoffset = -0x48;
1912
1913   sys16_update_proc = tturfbl_update_proc;
19141819}
19151820
19161821static DRIVER_INIT( tturfbl )
r4878r4879
19241829}
19251830
19261831/***************************************************************************/
1927// sound ??
1832
19281833static MACHINE_DRIVER_START( tturfbl )
19291834
19301835   /* basic machine hardware */
r4878r4879
19781883static ADDRESS_MAP_START( wb3bbl_map, ADDRESS_SPACE_PROGRAM, 16 )
19791884   AM_RANGE(0x000000, 0x03ffff) AM_ROM
19801885   AM_RANGE(0x3f0000, 0x3fffff) AM_WRITE(sys16_tilebank_w)
1981   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
1982   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
1983   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
1984   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
1886   AM_RANGE(0x400000, 0x407fff) AM_RAM // tilemap ram on the original, used as a buffer on the bootlegs
1887   AM_RANGE(0x409000, 0x40afff) AM_RAM AM_BASE(&system16a_bootleg_bg0_tileram)
1888   AM_RANGE(0x40a000, 0x40bfff) AM_RAM AM_BASE(&system16a_bootleg_bg1_tileram)
1889   AM_RANGE(0x410000, 0x410fff) AM_RAM AM_BASE(&sys16_textram)
1890   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
1891   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w )  AM_BASE(&paletteram16)
19851892   AM_RANGE(0xc40000, 0xc40001) AM_WRITE(sys16_coinctrl_w)
19861893   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
19871894   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
r4878r4879
19891896   AM_RANGE(0xc42000, 0xc42001) AM_READ_PORT("DSW2")
19901897   AM_RANGE(0xc42002, 0xc42003) AM_READ_PORT("DSW1")
19911898   AM_RANGE(0xc42006, 0xc42007) AM_WRITE(sound_command_w)
1992   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP
1993   AM_RANGE(0xc46000, 0xc4601f) AM_READWRITE(SYS16_MRA16_EXTRAM3, SYS16_MWA16_EXTRAM3) AM_BASE(&sys16_extraram3)
1994   AM_RANGE(0xff0000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
1899   AM_RANGE(0xC44000, 0xC44001) AM_WRITENOP
1900   AM_RANGE(0xc46000, 0xc46001) AM_WRITE(system16a_bootleg_bgscrolly_w)
1901   AM_RANGE(0xc46002, 0xc46003) AM_WRITE(system16a_bootleg_bgscrollx_w)
1902   AM_RANGE(0xc46004, 0xc46005) AM_WRITE(system16a_bootleg_fgscrolly_w)
1903   AM_RANGE(0xc46006, 0xc46007) AM_WRITE(system16a_bootleg_fgscrollx_w)
1904   AM_RANGE(0xc46008, 0xc46009) AM_WRITE(system16a_bootleg_tilemapselect_w)
1905   AM_RANGE(0xff0000, 0xffffff) AM_RAM // work ram
19951906ADDRESS_MAP_END
19961907
19971908/***************************************************************************/
19981909
1999static void wb3bbl_update_proc( void )
2000{
2001
2002   sys16_fg_scrollx = sys16_workingram[0xc030/2];
2003   sys16_bg_scrollx = sys16_workingram[0xc038/2];
2004   sys16_fg_scrolly = sys16_workingram[0xc032/2];
2005   sys16_bg_scrolly = sys16_workingram[0xc03c/2];
2006
2007   set_fg_page( sys16_textram[0x0ff6/2] );
2008   set_bg_page( sys16_textram[0x0ff4/2] );
2009}
2010
20111910static MACHINE_RESET( wb3bbl )
20121911{
20131912   static const int bank[16] = {
r4878r4879
20201919      0,1,
20211920      0,0
20221921   };
2023#if 1
2024   static const sys16_patch patch[] =
2025   {
2026      { 0x17058, 0x4e },
2027      { 0x17059, 0xb9 },
2028      { 0x1705a, 0x00 },
2029      { 0x1705b, 0x00 },
2030      { 0x1705c, 0x09 },
2031      { 0x1705d, 0xdc },
2032      { 0x1705e, 0x4e },
2033      { 0x1705f, 0xf9 },
2034      { 0x17060, 0x00 },
2035      { 0x17061, 0x01 },
2036      { 0x17062, 0x70 },
2037      { 0x17063, 0xe0 },
2038      { 0x1a3a, 0x31 },
2039      { 0x1a3b, 0x7c },
2040      { 0x1a3c, 0x80 },
2041      { 0x1a3d, 0x00 },
2042      { 0x23df8, 0x14 },
2043      { 0x23df9, 0x41 },
2044      { 0x23dfa, 0x10 },
2045      { 0x23dfd, 0x14 },
2046      { 0x23dff, 0x1c }
2047   };
20481922
2049   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
2050#endif
20511923   sys16_obj_bank = bank;
2052   sys16_update_proc = wb3bbl_update_proc;
20531924}
20541925
20551926static DRIVER_INIT( wb3bbl )
r4878r4879
20591930
20601931/***************************************************************************/
20611932
2062static MACHINE_DRIVER_START( wb3bbl )
1933static MACHINE_DRIVER_START( system16a_bootleg_wb3 )
20631934
20641935   /* basic machine hardware */
20651936   MDRV_IMPORT_FROM(system16)
20661937   MDRV_CPU_MODIFY("maincpu")
20671938   MDRV_CPU_PROGRAM_MAP(wb3bbl_map)
20681939
1940   MDRV_VIDEO_START( system16a_bootleg )
1941   MDRV_VIDEO_UPDATE( system16a_bootleg )
1942
20691943   MDRV_MACHINE_RESET(wb3bbl)
20701944MACHINE_DRIVER_END
20711945
20721946/*****************************************************************************/
20731947
2074ROM_START( bayrtbl1 )
1948// protected + encrypted bootleg
1949ROM_START( bayrouteb1 )
20751950   ROM_REGION( 0xc0000, "maincpu", 0 ) /* 68000 code */
20761951   ROM_LOAD16_BYTE( "b4.bin", 0x000000, 0x10000, CRC(eb6646ae) SHA1(073bc0a3868e70785f44e497a949cd9e3b591a33) )
20771952   ROM_LOAD16_BYTE( "b2.bin", 0x000001, 0x10000, CRC(ecd9cd0e) SHA1(177c38ca02c4e87d6adcae77ce4e9237938d23a9) )
r4878r4879
20811956   ROM_LOAD16_BYTE( "b8.bin", 0x0a0000, 0x10000, CRC(e7ca0331) SHA1(b255939576a84f4d266f31a7fde818e04ff35b24) )
20821957   ROM_LOAD16_BYTE( "b6.bin", 0x0a0001, 0x10000, CRC(2bc748a6) SHA1(9ab760377fde24cecb703726ee3e59ee23d60a3a) )
20831958
2084   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
1959   // interrupt code, taken from the other bootleg set(!)
1960   ROM_LOAD( "protdata", 0x0bf000, 0x01000, BAD_DUMP CRC(5474fd95) SHA1(1cbd47aa8f8b9641ba81942bcaae0bc768fd33fd) )
1961
1962   // there clearly should be some kind of MCU on this bootleg to put the interrupt code in RAM
1963   // as the game code waits for this to happen, and the interrupt points there
1964   ROM_REGION( 0xc0000, "mcu", 0 ) /* MCU code */
1965   ROM_LOAD( "unknown.mcu", 0x0000, 0x1000, NO_DUMP )
1966
1967
1968   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE |ROMREGION_INVERT) /* tiles */
20851969   ROM_LOAD( "bs16.bin", 0x00000, 0x10000, CRC(a8a5b310) SHA1(8883e1ed48a3e0f7b4c36d83579f93e84e28568c) )
20861970   ROM_LOAD( "bs14.bin", 0x10000, 0x10000, CRC(6bc4d0a8) SHA1(90b9a61c7a140291d72554857ce26d54ebf03fc2) )
20871971   ROM_LOAD( "bs12.bin", 0x20000, 0x10000, CRC(c1f967a6) SHA1(8eb6bbd9e17dc531830bc798b8485c8ea999e56e) )
r4878r4879
21001984   ROM_LOAD( "epr12459.a10", 0x00000, 0x08000, CRC(3e1d29d0) SHA1(fe3d985983e5132e8a26a02a3f2d8d420cbf1a49) )
21011985   ROM_LOAD( "mpr12460.a11", 0x10000, 0x20000, CRC(0bae570d) SHA1(05fa4a3405666342ab66e696a7344cca97569f19) )
21021986   ROM_LOAD( "mpr12461.a12", 0x30000, 0x20000, CRC(b03b8b46) SHA1(b0283ac377d464f3d9374a992192ec6c515a3c2f) )
1987
1988   // this is taken from the encrypted golden axe bootleg, the encryption is identical, so it was probably just missing from this dump
1989   ROM_REGION( 0x30000, "decryption", 0 ) // a 0x800 byte repeating rom containing part of an MS-DOS executable, used as the decryption key
1990   ROM_LOAD( "12.12",     0x00000, 0x08000, CRC(81ce4576) SHA1(84eea0ab8d8ea8869c12f0b603b91b1188d0e288) )
21031991ROM_END
21041992
2105ROM_START( bayrtbl2 )
1993// unprotected bootleg
1994ROM_START( bayrouteb2 )
21061995   ROM_REGION( 0xc0000, "maincpu", 0 ) /* 68000 code */
21071996   ROM_LOAD16_BYTE( "br_04", 0x000000, 0x10000, CRC(2e33ebfc) SHA1(f6b5a4bd28d302abd6b1e5a9ec6f2a8b57ff213e) )
21081997   ROM_LOAD16_BYTE( "br_06", 0x000001, 0x10000, CRC(3db42313) SHA1(e1c874ebf83e1a458cefaa038fbe89a9804ca30d) )
r4878r4879
21112000   ROM_LOAD16_BYTE( "br_05", 0x080001, 0x20000, CRC(552e6384) SHA1(2770b0c9d961671576e09ada2ebd7bb486f24547) )
21122001
21132002   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
2114   ROM_LOAD( "br_15",    0x00000, 0x10000, CRC(050079a9) SHA1(4b356eddec2f500fb0dcc20af6b7aed2f9ef0c02) )
2115   ROM_LOAD( "br_16",    0x10000, 0x10000, CRC(fc371928) SHA1(b36866c95bdc440aae999a90ecf3bbaed11d4351) )
2003   /* roms in this set were bad dumps, except for bs12, replaced with roms from above set which should be good versions */
2004   ROM_LOAD( "bs16.bin", 0x00000, 0x10000, CRC(a8a5b310) SHA1(8883e1ed48a3e0f7b4c36d83579f93e84e28568c) )
2005   ROM_LOAD( "bs14.bin", 0x10000, 0x10000, CRC(6bc4d0a8) SHA1(90b9a61c7a140291d72554857ce26d54ebf03fc2) )
21162006   ROM_LOAD( "bs12.bin", 0x20000, 0x10000, CRC(c1f967a6) SHA1(8eb6bbd9e17dc531830bc798b8485c8ea999e56e) )
21172007
21182008   ROM_REGION( 0x080000, "gfx2", 0 ) /* sprites */
r4878r4879
21902080
21912081// sys16B
21922082ROM_START( fpointbl )
2193   ROM_REGION( 0x020000, "maincpu", 0 ) /* 68000 code */
2083   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
21942084   ROM_LOAD16_BYTE( "flpoint.003", 0x000000, 0x10000, CRC(4d6df514) SHA1(168aa1629ab7152ba1984605155406b236954a2c) )
21952085   ROM_LOAD16_BYTE( "flpoint.002", 0x000001, 0x10000, CRC(4dff2ee8) SHA1(bd157d8c168d45e7490a05d5e1e901d9bdda9599) )
21962086
r4878r4879
22082098ROM_END
22092099
22102100ROM_START( fpointbj )
2211   ROM_REGION( 0x020000, "maincpu", 0 ) /* 68000 code */
2101   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
22122102   ROM_LOAD16_BYTE( "boot2.003", 0x000000, 0x10000, CRC(6c00d1b0) SHA1(fd0c47b8ca010a64d3ef91980f93854ebc98fbda) )
22132103   ROM_LOAD16_BYTE( "boot2.002", 0x000001, 0x10000, CRC(c1fcd704) SHA1(697bef464e53fb9891ed15ee2d6210107b693b20) )
22142104
r4878r4879
22352125   ROM_LOAD( "fpointbj_gal20v8.bin", 0x0400, 0x019d, NO_DUMP ) /* Protected */
22362126ROM_END
22372127
2238/* This is a frankenset, it has original and bootleg roms of different sizes and names mixed together, it's
2239   highly unlikely that the original bootleg PCB was like this */
2240ROM_START( goldnabl )
2128static UINT8 *decrypted_region;
2129
2130DRIVER_INIT( goldnabl )
2131{
2132   int i;
2133   UINT8 *ROM = memory_region(machine, "maincpu");
2134   UINT8* KEY = memory_region(machine, "decryption");
2135   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2136   UINT8 data[0x1000];
2137
2138   // the decryption key is in a rom (part of an MSDOS executable...)
2139   for (i=0;i<0x800;i++)
2140   {
2141      KEY[i] = KEY[i] ^ 0xff;
2142      data[(i*2)+0] = ((KEY[i] & 0x80) >> 1) | ((KEY[i] & 0x40) >> 2) | ((KEY[i] & 0x20) >> 3) | ((KEY[i] & 0x10) >> 4);
2143      data[(i*2)+1] = ((KEY[i] & 0x08) << 3) | ((KEY[i] & 0x04) << 2) | ((KEY[i] & 0x02) << 1) | ((KEY[i] & 0x01) << 0);
2144   }
2145
2146   decrypted_region = auto_alloc_array(machine, UINT8, 0xc0000);
2147   memcpy (decrypted_region, ROM, 0xc0000);
2148
2149   for (i = 0;i < 0x40000;i++)
2150   {
2151      decrypted_region[i] = ROM[i] ^ data[(i&0xfff)^1];
2152   }
2153
2154   memory_set_decrypted_region(space, 0x00000, 0xbffff, decrypted_region);
2155
2156   MACHINE_RESET_CALL(sys16_onetime);
2157}
2158
2159
2160DRIVER_INIT( bayrouteb1 )
2161{
2162   // it has the same encryption as the golden axe bootleg!
2163   //
2164   // but also some protection, probably code provided in RAM by an MCU
2165   //
2166   // for now we use the code which is present in the unprotected bootleg set
2167   // and modify the rom to use it
2168   UINT16 *ROM2;
2169   UINT16* decrypted_region2;
2170
2171   // decrypt
2172   DRIVER_INIT_CALL( goldnabl );
2173
2174   ROM2 = (UINT16*)memory_region(machine, "maincpu");
2175   decrypted_region2 = (UINT16*)decrypted_region;
2176
2177   // patch interrupt vector
2178   ROM2[0x0070/2] = 0x000b;
2179   ROM2[0x0072/2] = 0xf000;
2180
2181   // patch check for code in RAM
2182   decrypted_region2[0x107e/2] = 0x48e7;
2183   decrypted_region2[0x1080/2] = 0x000b;
2184   decrypted_region2[0x1082/2] = 0xf000;
2185}
2186
2187static DRIVER_INIT( bayrouteb2 )
2188{
2189   MACHINE_RESET_CALL(sys16_onetime);
2190}
2191
2192/*
2193
2194this is a more complete dump of the old encrypted bootleg set
2195
2196Golden Axe (different HW bottleg)
2197
2198Anno    1989
2199Produttore
2200N.revisione
2201CPU main PCB:
22021x 68000 (main)(missing)
22031x LH0080B-Z80B-CPU (sound)
22041x D7759C (sound)
22051x YM2151 (sound)
22061x YM3012 (sound)
22071x UPC1241H (sound)
22081x oscillator 20.000 (close to main)
22091x oscillator 24.000MHz (close to sound)
22101x blue resonator 655K (close to sound)
2211ROMs    main PCB:
22122x NMC27C512 (1,3)
22132x NMC27C256 (2,12)
22148x TMS27PC512 (4,5,6,7,8,9,10,11)
2215
2216roms PCB:
221729x Am27C512 (13-32,34-42)
22181x NMC27C512 (33)
22191x PROM N82S129N
2220
2221
2222RAMs:
2223main PCB:
22241x GM76C28
22252x GM76C88
22262x HM6116K
2227
2228roms PCB:
22298x LC3517BS
22302x 256K S BGD-A
2231
2232
2233PLDs:
2234main PCB:
22353x PAL16L8ACN (not dumped)
2236
2237roms PCB:
22381x PEEL18CV8P (not dumped)
2239Note    main PCB:
22401x JAMMA edge connector
22412x 50 pins flat cable connector to roms PCB
22421x trimmer (volume)
22432x 8x2 switches dip
2244
2245roms PCB:
22462x 50 pins flat cable connector to roms PCB
2247*/
2248
2249ROM_START( goldnaxeb1 )
22412250   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
2242// protected code
2243   ROM_LOAD16_BYTE( "ga6.a22", 0x00000, 0x10000, CRC(f95b459f) SHA1(dadf66d63454ed62fefa521d4fed249d28c63778) )
2244   ROM_LOAD16_BYTE( "ga4.a20", 0x00001, 0x10000, CRC(83eabdf5) SHA1(1effef966f513fbdec2026d535658e17ef7dea51) )
2245   ROM_LOAD16_BYTE( "ga11.a27",0x20000, 0x10000, CRC(f4ef9349) SHA1(3ffa335e74ffbc10f80387268da659643c566897) )
2246   ROM_LOAD16_BYTE( "ga8.a24", 0x20001, 0x10000, CRC(37a65839) SHA1(6e8055d91b840afd8526041d3752c0a55eaebe0c) )
2251   // encrypted code
2252   ROM_LOAD16_BYTE( "6.6",   0x00000, 0x10000, CRC(f95b459f) SHA1(dadf66d63454ed62fefa521d4fed249d28c63778) )
2253   ROM_LOAD16_BYTE( "4.4",   0x00001, 0x10000, CRC(83eabdf5) SHA1(1effef966f513fbdec2026d535658e17ef7dea51) )
2254   ROM_LOAD16_BYTE( "11.11", 0x20000, 0x10000, CRC(f4ef9349) SHA1(3ffa335e74ffbc10f80387268da659643c566897) )
2255   ROM_LOAD16_BYTE( "8.8",   0x20001, 0x10000, CRC(37a65839) SHA1(6e8055d91b840afd8526041d3752c0a55eaebe0c) )
22472256   /* emtpy 0x40000 - 0x80000 */
2248   ROM_LOAD16_BYTE( "epr12521.a8", 0x80000, 0x20000, CRC(5001d713) SHA1(68cf3f48d6e440e5b800503a211adda02107d956) )
2249   ROM_LOAD16_BYTE( "epr12519.a6", 0x80001, 0x20000, CRC(4438ca8e) SHA1(0af53d64f06abf41f4c46540d28d5f008a4835a3) )
2257   ROM_LOAD16_BYTE( "7.7",   0x80000, 0x10000, CRC(056879fd) SHA1(fc0a910c1dc4cf535ad589f482f57379798b5524) )
2258   ROM_LOAD16_BYTE( "5.5",   0x80001, 0x10000, CRC(8c77d958) SHA1(f7c5abfec2a9d1724c83b1de2cd994bb4c42857c) )
2259   ROM_LOAD16_BYTE( "10.10", 0xa0000, 0x10000, CRC(b69ab892) SHA1(9b426058a80abb8dd3d6c0c55574fdc841889a72) )
2260   ROM_LOAD16_BYTE( "9.9",   0xa0001, 0x10000, CRC(3cf2f725) SHA1(1f620fcebe8533cba50736ae1d97c095abf1bc25) )
22502261
2262
22512263   ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
2252   ROM_LOAD( "ga33.b16", 0x00000, 0x10000, CRC(84587263) SHA1(3a88c8578a477a487a0a214a367042b9739f39eb) )
2253   ROM_LOAD( "ga32.b15", 0x10000, 0x10000, CRC(63d72388) SHA1(ba0a582b1daf3a1e316237efbad17fcc0381643f) )
2254   ROM_LOAD( "ga31.b14", 0x20000, 0x10000, CRC(f8b6ae4f) SHA1(55132c98955107e4b247992f7917a6ce588460a7) )
2255   ROM_LOAD( "ga30.b13", 0x30000, 0x10000, CRC(e29baf4f) SHA1(3761cb2217599fe3f2f860f9395930b96ec52f47) )
2256   ROM_LOAD( "ga29.b12", 0x40000, 0x10000, CRC(22f0667e) SHA1(2d11b2ce105a3db9c914942cace85aff17deded9) )
2257   ROM_LOAD( "ga28.b11", 0x50000, 0x10000, CRC(afb1a7e4) SHA1(726fded9db72a881128b43f449d2baf450131f63) )
2264   ROM_LOAD( "32.16",  0x00000, 0x10000, CRC(84587263) SHA1(3a88c8578a477a487a0a214a367042b9739f39eb) )
2265   ROM_LOAD( "31.15", 0x10000, 0x10000, CRC(63d72388) SHA1(ba0a582b1daf3a1e316237efbad17fcc0381643f) )
2266   ROM_LOAD( "30.14",  0x20000, 0x10000, CRC(f8b6ae4f) SHA1(55132c98955107e4b247992f7917a6ce588460a7) )
2267   ROM_LOAD( "29.13", 0x30000, 0x10000, CRC(e29baf4f) SHA1(3761cb2217599fe3f2f860f9395930b96ec52f47) )
2268   ROM_LOAD( "28.12",  0x40000, 0x10000, CRC(22f0667e) SHA1(2d11b2ce105a3db9c914942cace85aff17deded9) )
2269   ROM_LOAD( "27.11", 0x50000, 0x10000, CRC(afb1a7e4) SHA1(726fded9db72a881128b43f449d2baf450131f63) )
22582270
22592271   ROM_REGION( 0x1c0000, "gfx2", 0 ) /* sprites */
2260   /* wrong! */
2261   ROM_LOAD16_BYTE( "ga34.b17",       0x000001, 0x10000, CRC(28ba70c8) SHA1(a6f33e1404928b6d1006943494646d6cfbd60a4b) )
2262   ROM_LOAD16_BYTE( "ga35.b18",       0x010000, 0x10000, CRC(2ed96a26) SHA1(edcf915243e6f92d31cdfc53965438f6b6bff51d) )
2263   ROM_LOAD16_BYTE( "ga23.a14",       0x020001, 0x10000, CRC(84dccc5b) SHA1(10263d98d663f1170c3203066f391075a1d64ff5) )
2264   ROM_LOAD16_BYTE( "ga18.a9",        0x030000, 0x10000, CRC(de346006) SHA1(65aa489373b6d2cccbb024f13fc190a7cae86274) )
2265   ROM_LOAD16_BYTE( "mpr12379.b4",    0x040001, 0x40000, CRC(1a0e8c57) SHA1(674f1ae7db632876fff346e76786801ae19d9799) )
2266   ROM_LOAD16_BYTE( "ga36.b19",       0x080000, 0x10000, CRC(101d2fff) SHA1(1de1390c5f55f192491053c8aac31be3389aab2b) )
2267   ROM_LOAD16_BYTE( "ga37.b20",       0x090001, 0x10000, CRC(677e64a6) SHA1(e3d0d31097017c6cb1a7f41292783f18ce13b41c) )
2268   ROM_LOAD16_BYTE( "ga19.a10",       0x0a0000, 0x10000, CRC(11794d05) SHA1(eef52d7a644dbcc5f983222f163445a725286a32) )
2269   ROM_LOAD16_BYTE( "ga20.a11",       0x0b0001, 0x10000, CRC(ad1c1c90) SHA1(155f17593cfab1a117bb755b1edd0c473d455f91) )
2270   ROM_LOAD16_BYTE( "mpr12381.b5",   0x0c0000, 0x40000, CRC(81ba6ecc) SHA1(7f59e4d86a192b97e92729371b78c3f1c784a0b5) )
2271   ROM_LOAD16_BYTE( "mpr12382.b3",   0x100001, 0x40000, CRC(81601c6f) SHA1(604bc5613c6c734a06860303ba36d61bb54508a0) )
2272   ROM_LOAD16_BYTE( "mpr12383.b6",   0x140000, 0x40000, CRC(5dbacf7a) SHA1(236866fb94672b13cbb2cb479324e61de87eeb34) )
2272   ROM_LOAD16_BYTE( "33.17",       0x000001, 0x10000, CRC(28ba70c8) SHA1(a6f33e1404928b6d1006943494646d6cfbd60a4b) )
2273   ROM_LOAD16_BYTE( "34.18",       0x020001, 0x10000, CRC(2ed96a26) SHA1(edcf915243e6f92d31cdfc53965438f6b6bff51d) )
2274   ROM_LOAD16_BYTE( "37.bin",       0x100001, 0x10000, CRC(84dccc5b) SHA1(10263d98d663f1170c3203066f391075a1d64ff5) )
2275   ROM_LOAD16_BYTE( "13.bin",     0x120001, 0x10000, CRC(3d41b995) SHA1(913d2a0c9a2ac6d36589966d7eb5537120ea6ff0) )
2276   //ROM_LOAD16_BYTE( "ga18.a9",     0x120001, 0x10000, CRC(de346006) SHA1(65aa489373b6d2cccbb024f13fc190a7cae86274) ) // the old set had this rom, with most of the data blanked out.. why? logo removed? bad?
22732277
2278   ROM_LOAD16_BYTE( "21.7",       0x000000, 0x10000, CRC(ede51fe0) SHA1(c05a2b51095a322bac5a67ee8886aecc186cbdfe) )
2279   ROM_LOAD16_BYTE( "22.8",       0x020000, 0x10000, CRC(30989141) SHA1(f6e7ae258deedec11b1f80c19575c884aac26c56) )
2280   ROM_LOAD16_BYTE( "38.bin",       0x100000, 0x10000, CRC(38e4c92a) SHA1(8b8a596da0726bc02c412a68e5163770fe3e62e4) )
2281   ROM_LOAD16_BYTE( "14.bin",     0x120000, 0x10000, CRC(9fb1f9b6) SHA1(a193ff48f2bfbb4afbc322ae33cdf360afcb681e) )
2282
2283    ROM_LOAD16_BYTE( "35.19",       0x040001, 0x10000, CRC(101d2fff) SHA1(1de1390c5f55f192491053c8aac31be3389aab2b) )
2284   ROM_LOAD16_BYTE( "36.20",       0x060001, 0x10000, CRC(677e64a6) SHA1(e3d0d31097017c6cb1a7f41292783f18ce13b41c) )
2285   ROM_LOAD16_BYTE( "15.bin",       0x0a0000, 0x10000, CRC(11794d05) SHA1(eef52d7a644dbcc5f983222f163445a725286a32) )
2286   ROM_LOAD16_BYTE( "17.bin",       0x160001, 0x10000, CRC(ad1c1c90) SHA1(155f17593cfab1a117bb755b1edd0c473d455f91) )
2287
2288     ROM_LOAD16_BYTE( "23.9",       0x040000, 0x10000, CRC(5853000d) SHA1(db7adf1de74c66f667ea7ccc41702576de081ff5) )
2289   ROM_LOAD16_BYTE( "24.10",       0x060000, 0x10000, CRC(697b3276) SHA1(a8aeb2cfaca9368d5bfa14a67de36dbadd4a0585) )
2290   ROM_LOAD16_BYTE( "16.bin",       0x140000, 0x10000, CRC(753b01e8) SHA1(0180cf893d63e60e14e2fb0f5836b302f08f0228) )
2291   ROM_LOAD16_BYTE( "18.bin",       0x160000, 0x10000, CRC(5dd6d8db) SHA1(270886aebf4549c5cf456b1e90927b759a53e2e1) )
2292
2293     ROM_LOAD16_BYTE( "40.23",       0x080001, 0x10000, CRC(a9519afe) SHA1(0550f596ef080db25241d88242d57edb3c7fb685) )
2294   ROM_LOAD16_BYTE( "39.22",       0x0a0001, 0x10000, CRC(74df9232) SHA1(61286c83eb6f31983c0ed24ca2151c58a95238f1) )
2295   ROM_LOAD16_BYTE( "19.bin",       0x180001, 0x10000, CRC(a8c8c784) SHA1(8e998019b4dbf509179d41eb2b446647db3d00a6) )
2296   ROM_LOAD16_BYTE( "25.bin",       0x1a0001, 0x10000, CRC(cc3a922c) SHA1(3c96459d95961d463909b6b0e8c77916c3a018e3) )
2297
2298      ROM_LOAD16_BYTE( "42.26",       0x080000, 0x10000, CRC(ac6ad195) SHA1(3c3fe38047698e28cae9193438fe0b85941476c5) )
2299   ROM_LOAD16_BYTE( "41.25",       0x0a0000, 0x10000, CRC(03a905c4) SHA1(c526a744021a392c860ded37afd54a78e9f47778) )
2300   ROM_LOAD16_BYTE( "20.bin",       0x180000, 0x10000, CRC(cba013c7) SHA1(a0658aaf7893bc9fb8f0435cab9f77ceb1fb4e1d) )
2301   ROM_LOAD16_BYTE( "26.bin",       0x1a0000, 0x10000, CRC(bea4d237) SHA1(46e51e89b4ee1e2701da1004758d7da547a2e4c2) )
2302
22742303   ROM_REGION( 0x30000, "soundcpu", 0 ) /* sound CPU */
2275   ROM_LOAD( "epr12390",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
2276   ROM_LOAD( "mpr12384.a11", 0x10000, 0x20000, CRC(6218d8e7) SHA1(5a745c750efb4a61716f99befb7ed14cc84e9973) )
2304   ROM_LOAD( "2.3",     0x00000, 0x08000, CRC(399fc5f5) SHA1(6f290b36dc71ff4759598e2a9c185a8945a3c9e7) )
2305   ROM_LOAD( "3.1",     0x10000, 0x10000, CRC(50eb5a56) SHA1(d59ba04254000de5577e8a58d0b51c73112a4c80) )
2306   ROM_LOAD( "1.2",     0x20000, 0x10000, CRC(b372eb94) SHA1(8f82530633589de003a5462b227335526a6a61a6) )
2307
2308   ROM_REGION( 0x30000, "decryption", 0 ) // a 0x800 byte repeating rom containing part of an MS-DOS executable, used as the decryption key
2309   ROM_LOAD( "12.12",     0x00000, 0x08000, CRC(81ce4576) SHA1(84eea0ab8d8ea8869c12f0b603b91b1188d0e288) )
2310
2311   ROM_REGION( 0x100, "prom", 0 )
2312   ROM_LOAD( "82s129.bin",     0x000, 0x100,  CRC(88962e80) SHA1(ebf3d57d53fcba727cf20e4bb26f12934f7d1bc7) )
22772313ROM_END
22782314
22792315/* Golden Axe (bootleg) made in Italy?
r4878r4879
22972333
22982334*/
22992335
2300ROM_START( goldnab2 )
2336
2337ROM_START( goldnaxeb2 )
23012338   ROM_REGION( 0x0c0000, "maincpu", 0 ) /* 68000 code */
23022339   ROM_LOAD16_BYTE( "ic39.1", 0x00000, 0x10000, CRC(71489c9a) SHA1(ec25463a2c63027d2635f0e27f5a971d68938fe3) )
23032340   ROM_LOAD16_BYTE( "ic53.5", 0x00001, 0x10000, CRC(7a98512d) SHA1(f022a047d23051211e2de761b6c2289438b8f3cc) )
r4878r4879
23092346   ROM_LOAD16_BYTE( "ic36.4", 0xa0000, 0x10000, CRC(b69ab892) SHA1(9b426058a80abb8dd3d6c0c55574fdc841889a72) )
23102347   ROM_LOAD16_BYTE( "ic50.8", 0xa0001, 0x10000, CRC(3cf2f725) SHA1(1f620fcebe8533cba50736ae1d97c095abf1bc25) )
23112348
2349
23122350   ROM_REGION( 0x60000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
23132351   ROM_LOAD( "ic4.35",  0x00000, 0x10000, CRC(84587263) SHA1(3a88c8578a477a487a0a214a367042b9739f39eb) )
23142352   ROM_LOAD( "ic18.38", 0x10000, 0x10000, CRC(63d72388) SHA1(ba0a582b1daf3a1e316237efbad17fcc0381643f) )
r4878r4879
23482386   ROM_LOAD( "ic46.9",  0x10000, 0x10000, CRC(634dd54e) SHA1(ac4ab0ad9c1ac634ff4dfb83232b0fa5cfb26fdd) )
23492387ROM_END
23502388
2389
2390
23512391ROM_START( passht4b )
23522392   ROM_REGION( 0x20000, "maincpu", 0 ) /* 68000 code */
23532393   ROM_LOAD16_BYTE( "pas4p.3", 0x000000, 0x10000, CRC(2d8bc946) SHA1(35d3e529d4815543d9876fd0545c3d686467abaa) )
r4878r4879
23982438   ROM_LOAD( "epr11861.a11", 0x28000, 0x08000, CRC(38b54a71) SHA1(68ec4ef5b115844214ff2213be1ce6678904fbd2) )
23992439ROM_END
24002440
2401/* Shinobi bootleg by 'Beta' (7751 replaced by what? Sample rom is different, but no extra sound CPU rom present, missing?) */
2402/* otherwise it seems to run fine on System 16A */
2403ROM_START( shinoblb )
2404   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2405   ROM_LOAD16_BYTE( "4.3k", 0x000000, 0x10000, CRC(c178a39c) SHA1(05ff1679cdfc3618df8b3fabdeab64b1f2299aa3) )
2406   ROM_LOAD16_BYTE( "2.3n", 0x000001, 0x10000, CRC(5ad8ebf2) SHA1(b22e0c8d4b27c553abface17c625e207d19417ab) )
2407   ROM_LOAD16_BYTE( "5.2k", 0x020000, 0x10000, CRC(a2a620bd) SHA1(f8b135ce14d6c5eac5e40ddfd5ad2f1e6f2bc7a6) )
2408   ROM_LOAD16_BYTE( "3.2n", 0x020001, 0x10000, CRC(a3ceda52) SHA1(97a1c52a162fb1d43b3f8f16613b70ce582a8d26) )
24092441
2410   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
2411   ROM_LOAD( "8.3b", 0x00000, 0x10000, CRC(46627e7d) SHA1(66bb5b22a2100e7b9df303007a837bc2d52cf7ba) )
2412   ROM_LOAD( "7.4b", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
2413   ROM_LOAD( "6.5b", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
24142442
2415   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) /* sprites */
2416   ROM_LOAD16_BYTE( "9.6r",  0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
2417   ROM_CONTINUE(             0x40001, 0x08000 )
2418   ROM_LOAD16_BYTE( "13.8r", 0x00000, 0x08000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
2419   ROM_CONTINUE(             0x40000, 0x08000 )
2420   ROM_LOAD16_BYTE( "10.6q", 0x10001, 0x08000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
2421   ROM_CONTINUE(             0x50001, 0x08000 )
2422   ROM_LOAD16_BYTE( "14.8q", 0x10000, 0x08000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
2423   ROM_CONTINUE(             0x50000, 0x08000 )
2424   ROM_LOAD16_BYTE( "11.6p", 0x20001, 0x08000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
2425   ROM_CONTINUE(             0x60001, 0x08000 )
2426   ROM_LOAD16_BYTE( "15.8p", 0x20000, 0x08000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
2427   ROM_CONTINUE(             0x60000, 0x08000 )
2428   ROM_LOAD16_BYTE( "12.6n", 0x30001, 0x08000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
2429   ROM_CONTINUE(             0x70001, 0x08000 )
2430   ROM_LOAD16_BYTE( "16.8n", 0x30000, 0x08000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
2431   ROM_CONTINUE(             0x70000, 0x08000 )
2432
2433   ROM_REGION( 0x20000, "soundcpu", 0 ) /* sound CPU */
2434   ROM_LOAD( "1.5s", 0x0000, 0x8000, CRC(dd50b745) SHA1(52e1977569d3713ad864d607170c9a61cd059a65) )
2435
2436   ROM_REGION( 0x08000, "samples", 0 ) /* sound samples (played by what?, not the same as the original) */
2437   ROM_LOAD( "17.6u", 0x0000, 0x8000, CRC(b7a6890c) SHA1(6431df82c7dbe454cabc6084c1a677ebb42ae4b3) )
2438ROM_END
2439
24402443/* Shinobi bootleg by 'Datsu' - Sound hardware is different */
24412444ROM_START( shinobld )
24422445   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
r4878r4879
24462449   ROM_LOAD16_BYTE( "15.bin", 0x020000, 0x10000, CRC(b70a6ec1) SHA1(79db41c36d6a053bcdc355b46b19ae938a7755a9) )
24472450
24482451   ROM_REGION( 0x30000, "gfx1", ROMREGION_INVERT | ROMREGION_DISPOSE ) /* tiles */
2449   ROM_LOAD( "9.bin",  0x10000, 0x10000, CRC(565e11c6) SHA1(e063400b3d0470b932d75da0be9cd4b446189dea) )
2450   ROM_LOAD( "10.bin", 0x20000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) )
2451   ROM_LOAD( "11.bin", 0x00000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) )
2452   ROM_LOAD( "9.bin",  0x00000, 0x10000, CRC(565e11c6) SHA1(e063400b3d0470b932d75da0be9cd4b446189dea) )
2453   ROM_LOAD( "10.bin", 0x10000, 0x10000, CRC(7cc40b6c) SHA1(ffad7eef7ab2ff9a2e49a8d71b5785a61fa3c675) )
2454   ROM_LOAD( "11.bin", 0x20000, 0x10000, CRC(0f6c7b1c) SHA1(defc76592c285b3396e89a3cff7a73f3a948117f) )
24522455
24532456   ROM_REGION( 0x080000, "gfx2", 0 ) /* sprites */
24542457   ROM_LOAD16_BYTE( "5.bin", 0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
r4878r4879
24992502   ROM_LOAD16_BYTE( "tt030be3.rom", 0x20000, 0x10000, CRC(100264a2) SHA1(d1ea4bf93f5472901ce95200f546ce9b58936aea) )
25002503   ROM_LOAD16_BYTE( "tt05ef8a.rom", 0x20001, 0x10000, CRC(f787a948) SHA1(512b8cb2f5e9795171951e02c07cae957db41334) )
25012504
2502   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
2505   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE |ROMREGION_INVERT ) /* tiles */
25032506   ROM_LOAD( "tt1574b3.rom", 0x00000, 0x10000, CRC(e9e630da) SHA1(e8471dedbb25475e4814d78b56f579fe9110461e) )
25042507   ROM_LOAD( "tt16cf44.rom", 0x10000, 0x10000, CRC(4c467735) SHA1(8338b6605cbe2e076da0b3e3a47630409a79f002) )
25052508   ROM_LOAD( "tt17d59e.rom", 0x20000, 0x10000, CRC(60c0f2fe) SHA1(3fea4ed757d47628f59ff940e40cb86b3b5b443b) )
r4878r4879
25472550ROM_END
25482551
25492552
2550/* pre-System16 */
2551/*          rom       parent    machine   inp       init */
2552/* Alien Syndrome */
2553/* Looked at 24/05/09 */
25532554
2554/* System16A */
2555/*          rom       parent    machine   inp       init */
2556GAME( 1987, shinoblb, shinobi,  shinob2,  shinobi,  shinobl,  ROT0,   "[Sega] (Beta bootleg)", "Shinobi (Beta bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2557GAME( 1987, shinobld, shinobi,  shinob2,  shinobi,  shinobl,  ROT0,   "[Sega] (Datsu bootleg)", "Shinobi (Datsu bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING )
2555// System 16B based bootlegs
2556GAME( 1989, bayrouteb1, bayroute, bayrouteb1, bayroute, bayrouteb1, ROT0,   "bootleg", "Bay Route (encrypted, protected bootleg)", GAME_NO_SOUND | GAME_NOT_WORKING )
2557GAME( 1989, bayrouteb2, bayroute, bayrouteb2, bayroute, bayrouteb2, ROT0,   "bootleg", "Bay Route (Datsu bootleg)", GAME_NO_SOUND | GAME_NOT_WORKING )
2558GAME( 1989, goldnaxeb1, goldnaxe, goldnaxe_b1, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (encrypted bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
2559GAME( 1989, goldnaxeb2, goldnaxe, goldnaxe_b2, goldnaxe, goldnab2, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING|GAME_NO_SOUND )
2560GAME( 1989, tturfbl,  tturf,    tturfbl,  tturf,    tturfbl,  ROT0,   "bootleg", "Tough Turf (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2561GAME( 1989, dduxbl,   ddux,     dduxbl,   ddux,     dduxbl,   ROT0,   "bootleg", "Dynamite Dux (bootleg)", GAME_NOT_WORKING )
2562GAME( 1989, eswatbl,  eswat,    eswatbl,  eswat,    eswatbl,  ROT0,   "bootleg", "E-Swat - Cyber Police (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_SOUND )
2563GAME( 1989, fpointbl, fpoint,   fpointbl, fpointbl, fpointbl, ROT0,   "bootleg", "Flash Point (World, bootleg)", GAME_NOT_WORKING )
2564GAME( 1989, fpointbj, fpoint,   fpointbl, fpointbl, fpointbl, ROT0,   "bootleg", "Flash Point (Japan, bootleg)", GAME_NOT_WORKING )
2565GAME( 1988, tetrisbl, tetris,   tetrisbl, tetris,   tetrisbl, ROT0,   "bootleg", "Tetris (bootleg)", 0 )
25582566
2559/* System16B */
2560/*          rom       parent    machine   inp       init */
2561GAME( 1989, bayrtbl1, bayroute, bayroute, bayroute, bayrtbl1, ROT0,   "bootleg", "Bay Route (bootleg set 1)", GAME_NOT_WORKING )
2562GAME( 1989, bayrtbl2, bayroute, bayroute, bayroute, bayrtbl1, ROT0,   "bootleg", "Bay Route (bootleg set 2)", GAME_NOT_WORKING )
2563GAME( 1989, dduxbl,   ddux,     dduxbl,   ddux,     dduxbl,   ROT0,   "bootleg", "Dynamite Dux (bootleg)", 0 )
2564GAME( 1989, eswatbl,  eswat,    eswatbl,  eswat,    eswatbl,  ROT0,   "bootleg", "E-Swat - Cyber Police (bootleg)", GAME_IMPERFECT_SOUND )
2565GAME( 1989, fpointbl, fpoint,   fpointbl, fpointbl, fpointbl, ROT0,   "bootleg", "Flash Point (World, bootleg)", 0 )
2566GAME( 1989, fpointbj, fpoint,   fpointbl, fpointbl, fpointbl, ROT0,   "bootleg", "Flash Point (Japan, bootleg)", 0 )
2567// System 16A based bootlegs (less complex tilemap system)
2568GAME( 1987, shinobld, shinobi,  system16a_bootleg_shinobi,  shinobi,  shinobl,  ROT0,   "[Sega] (Datsu bootleg)", "Shinobi (Datsu bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
2569GAME( 1988, passshtb, passsht,  passsht,  passsht,  passsht,  ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2570GAME( 1988, passht4b, passsht,  passht4b, passht4b, passht4b, ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
2571GAME( 1988, wb3bbl,   wb3,      system16a_bootleg_wb3,   wb3b,     wb3bbl,   ROT0,   "bootleg", "Wonder Boy III - Monster Lair (bootleg)", GAME_NOT_WORKING )
25672572
2568GAME( 1989, goldnabl, goldnaxe, goldnaxe, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (bootleg, encrypted)", GAME_NOT_WORKING )
2569GAME( 1989, goldnab2, goldnaxe, goldnaxe, goldnaxe, goldnabl, ROT0,   "bootleg", "Golden Axe (bootleg)", GAME_NOT_WORKING )
2570
2571GAME( 1988, passshtb, passsht,  passsht,  passsht,  passsht,  ROT270, "bootleg", "Passing Shot (2 Players) (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
2572GAME( 1988, passht4b, passsht,  passht4b, passht4b, passht4b, ROT270, "bootleg", "Passing Shot (4 Players) (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND | GAME_NOT_WORKING )
2573GAME( 1988, tetrisbl, tetris,   tetrisbl, tetris,   tetrisbl, ROT0,   "bootleg", "Tetris (bootleg)", 0 )
2574GAME( 1989, tturfbl,  tturf,    tturfbl,  tturf,    tturfbl,  ROT0,   "bootleg", "Tough Turf (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NOT_WORKING )
2575GAME( 1988, wb3bbl,   wb3,      wb3bbl,   wb3b,     wb3bbl,   ROT0,   "bootleg", "Wonder Boy III - Monster Lair (bootleg)", 0 )
2576
25772573static DRIVER_INIT( beautyb )
25782574{
25792575   UINT16*rom = (UINT16*)memory_region( machine, "maincpu" );
r4878r4879
26042600   ROM_LOAD16_BYTE( "b13.u3", 0x00000, 0x8000, CRC(90c4489b) SHA1(240275ad6dfd02feab636ceb620264d339e79b6a) )
26052601   ROM_LOAD16_BYTE( "b23.u2", 0x00001, 0x8000, CRC(79b8f9ed) SHA1(5926852ea00b60d91684dbea4687b67894a397a1) )
26062602
2607   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
2608   ROM_LOAD( "b43.bin", 0x00000, 0x10000, CRC(67fe3f0c) SHA1(c9479512dd7a80895740c7fbd2133ab4d4c679d6) )
2603   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
2604   ROM_LOAD( "b43.bin", 0x20000, 0x10000, CRC(67fe3f0c) SHA1(c9479512dd7a80895740c7fbd2133ab4d4c679d6) )
26092605   ROM_LOAD( "b53.bin", 0x10000, 0x10000, CRC(aca8e330) SHA1(912e636e3c1e238682ea29620e8e2c6089c77209) )
2610   ROM_LOAD( "b63.bin", 0x20000, 0x10000, CRC(f2af2fd5) SHA1(0a95ebb5eae7cdc6535533d73d06419c23d01ac3) )
2606   ROM_LOAD( "b63.bin", 0x00000, 0x10000, CRC(f2af2fd5) SHA1(0a95ebb5eae7cdc6535533d73d06419c23d01ac3) )
26112607
26122608   ROM_REGION( 0x020000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
26132609   /* no sprites on this */
r4878r4879
26312627   ROM_LOAD16_BYTE( "iqpipe.u3", 0x00000, 0x8000, CRC(4ef1a0ba) SHA1(b11412b6b9e1a5d2f44ed5b7ceaa011418e5eab5) )
26322628   ROM_LOAD16_BYTE( "iqpipe.u2", 0x00001, 0x8000, CRC(1dacee68) SHA1(7a37362a679a2c4cbeadca63c2ef9a112c946c97) )
26332629
2634   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
2635   ROM_LOAD( "iqpipe.4", 0x00000, 0x10000, CRC(938b9a04) SHA1(98c61b0526e76d5de134d9e22be0af0d576a6749) )
2630   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
2631   ROM_LOAD( "iqpipe.4", 0x20000, 0x10000, CRC(938b9a04) SHA1(98c61b0526e76d5de134d9e22be0af0d576a6749) )
26362632   ROM_LOAD( "iqpipe.5", 0x10000, 0x10000, CRC(dfaedd39) SHA1(498f1c34fecd8de497fdce41bb683d00047a868a) )
2637   ROM_LOAD( "iqpipe.6", 0x20000, 0x10000, CRC(8e554f8d) SHA1(4b3b0e47c36f37947422f1c31063f11975108cd0) )
2633   ROM_LOAD( "iqpipe.6", 0x00000, 0x10000, CRC(8e554f8d) SHA1(4b3b0e47c36f37947422f1c31063f11975108cd0) )
26382634
26392635   ROM_REGION( 0x020000, "gfx2", ROMREGION_ERASEFF ) /* sprites */
26402636   /* no sprites on this */
r4878r4879
26552651
26562652GAME( 1991, beautyb,    0,        beautyb,    tetris,    beautyb, ROT0,  "AMT", "Beauty Block", GAME_NO_SOUND|GAME_NOT_WORKING )
26572653GAME( 1991, iqpipe,     0,        beautyb,    tetris,    beautyb, ROT0,  "AMT", "IQ Pipe", GAME_NO_SOUND|GAME_NOT_WORKING )
2654
2655
2656/***************************************************************************/
2657
2658static WRITE16_HANDLER( sys18_refreshenable_w )
2659{
2660   if(ACCESSING_BITS_0_7)
2661   {
2662      sys16_refreshenable = data & 0x02;
2663   }
2664}
2665
2666static WRITE16_HANDLER( sys18_tilebank_w )
2667{
2668   if(ACCESSING_BITS_0_7)
2669   {
2670      sys16_tile_bank0 = (data >> 0) & 0x0F;
2671      sys16_tile_bank1 = (data >> 4) & 0x0F;
2672   }
2673}
2674
2675/***************************************************************************/
2676
2677#if 0
2678static void set_fg_page( int data )
2679{
2680   sys16_fg_page[0] = data>>12;
2681   sys16_fg_page[1] = (data>>8)&0xf;
2682   sys16_fg_page[2] = (data>>4)&0xf;
2683   sys16_fg_page[3] = data&0xf;
2684}
2685
2686static void set_bg_page( int data )
2687{
2688   sys16_bg_page[0] = data>>12;
2689   sys16_bg_page[1] = (data>>8)&0xf;
2690   sys16_bg_page[2] = (data>>4)&0xf;
2691   sys16_bg_page[3] = data&0xf;
2692}
2693
2694static void set_fg2_page( int data )
2695{
2696   sys16_fg2_page[0] = data>>12;
2697   sys16_fg2_page[1] = (data>>8)&0xf;
2698   sys16_fg2_page[2] = (data>>4)&0xf;
2699   sys16_fg2_page[3] = data&0xf;
2700}
2701
2702static void set_bg2_page( int data )
2703{
2704   sys16_bg2_page[0] = data>>12;
2705   sys16_bg2_page[1] = (data>>8)&0xf;
2706   sys16_bg2_page[2] = (data>>4)&0xf;
2707   sys16_bg2_page[3] = data&0xf;
2708}
2709#endif
2710
2711/***************************************************************************/
2712/*
2713    Sound hardware for Shadow Dancer (Datsu bootleg)
2714
2715    Z80 memory map
2716    0000-7FFF : ROM (fixed)
2717    8000-BFFF : ROM (banked)
2718    C000-C007 : ?
2719    C400      : Sound command (r/o)
2720    C800      : MSM5205 sample data output (w/o)
2721    CC00-CC03 : YM3438 #1
2722    D000-D003 : YM3438 #2
2723    D400      : ROM bank control (w/o)
2724    DF00-DFFF : ?
2725    E000-FFFF : Work RAM
2726
2727    The unused memory locations and I/O port access seem to be remnants of the original code that were not patched out:
2728
2729    - Program accesses RF5C68A channel registes at $C000-$C007
2730    - Program clears RF5C68A wave memory at $DF00-$DFFF
2731    - Program writes to port $A0 to access sound ROM banking control latch
2732    - Program reads port $C0 to access sound command
2733
2734    Interrupts
2735
2736    IRQ = Triggered when 68000 writes sound command. Z80 reads from $C400.
2737    NMI = Triggered when second nibble of sample data has been output to the MSM5205.
2738          Program copies sample data from ROM bank to the MSM5205 sample data buffer at $C800.
2739
2740    ROM banking seems correct.
2741    It doesn't look like there's a way to reset the MSM5205, unless that's related to bit 7 of the
2742    ROM bank control register.
2743    MSM5205 clock speed hasn't been confirmed.
2744*/
2745/***************************************************************************/
2746
2747
2748static WRITE8_HANDLER( shdancbl_msm5205_data_w )
2749{
2750   sample_buffer = data;
2751}
2752
2753static void shdancbl_msm5205_callback(const device_config *device)
2754{
2755   msm5205_data_w(device, sample_buffer & 0x0F);
2756   sample_buffer >>= 4;
2757   sample_select ^= 1;
2758   if(sample_select == 0)
2759      cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
2760}
2761
2762static const msm5205_interface shdancbl_msm5205_interface =
2763{
2764   shdancbl_msm5205_callback,
2765   MSM5205_S48_4B
2766};
2767
2768static UINT8* shdancbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
2769
2770static WRITE16_HANDLER( sound_command_irq_w )
2771{
2772   if( ACCESSING_BITS_0_7 )
2773   {
2774      soundlatch_w( space, 0, data&0xff );
2775      cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE );
2776   }
2777}
2778
2779static READ8_HANDLER( shdancbl_soundbank_r )
2780{
2781   if(shdancbl_soundbank_ptr) return shdancbl_soundbank_ptr[offset & 0x3FFF];
2782   return 0xFF;
2783}
2784
2785static WRITE8_HANDLER( shdancbl_bankctrl_w )
2786{
2787   UINT8 *mem = memory_region(space->machine, "soundcpu");
2788
2789   switch(data)
2790   {
2791      case 0:
2792         shdancbl_soundbank_ptr = &mem[0x18000]; /* IC45 8000-BFFF */
2793         break;
2794      case 1:
2795         shdancbl_soundbank_ptr = &mem[0x1C000]; /* IC45 C000-FFFF */
2796         break;
2797      case 2:
2798         shdancbl_soundbank_ptr = &mem[0x20000]; /* IC46 0000-3FFF */
2799         break;
2800      case 3:
2801         shdancbl_soundbank_ptr = &mem[0x24000]; /* IC46 4000-7FFF */
2802         break;
2803      default:
2804         shdancbl_soundbank_ptr = NULL;
2805         logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(space->cpu));
2806         break;
2807   }
2808}
2809
2810static ADDRESS_MAP_START(shdancbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
2811   AM_RANGE(0x0000, 0x7fff) AM_ROM
2812   AM_RANGE(0x8000, 0xbfff) AM_READ(shdancbl_soundbank_r)
2813   AM_RANGE(0xc000, 0xc00f) AM_WRITENOP
2814   AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r)
2815   AM_RANGE(0xc800, 0xc800) AM_WRITE(shdancbl_msm5205_data_w)
2816   AM_RANGE(0xcc00, 0xcc03) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
2817   AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
2818   AM_RANGE(0xd400, 0xd400) AM_WRITE(shdancbl_bankctrl_w)
2819   AM_RANGE(0xdf00, 0xdfff) AM_NOP
2820   AM_RANGE(0xe000, 0xffff) AM_RAM
2821ADDRESS_MAP_END
2822
2823
2824static ADDRESS_MAP_START( shdancbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
2825   ADDRESS_MAP_GLOBAL_MASK(0xff)
2826   AM_RANGE(0xa0, 0xbf) AM_WRITENOP
2827   AM_RANGE(0xc0, 0xdf) AM_READNOP
2828ADDRESS_MAP_END
2829
2830/***************************************************************************/
2831
2832static UINT8 *sys18_SoundMemBank;
2833
2834static READ8_HANDLER( system18_bank_r )
2835{
2836   if(sys18_SoundMemBank)
2837      return sys18_SoundMemBank[offset];
2838   return 0xFF;
2839}
2840
2841static ADDRESS_MAP_START( sound_18_map, ADDRESS_SPACE_PROGRAM, 8 )
2842   AM_RANGE(0x0000, 0x9fff) AM_ROM
2843   AM_RANGE(0xa000, 0xbfff) AM_READ(system18_bank_r)
2844   /**** D/A register ****/
2845   AM_RANGE(0xc000, 0xc008) AM_DEVWRITE("5c68", rf5c68_w)
2846   AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("5c68", rf5c68_mem_r, rf5c68_mem_w)
2847   AM_RANGE(0xe000, 0xffff) AM_RAM   //??
2848ADDRESS_MAP_END
2849
2850
2851static WRITE8_HANDLER( sys18_soundbank_w )
2852{
2853   UINT8 *mem = memory_region(space->machine, "soundcpu");
2854   int rom = (data >> 6) & 3;
2855   int bank = (data & 0x3f);
2856   int mask = sys18_sound_info[rom*2+0];
2857   int offs = sys18_sound_info[rom*2+1];
2858   if(mask) sys18_SoundMemBank = &mem[0x10000 + offs + ((bank & mask) << 13)];
2859   else sys18_SoundMemBank = NULL;
2860}
2861
2862static ADDRESS_MAP_START( sound_18_io_map, ADDRESS_SPACE_IO, 8 )
2863   ADDRESS_MAP_GLOBAL_MASK(0xff)
2864   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
2865   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
2866   AM_RANGE(0xa0, 0xa0) AM_WRITE(sys18_soundbank_w)
2867   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
2868ADDRESS_MAP_END
2869
2870
2871/***************************************************************************/
2872
2873/*
2874    315-5296 I/O chip emulation
2875*/
2876#if 0
2877static int io_reg[0x10];
2878
2879static READ16_HANDLER( sys18_io_r )
2880{
2881   if(ACCESSING_BITS_0_7)
2882   {
2883      switch(offset & 0x3000/2)
2884      {
2885         case 0x0000/2: /* I/O chip internal locations */
2886         case 0x1000/2: /* I/O chip internal locations (mirror) */
2887            switch(offset & 0x1F)
2888            {
2889               case 0x00: /* Port A - 1P controls */
2890                  if(io_reg[0x0F] & 0x01)
2891                     return io_reg[0x00];
2892                  else
2893                     return input_port_read(space->machine, "P1");
2894                  break;
2895
2896               case 0x01: /* Port B - 2P controls */
2897                  if(io_reg[0x0F] & 0x02)
2898                     return io_reg[0x01];
2899                  else
2900                     return input_port_read(space->machine, "P2");
2901                  break;
2902
2903               case 0x02: /* Port C - Bidirectional I/O port */
2904                  if(io_reg[0x0F] & 0x04)
2905                     return io_reg[0x02];
2906                  else
2907                     return -1;
2908                  break;
2909
2910               case 0x03: /* Port D - Miscellaneous outputs */
2911                  if(io_reg[0x0F] & 0x08)
2912                     return io_reg[0x03];
2913                  else
2914                     return -1;
2915                  break;
2916
2917               case 0x04: /* Port E - Service / Coin inputs */
2918                  if(io_reg[0x0F] & 0x10)
2919                     return io_reg[0x04];
2920                  else
2921                     return input_port_read(space->machine, "SERVICE");
2922                  break;
2923
2924               case 0x05: /* Port F - DIP switch #1 */
2925                  if(io_reg[0x0F] & 0x20)
2926                     return io_reg[0x05];
2927                  else
2928                     return input_port_read(space->machine, "DSW1");
2929                  break;
2930
2931               case 0x06: /* Port G - DIP switch #2 */
2932                  if(io_reg[0x0F] & 0x40)
2933                     return io_reg[0x06];
2934                  else
2935                     return input_port_read(space->machine, "P3");
2936                  break;
2937
2938               case 0x07: /* Port H - Tile banking control */
2939                  if(io_reg[0x0F] & 0x80)
2940                     return io_reg[0x07];
2941                  else
2942                     return -1;
2943                  break;
2944
2945               case 0x08: /* Protection #1 */
2946                  return 'S';
2947               case 0x09: /* Protection #2 */
2948                  return 'E';
2949               case 0x0A: /* Protection #3 */
2950                  return 'G';
2951               case 0x0B: /* Protection #4 */
2952                  return 'A';
2953
2954               case 0x0C: /* CNT2-0 pin output control (mirror) */
2955               case 0x0E: /* CNT2-0 pin output control */
2956                  return io_reg[0x0E];
2957
2958               case 0x0D: /* Port direction control (mirror) */
2959               case 0x0F: /* Port direction control */
2960                  return io_reg[0x0F];
2961            }
2962            return -1;
2963
2964         case 0x2000/2: /* Unused */
2965            logerror("read video control latch %06X (%06X)\n", offset, cpu_get_pc(space->cpu));
2966            return -1;
2967
2968         case 0x3000/2: /* Expansion connector */
2969            logerror("read expansion area %06X (%06X)\n", offset, cpu_get_pc(space->cpu));
2970            return -1;
2971      }
2972   }
2973
2974   return -1;
2975}
2976
2977static WRITE16_HANDLER( sys18_io_w )
2978{
2979   if(ACCESSING_BITS_0_7)
2980   {
2981      switch(offset & 0x3000/2)
2982      {
2983         case 0x0000/2: /* I/O chip internal locations */
2984         case 0x1000/2: /* I/O chip internal locations (mirror) */
2985            switch(offset & 0x1F)
2986            {
2987               case 0x00: /* Port A - 1P controls */
2988                  io_reg[0x00] = data;
2989                  break;
2990
2991               case 0x01: /* Port B - 2P controls */
2992                  io_reg[0x01] = data;
2993                  break;
2994
2995               case 0x02: /* Port C - Bidirectional I/O port */
2996                  io_reg[0x02] = data;
2997                  break;
2998
2999               case 0x03: /* Port D - Miscellaneous outputs */
3000                  io_reg[0x03] = data;
3001                  coin_lockout_w(1, data & 8);
3002                  coin_lockout_w(0, data & 4);
3003                  coin_counter_w(1, data & 2);
3004                  coin_counter_w(0, data & 1);
3005                  break;
3006
3007               case 0x04: /* Port E - Service / Coin inputs */
3008                  io_reg[0x04] = data;
3009                  break;
3010
3011               case 0x05: /* Port F - DIP switch #1 */
3012                  io_reg[0x05] = data;
3013                  break;
3014
3015               case 0x06: /* Port G - DIP switch #2 */
3016                  io_reg[0x06] = data;
3017                  break;
3018
3019               case 0x07: /* Port H - Tile banking control */
3020                  io_reg[0x07] = data;
3021                  sys16_tile_bank0 = (data >> 0) & 0x0F;
3022                  sys16_tile_bank1 = (data >> 4) & 0x0F;
3023                  break;
3024
3025               case 0x0E: /* CNT2-0 pin output control */
3026                  io_reg[0x0E] = data;
3027                  sys16_refreshenable = data & 0x02;
3028                  break;
3029
3030               case 0x0F: /* Port direction control */
3031                  io_reg[0x0F] = data;
3032                  break;
3033            }
3034            break;
3035
3036         case 0x2000/2: /* Video control latch */
3037            logerror("write video control latch %06X = %04X (%06X)\n", offset, data, cpu_get_pc(space->cpu));
3038            break;
3039
3040         case 0x3000/2: /* Expansion connector */
3041//              logerror("write expansion area %06X = %04X (%06X)\n", offset, data, cpu_get_pc(space->cpu));
3042            break;
3043      }
3044   }
3045}
3046#endif
3047
3048/***************************************************************************/
3049/*
3050    Shadow Dancer (Bootleg)
3051
3052    This seems to be a modified version of shdancer. It has no warning screen, displays English text during the
3053    attract sequence, and has a 2P input test. The 'Sega' copyright text was changed to 'Datsu', and their
3054    logo is missing.
3055
3056    Access to the configuration registers, I/O chip, and VDP are done even though it's likely none of this hardware
3057    exists in the bootleg. For example:
3058
3059    - Most I/O port access has been redirected to new addresses.
3060    - Z80 sound command has been redirected to a new address.
3061    - The tilebank routine which saves the bank value in VDP VRAM has a form of protection has been modified to store
3062      the tilebank value directly to $E4001F.
3063    - Implementing screen blanking control via $E4001D leaves the screen blanked at the wrong times (after coin-up).
3064
3065    This is probably due to unmodified parts of the original code accessing these components, which would be ignored
3066    on the bootleg hardware. Both the I/O chip and VDP are supported in this driver, just as I don't know for certain
3067    how much of either are present on the real board.
3068
3069    Bootleg specific addresses:
3070
3071    C40001 = DIP switch #1
3072    C40003 = DIP switch #2
3073    C40007 = Z80 sound command
3074    C41001 = Service input
3075    C41003 = Player 1 input
3076    C41005 = Player 2 input
3077    C44000 = Has 'clr.w' done after setting tile bank in $E4000F.
3078    C460xx = Extra video hardware controls
3079
3080    Here are the I/O chip addresses accessed:
3081
3082    E40001 = Player 1
3083    E40007 = Miscellaneous outputs (coin control, etc.)
3084    E4000F = Tile bank
3085    E4001D = CNT2-0 pin output state
3086    E4001F = I/O chip port direction
3087*/
3088/***************************************************************************/
3089
3090static ADDRESS_MAP_START( shdancbl_map, ADDRESS_SPACE_PROGRAM, 16 )
3091   AM_RANGE(0x000000, 0x07ffff) AM_ROM
3092   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
3093   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
3094   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
3095   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w ) AM_BASE(&paletteram16)
3096   AM_RANGE(0xc00000, 0xc0ffff) AM_NOP
3097   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
3098   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
3099   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
3100   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
3101   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
3102   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
3103   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP // only used via clr.w after tilebank set
3104
3105
3106   AM_RANGE(0xe4001c, 0xe4001d) AM_WRITENOP // to prevent access to screen blanking control below
3107   AM_RANGE(0xe40000, 0xe4ffff) AM_NOP
3108   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
3109   AM_RANGE(0xffc000, 0xffffff) AM_RAM
3110ADDRESS_MAP_END
3111
3112/***************************************************************************/
3113
3114static MACHINE_RESET( shdancbl )
3115{
3116   sys16_sprxoffset = -0xbc+0x77;
3117}
3118
3119
3120
3121static DRIVER_INIT( shdancbl )
3122{
3123   UINT8 *mem;
3124
3125   MACHINE_RESET_CALL(sys16_onetime);
3126
3127   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
3128   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
3129   sys16_MaxShadowColors=0;
3130
3131   /* Copy first 32K of IC45 to Z80 address space */
3132   mem = memory_region(machine, "soundcpu");
3133   memcpy(mem, mem+0x10000, 0x8000);
3134}
3135
3136/***************************************************************************/
3137/*
3138    Moonwalker (Bootleg)
3139*/
3140/***************************************************************************/
3141
3142static ADDRESS_MAP_START( mwalkbl_map, ADDRESS_SPACE_PROGRAM, 16 )
3143   AM_RANGE(0x000000, 0x07ffff) AM_ROM
3144   AM_RANGE(0x400000, 0x40ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
3145   AM_RANGE(0x410000, 0x410fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
3146   AM_RANGE(0x440000, 0x440fff) AM_RAM AM_BASE(&sys16_spriteram)
3147   AM_RANGE(0x840000, 0x840fff) AM_RAM_WRITE( sys16_paletteram_w ) AM_BASE(&paletteram16)
3148
3149   /* bootleg video regs */
3150   /*AM_RANGE(0xc00000, 0xc00001) AM_NOP
3151    AM_RANGE(0xc00002, 0xc00003) AM_NOP
3152    AM_RANGE(0xc00004, 0xc00005) AM_NOP // tile bank?
3153    AM_RANGE(0xc00006, 0xc00007) AM_NOP
3154    AM_RANGE(0xc44000, 0xc44001) AM_NOP
3155    AM_RANGE(0xc46000, 0xc46001) AM_NOP
3156    AM_RANGE(0xc46200, 0xc46201) AM_NOP
3157    AM_RANGE(0xc46400, 0xc464ff) AM_NOP // scroll?
3158    AM_RANGE(0xc46500, 0xc465ff) AM_NOP // scroll?
3159    */
3160
3161   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
3162   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
3163   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_nmi_w)
3164   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
3165   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
3166   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
3167   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P3")
3168   AM_RANGE(0xc41008, 0xc41009) AM_READNOP // figure this out, extra input for 3p?
3169   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
3170   AM_RANGE(0xc46800, 0xc46801) AM_WRITE(sys18_tilebank_w)
3171
3172   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
3173   AM_RANGE(0xffc000, 0xffffff) AM_RAM
3174ADDRESS_MAP_END
3175
3176/***************************************************************************/
3177
3178static MACHINE_RESET( mwalkbl )
3179{
3180
3181}
3182
3183static DRIVER_INIT( mwalkbl )
3184{
3185   UINT8 *RAM= memory_region(machine, "soundcpu");
3186   static const int mwalk_sound_info[] =
3187   {
3188      0x0f, 0x00000, // ROM #1 = 128K
3189      0x1f, 0x20000, // ROM #2 = 256K
3190      0x1f, 0x60000, // ROM #3 = 256K
3191      0x1f, 0xA0000  // ROM #4 = 256K
3192   };
3193
3194   MACHINE_RESET_CALL(sys16_onetime);
3195   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
3196   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
3197
3198   memcpy(sys18_sound_info, mwalk_sound_info, sizeof(sys18_sound_info));
3199   memcpy(RAM,&RAM[0x10000],0xa000);
3200}
3201
3202/***************************************************************************/
3203
3204/* bootleg doesn't have real vdp or i/o */
3205
3206static ADDRESS_MAP_START( astormbl_map, ADDRESS_SPACE_PROGRAM, 16 )
3207   AM_RANGE(0x000000, 0x07ffff) AM_ROM
3208   AM_RANGE(0x100000, 0x10ffff) AM_RAM_WRITE( sys16_tileram_w ) AM_BASE(&sys16_tileram)
3209   AM_RANGE(0x110000, 0x110fff) AM_RAM_WRITE( sys16_textram_w ) AM_BASE(&sys16_textram)
3210   AM_RANGE(0x140000, 0x140fff) AM_RAM_WRITE( sys16_paletteram_w ) AM_BASE(&paletteram16)
3211   AM_RANGE(0x200000, 0x200fff) AM_RAM AM_BASE(&sys16_spriteram)
3212   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
3213   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
3214   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
3215   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
3216   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
3217   AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1")
3218   AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2")
3219   AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3")
3220   AM_RANGE(0xa02100, 0xa02101) AM_NOP
3221   AM_RANGE(0xa03000, 0xa03001) AM_NOP
3222   AM_RANGE(0xa03034, 0xa03035) AM_NOP
3223
3224   /* bootleg video regs */
3225   AM_RANGE(0xc00000, 0xc00001) AM_NOP
3226   AM_RANGE(0xc00002, 0xc00003) AM_NOP
3227   AM_RANGE(0xc00004, 0xc00005) AM_NOP // tile bank?
3228   AM_RANGE(0xc00006, 0xc00007) AM_NOP
3229   AM_RANGE(0xc44000, 0xc44001) AM_NOP
3230   AM_RANGE(0xc46000, 0xc46001) AM_NOP
3231   AM_RANGE(0xc46200, 0xc46201) AM_NOP
3232   AM_RANGE(0xc46400, 0xc464ff) AM_NOP // scroll?
3233   AM_RANGE(0xc46500, 0xc465ff) AM_NOP // scroll?
3234
3235   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
3236   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP
3237   AM_RANGE(0xffc000, 0xffffff) AM_RAM
3238ADDRESS_MAP_END
3239
3240
3241/***************************************************************************/
3242
3243
3244static MACHINE_RESET( astormbl )
3245{
3246
3247}
3248
3249
3250static DRIVER_INIT( astormbl )
3251{
3252   UINT8 *RAM= memory_region(machine, "soundcpu");
3253   static const int astormbl_sound_info[] =
3254   {
3255      0x0f, 0x00000, // ROM #1 = 128K
3256      0x1f, 0x20000, // ROM #2 = 256K
3257      0x1f, 0x60000, // ROM #3 = 256K
3258      0x1f, 0xA0000  // ROM #4 = 256K
3259   };
3260
3261   MACHINE_RESET_CALL(sys16_onetime);
3262   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
3263   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
3264   sys16_MaxShadowColors = 0; // doesn't seem to use transparent shadows
3265
3266   memcpy(sys18_sound_info, astormbl_sound_info, sizeof(sys18_sound_info));
3267   memcpy(RAM,&RAM[0x10000],0xa000);
3268}
3269
3270
3271/*****************************************************************************/
3272
3273static MACHINE_DRIVER_START( system18 )
3274
3275   /* basic machine hardware */
3276   MDRV_CPU_ADD("maincpu", M68000, 10000000)
3277   MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
3278
3279   MDRV_CPU_ADD("soundcpu", Z80, 8000000)
3280   MDRV_CPU_PROGRAM_MAP(sound_18_map)
3281   MDRV_CPU_IO_MAP(sound_18_io_map)
3282
3283   /* video hardware */
3284   MDRV_SCREEN_ADD("screen", RASTER)
3285   MDRV_SCREEN_REFRESH_RATE(60)
3286   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
3287   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
3288   MDRV_SCREEN_SIZE(40*8, 28*8)
3289   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
3290
3291   MDRV_GFXDECODE(sys16)
3292   MDRV_PALETTE_LENGTH((2048+2048)*ShadowColorsMultiplier) // 64 extra colours for vdp (but we use 2048 so shadow mask works)
3293
3294   MDRV_VIDEO_START(system18old)
3295   MDRV_VIDEO_UPDATE(system18old)
3296
3297   /* sound hardware */
3298   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
3299
3300   MDRV_SOUND_ADD("3438.0", YM3438, 8000000)
3301   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
3302   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
3303   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
3304   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
3305
3306   MDRV_SOUND_ADD("3438.1", YM3438, 8000000)
3307   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
3308   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
3309   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
3310   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
3311
3312   MDRV_SOUND_ADD("5c68", RF5C68, 8000000)
3313   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
3314   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
3315MACHINE_DRIVER_END
3316
3317
3318static MACHINE_DRIVER_START( astormbl )
3319
3320   /* basic machine hardware */
3321   MDRV_IMPORT_FROM(system18)
3322   MDRV_CPU_MODIFY("maincpu")
3323   MDRV_CPU_PROGRAM_MAP(astormbl_map)
3324
3325   MDRV_MACHINE_RESET(astormbl)
3326MACHINE_DRIVER_END
3327
3328
3329static MACHINE_DRIVER_START( mwalkbl )
3330
3331   /* basic machine hardware */
3332   MDRV_IMPORT_FROM(system18)
3333   MDRV_CPU_MODIFY("maincpu")
3334   MDRV_CPU_PROGRAM_MAP(mwalkbl_map)
3335
3336   MDRV_MACHINE_RESET(mwalkbl)
3337MACHINE_DRIVER_END
3338
3339
3340static MACHINE_DRIVER_START( shdancbl )
3341
3342   /* basic machine hardware */
3343   MDRV_IMPORT_FROM(system18)
3344   MDRV_CPU_MODIFY("maincpu")
3345   MDRV_CPU_PROGRAM_MAP(shdancbl_map)
3346
3347   MDRV_CPU_MODIFY("soundcpu")
3348   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_map)
3349   MDRV_CPU_IO_MAP(shdancbl_sound_io_map)
3350   MDRV_SOUND_REMOVE("5c68")
3351
3352   MDRV_SOUND_ADD("5205", MSM5205, 200000)
3353   MDRV_SOUND_CONFIG(shdancbl_msm5205_interface)
3354   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
3355   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
3356
3357   MDRV_MACHINE_RESET(shdancbl)
3358MACHINE_DRIVER_END
3359
3360
3361/***************************************************************************/
3362
3363static INPUT_PORTS_START( astormbl )
3364   PORT_START("P1")   /* player 1 */
3365   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
3366   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
3367   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
3368   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3369   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
3370   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
3371   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
3372   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
3373
3374   PORT_START("P2")   /* player 2 */
3375   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
3376   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
3377   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
3378   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3379   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
3380   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
3381   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
3382   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
3383
3384   PORT_START("SERVICE")
3385   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
3386   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
3387   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
3388   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
3389   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
3390   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
3391   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
3392   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
3393
3394   PORT_START("COINAGE")
3395   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
3396   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
3397   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
3398   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
3399   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
3400   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
3401   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
3402   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
3403   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
3404   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
3405   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
3406   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
3407   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
3408   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
3409   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
3410   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
3411   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
3412   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
3413   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
3414   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
3415   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
3416   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
3417   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
3418   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
3419   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
3420   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
3421   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
3422   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
3423   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
3424   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
3425   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
3426   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
3427   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
3428   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
3429
3430   PORT_START("DSW1")   /* DSW1 */
3431   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
3432   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
3433   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3434   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
3435   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
3436   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3437   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Difficulty ) )
3438   PORT_DIPSETTING(    0x04, DEF_STR( Easiest ) )
3439   PORT_DIPSETTING(    0x08, DEF_STR( Easier ) )
3440   PORT_DIPSETTING(    0x0c, DEF_STR( Easy ) )
3441   PORT_DIPSETTING(    0x1c, DEF_STR( Normal ) )
3442   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
3443   PORT_DIPSETTING(    0x14, DEF_STR( Harder ) )
3444   PORT_DIPSETTING(    0x18, DEF_STR( Hardest ) )
3445   PORT_DIPSETTING(    0x00, "Special" )
3446   PORT_DIPNAME( 0x20, 0x20, "Coin Chutes" )
3447   PORT_DIPSETTING(    0x20, "3" )
3448   PORT_DIPSETTING(    0x00, "1" )
3449   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
3450   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
3451   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3452   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
3453   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
3454   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
3455
3456   PORT_START("P3")   /* player 3 */
3457   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
3458   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
3459   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
3460   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
3461   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
3462   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
3463   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
3464   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
3465INPUT_PORTS_END
3466
3467static INPUT_PORTS_START( mwalkbl )
3468   PORT_INCLUDE( astormbl )
3469
3470   PORT_MODIFY("SERVICE")   /* service */
3471   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
3472   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
3473   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
3474
3475   PORT_MODIFY("DSW1")   /* DSW1 */
3476   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
3477   PORT_DIPSETTING(    0x04, "2" )
3478   PORT_DIPSETTING(    0x00, "3" )
3479   PORT_DIPNAME( 0x08, 0x08, "Player Vitality" )
3480   PORT_DIPSETTING(    0x08, DEF_STR( Low ) )
3481   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
3482   PORT_DIPNAME( 0x10, 0x00, "Play Mode" )
3483   PORT_DIPSETTING(    0x10, "2 Players" )
3484   PORT_DIPSETTING(    0x00, "3 Players" )
3485   PORT_DIPNAME( 0x20, 0x20, "Coin Mode" )
3486   PORT_DIPSETTING(    0x20, "Common" )
3487   PORT_DIPSETTING(    0x00, "Individual" )
3488   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
3489   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
3490   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
3491   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
3492   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
3493
3494   PORT_MODIFY("P3")   /* player 3 */
3495   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
3496INPUT_PORTS_END
3497
3498/*****************************************************************************/
3499
3500ROM_START( astormbl )
3501   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
3502   ROM_LOAD16_BYTE( "astorm.a6", 0x000000, 0x40000, CRC(7682ed3e) SHA1(b857352ad9c66488e91f60989472638c483e4ae8) )
3503   ROM_LOAD16_BYTE( "astorm.a5", 0x000001, 0x40000, CRC(efe9711e) SHA1(496fd9e30941fde1658fab7292a669ef7964cecb) )
3504
3505   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
3506   ROM_LOAD( "epr13073.bin", 0x00000, 0x40000, CRC(df5d0a61) SHA1(79ad71de348f280bad847566c507b7a31f022292) )
3507   ROM_LOAD( "epr13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
3508   ROM_LOAD( "epr13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
3509
3510   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
3511   ROM_LOAD16_BYTE( "mpr13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
3512   ROM_LOAD16_BYTE( "astorm.a11",   0x000000, 0x40000, CRC(7829c4f3) SHA1(3adb7aa7f70163d3848c98316e18b9783c41d663) )
3513   ROM_LOAD16_BYTE( "mpr13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
3514   ROM_LOAD16_BYTE( "mpr13088.bin", 0x080000, 0x40000, CRC(3b6b4c55) SHA1(970495c54b3e1893ee8060f6ca1338c2cbbd1074) )
3515   ROM_LOAD16_BYTE( "mpr13080.bin", 0x100001, 0x40000, CRC(e668eefb) SHA1(d4a087a238b4d3ac2d23fe148d6a73018e348a89) )
3516   ROM_LOAD16_BYTE( "mpr13087.bin", 0x100000, 0x40000, CRC(2293427d) SHA1(4fd07763ff060afd594e3f64fa4750577f56c80e) )
3517   ROM_LOAD16_BYTE( "epr13079.bin", 0x180001, 0x40000, CRC(de9221ed) SHA1(5e2e434d1aa547be1e5652fc906d2e18c5122023) )
3518   ROM_LOAD16_BYTE( "epr13086.bin", 0x180000, 0x40000, CRC(8c9a71c4) SHA1(40b774765ac888792aad46b6351a24b7ef40d2dc) )
3519
3520   ROM_REGION( 0x100000, "soundcpu", 0 ) /* sound CPU */
3521   ROM_LOAD( "epr13083.bin", 0x10000, 0x20000, CRC(5df3af20) SHA1(e49105fcfd5bf37d14bd760f6adca5ce2412883d) )
3522   ROM_LOAD( "epr13076.bin", 0x30000, 0x40000, CRC(94e6c76e) SHA1(f99e58a9bf372c41af211bd9b9ea3ac5b924c6ed) )
3523   ROM_LOAD( "epr13077.bin", 0x70000, 0x40000, CRC(e2ec0d8d) SHA1(225b0d223b7282cba7710300a877fb4a2c6dbabb) )
3524   ROM_LOAD( "epr13078.bin", 0xb0000, 0x40000, CRC(15684dc5) SHA1(595051006de24f791dae937584e502ff2fa31d9c) )
3525ROM_END
3526
3527/*
3528
3529CPUs:
3530on main board:
3531
35321x MC68000P10 (main)
35331x Z8400BB1-Z80BCPU (sound)
35341x OKI M6295 (sound)
35351x oscillator 24.000MHz (close to main)
35361x oscillator 8.000MHz (close to sound)
3537
3538ROMs
3539on main board:
3540
35419x M27C512 (1,2,3,4,5,6,7,8,10)
35421x TMS27C256 (9)
354321x NM27C010Q (11-31)
3544
3545----------------------
3546
3547on roms board:
35486x NM27C010Q (32-37)
35492x N82S123N
3550
3551*/
3552
3553ROM_START( astormb2 )
3554   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
3555   ROM_LOAD16_BYTE( "1.a4", 0x000000, 0x10000, CRC(cca0d0af) SHA1(26fdbbeb8444d05f0ca2056a7c7fb81b0f1f2b5a) )
3556   ROM_LOAD16_BYTE( "2.a3", 0x020000, 0x10000, CRC(f95eb883) SHA1(b25d9c0fd46a534e7612f4a3ffa708b73654ae2b) )
3557   ROM_LOAD16_BYTE( "3.a2", 0x040000, 0x10000, CRC(4206ecd4) SHA1(45c65d7727cfaf215a7081159f6931185e92b39a) ) // epr13182.bin [3/4]      IDENTICAL
3558   ROM_LOAD16_BYTE( "4.a1", 0x060000, 0x10000, CRC(23247c95) SHA1(e4d78c453d2cb77946dd1b5266de823968eade77) ) // epr13182.bin [4/4]      98.648071%
3559   ROM_LOAD16_BYTE( "5.a9", 0x000001, 0x10000, CRC(6143039e) SHA1(8a5143c1e2c637149e988c423fa30b31e29a1193) )
3560   ROM_LOAD16_BYTE( "6.a8", 0x020001, 0x10000, CRC(0fd17bec) SHA1(e9a5dd93394fdf1561a925e4111dfce51b717b14) )
3561   ROM_LOAD16_BYTE( "7.a7", 0x040001, 0x10000, CRC(c901e228) SHA1(f459ba819a4e5f5174ff1b3957fb648c93beed53) ) // epr13181.bin [3/4]      IDENTICAL
3562   ROM_LOAD16_BYTE( "8.a6", 0x060001, 0x10000, CRC(bfb9d607) SHA1(8c3e10c1397fa0807d8df4715c9eb1945c774924) ) // epr13181.bin [4/4]      98.587036%
3563
3564   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
3565   ROM_LOAD( "32.01",  0x00000, 0x20000, CRC(d2aeb4ab) SHA1(9338ec5dc48f5d2b20511628a281236fe4646ef4) ) // epr13073.bin [1/2]      IDENTICAL
3566   ROM_LOAD( "33.011", 0x20000, 0x20000, CRC(2193f0ae) SHA1(84070f74693699c1ffc1a47517a97b5d058d08ec) ) // epr13073.bin [2/2]      IDENTICAL
3567   ROM_LOAD( "34.02",  0x40000, 0x20000, CRC(849aa725) SHA1(0f949dfe8a6c5796edc86a05339da80a158a95ae) ) // epr13074.bin [1/2]      IDENTICAL
3568   ROM_LOAD( "35.021", 0x60000, 0x20000, CRC(3f190347) SHA1(131953ccefb95eeef1ea90499ce521c3749f95c1) ) // epr13074.bin [2/2]      IDENTICAL
3569   ROM_LOAD( "36.03",  0x80000, 0x20000, CRC(c0f9628d) SHA1(aeacf5e409adfa0b9c28c90d4e89eb1f56cd5f4d) ) // epr13075.bin [1/2]      IDENTICAL
3570   ROM_LOAD( "37.031", 0xa0000, 0x20000, CRC(95af904e) SHA1(6574fa874c355c368109b417aab7d0b05c9d215d) ) // epr13075.bin [2/2]      IDENTICAL
3571
3572   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
3573   ROM_LOAD16_BYTE( "17.042", 0x000001, 0x20000, CRC(db08beb5) SHA1(c154d22c69b77637d6a9d0f2bffcfb47e6901ec8) ) // mpr13082.bin [1/2]      IDENTICAL
3574   ROM_LOAD16_BYTE( "16.043", 0x040001, 0x20000, CRC(41f78977) SHA1(9cf9fcf96722d148c4b2cf7aa33425b6efcd0379) ) // mpr13082.bin [2/2]      IDENTICAL
3575   ROM_LOAD16_BYTE( "29.012", 0x000000, 0x20000, CRC(22acf675) SHA1(80fd0d96017bf36d964a79f7e13e73fee7ed370a) ) // mpr13089.bin [1/2]      99.941254%
3576   ROM_LOAD16_BYTE( "28.013", 0x040000, 0x20000, CRC(32b37a3a) SHA1(70f268aa99a17739fd9d832b5f1d9e37247747e6) ) // mpr13089.bin [2/2]      IDENTICAL
3577    ROM_LOAD16_BYTE( "19.040", 0x080001, 0x20000, CRC(10c359ac) SHA1(9087cb824242ce5fc8eba45b61cca8b329c576e5) ) // mpr13081.bin [1/2]      IDENTICAL
3578   ROM_LOAD16_BYTE( "18.041", 0x0c0001, 0x20000, CRC(47146c1d) SHA1(cd5d92136f86128a9f304c4f8850f1efd652dd5c) ) // mpr13081.bin [2/2]      IDENTICAL
3579   ROM_LOAD16_BYTE( "31.010", 0x080000, 0x20000, CRC(e88fc39c) SHA1(f19c55c49771625a76e65b639a3b23969db8031d) ) // mpr13088.bin [1/2]      IDENTICAL
3580   ROM_LOAD16_BYTE( "30.011", 0x0c0000, 0x20000, CRC(6fe7e2a2) SHA1(94e5852377f72fd00daae302db4a5f93301213e4) ) // mpr13088.bin [2/2]      IDENTICAL
3581   ROM_LOAD16_BYTE( "21.032", 0x100001, 0x20000, CRC(c9e5a258) SHA1(809a3a3f88efe9c7a9dd9f6439ccb48fffb84df0) ) // mpr13080.bin [1/2]      IDENTICAL
3582   ROM_LOAD16_BYTE( "20.033", 0x140001, 0x20000, CRC(ddf8d00e) SHA1(0a9031063921bb03e7fd57eea369a1ddcfa85431) ) // mpr13080.bin [2/2]      IDENTICAL
3583   ROM_LOAD16_BYTE( "25.022", 0x100000, 0x20000, CRC(af8f3700) SHA1(3787f732eee5c6c9b6550bd4ce5387aff2c4072e) ) // mpr13087.bin [1/2]      IDENTICAL
3584   ROM_LOAD16_BYTE( "24.023", 0x140000, 0x20000, CRC(a092ecb6) SHA1(d7cc85eaea70c7947c497bc1d9743ab12a6fb43e) ) // mpr13087.bin [2/2]      IDENTICAL
3585   ROM_LOAD16_BYTE( "23.030", 0x180001, 0x20000, CRC(adc1b625) SHA1(496a1e92a833dbde37a0426165ff4250848b6ef4) ) // epr13079.bin [1/2]      IDENTICAL
3586   ROM_LOAD16_BYTE( "22.031", 0x1c0001, 0x20000, CRC(27c27f38) SHA1(439502250da4e376d2aa4bd9122455c6991e334d) ) // epr13079.bin [2/2]      IDENTICAL
3587   ROM_LOAD16_BYTE( "27.020", 0x180000, 0x20000, CRC(6c5312aa) SHA1(94b74c78f318fcc1881a2926cebc98033a7e535d) ) // epr13086.bin [1/2]      IDENTICAL
3588   ROM_LOAD16_BYTE( "26.021", 0x1c0000, 0x20000, CRC(c67fc986) SHA1(5fac826f9dde45201e3b93582dbe29c584a10229) ) // epr13086.bin [2/2]      99.987030%
3589
3590   /* Sound HW is very different to the originals */
3591   ROM_REGION( 0x210000, "soundcpu", ROMREGION_ERASEFF ) /* Z80 sound CPU */
3592   ROM_LOAD( "9.a5", 0x10000, 0x08000, CRC(0a4638e9) SHA1(0470e03a194464ff53c7583637193b585f5fd79f) )
3593
3594   ROM_REGION( 0x40000, "oki1", ROMREGION_ERASEFF ) /* Oki6295 Samples - fixed? samples */
3595   ROM_LOAD( "11.a10", 0x00000, 0x20000, CRC(7e0f752c) SHA1(a4070c3fa4848b5be223f9b927de4b6926dbb4e6) ) // contains sample table
3596   ROM_LOAD( "10.a11", 0x20000, 0x10000, CRC(722e5969) SHA1(9cf891c6533b2e2a5c4741aa4e405038a7bf4e97) )
3597   /* 0x30000- 0x3ffff banked? (guess) */
3598
3599   ROM_REGION( 0xc0000, "oki2", ROMREGION_ERASEFF ) /* Oki6295 Samples - banked? samples*/
3600   ROM_LOAD( "12.a15", 0x00000, 0x20000, CRC(cb4517db) SHA1(4c93376c2b3e70001bbc283d4485bb55514f6ef9) )
3601   ROM_LOAD( "13.a14", 0x20000, 0x20000, CRC(c60d6f18) SHA1(c9610729f19ae8414efd785948a1e6fb079bfe8d) )
3602   ROM_LOAD( "14.a13", 0x40000, 0x20000, CRC(07e6b3a5) SHA1(32da2a9aeb840b76e6f0117ac342ff5d612762b4) )
3603   ROM_LOAD( "15.a12", 0x60000, 0x20000, CRC(dffde929) SHA1(037b32470747d155385e532ee574b1234b3c2b26) )
3604
3605   ROM_REGION( 0x0120, "proms", 0 )
3606   ROM_LOAD( "n82s129n.129",  0x0000, 0x0100, CRC(a7c22d96) SHA1(160deae8053b09c09328325246598b3518c7e20b) )
3607   ROM_LOAD( "n82s123n.123",  0x0100, 0x0020, CRC(58bcf8bd) SHA1(e4d3d179b08c0f3424a6bec0f15058fb1b56f8d8) )
3608ROM_END
3609
3610
3611ROM_START( mwalkbl )
3612   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
3613   ROM_LOAD16_BYTE( "mwalkbl.01", 0x000000, 0x10000, CRC(f49cdb16) SHA1(34b7e98d31c3b9db2f0f055d7b249b0e5e5cb746) )
3614   ROM_LOAD16_BYTE( "mwalkbl.05", 0x000001, 0x10000, CRC(c483f29f) SHA1(8fdfa764d8e49754844a9dc001400d439f9af9f0) )
3615   ROM_LOAD16_BYTE( "mwalkbl.02", 0x020000, 0x10000, CRC(0bde1896) SHA1(42731ae90d56918dc50c0dcb53d092dcfb957159) )
3616   ROM_LOAD16_BYTE( "mwalkbl.06", 0x020001, 0x10000, CRC(5b9fc688) SHA1(53d8143c3876548f63b392f0ea16c0e7c30a7917) )
3617   ROM_LOAD16_BYTE( "mwalkbl.03", 0x040000, 0x10000, CRC(0c5fe15c) SHA1(626e3f37f019448c3c96bf73b2d2b5fe4b3716c0) )
3618   ROM_LOAD16_BYTE( "mwalkbl.07", 0x040001, 0x10000, CRC(9e600704) SHA1(efd3d450b26f81dc2b74f44b4aaf906fa017e437) )
3619   ROM_LOAD16_BYTE( "mwalkbl.04", 0x060000, 0x10000, CRC(64692f79) SHA1(ad7f32997b78863e3aa3214018cdd24e3ec9c5cb) )
3620   ROM_LOAD16_BYTE( "mwalkbl.08", 0x060001, 0x10000, CRC(546ca530) SHA1(51f74878fdc221fee026e2e6a7ca96f290c8947f) )
3621
3622   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
3623   ROM_LOAD( "mpr13216.b1", 0x00000, 0x40000, CRC(862d2c03) SHA1(3c5446d702a639b62a602c6d687f9875d8450218) )
3624   ROM_LOAD( "mpr13217.b2", 0x40000, 0x40000, CRC(7d1ac3ec) SHA1(8495357304f1df135bba77ef3b96e79a883b8ff0) )
3625   ROM_LOAD( "mpr13218.b3", 0x80000, 0x40000, CRC(56d3393c) SHA1(50a2d065060692c9ecaa56046a781cb21d93e554) )
3626
3627   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
3628   ROM_LOAD16_BYTE( "mpr13224.b11", 0x000001, 0x40000, CRC(c59f107b) SHA1(10fa60fca6e34eda277c483bb1c0e81bb88c8a47) )
3629   ROM_LOAD16_BYTE( "mpr13231.a11", 0x000000, 0x40000, CRC(a5e96346) SHA1(a854f4dd5dc16975373255110fdb8ab3d121b1af) )
3630   ROM_LOAD16_BYTE( "mpr13223.b10", 0x080001, 0x40000, CRC(364f60ff) SHA1(9ac887ec0b2e32b504b7c6a5f3bb1ce3fe41a15a) )
3631   ROM_LOAD16_BYTE( "mpr13230.a10", 0x080000, 0x40000, CRC(9550091f) SHA1(bb6e898f7b540e130fd338c10f74609a7604cef4) )
3632   ROM_LOAD16_BYTE( "mpr13222.b9",  0x100001, 0x40000, CRC(523df3ed) SHA1(2e496125e75decd674c3a08404fbdb53791a965d) )
3633   ROM_LOAD16_BYTE( "mpr13229.a9",  0x100000, 0x40000, CRC(f40dc45d) SHA1(e9468cef428f52ecdf6837c6d9a9fea934e7676c) )
3634   ROM_LOAD16_BYTE( "epr13221.b8",  0x180001, 0x40000, CRC(9ae7546a) SHA1(5413b0131881b0b32bac8de51da9a299835014bb) )
3635   ROM_LOAD16_BYTE( "epr13228.a8",  0x180000, 0x40000, CRC(de3786be) SHA1(2279bb390aa3efab9aeee0a643e5cb6a4f5933b6) )
3636
3637   ROM_REGION( 0x100000, "soundcpu", 0 ) /* sound CPU */
3638   ROM_LOAD( "epr13225.a4", 0x10000, 0x20000, CRC(56c2e82b) SHA1(d5755a1bb6e889d274dc60e883d4d65f12fdc877) )
3639   ROM_LOAD( "mpr13219.b4", 0x30000, 0x40000, CRC(19e2061f) SHA1(2dcf1718a43dab4da53b4f67722664e70ddd2169) )
3640   ROM_LOAD( "mpr13220.b5", 0x70000, 0x40000, CRC(58d4d9ce) SHA1(725e73a656845b02702ef131b4c0aa2a73cdd02e) )
3641   ROM_LOAD( "mpr13249.b6", 0xb0000, 0x40000, CRC(623edc5d) SHA1(c32d9f818d40f311877fbe6532d9e95b6045c3c4) )
3642ROM_END
3643
3644
3645// Shadow Dancer
3646ROM_START( shdancbl )
3647   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
3648   ROM_LOAD16_BYTE( "ic39", 0x000000, 0x10000, CRC(adc1781c) SHA1(b2ca2831a48779df7533e6b2a406ee539e1f650c) )
3649   ROM_LOAD16_BYTE( "ic53", 0x000001, 0x10000, CRC(1c1ac463) SHA1(21075f7afae372daef197f04f5f12d14479a8140) )
3650   ROM_LOAD16_BYTE( "ic38", 0x020000, 0x10000, CRC(cd6e155b) SHA1(e37b53cc431533091d26b37be9b8e30494de5faf) )
3651   ROM_LOAD16_BYTE( "ic52", 0x020001, 0x10000, CRC(bb3c49a4) SHA1(ab01a6de1a6d338d30f9cfea7b3bf80dda67f215) )
3652   ROM_LOAD16_BYTE( "ic37", 0x040000, 0x10000, CRC(1bd8d5c3) SHA1(4d663362c059e112ac6c742d80200be98d50d175) )
3653   ROM_LOAD16_BYTE( "ic51", 0x040001, 0x10000, CRC(ce2e71b4) SHA1(3e251319cd4c8c63c66e6b92b2eef514d79dba8e) )
3654   ROM_LOAD16_BYTE( "ic36", 0x060000, 0x10000, CRC(bb861290) SHA1(62ea8eec74c6b1f5530ee86f97ad821daeac26ad) )
3655   ROM_LOAD16_BYTE( "ic50", 0x060001, 0x10000, CRC(7f7b82b1) SHA1(675020b57ce689b2767ff83773e2b828cda5aeed) )
3656
3657   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE | ROMREGION_INVERT ) /* tiles */
3658   ROM_LOAD( "ic4",  0x00000, 0x20000, CRC(f0a016fe) SHA1(1426f3fbf50a04a8c5e998e071ca0e78d15f37a8) )
3659   ROM_LOAD( "ic18", 0x20000, 0x20000, CRC(f6bee053) SHA1(39ee5edfcc67bb4855217c7428254f3e8c862ba0) )
3660   ROM_LOAD( "ic3",  0x40000, 0x20000, CRC(e07e6b5d) SHA1(bdeb1193415049d0c9261ca261073bdd9e251b88) )
3661   ROM_LOAD( "ic17", 0x60000, 0x20000, CRC(f59deba1) SHA1(21188d22fe607281bb7da1e1f418a33d4a315695) )
3662   ROM_LOAD( "ic2",  0x80000, 0x20000, CRC(60095070) SHA1(913c2ee51fb6f838f3c6cbd27032bdf754fbadf1) )
3663   ROM_LOAD( "ic16", 0xa0000, 0x20000, CRC(0f0d5dd3) SHA1(76812e2f831256a8b6598257dd84a7f07443642e) )
3664
3665   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
3666
3667   // 12719
3668   ROM_LOAD16_BYTE( "ic73", 0x000001, 0x10000, CRC(59e77c96) SHA1(08da058529ac83352a4528d3792a21edda348f7a) )
3669   ROM_LOAD16_BYTE( "ic74", 0x020001, 0x10000, CRC(90ea5407) SHA1(4bdd93c86cb35822517433d491aa8be6857dd36c) )
3670   ROM_LOAD16_BYTE( "ic75", 0x040001, 0x10000, CRC(27d2fa61) SHA1(0ba3cd9448e54ce9fc9433f3edd28de9a4e451e9) )
3671   ROM_LOAD16_BYTE( "ic76", 0x060001, 0x10000, CRC(f36db688) SHA1(a527298ce9ca1d9f5aa7b9eac93985f34ca8119f) )
3672
3673   // 12726
3674   ROM_LOAD16_BYTE( "ic58", 0x000000, 0x10000, CRC(9cd5c8c7) SHA1(54c2d0a683bda37eb9a75f90f4ca5e620c09c4cf) )
3675   ROM_LOAD16_BYTE( "ic59", 0x020000, 0x10000, CRC(ff40e872) SHA1(bd2c4aac427d106a46318f4cb2eb05c34d3c70b6) )
3676   ROM_LOAD16_BYTE( "ic60", 0x040000, 0x10000, CRC(826d7245) SHA1(bb3394de058bd63b9939cd05f22c925e0cdc840a) )
3677   ROM_LOAD16_BYTE( "ic61", 0x060000, 0x10000, CRC(dcf8068b) SHA1(9c78de224df76fc90fb90f1bbd9b22dad0874f69) )
3678
3679   // 12718
3680   ROM_LOAD16_BYTE( "ic77", 0x080001, 0x10000, CRC(f93470b7) SHA1(1041afa43aa8d0589d6def9743721cdbda617f78) )
3681//  ROM_LOAD16_BYTE( "ic78", 0x0A0001, 0x10000, CRC(4d523ea3) SHA1(053c30778017127dddeae0783af463aef17bcc9a) ) // corrupt? (bad sprite when dog attacts in attract mode)
3682   ROM_LOAD16_BYTE( "sdbl.78", 0x0A0001, 0x10000, CRC(e533be5d) SHA1(926d6ba3f7a3ac289b0ae40d7633c70b2819df4d) )
3683   ROM_LOAD16_BYTE( "ic95", 0x0C0001, 0x10000, CRC(828b8294) SHA1(f2cdb882fb0709a909e6ef98f0315aceeb8bf283) )
3684//  ROM_LOAD16_BYTE( "ic94", 0x0E0001, 0x10000, CRC(542b2d1e) SHA1(1ce91aea6c49e6e365a91c30ca3049682c2162da) )
3685   ROM_LOAD16_BYTE( "sdbl.94", 0x0E0001, 0x10000, CRC(e2fa2b41) SHA1(7186107734dac5763dee43addcea7c14fb0d9d74) )
3686
3687   // 12725
3688   ROM_LOAD16_BYTE( "ic62", 0x080000, 0x10000, CRC(50ca8065) SHA1(8c0d6ae34b9da6c376df387e8fc8b1068bcb4dcb) )
3689   ROM_LOAD16_BYTE( "ic63", 0x0A0000, 0x10000, CRC(d1866aa9) SHA1(524c82a12a1c484a246b8d49d9f05a774d008108) )
3690   ROM_LOAD16_BYTE( "ic90", 0x0C0000, 0x10000, CRC(3602b758) SHA1(d25b6c8420e07d0f2ac3e1d8717f14738466df16) )
3691   ROM_LOAD16_BYTE( "ic89", 0x0E0000, 0x10000, CRC(1ba4be93) SHA1(6f4fe2016e375be3df477436f5cde7508a24ecd1) )
3692
3693   // 12717
3694   ROM_LOAD16_BYTE( "ic79", 0x100001, 0x10000, CRC(f22548ee) SHA1(723cb7604784c6715817daa8c86c18c6bcd1388d) )
3695   ROM_LOAD16_BYTE( "ic80", 0x120001, 0x10000, CRC(6209f7f9) SHA1(09b33c99d972a62af8ef56dacfa6262f002aba0c) )
3696   ROM_LOAD16_BYTE( "ic81", 0x140001, 0x10000, CRC(34692f23) SHA1(56126a81ac279662e3e3423da5205f65a62c4600) )
3697   ROM_LOAD16_BYTE( "ic82", 0x160001, 0x10000, CRC(7ae40237) SHA1(fae97cfcfd3cd557da3330158831e4727c438745) )
3698
3699   // 12724
3700   ROM_LOAD16_BYTE( "ic64", 0x100000, 0x10000, CRC(7a8b7bcc) SHA1(00cbbbc4b3db48ca3ac65ff56b02c7d63a1b898a) )
3701   ROM_LOAD16_BYTE( "ic65", 0x120000, 0x10000, CRC(90ffca14) SHA1(00962e5309a79ce34c6f420036054bc607595dfe) )
3702   ROM_LOAD16_BYTE( "ic66", 0x140000, 0x10000, CRC(5d655517) SHA1(2a1c197dde62bd7946ca7b5f1c2833bdbc2e2e32) )
3703   ROM_LOAD16_BYTE( "ic67", 0x160000, 0x10000, CRC(0e5d0855) SHA1(3c15088f7fdda5c2bba9c89d244bbcff022f05fd) )
3704
3705   // 12716
3706   ROM_LOAD16_BYTE( "ic83", 0x180001, 0x10000, CRC(a9040a32) SHA1(7b0b375285f528b2833c50892b55b0d4c550506d) )
3707   ROM_LOAD16_BYTE( "ic84", 0x1A0001, 0x10000, CRC(d6810031) SHA1(a82857a9ac442fbe076cdafcf7390765391ed136) )
3708   ROM_LOAD16_BYTE( "ic92", 0x1C0001, 0x10000, CRC(b57d5cb5) SHA1(636f1a07a84d37cecbe388a2f585893c4611436c) )
3709   ROM_LOAD16_BYTE( "ic91", 0x1E0001, 0x10000, CRC(49def6c8) SHA1(d8b2cc1993f0808553f87bf56fdbe47374576c5a) )
3710
3711   // 12723
3712   ROM_LOAD16_BYTE( "ic68", 0x180000, 0x10000, CRC(8d684e53) SHA1(00e82ddaf875a7452ff978b7b7eb87a1a5a8fb64) )
3713   ROM_LOAD16_BYTE( "ic69", 0x1A0000, 0x10000, CRC(c47d32e2) SHA1(92b21f51abdd7950fb09d965b1d71b7bffac31ec) )
3714   ROM_LOAD16_BYTE( "ic88", 0x1C0000, 0x10000, CRC(9de140e1) SHA1(f1125e056a898a4fa519b49ae866c5c742e36bf7) )
3715   ROM_LOAD16_BYTE( "ic87", 0x1E0000, 0x10000, CRC(8172a991) SHA1(6d12b1533a19cb02613b473cc8ba73ece1f2a2fc) )
3716
3717   ROM_REGION( 0x30000, "soundcpu", 0 ) /* sound CPU */
3718   ROM_LOAD( "ic45", 0x10000, 0x10000, CRC(576b3a81) SHA1(b65356a3837ed3875634ab0cbcd61acce44f2bb9) )
3719   ROM_LOAD( "ic46", 0x20000, 0x10000, CRC(c84e8c84) SHA1(f57895bedb6152c30733e91e6f4795702a62ac3a) )
3720ROM_END
3721
3722
3723/*****************************************************************************/
3724
3725GAME( 1990, astormbl, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3726GAME( 1990, astormb2, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
3727
3728GAME( 1990, mwalkbl,  mwalk,    mwalkbl,  mwalkbl,  mwalkbl,  ROT0, "bootleg", "Michael Jackson's Moonwalker (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3729
3730GAME( 1989, shdancbl, shdancer, shdancbl, mwalkbl,  shdancbl, ROT0, "bootleg", "Shadow Dancer (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
3731
src/mame/drivers/mcr3.c
r4878r4879
15161516static DRIVER_INIT( demoderm )
15171517{
15181518   mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
1519   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x01, 0x01, 0, 0, demoderm_ip1_r);
1520   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, demoderm_ip2_r);
1521   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, demoderm_op6_w);
1519   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x01, 0x01, 0, 0, demoderm_ip1_r);
1520   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, demoderm_ip2_r);
1521   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, demoderm_op6_w);
15221522}
15231523
15241524
15251525static DRIVER_INIT( sarge )
15261526{
15271527   mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
1528   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, turbocs_data_w);
1528   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, turbocs_data_w);
15291529}
15301530
15311531
15321532static DRIVER_INIT( maxrpm )
15331533{
15341534   mcr_common_init(machine, MCR_TURBO_CHIP_SQUEAK);
1535   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x01, 0x01, 0, 0, maxrpm_ip1_r);
1536   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, maxrpm_ip2_r);
1537   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x05, 0x05, 0, 0, maxrpm_op5_w);
1538   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, maxrpm_op6_w);
1535   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x01, 0x01, 0, 0, maxrpm_ip1_r);
1536   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, maxrpm_ip2_r);
1537   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x05, 0x05, 0, 0, maxrpm_op5_w);
1538   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, maxrpm_op6_w);
15391539
15401540   state_save_register_global(machine, maxrpm_adc_control);
15411541   state_save_register_global(machine, maxrpm_adc_select);
r4878r4879
15481548static DRIVER_INIT( rampage )
15491549{
15501550   mcr_common_init(machine, MCR_SOUNDS_GOOD);
1551   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, rampage_ip4_r);
1552   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, rampage_op6_w);
1551   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, rampage_ip4_r);
1552   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, rampage_op6_w);
15531553}
15541554
15551555
15561556static DRIVER_INIT( powerdrv )
15571557{
15581558   mcr_common_init(machine, MCR_SOUNDS_GOOD);
1559   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, powerdrv_ip2_r);
1560   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x05, 0x05, 0, 0, powerdrv_op5_w);
1561   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, powerdrv_op6_w);
1559   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x02, 0x02, 0, 0, powerdrv_ip2_r);
1560   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x05, 0x05, 0, 0, powerdrv_op5_w);
1561   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, powerdrv_op6_w);
15621562}
15631563
15641564
15651565static DRIVER_INIT( stargrds )
15661566{
15671567   mcr_common_init(machine, MCR_SOUNDS_GOOD);
1568   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x00, 0, 0, stargrds_ip0_r);
1569   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x05, 0x05, 0, 0, stargrds_op5_w);
1570   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, stargrds_op6_w);
1568   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x00, 0x00, 0, 0, stargrds_ip0_r);
1569   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x05, 0x05, 0, 0, stargrds_op5_w);
1570   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO), 0x06, 0x06, 0, 0, stargrds_op6_w);
15711571}
15721572
15731573
r4878r4879
16031603   spyhunt_scroll_offset = 88;
16041604
16051605   /* the SSIO Z80 doesn't have any program to execute */
1606   cpu_suspend(machine->cpu[1], SUSPEND_REASON_DISABLE, 1);
1606   cputag_suspend(machine, "csdcpu", SUSPEND_REASON_DISABLE, 1);
16071607
16081608   /* kludge for bad ROM read */
1609   memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0b53, 0x0b53, 0, 0, turbotag_kludge_r);
1609   memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0b53, 0x0b53, 0, 0, turbotag_kludge_r);
16101610}
16111611
16121612
src/mame/drivers/prehisle.c
r4878r4879
135135   PORT_DIPSETTING(   0x02, DEF_STR( Easy ) )
136136   PORT_DIPSETTING(   0x03, DEF_STR( Standard ) )
137137   PORT_DIPSETTING(   0x01, "Middle" )
138   PORT_DIPSETTING(   0x00, "Difficult" )
138   PORT_DIPSETTING(   0x00, DEF_STR( Difficult ) )
139139   PORT_DIPNAME( 0x0c, 0x0c, "Game Mode" )
140140   PORT_DIPSETTING(   0x08, "Demo Sounds Off" )
141141   PORT_DIPSETTING(   0x0c, "Demo Sounds On" )
src/mame/drivers/actfancr.c
r4878r4879
9999   AM_RANGE(0x046400, 0x0467ff) AM_WRITENOP /* Pf2 rowscroll - is it used? */
100100   AM_RANGE(0x060000, 0x06001f) AM_WRITE(actfancr_pf1_control_w)
101101   AM_RANGE(0x064000, 0x0647ff) AM_READWRITE(actfancr_pf1_data_r, actfancr_pf1_data_w) AM_BASE(&actfancr_pf1_data)
102   AM_RANGE(0x066400, 0x0667ff) AM_WRITE(SMH_RAM) AM_BASE(&actfancr_pf1_rowscroll_data)
102   AM_RANGE(0x066400, 0x0667ff) AM_WRITEONLY AM_BASE(&actfancr_pf1_rowscroll_data)
103103   AM_RANGE(0x100000, 0x100001) AM_WRITE(actfancr_sound_w)
104104   AM_RANGE(0x110000, 0x110001) AM_WRITE(buffer_spriteram_w)
105105   AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
src/mame/drivers/polepos.c
r4878r4879
212212
213213#include "driver.h"
214214#include "cpu/z80/z80.h"
215#include "cpu/z8000/z8000.h"
215216#include "cpu/mb88xx/mb88xx.h"
216217#include "deprecat.h"
217#include "machine/namcoio.h"
218#include "machine/namco06.h"
219#include "machine/namco51.h"
220#include "machine/namco53.h"
218221#include "sound/namco.h"
219#include "sound/namco52.h"
220222#include "sound/samples.h"
223#include "audio/namco52.h"
221224#include "audio/namco54.h"
222225#include "polepos.h"
223#include "nam_cust.h"
224226
225227#include "polepos.lh"
226228
227229#define POLEPOS_TOGGLE   PORT_TOGGLE
228230
229231
232static UINT8 steer_last;
233static UINT8 steer_delta;
234static INT16 steer_accum;
235
236
237
230238/*************************************************************************************/
231239/* Pole Position II protection                                                       */
232240/*************************************************************************************/
r4878r4879
320328         break;
321329
322330      case 0x06:   /* SB0 */
323         auto_start_mask = 0xfb | (bit << 2);
331         auto_start_mask = !bit;
324332         break;
325333
326334      case 0x07:   /* CHACL */
r4878r4879
339347}
340348
341349
342static READ8_HANDLER( in0_l )   { return input_port_read(space->machine, "IN0") & auto_start_mask; }   // fire and start buttons
343static READ8_HANDLER( in0_h )   { return input_port_read(space->machine, "IN0") >> 4; }            // coins
344static READ8_HANDLER( dipA_l )   { return input_port_read(space->machine, "DSWA"); }               // dips A
345static READ8_HANDLER( dipA_h )   { return input_port_read(space->machine, "DSWA") >> 4; }            // dips A
346static READ8_HANDLER( dipB_l )   { return input_port_read(space->machine, "DSWB"); }               // dips B
347static READ8_HANDLER( dipB_h )   { return input_port_read(space->machine, "DSWB") >> 4; }            // dips B
348static READ8_HANDLER( in1_l )   { return input_port_read(space->machine, "STEER"); }               // wheel
349static READ8_HANDLER( in1_h )   { return input_port_read(space->machine, "STEER") >> 4; }            // wheel
350static WRITE8_HANDLER( out_0 )
350static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine, param) >> 4; }
351static CUSTOM_INPUT( auto_start_r ) { return auto_start_mask; }
352
353static WRITE8_DEVICE_HANDLER( out_0 )
351354{
352355// no start lamps in pole position
353356//  set_led_status(1,data & 1);
r4878r4879
355358   coin_counter_w(1,~data & 4);
356359   coin_counter_w(0,~data & 8);
357360}
358static WRITE8_HANDLER( out_1 )
361
362static WRITE8_DEVICE_HANDLER( out_1 )
359363{
360364   coin_lockout_global_w(data & 1);
361365}
362366
363static const struct namcoio_interface intf0 =
367static const namco_51xx_interface namco_51xx_intf =
364368{
365   { in0_l, in0_h, dipB_l, dipB_h },   /* port read handlers */
366   { out_0, out_1 }               /* port write handlers */
369   {   /* port read handlers */
370      DEVCB_INPUT_PORT("IN0L"),
371      DEVCB_INPUT_PORT("IN0H"),
372      DEVCB_INPUT_PORT("DSWB"),
373      DEVCB_INPUT_PORT("DSWB_HI")
374   },
375   {   /* port write handlers */
376      DEVCB_HANDLER(out_0),
377      DEVCB_HANDLER(out_1)
378   }
367379};
368static const struct namcoio_interface intf1 =
380
381
382static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
369383{
370   { in1_l, in1_h, dipA_l, dipA_h },   /* port read handlers */
371   { NULL, NULL }                  /* port write handlers */
384   UINT32 length = memory_region_length(device->machine, "52xx");
385logerror("ROM @ %04X\n", offset);
386   return (offset < length) ? memory_region(device->machine, "52xx")[offset] : 0xff;
387}
388
389static READ8_DEVICE_HANDLER( namco_52xx_si_r )
390{
391   /* pulled to +5V */
392   return 1;
393}
394
395static const namco_52xx_interface namco_52xx_intf =
396{
397   "discrete",                     /* name of the discrete sound device */
398   NODE_04,                     /* index of the first node */
399   0,                           /* external clock rate */
400   DEVCB_HANDLER(namco_52xx_rom_r),   /* ROM read handler */
401   DEVCB_HANDLER(namco_52xx_si_r)      /* SI (pin 6) read handler */
372402};
373403
374404
375#include "cpu/z8000/z8000.h"
405static READ8_DEVICE_HANDLER( namco_53xx_k_r )
406{
407   /* hardwired to 0 */
408   return 0;
409}
410
411static READ8_DEVICE_HANDLER( steering_changed_r )
412{
413   /* read the current steering value and update our delta */
414   UINT8 steer_new = input_port_read(device->machine, "STEER");
415   steer_accum += (INT8)(steer_new - steer_last);
416   steer_last = steer_new;
417
418   /* if we have delta, clock things */
419   if (steer_accum < 0)
420   {
421      steer_delta = 1;
422      steer_accum++;
423   }
424   else if (steer_accum > 0)
425   {
426      steer_delta = 0;
427      steer_accum--;
428   }
429   else
430      steer_delta ^= 1;
431
432   return steer_accum & 1;
433}
434
435static READ8_DEVICE_HANDLER( steering_delta_r )
436{
437   return steer_delta;
438}
439
440static const namco_53xx_interface namco_53xx_intf =
441{
442   DEVCB_HANDLER(namco_53xx_k_r),         /* K port */
443   {
444      DEVCB_HANDLER(steering_changed_r),   /* R0 port */
445      DEVCB_HANDLER(steering_delta_r),   /* R1 port */
446      DEVCB_INPUT_PORT("DSWA"),         /* R2 port */
447      DEVCB_INPUT_PORT("DSWA_HI")         /* R3 port */
448   },
449   DEVCB_NULL                        /* P port (connected to test socket) */
450};
451
452
376453static MACHINE_RESET( polepos )
377454{
378455   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
r4878r4879
382459   for (i = 0; i < 8; i++)
383460      polepos_latch_w(space, i, 0);
384461
385   namco_06xx_init(machine, 0, 0,
386      NAMCOIO_51XX, &intf0,
387      NAMCOIO_53XX_POLEPOS, &intf1,
388      NAMCOIO_52XX, NULL,
389      NAMCOIO_54XX, NULL);
390
391462   /* set the interrupt vectors (this shouldn't be needed) */
392463   cpu_set_input_line_vector(cputag_get_cpu(machine, "sub"), 0, Z8000_NVI);
393464   cpu_set_input_line_vector(cputag_get_cpu(machine, "sub2"), 0, Z8000_NVI);
r4878r4879
401472
402473static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 )
403474   AM_RANGE(0x0000, 0x2fff) AM_ROM
404   AM_RANGE(0x3000, 0x37ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)   /* Battery Backup */
475   AM_RANGE(0x3000, 0x37ff) AM_MIRROR(0x0800) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)   /* Battery Backup */
405476   AM_RANGE(0x4000, 0x47ff) AM_READWRITE(polepos_sprite_r, polepos_sprite_w)            /* Motion Object */
406477   AM_RANGE(0x4800, 0x4bff) AM_READWRITE(polepos_road_r, polepos_road_w)             /* Road Memory */
407478   AM_RANGE(0x4c00, 0x4fff) AM_READWRITE(polepos_alpha_r, polepos_alpha_w)            /* Alphanumeric (char ram) */
408479   AM_RANGE(0x5000, 0x57ff) AM_READWRITE(polepos_view_r, polepos_view_w)             /* Background Memory */
409480
410   AM_RANGE(0x8000, 0x83ff) AM_READ(SMH_RAM)                  /* Sound Memory */
411   AM_RANGE(0x8000, 0x83bf) AM_WRITE(SMH_RAM)                  /* Sound Memory */
412   AM_RANGE(0x83c0, 0x83ff) AM_DEVWRITE("namco", polepos_sound_w) AM_BASE(&polepos_soundregs)/* Sound data */
481   AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0c00) AM_READ(SMH_RAM)                  /* Sound Memory */
482   AM_RANGE(0x8000, 0x83bf) AM_MIRROR(0x0c00) AM_WRITE(SMH_RAM)                  /* Sound Memory */
483   AM_RANGE(0x83c0, 0x83ff) AM_MIRROR(0x0c00) AM_DEVWRITE("namco", polepos_sound_w) AM_BASE(&polepos_soundregs)/* Sound data */
413484
414   AM_RANGE(0x9000, 0x90ff) AM_READWRITE(namco_06xx_0_data_r, namco_06xx_0_data_w)
415   AM_RANGE(0x9100, 0x9100) AM_READWRITE(namco_06xx_0_ctrl_r, namco_06xx_0_ctrl_w)
416   AM_RANGE(0xa000, 0xa000) AM_READ(polepos_ready_r)               /* READY */
417   AM_RANGE(0xa000, 0xa007) AM_WRITE(polepos_latch_w)            /* misc latches */
418   AM_RANGE(0xa100, 0xa100) AM_WRITE(watchdog_reset_w)            /* Watchdog */
419   AM_RANGE(0xa200, 0xa200) AM_WRITE(polepos_engine_sound_lsb_w)    /* Car Sound ( Lower Nibble ) */
420   AM_RANGE(0xa300, 0xa300) AM_WRITE(polepos_engine_sound_msb_w)    /* Car Sound ( Upper Nibble ) */
485   AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0eff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
486   AM_RANGE(0x9100, 0x9100) AM_MIRROR(0x0eff) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
487   AM_RANGE(0xa000, 0xa000) AM_MIRROR(0x0cff) AM_READ(polepos_ready_r)               /* READY */
488   AM_RANGE(0xa000, 0xa007) AM_MIRROR(0x0cf8) AM_WRITE(polepos_latch_w)            /* misc latches */
489   AM_RANGE(0xa100, 0xa100) AM_MIRROR(0x0cff) AM_WRITE(watchdog_reset_w)            /* Watchdog */
490   AM_RANGE(0xa200, 0xa200) AM_MIRROR(0x0cff) AM_WRITE(polepos_engine_sound_lsb_w)    /* Car Sound ( Lower Nibble ) */
491   AM_RANGE(0xa300, 0xa300) AM_MIRROR(0x0cff) AM_WRITE(polepos_engine_sound_msb_w)    /* Car Sound ( Upper Nibble ) */
421492ADDRESS_MAP_END
422493
423494static ADDRESS_MAP_START( z80_io, ADDRESS_SPACE_IO, 8 )
r4878r4879
429500/* the same memory map is used by both Z8002 CPUs; all RAM areas are shared */
430501static ADDRESS_MAP_START( z8002_map, ADDRESS_SPACE_PROGRAM, 16 )
431502   AM_RANGE(0x0000, 0x7fff) AM_ROM
432   AM_RANGE(0x6000, 0x6003) AM_WRITE(polepos_z8002_nvi_enable_w)   /* NVI enable - *NOT* shared by the two CPUs */
503   AM_RANGE(0x6000, 0x6001) AM_MIRROR(0x1ffe) AM_WRITE(polepos_z8002_nvi_enable_w)   /* NVI enable - *NOT* shared by the two CPUs */
433504   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(polepos_sprite16_r, polepos_sprite16_w) AM_BASE(&polepos_sprite16_memory)   /* Motion Object */
434505   AM_RANGE(0x9000, 0x97ff) AM_READWRITE(polepos_road16_r, polepos_road16_w) AM_BASE(&polepos_road16_memory)      /* Road Memory */
435506   AM_RANGE(0x9800, 0x9fff) AM_READWRITE(polepos_alpha16_r, polepos_alpha16_w) AM_BASE(&polepos_alpha16_memory)    /* Alphanumeric (char ram) */
436507   AM_RANGE(0xa000, 0xafff) AM_READWRITE(polepos_view16_r, polepos_view16_w) AM_BASE(&polepos_view16_memory)      /* Background memory */
437   AM_RANGE(0xc000, 0xc001) AM_WRITE(polepos_view16_hscroll_w)                  /* Background horz scroll position */
438   AM_RANGE(0xc100, 0xc101) AM_WRITE(polepos_road16_vscroll_w)                  /* Road vertical position */
508   AM_RANGE(0xc000, 0xc001) AM_MIRROR(0x38fe) AM_WRITE(polepos_view16_hscroll_w)                  /* Background horz scroll position */
509   AM_RANGE(0xc100, 0xc101) AM_MIRROR(0x38fe) AM_WRITE(polepos_road16_vscroll_w)                  /* Road vertical position */
439510ADDRESS_MAP_END
440511
441512
r4878r4879
445516 *********************************************************************/
446517
447518static INPUT_PORTS_START( polepos )
448   PORT_START("IN0")
519   PORT_START("IN0L")
449520   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
450521   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
451   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   // start 1, program controlled
522   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(auto_start_r, NULL)   // start 1, program controlled
452523   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
453   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
454   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
455   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
456   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
457524
525   PORT_START("IN0H")
526   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
527   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
528   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
529   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
530
458531   PORT_START("DSWA")
459532   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
460533   PORT_DIPSETTING(   0x05, DEF_STR( 3C_1C ) )
r4878r4879
479552   PORT_DIPSETTING(   0x80, "3" )
480553   PORT_DIPSETTING(   0x00, "4" )
481554
555   PORT_START("DSWA_HI")
556   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWA")
557
482558   PORT_START("DSWB")
483559   PORT_DIPNAME( 0x07, 0x07, "Extended Rank" )
484560   PORT_DIPSETTING(   0x07, "A" )
r4878r4879
505581   PORT_DIPSETTING(   0x80, DEF_STR( Off ))
506582   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
507583
584   PORT_START("DSWB_HI")
585   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWB")
586
508587   PORT_START("BRAKE")
509588   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
510589
r4878r4879
517596
518597
519598static INPUT_PORTS_START( poleposa )
520   PORT_START("IN0")
599   PORT_START("IN0L")
521600   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
522601   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
523   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   // start 1, program controlled
602   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(auto_start_r, NULL) // start 1, program controlled
524603   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
525   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
526   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
527   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
528   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
529604
605   PORT_START("IN0H")
606   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
607   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
608   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
609   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
610
530611   PORT_START("DSWA")
531612   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
532613   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
r4878r4879
551632   PORT_DIPSETTING(   0x01, "3" )
552633   PORT_DIPSETTING(   0x00, "4" )
553634
635   PORT_START("DSWA_HI")
636   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWA")
637
554638   PORT_START("DSWB")
555639   PORT_DIPNAME( 0xe0, 0xe0, "Practice Rank" )
556640   PORT_DIPSETTING(   0xe0, "A" )
r4878r4879
577661   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
578662   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
579663
664   PORT_START("DSWB_HI")
665   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWB")
666
580667   PORT_START("BRAKE")
581668   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
582669
r4878r4879
593680   PORT_START("IN0")
594681   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
595682   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
596   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   // start 1, program controlled
683   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(auto_start_r, NULL)   // start 1, program controlled
597684   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
598685   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
599686   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
r4878r4879
623710   PORT_DIPSETTING(   0x80, "3" )
624711   PORT_DIPSETTING(   0x00, "4" )
625712
713   PORT_START("DSWA_HI")
714   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWA")
715
626716   PORT_START("DSWB")
627717   PORT_DIPNAME( 0x07, 0x07, "Extended Rank" )
628718   PORT_DIPSETTING(   0x07, "A" )
r4878r4879
649739   PORT_DIPSETTING(   0x80, DEF_STR( Off ))
650740   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
651741
742   PORT_START("DSWB_HI")
743   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWB")
744
652745   PORT_START("BRAKE")
653746   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
654747
r4878r4879
661754
662755
663756static INPUT_PORTS_START( polepos2 )
664   PORT_START("IN0")
757   PORT_START("IN0L")
665758   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
666759   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gear Change") PORT_CODE(KEYCODE_SPACE) POLEPOS_TOGGLE /* Gear */
667   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL )   // start 1, program controlled
760   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM(auto_start_r, NULL)   // start 1, program controlled
668761   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
669   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
670   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
671   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
672   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
673762
763   PORT_START("IN0H")
764   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
765   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
766   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
767   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
768
674769   PORT_START("DSWA")
675770   PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_A ) )
676771   PORT_DIPSETTING(   0xc0, DEF_STR( 3C_1C ) )
r4878r4879
696791   PORT_DIPSETTING(   0x01, DEF_STR( Off ))
697792   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
698793
794   PORT_START("DSWA_HI")
795   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWA")
796
699797   PORT_START("DSWB")
700798   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Game_Time ) )
701799   PORT_DIPSETTING(   0x80, "90 secs." )
r4878r4879
719817   PORT_DIPSETTING(   0x01, "Average" )
720818   PORT_DIPSETTING(   0x00, DEF_STR( High ) )
721819
820   PORT_START("DSWB_HI")
821   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWB")
822
722823   PORT_START("BRAKE")
723824   PORT_BIT( 0xff, 0x00, IPT_PEDAL2 ) PORT_MINMAX(0,0x90) PORT_SENSITIVITY(100) PORT_KEYDELTA(16)
724825
r4878r4879
795896   1            /* stereo */
796897};
797898
798/* The 52xx output is 4Vpp.  After filtering it is 2Vpp.
799 * The output of the 54xx is 4Vpp.  After filtering it is clamped to +1.5/-2.
800 * So we need to make the 52xx volume 50% of the 54xx volume.
801 * 52xx and 54xx ouputs are mixed together to create an output called GAINx.
802 * This has a total resistance to the final op-amp of 13605 when the unemulated 4066
803 * panning circuit is at full volume.  The engine sound has a resistance of 17492.
804 * These values include 250 ohms of the 4066 when needed.
805 * This all means that the engine sound is 77% of the 54xx.
806 *
807 * Jan 13/05 D.R. - not sure about the following info.
808 * The Sound Buffers and Multiplexer circuit on sheet 7B is not emulated.
809 * Basically it is a quadraphonic 16 level mixer with a 4-bit DAC (R81-85).
810 * It mixes/pans the combined 52xx & 54xx output.
811 * The 4 speaker sit down game uses the full quad output.
812 * The 2 speaker stand up game combine RF-RR and LF-LR through the speakers.
813 *
814 * I set the base 54xx level at 80 and the other sounds realtive to that,
815 * to allow headroom when more the one effect is played.
816 */
817899
818static const namco_52xx_interface namco_52xx_config =
819{
820   0,            /* Use internal Playback frequency */
821   100,         /* High pass filter fc */
822   0.3,         /* High pass filter Q */
823   1200,         /* Low pass filter fc */
824   0.8,         /* Low pass filter Q */
825   .5            /* Combined gain of both filters */
826};
827
828
829900/*********************************************************************
830901 * Machine driver
831902 *********************************************************************/
r4878r4879
846917   MDRV_CPU_PROGRAM_MAP(z8002_map)
847918   MDRV_CPU_VBLANK_INT("screen", irq0_line_assert)
848919
849   MDRV_CPU_ADD(CPUTAG_54XX, MB8844, 18432000/12/6)   /* 1.536 MHz, internally divided by 6 */
850   MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program)
851   MDRV_CPU_DATA_MAP(namco_54xx_map_data)
852   MDRV_CPU_IO_MAP(namco_54xx_map_io)
920   MDRV_NAMCO_51XX_ADD("51xx", 18432000/12, namco_51xx_intf)      /* 1.536 MHz */
921   MDRV_NAMCO_52XX_ADD("52xx", 18432000/12, namco_52xx_intf)      /* 1.536 MHz */
922   MDRV_NAMCO_53XX_ADD("53xx", 18432000/12, namco_53xx_intf)      /* 1.536 MHz */
923   MDRV_NAMCO_54XX_ADD("54xx", 18432000/12, "discrete", NODE_01)   /* 1.536 MHz */
853924
925   MDRV_NAMCO_06XX_ADD("06xx", "maincpu", "51xx", "53xx", "52xx", "54xx")
926
854927   MDRV_WATCHDOG_VBLANK_INIT(16)   // 128V clocks the same as VBLANK
855928
856929   MDRV_QUANTUM_TIME(HZ(6000))   /* some interleaving */
r4878r4879
882955   MDRV_SOUND_ROUTE(0, "lspeaker", 0.80)
883956   MDRV_SOUND_ROUTE(1, "rspeaker", 0.80)
884957
885   MDRV_SOUND_ADD("namco52", NAMCO_52XX, 24576000/16)   /* 1.536 MHz */
886   MDRV_SOUND_CONFIG(namco_52xx_config)
887   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
888   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
889
890958   /* discrete circuit on the 54XX outputs */
891959   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
892960   MDRV_SOUND_CONFIG_DISCRETE(polepos)
r4878r4879
904972 * ROM definitions
905973 *********************************************************************/
906974
907#define POLEPOS_CUSTOMS \
908   ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \
909   ROM_REGION_NAMCO_51XX( "51xx" ) \
910   ROM_REGION_NAMCO_52XX( "52xx" ) \
911   ROM_REGION_NAMCO_53XX( "53xx" ) \
912
913975/*
914976    Pole Position - Namco Version
915977*/
r4878r4879
930992   ROM_LOAD16_BYTE( "pp1_5b.4m",     0x0001, 0x2000, CRC(5cdf5294) SHA1(dbdf327a541fd71aadafda9c925fa4cf7f7c4a24) )
931993   ROM_LOAD16_BYTE( "pp1_6b.4l",     0x0000, 0x2000, CRC(81696272) SHA1(27041a7c24297a6f317537c44922b51d2b2278a6) )
932994
933   POLEPOS_CUSTOMS
934
935995   /* graphics data */
936996   ROM_REGION( 0x01000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
937997   ROM_LOAD( "pp1_28.1f",     0x0000, 0x1000, CRC(5b277daf) SHA1(0b1feeb2c0c63a5db5ba9b0115aa1b2388636a70) )
r4878r4879
9821042   ROM_LOAD( "136014.110",   0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
9831043   ROM_LOAD( "136014.111",   0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
9841044
985   ROM_REGION( 0x8000, "namco52", 0 )
1045   ROM_REGION( 0x8000, "52xx", 0 )
9861046   ROM_LOAD( "pp1_11.2e",    0x0000, 0x2000, CRC(45b9bfeb) SHA1(ff8c690471944d414931fb88666594ef608997f8) )    /* voice */
9871047   ROM_LOAD( "pp1_12.2f",    0x2000, 0x2000, CRC(a31b4be5) SHA1(38298093bb97ea8647fe187359cae05b65e1c616) )    /* voice */
9881048   ROM_LOAD( "pp1_13.1e",    0x4000, 0x2000, CRC(a4237466) SHA1(88a397276038cc2fc05f2c18472e6b7cef167f2e) )    /* voice */
r4878r4879
10161076   ROM_LOAD16_BYTE( "136014.203",   0x0001, 0x2000, CRC(eedea6e7) SHA1(e1459c5e3f824e589e624c3acb18a183fd160df6) )
10171077   ROM_LOAD16_BYTE( "136014.204",   0x0000, 0x2000, CRC(c52c98ed) SHA1(2e33c487deaf8afb941e07e511a9828d2d8f6b31) )
10181078
1019   POLEPOS_CUSTOMS
1020
10211079   /* graphics data */
10221080   ROM_REGION( 0x01000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
10231081   ROM_LOAD( "136014.132",   0x0000, 0x1000, CRC(a949aa85) SHA1(2d6414196b6071101001128418233e585279ffb9) )
r4878r4879
10681126   ROM_LOAD( "136014.110",   0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
10691127   ROM_LOAD( "136014.111",   0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
10701128
1071   ROM_REGION( 0x6000, "namco52", 0 )
1129   ROM_REGION( 0x6000, "52xx", 0 )
10721130   ROM_LOAD( "136014.106",   0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) )    /* voice */
10731131
10741132   /* unknown or unused (P)ROM data */
r4878r4879
10971155   ROM_LOAD16_BYTE( "136014.103",   0x0001, 0x2000, CRC(af4fc019) SHA1(1bb6c0f3ffada2e1df72e1767581f8e8bb2b18f9) )
10981156   ROM_LOAD16_BYTE( "136014.104",   0x0000, 0x2000, CRC(ba0045f3) SHA1(aedb8d8c56407963aa4ffb66243288c8fd6d845a) )
10991157
1100   POLEPOS_CUSTOMS
1101
11021158   /* graphics data */
11031159   ROM_REGION( 0x01000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
11041160   ROM_LOAD( "136014.132",   0x0000, 0x1000, CRC(a949aa85) SHA1(2d6414196b6071101001128418233e585279ffb9) )
r4878r4879
11491205   ROM_LOAD( "136014.110",   0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
11501206   ROM_LOAD( "136014.111",   0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
11511207
1152   ROM_REGION( 0x6000, "namco52", 0 )
1208   ROM_REGION( 0x6000, "52xx", 0 )
11531209   ROM_LOAD( "136014.106",   0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) )    /* voice */
11541210
11551211   /* unknown or unused (P)ROM data */
r4878r4879
12751331   ROM_LOAD16_BYTE( "tr5b.bin",     0x0001, 0x2000, CRC(4e5f7b9c) SHA1(d26b1f24dd9ef00388987890bc5b95d4db403815) )
12761332   ROM_LOAD16_BYTE( "tr6b.bin",     0x0000, 0x2000, CRC(9d038ada) SHA1(7a9496c3fb93fd1945393656f8510a0c6421a9ab) )
12771333
1278   /* this is a bootleg, should we really be loading these? */
1279   POLEPOS_CUSTOMS
1280
12811334   /* graphics data */
12821335   ROM_REGION( 0x01000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
12831336   ROM_LOAD( "tr28.bin",     0x0000, 0x1000, CRC(b8217c96) SHA1(aba311bc3c4b118ba322a00e33e2d5cbe7bc6e4a) )
r4878r4879
13281381   ROM_LOAD( "136014.110",   0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
13291382   ROM_LOAD( "136014.111",   0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
13301383
1331   ROM_REGION( 0x6000, "namco52", 0 )
1384   ROM_REGION( 0x6000, "52xx", 0 )
13321385   ROM_LOAD( "136014.106",   0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) )    /* voice */
13331386
13341387   /* unknown or unused (P)ROM data */
r4878r4879
13521405   ROM_LOAD16_BYTE( "tr5b.bin",     0x0001, 0x2000, CRC(4e5f7b9c) SHA1(d26b1f24dd9ef00388987890bc5b95d4db403815) )
13531406   ROM_LOAD16_BYTE( "pole-d",       0x0000, 0x2000, CRC(932bb5a7) SHA1(8045fe1f9b4b1973ec0d6705adf3ba3891bddaa1) )
13541407
1355   /* this is a bootleg, should we really be loading these? */
1356   POLEPOS_CUSTOMS
1357
13581408   /* graphics data */
13591409   ROM_REGION( 0x01000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
13601410   ROM_LOAD( "tr28.bin",     0x0000, 0x1000, CRC(b8217c96) SHA1(aba311bc3c4b118ba322a00e33e2d5cbe7bc6e4a) )
r4878r4879
14051455   ROM_LOAD( "136014.110",   0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
14061456   ROM_LOAD( "136014.111",   0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
14071457
1408   ROM_REGION( 0x8000, "namco52", 0 )
1458   ROM_REGION( 0x8000, "52xx", 0 )
14091459   ROM_LOAD( "pp1_11.2e",    0x0000, 0x2000, CRC(45b9bfeb) SHA1(ff8c690471944d414931fb88666594ef608997f8) )    /* voice */
14101460   ROM_LOAD( "pp1_12.2f",    0x2000, 0x2000, CRC(a31b4be5) SHA1(38298093bb97ea8647fe187359cae05b65e1c616) )    /* voice */
14111461   ROM_LOAD( "pp1_13.1e",    0x4000, 0x2000, CRC(a4237466) SHA1(88a397276038cc2fc05f2c18472e6b7cef167f2e) )    /* voice */
r4878r4879
14321482   ROM_LOAD16_BYTE( "tr5b.f7",     0x0001, 0x2000, CRC(4e5f7b9c) SHA1(d26b1f24dd9ef00388987890bc5b95d4db403815) )
14331483   ROM_LOAD16_BYTE( "tr6b.f5",     0x0000, 0x2000, CRC(b3641d0c) SHA1(38ce172b2e38895749cbd3cc1c0e2c0fe8be744a) )
14341484
1435   /* this is a bootleg, should we really be loading these? */
1436   POLEPOS_CUSTOMS
1437
14381485   /* graphics data */
14391486   ROM_REGION( 0x01000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
14401487   ROM_LOAD( "tr28.j9",      0x0000, 0x1000, CRC(b8217c96) SHA1(aba311bc3c4b118ba322a00e33e2d5cbe7bc6e4a) )
r4878r4879
14851532   ROM_LOAD( "tr15.a8",      0x0000, 0x2000, CRC(b5ad4d5f) SHA1(c07e77a050200d6fe9952031f971ca35f4d15ff8) )    /* engine sound */
14861533   ROM_LOAD( "tr16.b9",      0x2000, 0x2000, CRC(8fdd2f6f) SHA1(3818dc94c60cd78c4212ab7a4367cf3d98166ee6) )    /* engine sound */
14871534
1488   ROM_REGION( 0x6000, "namco52", 0 )
1535   ROM_REGION( 0x6000, "52xx", 0 )
14891536   ROM_LOAD( "tr11.b1",      0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) )    /* voice */
14901537
14911538   /* unknown or unused (P)ROM data */
r4878r4879
15161563   ROM_LOAD16_BYTE( "pp4_7.3m",      0x4001, 0x1000, CRC(ad1c8994) SHA1(2877de9641516767170c0109900955cc7d1ff402) )
15171564   ROM_LOAD16_BYTE( "pp4_8.3l",      0x4000, 0x1000, CRC(ef25a2ee) SHA1(45959355cad1a48f19ae14193374e03d4f9965c7) )
15181565
1519   POLEPOS_CUSTOMS
1520
15211566   /* graphics data */
15221567   ROM_REGION( 0x02000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
15231568   ROM_LOAD( "pp4_28.1f",     0x0000, 0x2000, CRC(280dde7d) SHA1(b7c7fb3a5076aa4d0e0cf3256ece9a6194315626) )
r4878r4879
15701615   ROM_LOAD( "136014.181",   0x0000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
15711616   ROM_LOAD( "136014.182",   0x2000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
15721617
1573   ROM_REGION( 0x8000, "namco52", 0 )
1618   ROM_REGION( 0x8000, "52xx", 0 )
15741619   ROM_LOAD( "pp1_11.2e",     0x0000, 0x2000, CRC(45b9bfeb) SHA1(ff8c690471944d414931fb88666594ef608997f8) )    /* voice */
15751620   ROM_LOAD( "pp1_12.2f",     0x2000, 0x2000, CRC(a31b4be5) SHA1(38298093bb97ea8647fe187359cae05b65e1c616) )    /* voice */
15761621   ROM_LOAD( "pp1_13.1e",     0x4000, 0x2000, CRC(a4237466) SHA1(88a397276038cc2fc05f2c18472e6b7cef167f2e) )    /* voice */
r4878r4879
16101655   ROM_LOAD16_BYTE( "136014.184",   0x4001, 0x2000, CRC(d893c4ed) SHA1(60d39abefbb0c8df68864a30b1f5fcbf4780c86c) )
16111656   ROM_LOAD16_BYTE( "136014.185",   0x4000, 0x2000, CRC(899de75e) SHA1(4a16535115e37a3d342b2cb53f610a87c0d0abe1) )
16121657
1613   POLEPOS_CUSTOMS
1614
16151658   /* graphics data */
16161659   ROM_REGION( 0x02000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
16171660   ROM_LOAD( "136014.172",   0x0000, 0x2000, CRC(fbe5e72f) SHA1(07965d6e98ac1332ac6192b5e9cc927dd9eb706f) )
r4878r4879
16641707   ROM_LOAD( "136014.181",   0x0000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
16651708   ROM_LOAD( "136014.182",   0x2000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
16661709
1667   ROM_REGION( 0x6000, "namco52", 0 )
1710   ROM_REGION( 0x6000, "52xx", 0 )
16681711   ROM_LOAD( "136014.106",   0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) )    /* voice */
16691712
16701713   /* unknown or unused (P)ROM data */
r4878r4879
16961739   ROM_LOAD16_BYTE( "136014.184",   0x4001, 0x2000, CRC(d893c4ed) SHA1(60d39abefbb0c8df68864a30b1f5fcbf4780c86c) )
16971740   ROM_LOAD16_BYTE( "136014.185",   0x4000, 0x2000, CRC(899de75e) SHA1(4a16535115e37a3d342b2cb53f610a87c0d0abe1) )
16981741
1699   /* this is a bootleg, should we really be loading these? */
1700   POLEPOS_CUSTOMS
1701
17021742   /* graphics data */
17031743   ROM_REGION( 0x02000, "gfx1", ROMREGION_DISPOSE )    /* 2bpp alpha layer */
17041744   ROM_LOAD( "136014.172",   0x0000, 0x2000, CRC(fbe5e72f) SHA1(07965d6e98ac1332ac6192b5e9cc927dd9eb706f) )
r4878r4879
17511791   ROM_LOAD( "136014.181",   0x0000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
17521792   ROM_LOAD( "136014.182",   0x2000, 0x2000, CRC(7d93bc1c) SHA1(dad7c0aa24aef593c84e21f7f8858ca7ada86364) )    /* engine sound */
17531793
1754   ROM_REGION( 0x6000, "namco52", 0 )
1794   ROM_REGION( 0x6000, "52xx", 0 )
17551795   ROM_LOAD( "136014.106",   0x0000, 0x2000, CRC(5b4cf05e) SHA1(52342572940489175607bbf5b6cfd05ee9b0f004) )    /* voice */
17561796
17571797   /* unknown or unused (P)ROM data */
src/mame/drivers/jackal.c
r4878r4879
148148   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION( "SW2:6,7" )
149149   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
150150   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
151   PORT_DIPSETTING(    0x20, "Difficult" )
152   PORT_DIPSETTING(    0x00, "Very Difficult" )
151   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
152   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
153153   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:8" )
154154   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
155155   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/suna8.c
r4878r4879
13781378
13791379static void soundirq(const device_config *device, int state)
13801380{
1381   cpu_set_input_line(device->machine->cpu[1], 0, state);
1381   cputag_set_input_line(device->machine, "audiocpu", 0, state);
13821382}
13831383
13841384/* In games with only 2 CPUs, port A&B of the AY8910 are used
r4878r4879
15431543//  MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt, 2)
15441544   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)   // nmi breaks ramtest but is needed!
15451545
1546   MDRV_CPU_ADD("soundcpu", Z80, SUNA8_MASTER_CLOCK / 4)   /* Z0840006PSC */
1546   MDRV_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4)   /* Z0840006PSC */
15471547   MDRV_CPU_PROGRAM_MAP(brickzn_sound_map)
15481548
15491549   MDRV_CPU_ADD("pcm", Z80, SUNA8_MASTER_CLOCK / 4)   /* Z0840006PSC */
r4878r4879
16071607
16081608static MACHINE_RESET( hardhea2 )
16091609{
1610   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1610   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
16111611   hardhea2_rambank_0_w(space,0,0);
16121612}
16131613
r4878r4879
20732073   ROM_LOAD( "brickzon.008", 0x10000, 0x20000, CRC(c61540ba) SHA1(08c0ede591b229427b910ca6bb904a6146110be8) )
20742074   ROM_LOAD( "brickzon.007", 0x30000, 0x20000, CRC(ceed12f1) SHA1(9006726b75a65455afb1194298bade8fa2207b4a) )
20752075
2076   ROM_REGION( 0x10000, "soundcpu", 0 )      /* Music Z80 Code */
2076   ROM_REGION( 0x10000, "audiocpu", 0 )      /* Music Z80 Code */
20772077   ROM_LOAD( "brickzon.010", 0x00000, 0x10000, CRC(4eba8178) SHA1(9a214a1acacdc124529bc9dde73a8e884fc70293) )
20782078
20792079   ROM_REGION( 0x10000, "pcm", 0 )      /* PCM Z80 Code */
r4878r4879
20942094   ROM_LOAD( "38",           0x10000, 0x20000, CRC(e16216e8) SHA1(e88ae97e8a632823d5f1fe500954b6f6542407d5) )
20952095   ROM_LOAD( "brickzon.007", 0x30000, 0x20000, CRC(ceed12f1) SHA1(9006726b75a65455afb1194298bade8fa2207b4a) )
20962096
2097   ROM_REGION( 0x10000, "soundcpu", 0 )      /* Music Z80 Code */
2097   ROM_REGION( 0x10000, "audiocpu", 0 )      /* Music Z80 Code */
20982098   ROM_LOAD( "brickzon.010", 0x00000, 0x10000, CRC(4eba8178) SHA1(9a214a1acacdc124529bc9dde73a8e884fc70293) )
20992099
21002100   ROM_REGION( 0x10000, "pcm", 0 )      /* PCM Z80 Code */
r4878r4879
21552155   ROM_LOAD( "hrd-hd12", 0x30000, 0x10000, CRC(35d13212) SHA1(2fd03077b89ec9e55d2758b7f9cada970f0bdd91) )
21562156   ROM_LOAD( "hrd-hd13", 0x40000, 0x10000, CRC(3225e7d7) SHA1(2da9d1ce182dab8d9e09772e6899676b84c7458c) )
21572157
2158   ROM_REGION( 0x10000, "soundcpu", 0 )      /* Music Z80 Code */
2158   ROM_REGION( 0x10000, "audiocpu", 0 )      /* Music Z80 Code */
21592159   ROM_LOAD( "hrd-hd14", 0x00000, 0x08000, CRC(79a3be51) SHA1(30bc67cd3a936615c6931f8e15953425dff59611) )
21602160
21612161   ROM_REGION( 0x10000, "pcm", 0 )      /* PCM Z80 Code */
src/mame/drivers/btime.c
r4878r4879
251251   if      (offset <= 0x3bff)                       ;
252252   else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space,offset - 0x3c00,data); return; }
253253   else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space,offset - 0x7c00,data); return; }
254   else if (offset == 0x8000)                     { return; }  /* SMH_NOP */
254   else if (offset == 0x8000)                     { return; }  /* AM_NOP */
255255   else if (offset == 0x8001)                     { bnj_video_control_w(space,0,data); return; }
256256   else if (offset == 0x8003)                       ;
257   else if (offset == 0x9000)                     { return; }  /* SMH_NOP */
257   else if (offset == 0x9000)                     { return; }  /* AM_NOP */
258258   else if (offset == 0x9002)                     { audio_command_w(space,0,data); return; }
259259   else if (offset >= 0xb000 && offset <= 0xb1ff)   ;
260260   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n",space->cpu->tag,cpu_get_pc(space->cpu),data,offset);
r4878r4879
272272   else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space,offset - 0x7c00,data); return; }
273273   else if (offset == 0x8001)                     { bnj_video_control_w(space,0,data); return; }
274274   else if (offset == 0x8003)                       ;
275   else if (offset == 0x9000)                     { return; }  /* SMH_NOP */
275   else if (offset == 0x9000)                     { return; }  /* AM_NOP */
276276   else if (offset == 0x9002)                     { audio_command_w(space,0,data); return; }
277277   else if (offset >= 0xb000 && offset <= 0xbfff) { mmonkey_protection_w(space,offset - 0xb000, data); return; }
278278   else logerror("CPU '%s' PC %04x: warning - write %02x to unmapped memory address %04x\n",space->cpu->tag,cpu_get_pc(space->cpu),data,offset);
r4878r4879
367367   AM_RANGE(0x4002, 0x4002) AM_READ_PORT("SYSTEM") AM_WRITE(btime_video_control_w)
368368   AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW1") AM_WRITE(audio_command_w)
369369   AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW2") AM_WRITE(bnj_scroll1_w)
370   AM_RANGE(0xb000, 0xffff) AM_READ(SMH_ROM)
370   AM_RANGE(0xb000, 0xffff) AM_ROM
371371ADDRESS_MAP_END
372372
373373static ADDRESS_MAP_START( cookrace_map, ADDRESS_SPACE_PROGRAM, 8 )
r4878r4879
405405   AM_RANGE(0x4003, 0x4003) AM_READ_PORT("DSW1") AM_WRITE(audio_command_w)
406406   AM_RANGE(0x4004, 0x4004) AM_READ_PORT("DSW2") AM_WRITE(bnj_scroll1_w)
407407   AM_RANGE(0x4005, 0x4005) AM_WRITE(bnj_scroll2_w)
408   AM_RANGE(0x9000, 0xffff) AM_READ(SMH_ROM)
408   AM_RANGE(0x9000, 0xffff) AM_ROM
409409ADDRESS_MAP_END
410410
411411static ADDRESS_MAP_START( zoar_map, ADDRESS_SPACE_PROGRAM, 8 )
412412   AM_RANGE(0x0000, 0xffff) AM_WRITE(zoar_w)   /* override the following entries to */
413413                                    /* support ROM decryption */
414414   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&rambase)
415   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_RAM) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size)
416   AM_RANGE(0x8400, 0x87ff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram)
415   AM_RANGE(0x8000, 0x83ff) AM_WRITEONLY AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size)
416   AM_RANGE(0x8400, 0x87ff) AM_WRITEONLY AM_BASE(&btime_colorram)
417417   AM_RANGE(0x8800, 0x8bff) AM_WRITE(btime_mirrorvideoram_w)
418418   AM_RANGE(0x8c00, 0x8fff) AM_WRITE(btime_mirrorcolorram_w)
419419   AM_RANGE(0x9000, 0x9000) AM_WRITE(zoar_video_control_w)
r4878r4879
421421   AM_RANGE(0x9801, 0x9801) AM_READ_PORT("DSW2")
422422   AM_RANGE(0x9802, 0x9802) AM_READ_PORT("P1")
423423   AM_RANGE(0x9803, 0x9803) AM_READ_PORT("P2")
424   AM_RANGE(0x9800, 0x9803) AM_WRITE(SMH_RAM) AM_BASE(&zoar_scrollram)
424   AM_RANGE(0x9800, 0x9803) AM_WRITEONLY AM_BASE(&zoar_scrollram)
425425   AM_RANGE(0x9804, 0x9804) AM_READ_PORT("SYSTEM") AM_WRITE(bnj_scroll2_w)
426426   AM_RANGE(0x9805, 0x9805) AM_WRITE(bnj_scroll1_w)
427427   AM_RANGE(0x9806, 0x9806) AM_WRITE(audio_command_w)
428   AM_RANGE(0xd000, 0xffff) AM_READ(SMH_ROM)
428   AM_RANGE(0xd000, 0xffff) AM_ROM
429429ADDRESS_MAP_END
430430
431431static ADDRESS_MAP_START( lnc_map, ADDRESS_SPACE_PROGRAM, 8 )
r4878r4879
433433                                    /* support ROM decryption */
434434   AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(&rambase)
435435   AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(lnc_videoram_w) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size)
436   AM_RANGE(0x7800, 0x7bff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram)  /* this is just here to initialize the pointer */
436   AM_RANGE(0x7800, 0x7bff) AM_WRITEONLY AM_BASE(&btime_colorram)  /* this is just here to initialize the pointer */
437437   AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w)
438438   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW1") AM_WRITENOP     /* ??? */
439439   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW2") AM_WRITE(bnj_video_control_w)
440   AM_RANGE(0x8003, 0x8003) AM_WRITE(SMH_RAM) AM_BASE(&lnc_charbank)
440   AM_RANGE(0x8003, 0x8003) AM_WRITEONLY AM_BASE(&lnc_charbank)
441441   AM_RANGE(0x9000, 0x9000) AM_READ_PORT("P1") AM_WRITENOP     /* IRQ ack??? */
442442   AM_RANGE(0x9001, 0x9001) AM_READ_PORT("P2")
443443   AM_RANGE(0x9002, 0x9002) AM_READ_PORT("SYSTEM") AM_WRITE(audio_command_w)
444444   AM_RANGE(0xb000, 0xb1ff) AM_RAM
445   AM_RANGE(0xc000, 0xffff) AM_READ(SMH_ROM)
445   AM_RANGE(0xc000, 0xffff) AM_ROM
446446ADDRESS_MAP_END
447447
448448static ADDRESS_MAP_START( mmonkey_map, ADDRESS_SPACE_PROGRAM, 8 )
r4878r4879
450450                                       /* support ROM decryption */
451451   AM_RANGE(0x0000, 0x3bff) AM_RAM AM_BASE(&rambase)
452452   AM_RANGE(0x3c00, 0x3fff) AM_RAM_WRITE(lnc_videoram_w) AM_BASE(&btime_videoram) AM_SIZE(&btime_videoram_size)
453   AM_RANGE(0x7800, 0x7bff) AM_WRITE(SMH_RAM) AM_BASE(&btime_colorram)      /* this is just here to initialize the pointer */
453   AM_RANGE(0x7800, 0x7bff) AM_WRITEONLY AM_BASE(&btime_colorram)      /* this is just here to initialize the pointer */
454454   AM_RANGE(0x7c00, 0x7fff) AM_READWRITE(btime_mirrorvideoram_r, lnc_mirrorvideoram_w)
455455   AM_RANGE(0x8000, 0x8000) AM_READ_PORT("DSW1")
456456   AM_RANGE(0x8001, 0x8001) AM_READ_PORT("DSW2") AM_WRITE(bnj_video_control_w)
457   AM_RANGE(0x8003, 0x8003) AM_WRITE(SMH_RAM) AM_BASE(&lnc_charbank)
457   AM_RANGE(0x8003, 0x8003) AM_WRITEONLY AM_BASE(&lnc_charbank)
458458   AM_RANGE(0x9000, 0x9000) AM_READ_PORT("P1") AM_WRITENOP   /* IRQ ack??? */
459459   AM_RANGE(0x9001, 0x9001) AM_READ_PORT("P2")
460460   AM_RANGE(0x9002, 0x9002) AM_READ_PORT("SYSTEM") AM_WRITE(audio_command_w)
461461   AM_RANGE(0xb000, 0xbfff) AM_READWRITE(mmonkey_protection_r, mmonkey_protection_w)
462   AM_RANGE(0xc000, 0xffff) AM_READ(SMH_ROM)
462   AM_RANGE(0xc000, 0xffff) AM_ROM
463463ADDRESS_MAP_END
464464
465465static ADDRESS_MAP_START( bnj_map, ADDRESS_SPACE_PROGRAM, 8 )
r4878r4879
477477   AM_RANGE(0x5400, 0x5400) AM_WRITE(bnj_scroll1_w)
478478   AM_RANGE(0x5800, 0x5800) AM_WRITE(bnj_scroll2_w)
479479   AM_RANGE(0x5c00, 0x5c0f) AM_WRITE(btime_paletteram_w) AM_BASE(&paletteram)
480   AM_RANGE(0xa000, 0xffff) AM_READ(SMH_ROM)
480   AM_RANGE(0xa000, 0xffff) AM_ROM
481481ADDRESS_MAP_END
482482
483483static ADDRESS_MAP_START( disco_map, ADDRESS_SPACE_PROGRAM, 8 )
r4878r4879
494494   AM_RANGE(0x9800, 0x9800) AM_READ_PORT("DSW1")
495495   AM_RANGE(0x9a00, 0x9a00) AM_READ_PORT("DSW2") AM_WRITE(audio_command_w)
496496   AM_RANGE(0x9c00, 0x9c00) AM_READ_PORT("VBLANK") AM_WRITE(disco_video_control_w)
497   AM_RANGE(0xa000, 0xffff) AM_READ(SMH_ROM)
497   AM_RANGE(0xa000, 0xffff) AM_ROM
498498ADDRESS_MAP_END
499499
500500
r4878r4879
516516   AM_RANGE(0x5000, 0x5fff) AM_DEVWRITE("ay1", ay8910_address_w)
517517   AM_RANGE(0x6000, 0x6fff) AM_DEVWRITE("ay2", ay8910_data_w)
518518   AM_RANGE(0x7000, 0x7fff) AM_DEVWRITE("ay2", ay8910_address_w)
519   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(soundlatch_r, SMH_NOP) /* ack ? */
519   AM_RANGE(0x8000, 0x8fff) AM_READ(soundlatch_r) AM_WRITENOP /* ack ? */
520520   AM_RANGE(0xf000, 0xffff) AM_ROM
521521ADDRESS_MAP_END
522522
src/mame/drivers/m14.c
r4878r4879
9393         0);
9494}
9595
96VIDEO_START( m14 )
96static VIDEO_START( m14 )
9797{
9898   m14_tilemap = tilemap_create(machine, m14_get_tile_info,tilemap_scan_rows,8,8,32,32);
9999}
100100
101VIDEO_UPDATE( m14 )
101static VIDEO_UPDATE( m14 )
102102{
103103   tilemap_draw(bitmap,cliprect,m14_tilemap,0,0);
104104   return 0;
src/mame/drivers/cps1.c
r4878r4879
29682968
29692969#define CODE_SIZE 0x400000
29702970
2971/* B-Board 88618B */
2972ROM_START( forgottn )
2973   ROM_REGION( CODE_SIZE, "maincpu", 0 )
2974   ROM_LOAD16_BYTE( "lwu_11a.14f",    0x00000, 0x20000, CRC(ddf78831) SHA1(b9c815613efdfde933d4500b588798b7fb4c1854) )
2975   ROM_LOAD16_BYTE( "lwu_15a.14g",    0x00001, 0x20000, CRC(f7ce2097) SHA1(44c06fabdb6de7d8afc2164458c90b0be9cf945d) )
2976   ROM_LOAD16_BYTE( "lwu_10a.13f",    0x40000, 0x20000, CRC(8cb38c81) SHA1(1d36cab7d17ff778ee7dfcd9606a3a87f6906f21) )
2977   ROM_LOAD16_BYTE( "lwu_14a.13g",    0x40001, 0x20000, CRC(d70ef9fd) SHA1(b393aa2a7bea440fdcf057ffc6ff233fc0d35d4b) )
2978   ROM_LOAD16_WORD_SWAP( "lw-07.13e", 0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )
2979
2980   ROM_REGION( 0x400000, "gfx", 0 )
2981   ROMX_LOAD( "lw-01.9d",  0x000000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) )
2982   ROMX_LOAD( "lw-08.9f",  0x000002, 0x80000, CRC(25a8e43c) SHA1(d57cee1fc508db2677e84882fb814e4d9ad20543) , ROM_GROUPWORD | ROM_SKIP(6) )
2983   ROMX_LOAD( "lw-05.9e",  0x000004, 0x80000, CRC(e4552fd7) SHA1(11147afc475904848458425661473586dd6f60cc) , ROM_GROUPWORD | ROM_SKIP(6) )
2984   ROMX_LOAD( "lw-12.9g",  0x000006, 0x80000, CRC(8e6a832b) SHA1(d63a1331fda2365f090fa31950098f321a720ea8) , ROM_GROUPWORD | ROM_SKIP(6) )
2985   ROMX_LOAD( "lw-02.12d", 0x200000, 0x80000, CRC(43e6c5c8) SHA1(d3e6c971de0477ec4e178adc82508208dd8b397f) , ROM_GROUPWORD | ROM_SKIP(6) )
2986   ROMX_LOAD( "lw-09.12f", 0x200002, 0x80000, CRC(899cb4ad) SHA1(95e61af338945e690f2a82746feba3871ea224eb) , ROM_GROUPWORD | ROM_SKIP(6) )
2987   ROMX_LOAD( "lw-06.12e", 0x200004, 0x80000, CRC(5b9edffc) SHA1(6fd8f4a3ab070733b52365ab1945bf86acb2bf62) , ROM_GROUPWORD | ROM_SKIP(6) )
2988   ROMX_LOAD( "lw-13.12g", 0x200006, 0x80000, CRC(8e058ef5) SHA1(00f2c0050fd106276ea5398511c5861ebfbc0d10) , ROM_GROUPWORD | ROM_SKIP(6) )
2989
2990   ROM_REGION( 0x8000, "stars", 0 )
2991   ROM_COPY( "gfx", 0x200000, 0x000000, 0x8000 )
2992
2993   ROM_REGION( 0x18000, "audiocpu", 0 )
2994   ROM_LOAD( "lwu_00.14a", 0x00000, 0x08000, CRC(59df2a63) SHA1(dfe1fffc7a17179a80a2ae623e93b30a7d6df20d) )   // == lw_00b.14a
2995   ROM_CONTINUE(           0x10000, 0x08000 )
2996
2997   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
2998   ROM_LOAD( "lw-03u.14c", 0x00000, 0x20000, CRC(807d051f) SHA1(720e4733787b9b11f4d1cdce0892b69475802844) )
2999   ROM_LOAD( "lw-04u.13c", 0x20000, 0x20000, CRC(e6cd098e) SHA1(667f6e5736f76a1c4c450c4e2035574ea89d7910) )
3000
3001   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
3002   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
3003   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
3004   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
3005   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
3006   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
3007ROM_END
3008
30092971/* B-Board 88621B */
30102972/*
30112973 These ROMs read from a dead and very unique top board.
r4878r4879
30252987 Custom chip -   CAPCOM CPS-B-01 (QFP160)
30262988 NEC D4701AC
30272989*/
3028ROM_START( forgott1 )
2990ROM_START( forgottn )
30292991   ROM_REGION( CODE_SIZE, "maincpu", 0 )
30302992   ROM_LOAD16_BYTE( "lw_11.12f",      0x00000, 0x20000, CRC(73e920b7) SHA1(2df12fc1a66f488d06b0927db909da81466d7d07) )
3031   ROM_LOAD16_BYTE( "lw_15.12h",      0x00001, 0x20000, NO_DUMP )
3032   ROM_LOAD16_BYTE( "lw_10.13f",      0x40000, 0x20000, NO_DUMP )
3033   ROM_LOAD16_BYTE( "lw_14.13h",      0x40001, 0x20000, NO_DUMP )
2993   ROM_LOAD16_BYTE( "lw_15.12h",      0x00001, 0x20000, CRC(50d7012d) SHA1(f82a28a835f0a83b26c2c8170b824447b1d7409f) )
2994   ROM_LOAD16_BYTE( "lw_10.13f",      0x40000, 0x20000, CRC(bea45994) SHA1(c419f65c5e0c11ae7508ec54412bf6b62fac4f72) )
2995   ROM_LOAD16_BYTE( "lw_14.13h",      0x40001, 0x20000, CRC(539b2339) SHA1(8a9e452ef8ed05e0b956d36990266657d3077470) )
30342996   ROM_LOAD16_WORD_SWAP( "lw-07.10g", 0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )   // == lw-07.13e
30352997
30362998   ROM_REGION( 0x400000, "gfx", 0 )
r4878r4879
30793041ROM_END
30803042
30813043/* B-Board 88618B */
3044ROM_START( forgottu )
3045   ROM_REGION( CODE_SIZE, "maincpu", 0 )
3046   ROM_LOAD16_BYTE( "lwu_11a.14f",    0x00000, 0x20000, CRC(ddf78831) SHA1(b9c815613efdfde933d4500b588798b7fb4c1854) )
3047   ROM_LOAD16_BYTE( "lwu_15a.14g",    0x00001, 0x20000, CRC(f7ce2097) SHA1(44c06fabdb6de7d8afc2164458c90b0be9cf945d) )
3048   ROM_LOAD16_BYTE( "lwu_10a.13f",    0x40000, 0x20000, CRC(8cb38c81) SHA1(1d36cab7d17ff778ee7dfcd9606a3a87f6906f21) )
3049   ROM_LOAD16_BYTE( "lwu_14a.13g",    0x40001, 0x20000, CRC(d70ef9fd) SHA1(b393aa2a7bea440fdcf057ffc6ff233fc0d35d4b) )
3050   ROM_LOAD16_WORD_SWAP( "lw-07.13e", 0x80000, 0x80000, CRC(fd252a26) SHA1(5cfb097984912a5167a8c7ec4c2e119b642f9970) )
3051
3052   ROM_REGION( 0x400000, "gfx", 0 )
3053   ROMX_LOAD( "lw-01.9d",  0x000000, 0x80000, CRC(0318f298) SHA1(178ffd6da7bf845e30abf1bfc38a469cd319a73f) , ROM_GROUPWORD | ROM_SKIP(6) )
3054   ROMX_LOAD( "lw-08.9f",  0x000002, 0x80000, CRC(25a8e43c) SHA1(d57cee1fc508db2677e84882fb814e4d9ad20543) , ROM_GROUPWORD | ROM_SKIP(6) )
3055   ROMX_LOAD( "lw-05.9e",  0x000004, 0x80000, CRC(e4552fd7) SHA1(11147afc475904848458425661473586dd6f60cc) , ROM_GROUPWORD | ROM_SKIP(6) )
3056   ROMX_LOAD( "lw-12.9g",  0x000006, 0x80000, CRC(8e6a832b) SHA1(d63a1331fda2365f090fa31950098f321a720ea8) , ROM_GROUPWORD | ROM_SKIP(6) )
3057   ROMX_LOAD( "lw-02.12d", 0x200000, 0x80000, CRC(43e6c5c8) SHA1(d3e6c971de0477ec4e178adc82508208dd8b397f) , ROM_GROUPWORD | ROM_SKIP(6) )
3058   ROMX_LOAD( "lw-09.12f", 0x200002, 0x80000, CRC(899cb4ad) SHA1(95e61af338945e690f2a82746feba3871ea224eb) , ROM_GROUPWORD | ROM_SKIP(6) )
3059   ROMX_LOAD( "lw-06.12e", 0x200004, 0x80000, CRC(5b9edffc) SHA1(6fd8f4a3ab070733b52365ab1945bf86acb2bf62) , ROM_GROUPWORD | ROM_SKIP(6) )
3060   ROMX_LOAD( "lw-13.12g", 0x200006, 0x80000, CRC(8e058ef5) SHA1(00f2c0050fd106276ea5398511c5861ebfbc0d10) , ROM_GROUPWORD | ROM_SKIP(6) )
3061
3062   ROM_REGION( 0x8000, "stars", 0 )
3063   ROM_COPY( "gfx", 0x200000, 0x000000, 0x8000 )
3064
3065   ROM_REGION( 0x18000, "audiocpu", 0 )
3066   ROM_LOAD( "lwu_00.14a", 0x00000, 0x08000, CRC(59df2a63) SHA1(dfe1fffc7a17179a80a2ae623e93b30a7d6df20d) )   // == lw_00b.14a
3067   ROM_CONTINUE(           0x10000, 0x08000 )
3068
3069   ROM_REGION( 0x40000, "oki", 0 )   /* Samples */
3070   ROM_LOAD( "lw-03u.14c", 0x00000, 0x20000, CRC(807d051f) SHA1(720e4733787b9b11f4d1cdce0892b69475802844) )
3071   ROM_LOAD( "lw-04u.13c", 0x20000, 0x20000, CRC(e6cd098e) SHA1(667f6e5736f76a1c4c450c4e2035574ea89d7910) )
3072
3073   ROM_REGION( 0x0200, "aboardplds", ROMREGION_DISPOSE )
3074   ROM_LOAD( "buf1",         0x0000, 0x0117, CRC(eb122de7) SHA1(b26b5bfe258e3e184f069719f9fd008d6b8f6b9b) )
3075   ROM_LOAD( "ioa1",         0x0000, 0x0117, CRC(59c7ee3b) SHA1(fbb887c5b4f5cb8df77cec710eaac2985bc482a6) )
3076   ROM_LOAD( "prg1",         0x0000, 0x0117, CRC(f1129744) SHA1(a5300f301c1a08a7da768f0773fa0fe3f683b237) )
3077   ROM_LOAD( "rom1",         0x0000, 0x0117, CRC(41dc73b9) SHA1(7d4c9f1693c821fbf84e32dd6ef62ddf14967845) )
3078   ROM_LOAD( "sou1",         0x0000, 0x0117, CRC(84f4b2fe) SHA1(dcc9e86cc36316fe42eace02d6df75d08bc8bb6d) )
3079ROM_END
3080
3081/* B-Board 88618B */
30823082ROM_START( lostwrld )
30833083   ROM_REGION( CODE_SIZE, "maincpu", 0 )
30843084   ROM_LOAD16_BYTE( "lw_11c.14f",     0x00000, 0x20000, CRC(67e42546) SHA1(3e385661f71616180a26b74e443978077246fe66) )
r4878r4879
83838383}
83848384
83858385
8386GAME( 1988, forgottn, 0,        cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (US)", 0 )
8387GAME( 1988, forgott1, forgottn, cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (World?)", GAME_NOT_WORKING )
8386GAME( 1988, forgottn, 0,        cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (World)", 0 )
8387GAME( 1988, forgottu, forgottn, cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Forgotten Worlds (US)", 0 )
83888388GAME( 1988, lostwrld, forgottn, cps1_10MHz, forgottn, forgottn, ROT0,   "Capcom", "Lost Worlds (Japan)", 0 )
83898389GAME( 1988, ghouls,   0,        cps1_10MHz, ghouls,   cps1,     ROT0,   "Capcom", "Ghouls'n Ghosts (World)" , 0)            // Wed.26.10.1988 in the ROMS
83908390GAME( 1988, ghoulsu,  ghouls,   cps1_10MHz, ghoulsu,  cps1,     ROT0,   "Capcom", "Ghouls'n Ghosts (US)" , 0)               // Wed.26.10.1988 in the ROMS
src/mame/drivers/jantotsu.c
r4878r4879
99 Mode is for adjusting these screens (to not let the human opponent to read your tiles).
1010
1111TODO:
12-MSM5205 samples are wrongly played i.e. plays chi when it's clearly a pon.ADPCM index issue;
13-MSM5205 sample stop is wrong;
14-Video buffering? If you coin up,you can see the "credit 1" msg that gets build into the
12-Video buffering? If you coin up, you can see the "credit 1" msg that gets build into the
1513 video bitmaps...
16-According to the flyer,color bitplanes might be wrong on the A-N mahjong charset,might be a
17 BTANB however...
14-According to the flyer, color bitplanes might be wrong on the A-N mahjong charset, might be
15 a BTANB however...
1816-I need schematics / pcb photos (component + solder sides) to understand if the background
1917 color is hard-wired to the DIP-Switches or there's something else wrong.
2018
r4878r4879
2725c04b-c058 "left" computer tiles
2826
2927============================================================================================
28MSM samples table (I'm assuming that F is left-right players, M2 is up / player 2 and M1 is player 1):
29start |end   |sample    |possible data triggers
30------------------------|----------------------
31jat-43 (0x0000-0x1fff)
320x0000|0x06ff|rii'chi M1| 0x00
330x0700|0x0bff|rii'chi M2| 0x07
340x0c00|0x0fff|nagare?   |
350x1000|0x13ff|ron M     |
360x1400|0x17ff|kore?     | 0x14
370x1800|0x1bff|kan M1    | 0x18
380x1c00|0x1fff|kan M2    |
39jat-42 (0x4000-0x5fff)
400x4000|0x42ff|koi?      |
410x4300|0x4ef0|ippatsu M |
420x5000|0x52ff|pon M     |
430x5300|0x57ff|tsumo M2  | 0x53
440x5800|0x5dff|rii'chi F | 0x58
45jat-41 (0x8000-0x9fff)
460x8000|0x87ff|ippatsu F |
470x8800|0x8fff|ryutoku?  | 0x88
480x9000|0x95ff|otoyo?    | 0x90
490x9600|0x9eff|yatta     | 0x96
50jat-40 (0xc000-0xdfff)
510xc000|0xc8ff|odaii?    | 0xc0
520xc900|0xccff|tsumo F   | 0xc9
530xcd00|0xcfff|tsumo M1  |
540xd000|0xd3ff|ron F     | 0xd0
550xd400|0xd7ff|pon F     | 0xd4
560xd800|0xdbff|kan F     |
570xdc00|0xdfff|chi       |
58------------------------------------------------
3059
60
61============================================================================================
62
31634nin-uchi mahjong Jantotsu
3264(c)1983 Sanritsu
3365
r4878r4879
6799#include "sound/sn76496.h"
68100#include "sound/msm5205.h"
69101
70static UINT8 *jan_bitmap_1,*jan_bitmap_2,*jan_bitmap_3,*jan_bitmap_4;
102static UINT8 *jan_bitmap;
71103static UINT8 vram_bank,col_bank;
72104static UINT8 mux_data;
73105
106static UINT32 adpcm_pos;
107static UINT8 adpcm_idle;
108static int adpcm_data;
109
74110static VIDEO_START(jantotsu)
75111{
76   jan_bitmap_1 = auto_alloc_array(machine, UINT8, 0x2000);
77   jan_bitmap_2 = auto_alloc_array(machine, UINT8, 0x2000);
78   jan_bitmap_3 = auto_alloc_array(machine, UINT8, 0x2000);
79   jan_bitmap_4 = auto_alloc_array(machine, UINT8, 0x2000);
112   jan_bitmap = auto_alloc_array(machine, UINT8, 0x8000);
113
80114   vram_bank = 0;
81115}
82116
r4878r4879
94128
95129         for (i=0;i<8;i++)
96130         {
97            pen[0] = (jan_bitmap_1[count])>>(7-i);
98            pen[1] = (jan_bitmap_2[count])>>(7-i);
99            pen[2] = (jan_bitmap_3[count])>>(7-i);
100            pen[3] = (jan_bitmap_4[count])>>(7-i);
131            pen[0] = (jan_bitmap[count+0x0000])>>(7-i);
132            pen[1] = (jan_bitmap[count+0x2000])>>(7-i);
133            pen[2] = (jan_bitmap[count+0x4000])>>(7-i);
134            pen[3] = (jan_bitmap[count+0x6000])>>(7-i);
101135
102136            color = ((pen[0] & 1)<<0);
103137            color|= ((pen[1] & 1)<<1);
r4878r4879
116150   return 0;
117151}
118152
153/* banked vram */
119154static READ8_HANDLER( jantotsu_bitmap_r )
120155{
121   switch(vram_bank & 3)
122   {
123      case 0: return jan_bitmap_1[offset];
124      case 1: return jan_bitmap_2[offset];
125      case 2: return jan_bitmap_3[offset];
126      case 3: return jan_bitmap_4[offset];
127   }
128   return 0;
156   return jan_bitmap[offset+((vram_bank & 3)*0x2000)];
129157}
130158
131159static WRITE8_HANDLER( jantotsu_bitmap_w )
132160{
133   switch(vram_bank & 3)
134   {
135      case 0: jan_bitmap_1[offset] = data; break;
136      case 1: jan_bitmap_2[offset] = data; break;
137      case 2: jan_bitmap_3[offset] = data; break;
138      case 3: jan_bitmap_4[offset] = data; break;
139   }
161   jan_bitmap[offset+((vram_bank & 3)*0x2000)] = data;
140162}
141163
142164static WRITE8_HANDLER( bankaddr_w )
r4878r4879
185207
186208   switch(mux_data)
187209   {
188      case 1:    return input_port_read(space->machine, "PL1_1") | coin_port;
189      case 2:    return input_port_read(space->machine, "PL1_2") | coin_port;
190      case 4:    return input_port_read(space->machine, "PL1_3") | coin_port;
191      case 8:    return input_port_read(space->machine, "PL1_4") | coin_port;
210      case 0x01: return input_port_read(space->machine, "PL1_1") | coin_port;
211      case 0x02: return input_port_read(space->machine, "PL1_2") | coin_port;
212      case 0x04: return input_port_read(space->machine, "PL1_3") | coin_port;
213      case 0x08: return input_port_read(space->machine, "PL1_4") | coin_port;
192214      case 0x10: return input_port_read(space->machine, "PL2_1") | coin_port;
193215      case 0x20: return input_port_read(space->machine, "PL2_2") | coin_port;
194216      case 0x40: return input_port_read(space->machine, "PL2_3") | coin_port;
r4878r4879
205227
206228/*If bits 6 & 7 doesn't return 0x80,the game hangs until this bit is set,
207229  so I'm guessing that these bits can't be read by the z80 at all but directly
208  hard-wired to the video chip.However I need the schematics / pcb snaps and/or
230  hard-wired to the video chip. However I need the schematics / pcb snaps and/or
209231  a side-by-side test (to know if the background colors really works) to be sure. */
210232static READ8_HANDLER( jantotsu_dsw2_r )
211233{
212234   return (input_port_read(space->machine, "DSW2") & 0x3f) | 0x80;
213235}
214236
215static UINT32 adpcm_pos;
216static UINT8 adpcm_idle;
217static int adpcm_data;
218
219237static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
220238{
221239   switch (offset)
222240   {
223241      case 0:
224         adpcm_pos = (data & 0xff) * 0x80;
242         adpcm_pos = (data & 0xff) * 0x100;
225243         adpcm_idle = 0;
226244         msm5205_reset_w(device,0);
245         /* I don't think that this will ever happen, it's there just to be sure
246               (i.e. I'll probably never do a "nagare" in my entire life ;-) ) */
247         if(data & 0x20)
248            popmessage("ADPCM called with data = %02x, contact MAMEdev",data);
227249//          printf("%02x 0\n",data);
228250         break;
229      /*same write as port 2?*/
251      /*same write as port 2? MSM sample ack? */
230252      case 1:
231253//          adpcm_idle = 1;
232254//          msm5205_reset_w(device,1);
r4878r4879
239261{
240262   static UINT8 trigger;
241263
242   if (adpcm_pos >= 0x8000 || adpcm_idle)
264   if (adpcm_pos >= 0x10000 || adpcm_idle)
243265   {
244266      //adpcm_idle = 1;
245267      msm5205_reset_w(device,1);
r4878r4879
255277      if(trigger == 0)
256278      {
257279         adpcm_pos++;
258         if((ROM[adpcm_pos] & 0xff) == 0xff)
280         if((ROM[adpcm_pos] & 0xff) == 0x70)
259281            adpcm_idle = 1;
260282      }
261283   }
r4878r4879
281303   PORT_START("COINS")
282304   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
283305   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
306
284307   PORT_START("DSW1")
285308   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:1")
286309   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
287310   PORT_DIPSETTING(    0x01, DEF_STR( 1C_2C ) )
288311   PORT_DIPUNUSED_DIPLOC( 0x02, 0x00, "SW1:2" )
289   PORT_DIPNAME( 0x1c, 0x00, "Player vs. CPU timer decrement speed") PORT_DIPLOCATION("SW1:3,4,5") //in msecs I suppose
312   PORT_DIPNAME( 0x1c, 0x10, "Player vs. CPU timer decrement speed") PORT_DIPLOCATION("SW1:3,4,5") //in msecs I suppose
290313   PORT_DIPSETTING(    0x00, "30")
291314   PORT_DIPSETTING(    0x08, "50" )
292315   PORT_DIPSETTING(    0x04, "70")
r4878r4879
295318   PORT_DIPSETTING(    0x18, "130" )
296319   PORT_DIPSETTING(    0x14, "150" )
297320   PORT_DIPSETTING(    0x1c, "170" )
298   PORT_DIPNAME( 0xe0, 0x00, "Player vs. Player timer decrement speed" ) PORT_DIPLOCATION("SW1:6,7,8") //in msecs I suppose
321   PORT_DIPNAME( 0xe0, 0x80, "Player vs. Player timer decrement speed" ) PORT_DIPLOCATION("SW1:6,7,8") //in msecs I suppose
299322   PORT_DIPSETTING(    0x00, "100" )
300323   PORT_DIPSETTING(    0x40, "120" )
301324   PORT_DIPSETTING(    0x20, "140" )
r4878r4879
304327   PORT_DIPSETTING(    0xc0, "200" )
305328   PORT_DIPSETTING(    0xa0, "220" )
306329   PORT_DIPSETTING(    0xe0, "240" )
330
307331   PORT_START("DSW2")
308332   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2,3")
309333   PORT_DIPSETTING(    0x07, DEF_STR( Easy ) )
r4878r4879
321345   PORT_DIPSETTING(    0x80, "Green" )
322346   PORT_DIPSETTING(    0x40, "Blue" )
323347   PORT_DIPSETTING(    0x00, "Black" )
348
324349   PORT_START("PL1_1")
325350   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
326351   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Mahjong Nagare") PORT_CODE(KEYCODE_S)
r4878r4879
328353   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Continue Button No") PORT_CODE(KEYCODE_O)
329354   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
330355   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
356
331357   PORT_START("PL1_2")
332358   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M )
333359   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N )
r4878r4879
335361   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
336362   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
337363   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
364
338365   PORT_START("PL1_3")
339366   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_G )
340367   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
r4878r4879
342369   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_J )
343370   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_K )
344371   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_L )
372
345373   PORT_START("PL1_4")
346374   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
347375   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B )
r4878r4879
349377   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D )
350378   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_E )
351379   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_F )
380
352381   PORT_START("PL2_1")
353382   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
354383   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Mahjong Nagare") PORT_PLAYER(2)
355384   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Continue Button Yes") PORT_PLAYER(2)
356385   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Continue Button No") PORT_PLAYER(2)
357386   PORT_BIT( 0x30, IP_ACTIVE_LOW, IPT_UNUSED )
387
358388   PORT_START("PL2_2")
359389   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
360390   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
r4878r4879
362392   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
363393   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
364394   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
395
365396   PORT_START("PL2_3")
366397   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
367398   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
r4878r4879
369400   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
370401   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
371402   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
403
372404   PORT_START("PL2_4")
373405   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
374406   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
r4878r4879
378410   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
379411INPUT_PORTS_END
380412
381static INTERRUPT_GEN( jantotsu_irq )
382{
383   cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE );
384}
385
386413static MACHINE_RESET( jantotsu )
387414{
388415   mux_data = 0;
r4878r4879
395422static const msm5205_interface msm5205_config =
396423{
397424   jan_adpcm_int,   /* interrupt function */
398   MSM5205_S48_4B   /* 8kHz */
425   MSM5205_S64_4B   /* 6 KHz */
399426};
400427
401428static MACHINE_DRIVER_START( jantotsu )
r4878r4879
403430   MDRV_CPU_ADD("maincpu", Z80,18432000/4)
404431   MDRV_CPU_PROGRAM_MAP(jantotsu_map)
405432   MDRV_CPU_IO_MAP(jantotsu_io)
406   MDRV_CPU_VBLANK_INT("screen", jantotsu_irq)
433   MDRV_CPU_VBLANK_INT("screen", nmi_line_pulse)
407434
408435   MDRV_MACHINE_RESET(jantotsu)
409436   /* video hardware */
r4878r4879
429456   MDRV_SOUND_ADD("sn2", SN76489A, 18432000/4)
430457   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
431458
432   MDRV_SOUND_ADD("adpcm", MSM5205, 288000)
459   MDRV_SOUND_ADD("adpcm", MSM5205, 384000)
433460   MDRV_SOUND_CONFIG(msm5205_config)
434461   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
435462MACHINE_DRIVER_END
r4878r4879
445472   ROM_LOAD( "jat-04.3e", 0x08000, 0x02000, CRC(734e029f) SHA1(75aa13397847b4db32c41aaa6ff2ac82f16bd7a2) )
446473   ROM_LOAD( "jat-05.4e", 0x0a000, 0x02000, CRC(1a725e1a) SHA1(1d39d607850f47b9389f41147d4570da8814f639) )
447474
448   ROM_REGION( 0x8000, "adpcm", 0 )
449   ROM_LOAD( "jat-40.6b", 0x00000, 0x02000, CRC(2275253e) SHA1(64e9415faf2775c6b9ab497dce7fda8c4775192e) )
450   ROM_LOAD( "jat-41.7b", 0x02000, 0x02000, CRC(ce08ed71) SHA1(8554e5e7ec178f57bed5fbdd5937e3a35f72c454) )
475   ROM_REGION( 0x10000, "adpcm", ROMREGION_ERASE00 )
476   ROM_LOAD( "jat-43.9b", 0x00000, 0x02000, CRC(3c1d843c) SHA1(7a836e66cad4e94916f0d80a439efde49306a0e1) )
451477   ROM_LOAD( "jat-42.8b", 0x04000, 0x02000, CRC(3ac3efbf) SHA1(846faea7c7c01fb7500aa33a70d4b54e878c0e41) )
452   ROM_LOAD( "jat-43.9b", 0x06000, 0x02000, CRC(3c1d843c) SHA1(7a836e66cad4e94916f0d80a439efde49306a0e1) )
478   ROM_LOAD( "jat-41.7b", 0x08000, 0x02000, CRC(ce08ed71) SHA1(8554e5e7ec178f57bed5fbdd5937e3a35f72c454) )
479   ROM_LOAD( "jat-40.6b", 0x0c000, 0x02000, CRC(2275253e) SHA1(64e9415faf2775c6b9ab497dce7fda8c4775192e) )
453480
454481   ROM_REGION( 0x20, "proms", 0 )
455482   ROM_LOAD( "jat-60.10p", 0x00, 0x20,  CRC(65528ae0) SHA1(6e3bf27d10ec14e3c6a494667b03b68726fcff14) )
456483ROM_END
457484
458GAME( 1983, jantotsu,  0,    jantotsu, jantotsu,  0, ROT270, "Sanritsu", "4nin-uchi Mahjong Jantotsu", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
485GAME( 1983, jantotsu,  0,    jantotsu, jantotsu,  0, ROT270, "Sanritsu", "4nin-uchi Mahjong Jantotsu", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/galaxian.c
r4878r4879
368368   /* the inverse of bit 3 clocks the flip flop to signal an INT */
369369   /* it is automatically cleared on the acknowledge */
370370   if ((old & 0x08) && !(data & 0x08))
371      cpu_set_input_line(device->machine->cpu[1], 0, HOLD_LINE);
371      cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE);
372372
373373   /* bit 4 is sound disable */
374374   sound_global_enable(~data & 0x10);
r4878r4879
576576
577577static WRITE8_HANDLER( explorer_sound_control_w )
578578{
579   cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE);
579   cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
580580}
581581
582582
583583static READ8_DEVICE_HANDLER( explorer_sound_latch_r )
584584{
585   cpu_set_input_line(device->machine->cpu[1], 0, CLEAR_LINE);
586   return soundlatch_r(cpu_get_address_space(device->machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0);
585   cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
586   return soundlatch_r(cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0);
587587}
588588
589589
r4878r4879
619619   /* the inverse of bit 0 clocks the flip flop to signal an INT */
620620   /* it is automatically cleared on the acknowledge */
621621   if ((old & 0x01) && !(data & 0x01))
622      cpu_set_input_line(device->machine->cpu[1], 0, HOLD_LINE);
622      cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE);
623623}
624624
625625
r4878r4879
689689
690690static WRITE8_HANDLER( froggrmc_sound_control_w )
691691{
692   cpu_set_input_line(space->machine->cpu[1], 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
692   cputag_set_input_line(space->machine, "audiocpu", 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
693693}
694694
695695
r4878r4879
823823
824824static INPUT_CHANGED( gmgalax_game_changed )
825825{
826   const address_space *space = cpu_get_address_space(field->port->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
826   const address_space *space = cputag_get_address_space(field->port->machine, "maincpu", ADDRESS_SPACE_PROGRAM);
827827
828828   /* new value is the selected game */
829829   gmgalax_selected_game = newval;
r4878r4879
836836   galaxian_stars_enable_w(space, 0, 0);
837837
838838   /* reset the CPU */
839   cpu_set_input_line(field->port->machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
839   cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
840840}
841841
842842
r4878r4879
10151015static WRITE8_HANDLER( checkman_sound_command_w )
10161016{
10171017   soundlatch_w(space, 0, data);
1018   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE);
1018   cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
10191019}
10201020
10211021
10221022static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen )
10231023{
1024   cpu_set_input_line(timer->machine->cpu[1], 0, HOLD_LINE);
1024   cputag_set_input_line(timer->machine, "audiocpu", 0, HOLD_LINE);
10251025}
10261026
10271027
r4878r4879
23242324
23252325static void unmap_galaxian_sound(running_machine *machine, offs_t base)
23262326{
2327   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2327   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
23282328
23292329   memory_install_write8_handler(space, base + 0x0004, base + 0x0007, 0, 0x07f8, (write8_space_func)SMH_UNMAP);
23302330   memory_install_write8_handler(space, base + 0x0800, base + 0x0807, 0, 0x07f8, (write8_space_func)SMH_UNMAP);
r4878r4879
23472347
23482348static DRIVER_INIT( nolock )
23492349{
2350   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2350   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
23512351
23522352   /* same as galaxian... */
23532353   DRIVER_INIT_CALL(galaxian);
r4878r4879
23592359
23602360static DRIVER_INIT( azurian )
23612361{
2362   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2362   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
23632363
23642364   /* yellow bullets instead of white ones */
23652365   common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL);
r4878r4879
23712371
23722372static DRIVER_INIT( gmgalax )
23732373{
2374   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2374   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
23752375
23762376   /* video extensions */
23772377   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info);
r4878r4879
23882388
23892389static DRIVER_INIT( pisces )
23902390{
2391   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2391   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
23922392
23932393   /* video extensions */
23942394   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
r4878r4879
24002400
24012401static DRIVER_INIT( batman2 )
24022402{
2403   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2403   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
24042404
24052405   /* video extensions */
24062406   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
r4878r4879
24122412
24132413static DRIVER_INIT( frogg )
24142414{
2415   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2415   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
24162416
24172417   /* same as galaxian... */
24182418   common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
r4878r4879
24522452
24532453static DRIVER_INIT( mooncrgx )
24542454{
2455   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2455   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
24562456
24572457   /* video extensions */
24582458   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
r4878r4879
24642464
24652465static DRIVER_INIT( moonqsr )
24662466{
2467   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2467   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
24682468   UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
24692469
24702470   /* video extensions */
r4878r4879
24782478
24792479static DRIVER_INIT( pacmanbl )
24802480{
2481   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2481   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
24822482
24832483   /* same as galaxian... */
24842484   DRIVER_INIT_CALL(galaxian);
r4878r4879
25042504
25052505static DRIVER_INIT( zigzag )
25062506{
2507   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2507   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
25082508
25092509   /* video extensions */
25102510   common_init(machine, NULL, galaxian_draw_background, NULL, NULL);
r4878r4879
25442544
25452545static DRIVER_INIT( checkman )
25462546{
2547   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2548   const address_space *iospace = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO);
2547   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2548   const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
25492549
25502550   /* video extensions */
25512551   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
r4878r4879
25642564
25652565static DRIVER_INIT( checkmaj )
25662566{
2567   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2567   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
25682568
25692569   /* video extensions */
25702570   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
r4878r4879
25792579
25802580static DRIVER_INIT( dingo )
25812581{
2582   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2582   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
25832583
25842584   /* video extensions */
25852585   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
r4878r4879
25942594
25952595static DRIVER_INIT( dingoe )
25962596{
2597   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2598   const address_space *iospace = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO);
2597   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
2598   const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO);
25992599
26002600   /* video extensions */
26012601   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
r4878r4879
26162616
26172617static DRIVER_INIT( skybase )
26182618{
2619   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2619   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
26202620
26212621   /* video extensions */
26222622   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
r4878r4879
26622662
26632663static DRIVER_INIT( kingball )
26642664{
2665   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2665   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
26662666
26672667   /* video extensions */
26682668   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
r4878r4879
26792679
26802680static DRIVER_INIT( scorpnmc )
26812681{
2682   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2682   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
26832683
26842684   /* video extensions */
26852685   common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
r4878r4879
27102710
27112711static DRIVER_INIT( theend )
27122712{
2713   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2713   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
27142714
27152715   /* video extensions */
27162716   common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
r4878r4879
27292729
27302730static DRIVER_INIT( explorer )
27312731{
2732   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2732   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
27332733
27342734   /* video extensions */
27352735   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
r4878r4879
27552755   galaxian_sfx_tilemap = TRUE;
27562756
27572757   /* sound board has space for extra ROM */
2758   memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, (read8_space_func)SMH_BANK(1));
2758   memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, (read8_space_func)SMH_BANK(1));
27592759   memory_set_bankptr(machine, 1, memory_region(machine, "audiocpu"));
27602760}
27612761
27622762
27632763static DRIVER_INIT( atlantis )
27642764{
2765   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2765   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
27662766
27672767   /* video extensions */
27682768   common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
r4878r4879
28042804
28052805static DRIVER_INIT( froggrmc )
28062806{
2807   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2807   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
28082808
28092809   /* video extensions */
28102810   common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
r4878r4879
28532853
28542854static DRIVER_INIT( scorpion )
28552855{
2856   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
2856   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
28572857
28582858   common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
28592859
28602860   /* hook up AY8910 */
2861   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_IO), 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w);
2861   memory_install_readwrite8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_IO), 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w);
28622862
28632863   /* extra ROM */
28642864   memory_install_read8_handler(space, 0x5800, 0x67ff, 0, 0, (read8_space_func)SMH_BANK(1));
r4878r4879
28672867   /* no background related */
28682868//  memory_install_write8_handler(space, 0x6803, 0x6803, 0, 0, (write8_space_func)SMH_NOP);
28692869
2870   memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, scorpion_digitalker_intr_r);
2870   memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, scorpion_digitalker_intr_r);
28712871/*
28722872{
28732873    const UINT8 *rom = memory_region(machine, "speech");
src/mame/drivers/bbusters.c
r4878r4879
209209VIDEO_UPDATE( bbuster );
210210VIDEO_UPDATE( mechatt );
211211
212static UINT16 *bbuster_ram, *eprom_data;
213extern UINT16 *bbuster_pf1_data,*bbuster_pf2_data,*bbuster_pf1_scroll_data,*bbuster_pf2_scroll_data;
212static UINT16 *bbusters_ram, *eprom_data;
213extern UINT16 *bbusters_pf1_data,*bbusters_pf2_data,*bbusters_pf1_scroll_data,*bbusters_pf2_scroll_data;
214214
215WRITE16_HANDLER( bbuster_pf1_w );
216WRITE16_HANDLER( bbuster_pf2_w );
217WRITE16_HANDLER( bbuster_video_w );
215WRITE16_HANDLER( bbusters_pf1_w );
216WRITE16_HANDLER( bbusters_pf2_w );
217WRITE16_HANDLER( bbusters_video_w );
218218
219219/******************************************************************************/
220220
r4878r4879
321321
322322/*******************************************************************************/
323323
324static ADDRESS_MAP_START( bbuster_map, ADDRESS_SPACE_PROGRAM, 16 )
324static ADDRESS_MAP_START( bbusters_map, ADDRESS_SPACE_PROGRAM, 16 )
325325   AM_RANGE(0x000000, 0x07ffff) AM_ROM
326   AM_RANGE(0x080000, 0x08ffff) AM_RAM AM_BASE(&bbuster_ram)
327   AM_RANGE(0x090000, 0x090fff) AM_RAM_WRITE(bbuster_video_w) AM_BASE(&videoram16)
326   AM_RANGE(0x080000, 0x08ffff) AM_RAM AM_BASE(&bbusters_ram)
327   AM_RANGE(0x090000, 0x090fff) AM_RAM_WRITE(bbusters_video_w) AM_BASE(&videoram16)
328328   AM_RANGE(0x0a0000, 0x0a0fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
329329   AM_RANGE(0x0a1000, 0x0a7fff) AM_RAM      /* service mode */
330330   AM_RANGE(0x0a8000, 0x0a8fff) AM_RAM AM_BASE(&spriteram16_2) AM_SIZE(&spriteram_2_size)
331331   AM_RANGE(0x0a9000, 0x0affff) AM_RAM      /* service mode */
332   AM_RANGE(0x0b0000, 0x0b1fff) AM_RAM_WRITE(bbuster_pf1_w) AM_BASE(&bbuster_pf1_data)
333   AM_RANGE(0x0b2000, 0x0b3fff) AM_RAM_WRITE(bbuster_pf2_w) AM_BASE(&bbuster_pf2_data)
332   AM_RANGE(0x0b0000, 0x0b1fff) AM_RAM_WRITE(bbusters_pf1_w) AM_BASE(&bbusters_pf1_data)
333   AM_RANGE(0x0b2000, 0x0b3fff) AM_RAM_WRITE(bbusters_pf2_w) AM_BASE(&bbusters_pf2_data)
334334   AM_RANGE(0x0b4000, 0x0b5fff) AM_RAM      /* service mode */
335   AM_RANGE(0x0b8000, 0x0b8003) AM_WRITE(SMH_RAM) AM_BASE(&bbuster_pf1_scroll_data)
336   AM_RANGE(0x0b8008, 0x0b800b) AM_WRITE(SMH_RAM) AM_BASE(&bbuster_pf2_scroll_data)
335   AM_RANGE(0x0b8000, 0x0b8003) AM_WRITEONLY AM_BASE(&bbusters_pf1_scroll_data)
336   AM_RANGE(0x0b8008, 0x0b800b) AM_WRITEONLY AM_BASE(&bbusters_pf2_scroll_data)
337337   AM_RANGE(0x0d0000, 0x0d0fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
338338   AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("COINS")   /* Coins */
339339   AM_RANGE(0x0e0002, 0x0e0003) AM_READ_PORT("IN0")   /* Player 1 & 2 */
r4878r4879
345345   AM_RANGE(0x0e8002, 0x0e8003) AM_READ(control_3_r)
346346   AM_RANGE(0x0f0008, 0x0f0009) AM_WRITENOP
347347   AM_RANGE(0x0f0018, 0x0f0019) AM_WRITE(sound_cpu_w)
348   AM_RANGE(0x0f8000, 0x0f80ff) AM_READWRITE(eprom_r, SMH_RAM) AM_BASE(&eprom_data) /* Eeprom */
348   AM_RANGE(0x0f8000, 0x0f80ff) AM_READ(eprom_r) AM_WRITEONLY AM_BASE(&eprom_data) /* Eeprom */
349349ADDRESS_MAP_END
350350
351351/*******************************************************************************/
352352
353353static ADDRESS_MAP_START( mechatt_map, ADDRESS_SPACE_PROGRAM, 16 )
354354   AM_RANGE(0x000000, 0x06ffff) AM_ROM
355   AM_RANGE(0x070000, 0x07ffff) AM_RAM AM_BASE(&bbuster_ram)
356   AM_RANGE(0x090000, 0x090fff) AM_RAM_WRITE(bbuster_video_w) AM_BASE(&videoram16)
355   AM_RANGE(0x070000, 0x07ffff) AM_RAM AM_BASE(&bbusters_ram)
356   AM_RANGE(0x090000, 0x090fff) AM_RAM_WRITE(bbusters_video_w) AM_BASE(&videoram16)
357357   AM_RANGE(0x0a0000, 0x0a0fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
358358   AM_RANGE(0x0a1000, 0x0a7fff) AM_WRITENOP
359   AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(bbuster_pf1_w) AM_BASE(&bbuster_pf1_data)
360   AM_RANGE(0x0b8000, 0x0b8003) AM_WRITEONLY AM_BASE(&bbuster_pf1_scroll_data)
361   AM_RANGE(0x0c0000, 0x0c3fff) AM_RAM_WRITE(bbuster_pf2_w) AM_BASE(&bbuster_pf2_data)
362   AM_RANGE(0x0c8000, 0x0c8003) AM_WRITEONLY AM_BASE(&bbuster_pf2_scroll_data)
359   AM_RANGE(0x0b0000, 0x0b3fff) AM_RAM_WRITE(bbusters_pf1_w) AM_BASE(&bbusters_pf1_data)
360   AM_RANGE(0x0b8000, 0x0b8003) AM_WRITEONLY AM_BASE(&bbusters_pf1_scroll_data)
361   AM_RANGE(0x0c0000, 0x0c3fff) AM_RAM_WRITE(bbusters_pf2_w) AM_BASE(&bbusters_pf2_data)
362   AM_RANGE(0x0c8000, 0x0c8003) AM_WRITEONLY AM_BASE(&bbusters_pf2_scroll_data)
363363   AM_RANGE(0x0d0000, 0x0d07ff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBxxxx_word_w) AM_BASE(&paletteram16)
364364   AM_RANGE(0x0e0000, 0x0e0001) AM_READ_PORT("IN0")
365365   AM_RANGE(0x0e0002, 0x0e0003) AM_READ_PORT("DSW1")
r4878r4879
708708
709709   /* basic machine hardware */
710710   MDRV_CPU_ADD("maincpu", M68000, 12000000)
711   MDRV_CPU_PROGRAM_MAP(bbuster_map)
711   MDRV_CPU_PROGRAM_MAP(bbusters_map)
712712   MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
713713
714714   MDRV_CPU_ADD("audiocpu", Z80,4000000) /* Accurate */
src/mame/drivers/flstory.c
r4878r4879
450450   PORT_DIPNAME(0x60, 0x00, DEF_STR( Difficulty ) )
451451   PORT_DIPSETTING(   0x20, DEF_STR( Easy ) )
452452   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )
453   PORT_DIPSETTING(   0x40, "Difficult" )
454   PORT_DIPSETTING(   0x60, "Very Difficult" )
453   PORT_DIPSETTING(   0x40, DEF_STR( Difficult ) )
454   PORT_DIPSETTING(   0x60, DEF_STR( Very_Difficult ) )
455455   PORT_DIPNAME(0x80, 0x80, DEF_STR( Coinage ) )
456456   PORT_DIPSETTING(   0x80, "A and B" )
457457   PORT_DIPSETTING(   0x00, "A only" )
src/mame/drivers/model2.c
r4878r4879
190190   {
191191      if (copro_fifoout_num == COPRO_FIFOOUT_SIZE)
192192      {
193         sharc_set_flag_input(space->machine->cpu[2], 1, ASSERT_LINE);
193         sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, ASSERT_LINE);
194194      }
195195      else
196196      {
197         sharc_set_flag_input(space->machine->cpu[2], 1, CLEAR_LINE);
197         sharc_set_flag_input(cputag_get_cpu(space->machine, "dsp"), 1, CLEAR_LINE);
198198      }
199199   }
200200
r4878r4879
341341   MACHINE_RESET_CALL(model2_common);
342342
343343   // hold TGP in halt until we have code
344   cpu_set_input_line(machine->cpu[2], INPUT_LINE_HALT, ASSERT_LINE);
344   cputag_set_input_line(machine, "tgp", INPUT_LINE_HALT, ASSERT_LINE);
345345
346346   dsp_type = DSP_TYPE_TGP;
347347}
r4878r4879
352352   memory_set_bankptr(machine, 5, memory_region(machine, "scsp") + 0x600000);
353353
354354   // copy the 68k vector table into RAM
355   memcpy(model2_soundram, memory_region(machine, "audiocpu")+0x80000, 16);
355   memcpy(model2_soundram, memory_region(machine, "audiocpu") + 0x80000, 16);
356356   device_reset(cputag_get_cpu(machine, "audiocpu"));
357357}
358358
r4878r4879
362362   MACHINE_RESET_CALL(model2_scsp);
363363
364364   // hold TGP in halt until we have code
365   cpu_set_input_line(machine->cpu[2], INPUT_LINE_HALT, ASSERT_LINE);
365   cputag_set_input_line(machine, "tgp", INPUT_LINE_HALT, ASSERT_LINE);
366366
367367   dsp_type = DSP_TYPE_TGP;
368368}
r4878r4879
372372   MACHINE_RESET_CALL(model2_common);
373373   MACHINE_RESET_CALL(model2_scsp);
374374
375   cpu_set_input_line(machine->cpu[2], INPUT_LINE_HALT, ASSERT_LINE);
375   cputag_set_input_line(machine, "dsp", INPUT_LINE_HALT, ASSERT_LINE);
376376
377377   // set FIFOIN empty flag on SHARC
378   cpu_set_input_line(machine->cpu[2], SHARC_INPUT_FLAG0, ASSERT_LINE);
378   cputag_set_input_line(machine, "dsp", SHARC_INPUT_FLAG0, ASSERT_LINE);
379379   // clear FIFOOUT buffer full flag on SHARC
380   cpu_set_input_line(machine->cpu[2], SHARC_INPUT_FLAG1, CLEAR_LINE);
380   cputag_set_input_line(machine, "dsp", SHARC_INPUT_FLAG1, CLEAR_LINE);
381381
382382   dsp_type = DSP_TYPE_SHARC;
383383}
r4878r4879
503503         logerror("Boot copro, %d dwords\n", model2_coprocnt);
504504         if (dsp_type != DSP_TYPE_TGPX4)
505505         {
506            cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_HALT, CLEAR_LINE);
506            if (dsp_type == DSP_TYPE_SHARC)
507               cputag_set_input_line(space->machine, "dsp", INPUT_LINE_HALT, CLEAR_LINE);
508            else
509               cputag_set_input_line(space->machine, "tgp", INPUT_LINE_HALT, CLEAR_LINE);
507510         }
508511      }
509512   }
r4878r4879
518521   d |= a << 23;
519522
520523   //logerror("copro_function_port_w: %08X, %08X, %08X\n", data, offset, mem_mask);
521   copro_fifoin_push(space->machine->cpu[2], d);
524   if (dsp_type == DSP_TYPE_SHARC)
525      copro_fifoin_push(cputag_get_cpu(space->machine, "dsp"), d);
526   else
527      copro_fifoin_push(cputag_get_cpu(space->machine, "tgp"), d);
522528}
523529
524530static READ32_HANDLER(copro_fifo_r)
r4878r4879
533539   {
534540      if (dsp_type == DSP_TYPE_SHARC)
535541      {
536         sharc_external_dma_write(space->machine->cpu[2], model2_coprocnt, data & 0xffff);
542         sharc_external_dma_write(cputag_get_cpu(space->machine, "dsp"), model2_coprocnt, data & 0xffff);
537543      }
538544      else if (dsp_type == DSP_TYPE_TGP)
539545      {
r4878r4879
545551   else
546552   {
547553      //mame_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(space->cpu));
548      copro_fifoin_push(space->machine->cpu[2], data);
554      if (dsp_type == DSP_TYPE_SHARC)
555         copro_fifoin_push(cputag_get_cpu(space->machine, "dsp"), data);
556      else
557         copro_fifoin_push(cputag_get_cpu(space->machine, "tgp"), data);
549558   }
550559}
551560
r4878r4879
558567      (strcmp(space->machine->gamedrv->name, "vstriker" ) == 0) ||
559568      (strcmp(space->machine->gamedrv->name, "gunblade" ) == 0))
560569   {
561      sharc_external_iop_write(space->machine->cpu[2], offset, data);
570      sharc_external_iop_write(cputag_get_cpu(space->machine, "dsp"), offset, data);
562571   }
563572   else
564573   {
r4878r4879
569578      else
570579      {
571580         iop_data |= (data & 0xffff) << 16;
572         sharc_external_iop_write(space->machine->cpu[2], offset, iop_data);
581         sharc_external_iop_write(cputag_get_cpu(space->machine, "dsp"), offset, iop_data);
573582      }
574583      iop_write_num++;
575584   }
r4878r4879
619628        else
620629        {
621630            logerror("Boot geo, %d dwords\n", model2_geocnt);
622            cpu_set_input_line(space->machine->cpu[3], INPUT_LINE_HALT, CLEAR_LINE);
631            cputag_set_input_line(space->machine, "dsp2", INPUT_LINE_HALT, CLEAR_LINE);
623632            //cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(1000));       // Give the SHARC enough time to boot itself
624633        }
625634    }
r4878r4879
644653{
645654    if (model2_geoctl & 0x80000000)
646655    {
647        sharc_external_dma_write(space->machine->cpu[3], model2_geocnt, data & 0xffff);
656        sharc_external_dma_write(cputag_get_cpu(space->machine, "dsp2"), model2_geocnt, data & 0xffff);
648657
649658        model2_geocnt++;
650659    }
r4878r4879
660669{
661670    if ((strcmp(space->machine->gamedrv->name, "schamp" ) == 0))
662671    {
663        sharc_external_iop_write(space->machine->cpu[3], offset, data);
672        sharc_external_iop_write(cputag_get_cpu(space->machine, "dsp2"), offset, data);
664673    }
665674    else
666675    {
r4878r4879
671680        else
672681        {
673682            geo_iop_data |= (data & 0xffff) << 16;
674            sharc_external_iop_write(space->machine->cpu[3], offset, geo_iop_data);
683            sharc_external_iop_write(cputag_get_cpu(space->machine, "dsp2"), offset, geo_iop_data);
675684        }
676685        geo_iop_write_num++;
677686    }
r4878r4879
17541763   UINT32 result = 0;
17551764   //mame_printf_debug("SHARC FIFOIN pop at %08X\n", cpu_get_pc(space->cpu));
17561765
1757   copro_fifoin_pop(space->machine->cpu[2], &result);
1766   copro_fifoin_pop(cputag_get_cpu(space->machine, "dsp"), &result);
17581767   return result;
17591768}
17601769
17611770static WRITE32_HANDLER(copro_sharc_output_fifo_w)
17621771{
17631772   //mame_printf_debug("SHARC FIFOOUT push %08X\n", data);
1764   copro_fifoout_push(space->machine->cpu[2], data);
1773   copro_fifoout_push(cputag_get_cpu(space->machine, "dsp"), data);
17651774}
17661775
17671776static READ32_HANDLER(copro_sharc_buffer_r)
src/mame/drivers/sshangha.c
r4878r4879
1313  OSC  : 28.0000MHz 16.0000MHz
1414
1515  The original uses a protection chip which isn't fully worked out yet.
16  Sound doesn't work.  The bootleg never seems to write to a sound latch
17  (Not sure the bootleg even has the same sound hardware as the original).
16  Sound doesn't work for the original set, probably the sound ports are inside
17  the protection area.
1818
1919  Emulation by Bryan McPhail, mish@tendril.co.uk
2020
r4878r4879
7373
7474static UINT16 *sshangha_prot_data;
7575
76static UINT16 *sshangha_sound_shared_ram;
77
7678/******************************************************************************/
7779
7880static WRITE16_HANDLER( sshangha_protection16_w )
r4878r4879
8082   COMBINE_DATA(&sshangha_prot_data[offset]);
8183
8284   logerror("CPU #0 PC %06x: warning - write unmapped control address %06x %04x\n",cpu_get_pc(space->cpu),offset<<1,data);
83
84   if (offset == (0x260 >> 1)) {
85      //soundlatch_w(0, data & 0xff);
86      //cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
87   }
8885}
8986
90static WRITE16_HANDLER( sshangha_sound_w )
91{
92   soundlatch_w(space, 0, data & 0xff);
93   cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
94}
95
9687/* Protection/IO chip 146 */
9788static READ16_HANDLER( sshangha_protection16_r )
9889{
r4878r4879
123114      case 0x0ac >> 1:
124115         return input_port_read(space->machine, "DSW");
125116   }
117
126118   return sshangha_prot_data[offset];
127119}
128120
r4878r4879
150142
151143static ADDRESS_MAP_START( sshangha_map, ADDRESS_SPACE_PROGRAM, 16 )
152144   AM_RANGE(0x000000, 0x03ffff) AM_ROM
153   AM_RANGE(0x084000, 0x0847ff) AM_READ(sshanghb_protection16_r)
154   AM_RANGE(0x10000c, 0x10000d) AM_WRITE(sshangha_sound_w)
155   AM_RANGE(0x101000, 0x101001) AM_READ(deco_71_r)//bootleg hack
156   AM_RANGE(0x10100c, 0x10100d) AM_WRITE(sshangha_sound_w)   /* the bootleg writes here */
145   AM_RANGE(0x100000, 0x10000f) AM_RAM AM_BASE(&sshangha_sound_shared_ram)
157146
158147   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(sshangha_pf1_data_w) AM_BASE(&sshangha_pf1_data)
159148   AM_RANGE(0x202000, 0x203fff) AM_RAM_WRITE(sshangha_pf2_data_w) AM_BASE(&sshangha_pf2_data)
r4878r4879
163152   AM_RANGE(0x300000, 0x30000f) AM_WRITE(sshangha_control_0_w)
164153   AM_RANGE(0x320000, 0x320001) AM_WRITE(sshangha_video_w)
165154   AM_RANGE(0x320002, 0x320005) AM_WRITENOP
155   AM_RANGE(0x320006, 0x320007) AM_READNOP //irq ack
166156
167157   AM_RANGE(0x340000, 0x340fff) AM_RAM AM_BASE(&spriteram16)
168158   AM_RANGE(0x350000, 0x350001) AM_READ(deco_71_r)
r4878r4879
176166   AM_RANGE(0xff4000, 0xff47ff) AM_READWRITE(sshangha_protection16_r,sshangha_protection16_w) AM_BASE(&sshangha_prot_data)
177167ADDRESS_MAP_END
178168
169static ADDRESS_MAP_START( sshanghb_map, ADDRESS_SPACE_PROGRAM, 16 )
170   AM_RANGE(0x000000, 0x03ffff) AM_ROM
171   AM_RANGE(0x084000, 0x0847ff) AM_READ(sshanghb_protection16_r)
172   AM_RANGE(0x101000, 0x10100f) AM_RAM AM_BASE(&sshangha_sound_shared_ram) /* the bootleg writes here */
173
174   AM_RANGE(0x200000, 0x201fff) AM_RAM_WRITE(sshangha_pf1_data_w) AM_BASE(&sshangha_pf1_data)
175   AM_RANGE(0x202000, 0x203fff) AM_RAM_WRITE(sshangha_pf2_data_w) AM_BASE(&sshangha_pf2_data)
176   AM_RANGE(0x204000, 0x2047ff) AM_RAM AM_BASE(&sshangha_pf1_rowscroll)
177   AM_RANGE(0x206000, 0x2067ff) AM_RAM AM_BASE(&sshangha_pf2_rowscroll)
178   AM_RANGE(0x206800, 0x207fff) AM_RAM
179   AM_RANGE(0x300000, 0x30000f) AM_WRITE(sshangha_control_0_w)
180   AM_RANGE(0x320000, 0x320001) AM_WRITE(sshangha_video_w)
181   AM_RANGE(0x320002, 0x320005) AM_WRITENOP
182   AM_RANGE(0x320006, 0x320007) AM_READNOP //irq ack
183
184   AM_RANGE(0x340000, 0x340fff) AM_RAM AM_BASE(&spriteram16)
185   AM_RANGE(0x350000, 0x350001) AM_READ(deco_71_r)
186   AM_RANGE(0x350000, 0x350007) AM_WRITENOP
187   AM_RANGE(0x360000, 0x360fff) AM_RAM AM_BASE(&spriteram16_2)
188   AM_RANGE(0x370000, 0x370001) AM_READ(deco_71_r)
189   AM_RANGE(0x370000, 0x370007) AM_WRITENOP
190   AM_RANGE(0x380000, 0x383fff) AM_RAM_WRITE(paletteram16_xbgr_word_be_w) AM_BASE(&paletteram16)
191   AM_RANGE(0x3c0000, 0x3c0fff) AM_RAM   /* Sprite ram buffer on bootleg only?? */
192   AM_RANGE(0xfec000, 0xff3fff) AM_RAM
193   AM_RANGE(0xff4000, 0xff47ff) AM_RAM
194ADDRESS_MAP_END
195
179196/******************************************************************************/
180197
181static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
198/* 8 "sound latches" shared between main and sound cpus. */
199
200static READ8_HANDLER(sshangha_sound_shared_r)
201{
202   return sshangha_sound_shared_ram[offset] & 0xff;
203}
204
205static WRITE8_HANDLER(sshangha_sound_shared_w)
206{
207   sshangha_sound_shared_ram[offset] = data & 0xff;
208}
209
210/* Note: there's rom data after 0x8000 but the game never seem to call a rom bank, left-over? */
211static ADDRESS_MAP_START( sshangha_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
182212   AM_RANGE(0x0000, 0x7fff) AM_ROM
183213   AM_RANGE(0xc000, 0xc001) AM_DEVREADWRITE("ym", ym2203_r,ym2203_w)
184   AM_RANGE(0xf800, 0xffff) AM_RAM
185//  AM_RANGE(0xf800, 0xf800) AM_READ(soundlatch_r)
214   AM_RANGE(0xc200, 0xc201) AM_DEVREADWRITE("oki",okim6295_r,okim6295_w)
215   AM_RANGE(0xf800, 0xf807) AM_READWRITE(sshangha_sound_shared_r,sshangha_sound_shared_w)
216   AM_RANGE(0xf808, 0xffff) AM_RAM
186217ADDRESS_MAP_END
187218
188219/******************************************************************************/
r4878r4879
330361   MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
331362
332363   MDRV_CPU_ADD("audiocpu", Z80, 16000000/4)
333   MDRV_CPU_PROGRAM_MAP(sound_map)
364   MDRV_CPU_PROGRAM_MAP(sshangha_sound_map)
334365
366   MDRV_QUANTUM_TIME(HZ(6000))
367
335368   MDRV_MACHINE_RESET(sshangha)   /* init machine */
336369
337370   /* video hardware */
r4878r4879
351384   MDRV_VIDEO_UPDATE(sshangha)
352385
353386   /* sound hardware */
354   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
387   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") /* sure it's stereo? */
355388
356389   MDRV_SOUND_ADD("ym", YM2203, 16000000/4)
357390   MDRV_SOUND_CONFIG(ym2203_config)
r4878r4879
364397   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.27)
365398MACHINE_DRIVER_END
366399
400static MACHINE_DRIVER_START( sshanghb )
401   MDRV_IMPORT_FROM( sshangha )
402
403   MDRV_CPU_MODIFY("maincpu")
404   MDRV_CPU_PROGRAM_MAP(sshanghb_map)
405MACHINE_DRIVER_END
406
367407/******************************************************************************/
368408
369409ROM_START( sshangha )
r4878r4879
424464}
425465
426466
427GAME( 1992, sshangha, 0,        sshangha, sshangha, sshangha, ROT0, "Hot-B.",  "Super Shanghai Dragon's Eye (Japan)", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND )
428GAME( 1992, sshanghb, sshangha, sshangha, sshangha, sshangha, ROT0, "bootleg", "Super Shanghai Dragon's Eye (World, bootleg)", GAME_NO_SOUND )
467GAME( 1992, sshangha, 0,        sshangha, sshangha, sshangha, ROT0, "Hot-B.",  "Super Shanghai Dragon's Eye (Japan)", GAME_UNEMULATED_PROTECTION | GAME_NOT_WORKING )
468GAME( 1992, sshanghb, sshangha, sshanghb, sshangha, sshangha, ROT0, "bootleg", "Super Shanghai Dragon's Eye (World, bootleg)", 0 )
src/mame/drivers/pcat_nit.c
r4878r4879
327327}
328328
329329
330const struct pit8253_config at_pit8254_config =
330static const struct pit8253_config at_pit8254_config =
331331{
332332   {
333333      {
src/mame/drivers/tmnt.c
r4878r4879
12721272   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
12731273   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
12741274   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1275   PORT_DIPSETTING(    0x20, "Difficult" )
1276   PORT_DIPSETTING(    0x00, "Very Difficult" )
1275   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1276   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
12771277   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
12781278   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12791279   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
13291329   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
13301330   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
13311331   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1332   PORT_DIPSETTING(    0x20, "Difficult" )
1333   PORT_DIPSETTING(    0x00, "Very Difficult" )
1332   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1333   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
13341334   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
13351335   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13361336   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
14061406   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
14071407   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
14081408   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1409   PORT_DIPSETTING(    0x20, "Difficult" )
1410   PORT_DIPSETTING(    0x00, "Very Difficult" )
1409   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1410   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
14111411   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
14121412   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14131413   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
14711471   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
14721472   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
14731473   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1474   PORT_DIPSETTING(    0x20, "Difficult" )
1475   PORT_DIPSETTING(    0x00, "Very Difficult" )
1474   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1475   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
14761476   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
14771477   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14781478   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/jpmimpct.c
r4878r4879
308308
309309static WRITE16_HANDLER( duart_1_w )
310310{
311   int old_val;
311   //int old_val;
312312   switch (offset)
313313   {
314314      case 0x1:
r4878r4879
364364      }
365365      case 0xe:
366366      {
367          old_val = duart_1.OPR;
367          //old_val = duart_1.OPR;
368368          duart_1.OPR = duart_1.OPR | data;
369369          duart_1.OP = ~duart_1.OPR;
370370         /* Output port bit set */
r4878r4879
372372      }
373373      case 0xf:
374374      {
375          old_val = duart_1.OPR;
375          //old_val = duart_1.OPR;
376376          duart_1.OPR = duart_1.OPR &~data;
377377          duart_1.OP = ~duart_1.OPR;
378378         /* Output port bit reset */
src/mame/drivers/namcos12.c
r4878r4879
17071707   ROM_LOAD( "eg1wave0.2",          0x0000000, 0x800000, CRC(961fe69f) SHA1(0189a061959a8d94b9d2db627911264faf9f28fd) )
17081708ROM_END
17091709
1710ROM_START( ehrgeizj )
1711   ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */
1712   ROM_LOAD16_BYTE( "eg1vera.2l",   0x0000000, 0x200000, CRC(302d62cf) SHA1(e2de280ae4475829398a6770aed8eab0ed35b1ce) )
1713   ROM_LOAD16_BYTE( "eg1vera.2p",   0x0000001, 0x200000, CRC(1d7fb3a1) SHA1(dc038a639f89d7c8daaf987b728fde175fe4dbec) )
1714
1715   ROM_REGION32_LE( 0x1c00000, "user2", 0 ) /* main data */
1716   ROM_LOAD16_BYTE( "eg1rom0l.12",  0x0000000, 0x800000, CRC(fe11a48e) SHA1(bdb2af5949bb4a324dab01489e9488aa5b9bd129) )
1717   ROM_LOAD16_BYTE( "eg1rom0u.11",  0x0000001, 0x800000, CRC(7cb90c25) SHA1(0ff6f7bf8b7eb2e0706bd235fcb9a95ea639fae6) )
1718   ROM_LOAD16_BYTE( "eg1fl1l.9",    0x1000000, 0x200000, CRC(dd4cac2b) SHA1(f49d0055303b3d8639e94f93bce6bf160cc99913) )
1719   ROM_LOAD16_BYTE( "eg1fl1u.10",   0x1000001, 0x200000, CRC(e3348407) SHA1(829bf1be0f74fd385e325d774f1449e28aba1e4d) )
1720   ROM_LOAD16_BYTE( "eg1fl2l.7",    0x1400000, 0x200000, CRC(34493262) SHA1(9dd5b1b25e7232460bf5ee5b339d9f536ec26979) )
1721   ROM_LOAD16_BYTE( "eg1fl2u.8",    0x1400001, 0x200000, CRC(4fb84f1d) SHA1(714e0ef56871d7b4568bc6dda08bbb1c01dbba37) )
1722   ROM_LOAD16_BYTE( "eg1fl3l.5",    0x1800000, 0x200000, CRC(f9441f87) SHA1(70944160620ba2fc80b4fc3a7b61c33622298a8b) )
1723   ROM_LOAD16_BYTE( "eg1fl3u.6",    0x1800001, 0x200000, CRC(cea397de) SHA1(3791dbadb5699c805c27930e59c61af4d62f77f7) )
1724
1725   ROM_REGION( 0x0080000, "sub", 0 ) /* sound prg */
1726   ROM_LOAD16_WORD_SWAP( "eg1vera.11s", 0x0000000, 0x080000, CRC(9e44645e) SHA1(374eb4a4c09d6b5b7af5ff0efec16b4d2aacbe2b) )
1727
1728   ROM_REGION( 0x0800000, "c352", 0 ) /* samples */
1729   ROM_LOAD( "eg1wave0.2",          0x0000000, 0x800000, CRC(961fe69f) SHA1(0189a061959a8d94b9d2db627911264faf9f28fd) )
1730ROM_END
1731
17101732ROM_START( fgtlayer )
17111733   ROM_REGION32_LE( 0x00400000, "user1", 0 ) /* main prg */
17121734   ROM_LOAD16_BYTE( "ftl1vera.2e",  0x0000000, 0x200000, CRC(f4156e79) SHA1(cedb917940be8c74fa4ddb48213ce6917444e306) )
r4878r4879
23972419GAME( 1998, soulclbd,  soulclbr, coh700,   namcos12, namcos12, ROT0, "Namco",         "Soul Calibur (Japan, SOC11/VER.A2)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC020 */
23982420GAME( 1998, ehrgeiz,   0,        coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG3/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
23992421GAME( 1998, ehrgeiza,  ehrgeiz,  coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (EG2/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
2422GAME( 1998, ehrgeizj,  ehrgeiz,  coh700,   namcos12, namcos12, ROT0, "Square/Namco",  "Ehrgeiz (Japan, EG1/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC021 */
24002423GAME( 1998, mdhorse,   0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Derby Quiz My Dream Horse (Japan, MDH1/VER.A2)", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC035 */
24012424GAME( 1998, sws98,     0,        coh700,   namcos12, namcos12, ROT0, "Namco",         "Super World Stadium '98 (Japan, SS81/VER.A)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC0?? */
24022425GAME( 1998, tenkomor,  0,        coh700,   namcos12, namcos12, ROT90, "Namco",        "Tenkomori Shooting (TKM2/VER.A1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND ) /* KC036 */
src/mame/drivers/zodiack.c
r4878r4879
583583
584584ROM_START( dogfight )
585585   ROM_REGION( 0x10000, "maincpu", 0 )
586   ROM_LOAD( "df-2",         0x0000, 0x2000, CRC(ad24b28b) SHA1(5bfc24c9d176a987525c5ad3eff3308f679d4d44) )
587   ROM_LOAD( "df-3",         0x2000, 0x2000, CRC(cd172707) SHA1(9d7a494006db13cbe9c895875a18d9423a0128bc) )
588   ROM_LOAD( "df-5",         0x4000, 0x1000, CRC(874dc6bf) SHA1(2c34fdfb2838c41f239171bc9a14a5cc7a94a170) )
589   ROM_LOAD( "df-4",         0xc000, 0x1000, CRC(d8aa3d6d) SHA1(0863d566ff4a181ae8a8d552f9768dd028254605) )
586   ROM_LOAD( "df-2.4f",      0x0000, 0x2000, CRC(ad24b28b) SHA1(5bfc24c9d176a987525c5ad3eff3308f679d4d44) )
587   ROM_LOAD( "df-3.4h",      0x2000, 0x2000, CRC(cd172707) SHA1(9d7a494006db13cbe9c895875a18d9423a0128bc) )
588   ROM_LOAD( "df-5.4n",      0x4000, 0x1000, CRC(874dc6bf) SHA1(2c34fdfb2838c41f239171bc9a14a5cc7a94a170) )
589   ROM_LOAD( "df-4.4m",      0xc000, 0x1000, CRC(d8aa3d6d) SHA1(0863d566ff4a181ae8a8d552f9768dd028254605) )
590590
591591   ROM_REGION( 0x10000, "audiocpu", 0 )
592   ROM_LOAD( "df-1",         0x0000, 0x1000, CRC(dcbb1c5b) SHA1(51fa51ff64982455b00484d55f6a8cf89fc786f1) )
592   ROM_LOAD( "df-1.4n",      0x0000, 0x1000, CRC(dcbb1c5b) SHA1(51fa51ff64982455b00484d55f6a8cf89fc786f1) )
593593
594594   ROM_REGION( 0x2800, "gfx1", ROMREGION_DISPOSE )
595   ROM_LOAD( "df-6",         0x0000, 0x0800, CRC(3059b515) SHA1(849e99a04ddcdfcf097cc3ac17e9edf12b51cd69) )
596   ROM_LOAD( "df-7",         0x0800, 0x1000, CRC(ffe05fee) SHA1(70b9d0808defd936e2c3567f8e6996a19753de81) )
597   ROM_LOAD( "df-8",         0x1800, 0x1000, CRC(2cb51793) SHA1(d90177ef28730774202a04a0846281537a1883df) )
595   ROM_LOAD( "df-6.3s",      0x0000, 0x0800, CRC(3059b515) SHA1(849e99a04ddcdfcf097cc3ac17e9edf12b51cd69) )
596   ROM_LOAD( "df-7.7n",      0x0800, 0x1000, CRC(ffe05fee) SHA1(70b9d0808defd936e2c3567f8e6996a19753de81) )
597   ROM_LOAD( "df-8.7r",      0x1800, 0x1000, CRC(2cb51793) SHA1(d90177ef28730774202a04a0846281537a1883df) )
598598
599599   ROM_REGION( 0x0040, "proms", 0 )
600   ROM_LOAD( "1.bpr",        0x0000, 0x0020, CRC(69a35aa5) SHA1(fe494ed1ff642f95834dfca92e9c4494e04f7b81) )
601   ROM_LOAD( "2.bpr",        0x0020, 0x0020, CRC(596ae457) SHA1(1c1a3130d88c5fd5c66ce9f91d97a09c0a0b535f) )
600   ROM_LOAD( "mmi6331.2a", 0x0000, 0x0020, CRC(69a35aa5) SHA1(fe494ed1ff642f95834dfca92e9c4494e04f7b81) )
601   ROM_LOAD( "mmi6331.2b", 0x0020, 0x0020, CRC(596ae457) SHA1(1c1a3130d88c5fd5c66ce9f91d97a09c0a0b535f) )
602602ROM_END
603603
604604ROM_START( moguchan )
src/mame/drivers/system18.c
r4878r4879
1/*  System18 Hardware
2**
3**  MC68000 + Z80
4**  2xYM3438 + Custom PCM
5**
6**  Alien Storm
7**  Bloxeed
8**  Clutch Hitter
9**  D.D. Crew
10**  Laser Ghost
11**  Michael Jackson's Moonwalker
12**  Shadow Dancer
13**  Search Wally
14*/
15
161/*
172
18Changes:
1904/28/04  Charles MacDonald
20- Added MSM5205 sample playback to shdancbl.
3    SYstem 18 bootlegs
214
2203/17/04
23- Added Where's Wally? (wwally) It's encrypted and unplayable.
24- Moved Ace Attacker to system16.c (it's a not a System 18 game)
25- Fixed System 18 sample ROM banking. This doesn't help the current working games, but will support others when/if they are decrypted.
26- Fixed RF5C68A clock (7.15 MHz -> 8.00 MHz).
27- Fixed Z80 clock (8.192 MHz -> 8.00 MHz).
28- Cleaned up shdancbl sound hardware a little.
5    The system 18 bootlegs lack the VDP
296
3003/12/04
31- Added preliminary VDP emulation to fix shdancer tile banking and VDP memory tests in other games.
32- Added I/O chip emulation, fixes blanked screen at end of shdancer memory test, coin meter/lockout implemented.
33- Cleaned up shdancer,shdancrj,shdancbl drivers.
34- Added Shadow Dancer (Rev.B) driver (shdancrb).
35- Added sound emulation to shdancbl.
36
37To do:
38- mwalkbl VDP test says IC68 (315-5313) is bad, but the test code seems to print the 'bad' message always, and it
39  doesn't look like that VDP layer is supposed to cover the text (indicating success).
40- astormbl writes to mirrored sprite RAM at $141000.
41- mwalkbl writes to mirrored palette RAM at $841000.
42
43shdancbl:
44- Sampled sound needs to be implemented.
45- ROM test fails. Maybe the original game code was not patched to fix this, rather than the ROMs really being bad.
46- Supporting the screen blanking control at $E4001D causes some problems after coin-up.
47- Player 1 inputs map to player 2.
48- Misplaced tilemap horizontal scrolling in several locations:
49  Level map screen, bonus stage, train level, sewer level, etc.
50- Bad sprites in some specific cases:
51  - Green shield-throwing man, animation when dog attacks enemy, fade-in when ninjas appear, etc.
52- Missing "Shadow Dancer" logo on title screen if you insert a coin instead of watching the intro sequence.
53
54I very carefully checked the sprite ROMs to make sure they are loaded correctly, and it seems that for the bad
55sprites listed above, one of the even/odd pair is correct while the other is not. The correct data isn't present
56in any of the ROMs I think. Maybe they need to be redumped, or it's an actual problem of the bootleg?
57
58Other notes:
59- The sys18_sound_info structure holds the offset to each ROM in the "sound" space as well as a mask to be applied
60   to the 8K bank offset into each ROM. For an unused ROM, the mask should be set to zero.
61
627*/
638
64#include "driver.h"
65#include "cpu/z80/z80.h"
66#include "system16.h"
67#include "cpu/m68000/m68000.h"
68#include "machine/fd1094.h"
69#include "sound/msm5205.h"
70#include "sound/2612intf.h"
71#include "sound/rf5c68.h"
729
73/* video/segac2.c */
74extern void update_system18_vdp( bitmap_t *bitmap, const rectangle *cliprect );
75extern READ16_HANDLER( segac2_vdp_r );
76extern WRITE16_HANDLER( segac2_vdp_w );
7710
78/***************************************************************************/
7911
80static WRITE16_HANDLER( sys18_refreshenable_w )
81{
82   if(ACCESSING_BITS_0_7)
83   {
84      sys16_refreshenable = data & 0x02;
85   }
86}
87
88static WRITE16_HANDLER( sys18_tilebank_w )
89{
90   if(ACCESSING_BITS_0_7)
91   {
92      sys16_tile_bank0 = (data >> 0) & 0x0F;
93      sys16_tile_bank1 = (data >> 4) & 0x0F;
94   }
95}
96
97/***************************************************************************/
98
99static void set_fg_page( int data )
100{
101   sys16_fg_page[0] = data>>12;
102   sys16_fg_page[1] = (data>>8)&0xf;
103   sys16_fg_page[2] = (data>>4)&0xf;
104   sys16_fg_page[3] = data&0xf;
105}
106
107static void set_bg_page( int data )
108{
109   sys16_bg_page[0] = data>>12;
110   sys16_bg_page[1] = (data>>8)&0xf;
111   sys16_bg_page[2] = (data>>4)&0xf;
112   sys16_bg_page[3] = data&0xf;
113}
114
115static void set_fg2_page( int data )
116{
117   sys16_fg2_page[0] = data>>12;
118   sys16_fg2_page[1] = (data>>8)&0xf;
119   sys16_fg2_page[2] = (data>>4)&0xf;
120   sys16_fg2_page[3] = data&0xf;
121}
122
123static void set_bg2_page( int data )
124{
125   sys16_bg2_page[0] = data>>12;
126   sys16_bg2_page[1] = (data>>8)&0xf;
127   sys16_bg2_page[2] = (data>>4)&0xf;
128   sys16_bg2_page[3] = data&0xf;
129}
130
131/***************************************************************************/
132/*
133    Sound hardware for Shadow Dancer (Datsu bootleg)
134
135    Z80 memory map
136    0000-7FFF : ROM (fixed)
137    8000-BFFF : ROM (banked)
138    C000-C007 : ?
139    C400      : Sound command (r/o)
140    C800      : MSM5205 sample data output (w/o)
141    CC00-CC03 : YM3438 #1
142    D000-D003 : YM3438 #2
143    D400      : ROM bank control (w/o)
144    DF00-DFFF : ?
145    E000-FFFF : Work RAM
146
147    The unused memory locations and I/O port access seem to be remnants of the original code that were not patched out:
148
149    - Program accesses RF5C68A channel registes at $C000-$C007
150    - Program clears RF5C68A wave memory at $DF00-$DFFF
151    - Program writes to port $A0 to access sound ROM banking control latch
152    - Program reads port $C0 to access sound command
153
154    Interrupts
155
156    IRQ = Triggered when 68000 writes sound command. Z80 reads from $C400.
157    NMI = Triggered when second nibble of sample data has been output to the MSM5205.
158          Program copies sample data from ROM bank to the MSM5205 sample data buffer at $C800.
159
160    ROM banking seems correct.
161    It doesn't look like there's a way to reset the MSM5205, unless that's related to bit 7 of the
162    ROM bank control register.
163    MSM5205 clock speed hasn't been confirmed.
164*/
165/***************************************************************************/
166
167static int sample_buffer = 0;
168static int sample_select = 0;
169
170static WRITE8_HANDLER( shdancbl_msm5205_data_w )
171{
172   sample_buffer = data;
173}
174
175static void shdancbl_msm5205_callback(const device_config *device)
176{
177   msm5205_data_w(device, sample_buffer & 0x0F);
178   sample_buffer >>= 4;
179   sample_select ^= 1;
180   if(sample_select == 0)
181      cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
182}
183
184static const msm5205_interface shdancbl_msm5205_interface =
185{
186   shdancbl_msm5205_callback,
187   MSM5205_S48_4B
188};
189
190static UINT8* shdancbl_soundbank_ptr = NULL;      /* Pointer to currently selected portion of ROM */
191
192static WRITE16_HANDLER( sound_command_irq_w )
193{
194   if( ACCESSING_BITS_0_7 )
195   {
196      soundlatch_w( space, 0, data&0xff );
197      cputag_set_input_line(space->machine, "soundcpu", 0, HOLD_LINE );
198   }
199}
200
201static READ8_HANDLER( shdancbl_soundbank_r )
202{
203   if(shdancbl_soundbank_ptr) return shdancbl_soundbank_ptr[offset & 0x3FFF];
204   return 0xFF;
205}
206
207static WRITE8_HANDLER( shdancbl_bankctrl_w )
208{
209   UINT8 *mem = memory_region(space->machine, "soundcpu");
210
211   switch(data)
212   {
213      case 0:
214         shdancbl_soundbank_ptr = &mem[0x18000]; /* IC45 8000-BFFF */
215         break;
216      case 1:
217         shdancbl_soundbank_ptr = &mem[0x1C000]; /* IC45 C000-FFFF */
218         break;
219      case 2:
220         shdancbl_soundbank_ptr = &mem[0x20000]; /* IC46 0000-3FFF */
221         break;
222      case 3:
223         shdancbl_soundbank_ptr = &mem[0x24000]; /* IC46 4000-7FFF */
224         break;
225      default:
226         shdancbl_soundbank_ptr = NULL;
227         logerror("Invalid bank setting %02X (%04X)\n", data, cpu_get_pc(space->cpu));
228         break;
229   }
230}
231
232static ADDRESS_MAP_START(shdancbl_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
233   AM_RANGE(0x0000, 0x7fff) AM_ROM
234   AM_RANGE(0x8000, 0xbfff) AM_READ(shdancbl_soundbank_r)
235   AM_RANGE(0xc000, 0xc00f) AM_WRITENOP
236   AM_RANGE(0xc400, 0xc400) AM_READ(soundlatch_r)
237   AM_RANGE(0xc800, 0xc800) AM_WRITE(shdancbl_msm5205_data_w)
238   AM_RANGE(0xcc00, 0xcc03) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
239   AM_RANGE(0xd000, 0xd003) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
240   AM_RANGE(0xd400, 0xd400) AM_WRITE(shdancbl_bankctrl_w)
241   AM_RANGE(0xdf00, 0xdfff) AM_NOP
242   AM_RANGE(0xe000, 0xffff) AM_RAM
243ADDRESS_MAP_END
244
245static ADDRESS_MAP_START( shdancbl_sound_io_map, ADDRESS_SPACE_IO, 8 )
246   ADDRESS_MAP_GLOBAL_MASK(0xff)
247   AM_RANGE(0xa0, 0xbf) AM_WRITENOP
248   AM_RANGE(0xc0, 0xdf) AM_READNOP
249ADDRESS_MAP_END
250
251/***************************************************************************/
252
253static UINT8 *sys18_SoundMemBank;
254
255static READ8_HANDLER( system18_bank_r )
256{
257   if(sys18_SoundMemBank)
258      return sys18_SoundMemBank[offset];
259   return 0xFF;
260}
261
262static ADDRESS_MAP_START( sound_18_map, ADDRESS_SPACE_PROGRAM, 8 )
263   AM_RANGE(0x0000, 0x9fff) AM_ROM
264   AM_RANGE(0xa000, 0xbfff) AM_READ(system18_bank_r)
265   /**** D/A register ****/
266   AM_RANGE(0xc000, 0xc008) AM_DEVWRITE("5c68", rf5c68_w)
267   AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("5c68", rf5c68_mem_r, rf5c68_mem_w)
268   AM_RANGE(0xe000, 0xffff) AM_RAM   //??
269ADDRESS_MAP_END
270
271
272static WRITE8_HANDLER( sys18_soundbank_w )
273{
274   UINT8 *mem = memory_region(space->machine, "soundcpu");
275   int rom = (data >> 6) & 3;
276   int bank = (data & 0x3f);
277   int mask = sys18_sound_info[rom*2+0];
278   int offs = sys18_sound_info[rom*2+1];
279   if(mask) sys18_SoundMemBank = &mem[0x10000 + offs + ((bank & mask) << 13)];
280   else sys18_SoundMemBank = NULL;
281}
282
283static ADDRESS_MAP_START( sound_18_io_map, ADDRESS_SPACE_IO, 8 )
284   ADDRESS_MAP_GLOBAL_MASK(0xff)
285   AM_RANGE(0x80, 0x83) AM_DEVREADWRITE("3438.0", ym3438_r, ym3438_w)
286   AM_RANGE(0x90, 0x93) AM_DEVREADWRITE("3438.1", ym3438_r, ym3438_w)
287   AM_RANGE(0xa0, 0xa0) AM_WRITE(sys18_soundbank_w)
288   AM_RANGE(0xc0, 0xc0) AM_READ(soundlatch_r)
289ADDRESS_MAP_END
290
291static WRITE16_HANDLER( sound_command_nmi_w )
292{
293   if( ACCESSING_BITS_0_7 )
294   {
295      soundlatch_w( space, 0, data & 0xff );
296      cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
297   }
298}
299
300/***************************************************************************/
301
302/*
303    315-5313 Video Display Processor (VDP) emulation
304*/
305
306static struct {
307   UINT16 vram[0x8000], read_buffer;
308   UINT16 cram[0x40];
309   UINT16 vsram[0x40];
310   UINT8 reg[0x20];
311   int pending, code, addr, addr_latch;
312} vdp;
313
314static WRITE16_HANDLER( vdp_w )
315{
316   switch(offset)
317   {
318      case 0: /* Data port */
319      case 1: /* Data port */
320         vdp.pending = 0;
321         switch(vdp.code & 0x0F)
322         {
323            case 1: /* VRAM */
324               vdp.vram[(vdp.addr >> 1) & 0x7FFF] = data;
325               break;
326            case 3: /* CRAM */
327               vdp.cram[(vdp.addr >> 1) & 0x3F] = data;
328               break;
329            case 5: /* VSRAM */
330               vdp.vsram[(vdp.addr >> 1) & 0x3F] = data;
331               break;
332         }
333         vdp.addr = (vdp.addr + vdp.reg[0x0F]) & 0xFFFF;
334         break;
335
336      case 2: /* Control port */
337      case 3: /* Control port */
338         if(vdp.pending == 0)
339         {
340            if((data & 0xC000) == 0x8000)
341            {
342               int d = (data >> 0) & 0xFF;
343               int r = (data >> 8) & 0x1F;
344               vdp.reg[r] = d;
345            }
346            else
347            {
348               vdp.pending = 1;
349               vdp.code = (vdp.code & 0x3C) | ((data >> 14) & 3);
350               vdp.addr = (vdp.addr_latch & 0xC000) | (data & 0x3FFF);
351            }
352         }
353         else
354         {
355            vdp.pending = 0;
356            vdp.code = (vdp.code & 0x03) | ((data >> 2) & 0x3C);
357            vdp.addr = (vdp.addr & 0x3FFF) | ((data & 3) << 14);
358            vdp.addr_latch = vdp.addr & 0xC000;
359
360            // Read-ahead for VRAM
361            if(vdp.code == 0)
362            {
363               vdp.read_buffer = vdp.vram[(vdp.addr >> 1) & 0x7FFF];
364               vdp.addr = (vdp.addr + vdp.reg[0x0F]) & 0xFFFF;
365            }
366
367            // Check for DMA request
368            if((vdp.reg[1] & 0x20) && (vdp.code & 0x20))
369            {
370               logerror("vdp: DMA disabled in this system.\n");
371            }
372         }
373         break;
374
375      default: /* Unused */
376         logerror("vdp: write %04X to %08X\n", data, offset);
377         break;
378   }
379}
380
381static READ16_HANDLER( vdp_r )
382{
383   UINT16 temp = -1;
384
385   vdp.pending = 0;
386
387   switch(offset)
388   {
389      case 0: /* Data port */
390      case 1: /* Data port */
391         switch(vdp.code & 0x0F)
392         {
393            case 0: /* VRAM */
394               temp = vdp.read_buffer;
395               vdp.read_buffer = vdp.vram[(vdp.addr >> 1) & 0x7FFF];
396               break;
397
398            case 4: /* VSRAM */
399               temp = vdp.vsram[(vdp.addr >> 1) & 0x3F];
400               break;
401
402            case 8: /* CRAM */
403               temp = vdp.cram[(vdp.addr >> 1) & 0x3F];
404               break;
405         }
406         vdp.addr = (vdp.addr + vdp.reg[0x0F]) & 0xFFFF;
407         break;
408
409      case 2: /* Control port */
410      case 3: /* Control port */
411
412         /* VRAM write FIFO is always empty */
413         temp = 0x0200;
414
415         /* Having screen turned off forces V-Blank flag to be set */
416         if((vdp.reg[1] & 0x40) == 0)
417            temp |= 0x80;
418
419         break;
420   }
421
422   return temp;
423}
424
425/***************************************************************************/
426
427/*
428    315-5296 I/O chip emulation
429*/
430
431static int io_reg[0x10];
432
433static READ16_HANDLER( sys18_io_r )
434{
435   if(ACCESSING_BITS_0_7)
436   {
437      switch(offset & 0x3000/2)
438      {
439         case 0x0000/2: /* I/O chip internal locations */
440         case 0x1000/2: /* I/O chip internal locations (mirror) */
441            switch(offset & 0x1F)
442            {
443               case 0x00: /* Port A - 1P controls */
444                  if(io_reg[0x0F] & 0x01)
445                     return io_reg[0x00];
446                  else
447                     return input_port_read(space->machine, "P1");
448                  break;
449
450               case 0x01: /* Port B - 2P controls */
451                  if(io_reg[0x0F] & 0x02)
452                     return io_reg[0x01];
453                  else
454                     return input_port_read(space->machine, "P2");
455                  break;
456
457               case 0x02: /* Port C - Bidirectional I/O port */
458                  if(io_reg[0x0F] & 0x04)
459                     return io_reg[0x02];
460                  else
461                     return -1;
462                  break;
463
464               case 0x03: /* Port D - Miscellaneous outputs */
465                  if(io_reg[0x0F] & 0x08)
466                     return io_reg[0x03];
467                  else
468                     return -1;
469                  break;
470
471               case 0x04: /* Port E - Service / Coin inputs */
472                  if(io_reg[0x0F] & 0x10)
473                     return io_reg[0x04];
474                  else
475                     return input_port_read(space->machine, "SERVICE");
476                  break;
477
478               case 0x05: /* Port F - DIP switch #1 */
479                  if(io_reg[0x0F] & 0x20)
480                     return io_reg[0x05];
481                  else
482                     return input_port_read(space->machine, "DSW1");
483                  break;
484
485               case 0x06: /* Port G - DIP switch #2 */
486                  if(io_reg[0x0F] & 0x40)
487                     return io_reg[0x06];
488                  else
489                     return input_port_read(space->machine, "P3");
490                  break;
491
492               case 0x07: /* Port H - Tile banking control */
493                  if(io_reg[0x0F] & 0x80)
494                     return io_reg[0x07];
495                  else
496                     return -1;
497                  break;
498
499               case 0x08: /* Protection #1 */
500                  return 'S';
501               case 0x09: /* Protection #2 */
502                  return 'E';
503               case 0x0A: /* Protection #3 */
504                  return 'G';
505               case 0x0B: /* Protection #4 */
506                  return 'A';
507
508               case 0x0C: /* CNT2-0 pin output control (mirror) */
509               case 0x0E: /* CNT2-0 pin output control */
510                  return io_reg[0x0E];
511
512               case 0x0D: /* Port direction control (mirror) */
513               case 0x0F: /* Port direction control */
514                  return io_reg[0x0F];
515            }
516            return -1;
517
518         case 0x2000/2: /* Unused */
519            logerror("read video control latch %06X (%06X)\n", offset, cpu_get_pc(space->cpu));
520            return -1;
521
522         case 0x3000/2: /* Expansion connector */
523            logerror("read expansion area %06X (%06X)\n", offset, cpu_get_pc(space->cpu));
524            return -1;
525      }
526   }
527
528   return -1;
529}
530
531static WRITE16_HANDLER( sys18_io_w )
532{
533   if(ACCESSING_BITS_0_7)
534   {
535      switch(offset & 0x3000/2)
536      {
537         case 0x0000/2: /* I/O chip internal locations */
538         case 0x1000/2: /* I/O chip internal locations (mirror) */
539            switch(offset & 0x1F)
540            {
541               case 0x00: /* Port A - 1P controls */
542                  io_reg[0x00] = data;
543                  break;
544
545               case 0x01: /* Port B - 2P controls */
546                  io_reg[0x01] = data;
547                  break;
548
549               case 0x02: /* Port C - Bidirectional I/O port */
550                  io_reg[0x02] = data;
551                  break;
552
553               case 0x03: /* Port D - Miscellaneous outputs */
554                  io_reg[0x03] = data;
555                  coin_lockout_w(1, data & 8);
556                  coin_lockout_w(0, data & 4);
557                  coin_counter_w(1, data & 2);
558                  coin_counter_w(0, data & 1);
559                  break;
560
561               case 0x04: /* Port E - Service / Coin inputs */
562                  io_reg[0x04] = data;
563                  break;
564
565               case 0x05: /* Port F - DIP switch #1 */
566                  io_reg[0x05] = data;
567                  break;
568
569               case 0x06: /* Port G - DIP switch #2 */
570                  io_reg[0x06] = data;
571                  break;
572
573               case 0x07: /* Port H - Tile banking control */
574                  io_reg[0x07] = data;
575                  sys16_tile_bank0 = (data >> 0) & 0x0F;
576                  sys16_tile_bank1 = (data >> 4) & 0x0F;
577                  break;
578
579               case 0x0E: /* CNT2-0 pin output control */
580                  io_reg[0x0E] = data;
581                  sys16_refreshenable = data & 0x02;
582                  break;
583
584               case 0x0F: /* Port direction control */
585                  io_reg[0x0F] = data;
586                  break;
587            }
588            break;
589
590         case 0x2000/2: /* Video control latch */
591            logerror("write video control latch %06X = %04X (%06X)\n", offset, data, cpu_get_pc(space->cpu));
592            break;
593
594         case 0x3000/2: /* Expansion connector */
595//              logerror("write expansion area %06X = %04X (%06X)\n", offset, data, cpu_get_pc(space->cpu));
596            break;
597      }
598   }
599}
600
601
602/***************************************************************************/
603/*
604    Shadow Dancer (Bootleg)
605
606    This seems to be a modified version of shdancer. It has no warning screen, displays English text during the
607    attract sequence, and has a 2P input test. The 'Sega' copyright text was changed to 'Datsu', and their
608    logo is missing.
609
610    Access to the configuration registers, I/O chip, and VDP are done even though it's likely none of this hardware
611    exists in the bootleg. For example:
612
613    - Most I/O port access has been redirected to new addresses.
614    - Z80 sound command has been redirected to a new address.
615    - The tilebank routine which saves the bank value in VDP VRAM has a form of protection has been modified to store
616      the tilebank value directly to $E4001F.
617    - Implementing screen blanking control via $E4001D leaves the screen blanked at the wrong times (after coin-up).
618
619    This is probably due to unmodified parts of the original code accessing these components, which would be ignored
620    on the bootleg hardware. Both the I/O chip and VDP are supported in this driver, just as I don't know for certain
621    how much of either are present on the real board.
622
623    Bootleg specific addresses:
624
625    C40001 = DIP switch #1
626    C40003 = DIP switch #2
627    C40007 = Z80 sound command
628    C41001 = Service input
629    C41003 = Player 1 input
630    C41005 = Player 2 input
631    C44000 = Has 'clr.w' done after setting tile bank in $E4000F.
632    C460xx = Extra video hardware controls
633
634    Here are the I/O chip addresses accessed:
635
636    E40001 = Player 1
637    E40007 = Miscellaneous outputs (coin control, etc.)
638    E4000F = Tile bank
639    E4001D = CNT2-0 pin output state
640    E4001F = I/O chip port direction
641*/
642/***************************************************************************/
643
644static ADDRESS_MAP_START( shdancbl_map, ADDRESS_SPACE_PROGRAM, 16 )
645   AM_RANGE(0x000000, 0x07ffff) AM_ROM
646   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
647   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
648   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
649   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
650   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(vdp_r, vdp_w)
651   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
652   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
653   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_irq_w)
654   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
655   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
656   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
657   AM_RANGE(0xc44000, 0xc44001) AM_WRITENOP // only used via clr.w after tilebank set
658   AM_RANGE(0xc46000, 0xc46fff) AM_WRITENOP // bootleg specific video hardware
659   AM_RANGE(0xe4001c, 0xe4001d) AM_WRITENOP // to prevent access to screen blanking control below
660   AM_RANGE(0xe40000, 0xe4ffff) AM_READWRITE(sys18_io_r, sys18_io_w)
661   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
662   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
663ADDRESS_MAP_END
664
665/***************************************************************************/
666
667static void shdancbl_update_proc( void )
668{
669   sys16_fg_scrollx = sys16_textram[0x0e98/2];
670   sys16_bg_scrollx = sys16_textram[0x0e9a/2];
671   sys16_fg_scrolly = sys16_textram[0x0e90/2];
672   sys16_bg_scrolly = sys16_textram[0x0e92/2];
673
674   set_fg_page( sys16_textram[0x0e80/2] );
675   set_bg_page( sys16_textram[0x0e82/2] );
676
677   sys16_fg2_scrollx = sys16_textram[0x0e9c/2];
678   sys16_bg2_scrollx = sys16_textram[0x0e9e/2];
679   sys16_fg2_scrolly = sys16_textram[0x0e94/2];
680   sys16_bg2_scrolly = sys16_textram[0x0e96/2];
681
682   set_fg2_page( sys16_textram[0x0e84/2] );
683   set_bg2_page( sys16_textram[0x0e82/2] );
684
685   sys18_bg2_active=0;
686   sys18_fg2_active=0;
687
688   if(sys16_fg2_scrollx | sys16_fg2_scrolly | sys16_textram[0x0e84/2])
689      sys18_fg2_active=1;
690   if(sys16_bg2_scrollx | sys16_bg2_scrolly | sys16_textram[0x0e86/2])
691      sys18_bg2_active=1;
692}
693
694static MACHINE_RESET( shdancbl )
695{
696   sys16_sprxoffset = -0xbc+0x77;
697   sys16_update_proc = shdancbl_update_proc;
698}
699
700static READ16_HANDLER( shdancbl_skip_r )
701{
702   if (cpu_get_pc(space->cpu)==0x2f76) {cpu_spinuntil_int(space->cpu); return 0xffff;}
703   return sys16_workingram[0];
704}
705
706static DRIVER_INIT( shdancbl )
707{
708   int i;
709   UINT8 *mem;
710
711   /* Invert tile ROM data*/
712   mem = memory_region(machine, "gfx1");
713   for(i = 0; i < 0xc0000; i++)
714      mem[i] ^= 0xFF;
715
716   MACHINE_RESET_CALL(sys16_onetime);
717   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xffc000, 0xffc001, 0, 0, shdancbl_skip_r );
718
719   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
720   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
721   sys16_MaxShadowColors=0;
722
723   /* Copy first 32K of IC45 to Z80 address space */
724   mem = memory_region(machine, "soundcpu");
725   memcpy(mem, mem+0x10000, 0x8000);
726}
727
728/***************************************************************************/
729/*
730    Moonwalker (Bootleg)
731*/
732/***************************************************************************/
733
734static ADDRESS_MAP_START( mwalkbl_map, ADDRESS_SPACE_PROGRAM, 16 )
735   AM_RANGE(0x000000, 0x07ffff) AM_ROM
736   AM_RANGE(0x400000, 0x40ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
737   AM_RANGE(0x410000, 0x410fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
738   AM_RANGE(0x440000, 0x440fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
739   AM_RANGE(0x840000, 0x840fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
740   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(vdp_r, vdp_w)
741   AM_RANGE(0xc40000, 0xc40001) AM_READ_PORT("COINAGE")
742   AM_RANGE(0xc40002, 0xc40003) AM_READ_PORT("DSW1")
743   AM_RANGE(0xc40006, 0xc40007) AM_WRITE(sound_command_nmi_w)
744   AM_RANGE(0xc41000, 0xc41001) AM_READ_PORT("SERVICE")
745   AM_RANGE(0xc41002, 0xc41003) AM_READ_PORT("P1")
746   AM_RANGE(0xc41004, 0xc41005) AM_READ_PORT("P2")
747   AM_RANGE(0xc41006, 0xc41007) AM_READ_PORT("P3")
748   AM_RANGE(0xc41008, 0xc41009) AM_READNOP // figure this out, extra input for 3p?
749   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
750   AM_RANGE(0xc46800, 0xc46801) AM_WRITE(sys18_tilebank_w)
751   AM_RANGE(0xe40000, 0xe4ffff) AM_READWRITE(SYS16_MRA16_EXTRAM2, SYS16_MWA16_EXTRAM2) AM_BASE(&sys16_extraram2)
752   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP // config regs
753   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
754ADDRESS_MAP_END
755
756/***************************************************************************/
757
758static void mwalkbl_update_proc( void )
759{
760   sys16_fg_scrollx = sys16_textram[0x0e98/2];
761   sys16_bg_scrollx = sys16_textram[0x0e9a/2];
762   sys16_fg_scrolly = sys16_textram[0x0e90/2];
763   sys16_bg_scrolly = sys16_textram[0x0e92/2];
764
765   set_fg_page( sys16_textram[0x0e80/2] );
766   set_bg_page( sys16_textram[0x0e82/2] );
767
768   sys16_fg2_scrollx = sys16_textram[0x0e9c/2];
769   sys16_bg2_scrollx = sys16_textram[0x0e9e/2];
770   sys16_fg2_scrolly = sys16_textram[0x0e94/2];
771   sys16_bg2_scrolly = sys16_textram[0x0e96/2];
772
773   set_fg2_page( sys16_textram[0x0e84/2] );
774   set_bg2_page( sys16_textram[0x0e86/2] );
775
776   if(sys16_fg2_scrollx | sys16_fg2_scrolly | sys16_textram[0x0e84/2])
777      sys18_fg2_active=1;
778   else
779      sys18_fg2_active=0;
780   if(sys16_bg2_scrollx | sys16_bg2_scrolly | sys16_textram[0x0e86/2])
781      sys18_bg2_active=1;
782   else
783      sys18_bg2_active=0;
784}
785
786static MACHINE_RESET( mwalkbl )
787{
788   static const sys16_patch patch[] =
789   {
790      { 0x70116, 0x4e },
791      { 0x70117, 0x71 },
792
793      { 0x0314a, 0x46 },
794      { 0x0314b, 0x42 },
795      { 0x0311b, 0x3f },
796
797      { 0x70103, 0x00 },
798      { 0x70109, 0x00 },
799      { 0x07727, 0x00 },
800      { 0x07729, 0x00 },
801      { 0x0780d, 0x00 },
802      { 0x0780f, 0x00 },
803      { 0x07861, 0x00 },
804      { 0x07863, 0x00 },
805      { 0x07d47, 0x00 },
806      { 0x07863, 0x00 },
807      { 0x08533, 0x00 },
808      { 0x08535, 0x00 },
809      { 0x085bd, 0x00 },
810      { 0x085bf, 0x00 },
811      { 0x09a4b, 0x00 },
812      { 0x09a4d, 0x00 },
813      { 0x09b2f, 0x00 },
814      { 0x09b31, 0x00 },
815      { 0x0a05b, 0x00 },
816      { 0x0a05d, 0x00 },
817      { 0x0a23f, 0x00 },
818      { 0x0a241, 0x00 },
819      { 0x10159, 0x00 },
820      { 0x1015b, 0x00 },
821      { 0x109fb, 0x00 },
822      { 0x109fd, 0x00 },
823
824      // * SEGA mark
825      { 0x70212, 0x4e },
826      { 0x70213, 0x71 }
827   };
828
829   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
830   sys16_bg_priority_value=0x1000;
831   sys16_sprxoffset = -0x238;
832
833   sys16_update_proc = mwalkbl_update_proc;
834}
835
836static DRIVER_INIT( mwalkbl )
837{
838   UINT8 *RAM= memory_region(machine, "soundcpu");
839   static const int mwalk_sound_info[] =
840   {
841      0x0f, 0x00000, // ROM #1 = 128K
842      0x1f, 0x20000, // ROM #2 = 256K
843      0x1f, 0x60000, // ROM #3 = 256K
844      0x1f, 0xA0000  // ROM #4 = 256K
845   };
846
847   MACHINE_RESET_CALL(sys16_onetime);
848   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
849   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
850
851   memcpy(sys18_sound_info, mwalk_sound_info, sizeof(sys18_sound_info));
852   memcpy(RAM,&RAM[0x10000],0xa000);
853}
854
855/***************************************************************************/
856
857/* bootleg doesn't have real vdp or i/o */
858
859static ADDRESS_MAP_START( astormbl_map, ADDRESS_SPACE_PROGRAM, 16 )
860   AM_RANGE(0x000000, 0x07ffff) AM_ROM
861   AM_RANGE(0x100000, 0x10ffff) AM_READWRITE(SYS16_MRA16_TILERAM, SYS16_MWA16_TILERAM) AM_BASE(&sys16_tileram)
862   AM_RANGE(0x110000, 0x110fff) AM_READWRITE(SYS16_MRA16_TEXTRAM, SYS16_MWA16_TEXTRAM) AM_BASE(&sys16_textram)
863   AM_RANGE(0x140000, 0x140fff) AM_READWRITE(SYS16_MRA16_PALETTERAM, SYS16_MWA16_PALETTERAM) AM_BASE(&paletteram16)
864   AM_RANGE(0x200000, 0x200fff) AM_READWRITE(SYS16_MRA16_SPRITERAM, SYS16_MWA16_SPRITERAM) AM_BASE(&sys16_spriteram)
865   AM_RANGE(0xa00000, 0xa00001) AM_READ_PORT("COINAGE")
866   AM_RANGE(0xa00002, 0xa00003) AM_READ_PORT("DSW1")
867   AM_RANGE(0xa00006, 0xa00007) AM_WRITE(sound_command_nmi_w)
868   AM_RANGE(0xa0000e, 0xa0000f) AM_WRITE(sys18_tilebank_w)
869   AM_RANGE(0xa01000, 0xa01001) AM_READ_PORT("SERVICE")
870   AM_RANGE(0xa01002, 0xa01003) AM_READ_PORT("P1")
871   AM_RANGE(0xa01004, 0xa01005) AM_READ_PORT("P2")
872   AM_RANGE(0xa01006, 0xa01007) AM_READ_PORT("P3")
873   AM_RANGE(0xc00000, 0xc0ffff) AM_READWRITE(vdp_r, vdp_w)
874   AM_RANGE(0xc46600, 0xc46601) AM_WRITE(sys18_refreshenable_w)
875   AM_RANGE(0xfe0020, 0xfe003f) AM_WRITENOP
876   AM_RANGE(0xffc000, 0xffffff) AM_READWRITE(SYS16_MRA16_WORKINGRAM, SYS16_MWA16_WORKINGRAM) AM_BASE(&sys16_workingram)
877ADDRESS_MAP_END
878
879
880/***************************************************************************/
881
882static void astormbl_update_proc( void )
883{
884   UINT16 data;
885   sys16_fg_scrollx = sys16_textram[0x0e98/2];
886   sys16_bg_scrollx = sys16_textram[0x0e9a/2];
887   sys16_fg_scrolly = sys16_textram[0x0e90/2];
888   sys16_bg_scrolly = sys16_textram[0x0e92/2];
889
890   data = sys16_textram[0x0e80/2];
891   sys16_fg_page[1] = data>>12;
892   sys16_fg_page[3] = (data>>8)&0xf;
893   sys16_fg_page[0] = (data>>4)&0xf;
894   sys16_fg_page[2] = data&0xf;
895
896   data = sys16_textram[0x0e82/2];
897   sys16_bg_page[1] = data>>12;
898   sys16_bg_page[3] = (data>>8)&0xf;
899   sys16_bg_page[0] = (data>>4)&0xf;
900   sys16_bg_page[2] = data&0xf;
901
902   sys16_fg2_scrollx = sys16_textram[0x0e9c/2];
903   sys16_bg2_scrollx = sys16_textram[0x0e9e/2];
904   sys16_fg2_scrolly = sys16_textram[0x0e94/2];
905   sys16_bg2_scrolly = sys16_textram[0x0e96/2];
906
907   data = sys16_textram[0x0e84/2];
908   sys16_fg2_page[1] = data>>12;
909   sys16_fg2_page[3] = (data>>8)&0xf;
910   sys16_fg2_page[0] = (data>>4)&0xf;
911   sys16_fg2_page[2] = data&0xf;
912
913   data = sys16_textram[0x0e86/2];
914   sys16_bg2_page[1] = data>>12;
915   sys16_bg2_page[3] = (data>>8)&0xf;
916   sys16_bg2_page[0] = (data>>4)&0xf;
917   sys16_bg2_page[2] = data&0xf;
918
919// enable regs
920   if(sys16_fg2_scrollx | sys16_fg2_scrolly | sys16_textram[0x0e84/2])
921      sys18_fg2_active=1;
922   else
923      sys18_fg2_active=0;
924   if(sys16_bg2_scrollx | sys16_bg2_scrolly | sys16_textram[0x0e86/2])
925      sys18_bg2_active=1;
926   else
927      sys18_bg2_active=0;
928}
929
930static MACHINE_RESET( astormbl )
931{
932   static const sys16_patch patch[] =
933   {
934      { 0x02D6E, 0x32 },
935      { 0x02D6F, 0x3c },
936      { 0x02D70, 0x80 },
937      { 0x02D71, 0x00 },
938      { 0x02D72, 0x33 },
939      { 0x02D73, 0xc1 },
940      { 0x02ea2, 0x30 },
941      { 0x02ea3, 0x38 },
942      { 0x02ea4, 0xec },
943      { 0x02ea5, 0xf6 },
944      { 0x02ea6, 0x30 },
945      { 0x02ea7, 0x80 },
946      { 0x02e5c, 0x30 },
947      { 0x02e5d, 0x38 },
948      { 0x02e5e, 0xec },
949      { 0x02e5f, 0xe2 },
950      { 0x02e60, 0xc0 },
951      { 0x02e61, 0x7c },
952
953      { 0x04cd8, 0x02 },
954      { 0x04cec, 0x03 },
955      { 0x2dc6c, 0xe9 },
956      { 0x2dc64, 0x10 },
957      { 0x2dc65, 0x10 },
958      { 0x3a100, 0x10 },
959      { 0x3a101, 0x13 },
960      { 0x3a102, 0x90 },
961      { 0x3a103, 0x2b },
962      { 0x3a104, 0x00 },
963      { 0x3a105, 0x01 },
964      { 0x3a106, 0x0c },
965      { 0x3a107, 0x00 },
966      { 0x3a108, 0x00 },
967      { 0x3a109, 0x01 },
968      { 0x3a10a, 0x66 },
969      { 0x3a10b, 0x06 },
970      { 0x3a10c, 0x42 },
971      { 0x3a10d, 0x40 },
972      { 0x3a10e, 0x54 },
973      { 0x3a10f, 0x8b },
974      { 0x3a110, 0x60 },
975      { 0x3a111, 0x02 },
976      { 0x3a112, 0x30 },
977      { 0x3a113, 0x1b },
978      { 0x3a114, 0x34 },
979      { 0x3a115, 0xc0 },
980      { 0x3a116, 0x34 },
981      { 0x3a117, 0xdb },
982      { 0x3a118, 0x24 },
983      { 0x3a119, 0xdb },
984      { 0x3a11a, 0x24 },
985      { 0x3a11b, 0xdb },
986      { 0x3a11c, 0x4e },
987      { 0x3a11d, 0x75 },
988      { 0x0af8e, 0x66 },
989
990      /* fix missing credit text */
991      { 0x03f9a, 0xec },
992      { 0x03f9b, 0x36 }
993   };
994
995   sys16_patch_code(machine, patch, ARRAY_LENGTH(patch));
996   sys16_fgxoffset = sys16_bgxoffset = -9;
997   sys16_update_proc = astormbl_update_proc;
998}
999
1000
1001static DRIVER_INIT( astormbl )
1002{
1003   UINT8 *RAM= memory_region(machine, "soundcpu");
1004   static const int astormbl_sound_info[] =
1005   {
1006      0x0f, 0x00000, // ROM #1 = 128K
1007      0x1f, 0x20000, // ROM #2 = 256K
1008      0x1f, 0x60000, // ROM #3 = 256K
1009      0x1f, 0xA0000  // ROM #4 = 256K
1010   };
1011
1012   MACHINE_RESET_CALL(sys16_onetime);
1013   sys18_splittab_fg_x=&sys16_textram[0x0f80/2];
1014   sys18_splittab_bg_x=&sys16_textram[0x0fc0/2];
1015   sys16_MaxShadowColors = 0; // doesn't seem to use transparent shadows
1016
1017   memcpy(sys18_sound_info, astormbl_sound_info, sizeof(sys18_sound_info));
1018   memcpy(RAM,&RAM[0x10000],0xa000);
1019}
1020
1021
1022/*****************************************************************************/
1023
1024static MACHINE_DRIVER_START( system18 )
1025
1026   /* basic machine hardware */
1027   MDRV_CPU_ADD("maincpu", M68000, 10000000)
1028   MDRV_CPU_VBLANK_INT("screen", irq4_line_hold)
1029
1030   MDRV_CPU_ADD("soundcpu", Z80, 8000000)
1031   MDRV_CPU_PROGRAM_MAP(sound_18_map)
1032   MDRV_CPU_IO_MAP(sound_18_io_map)
1033
1034   /* video hardware */
1035   MDRV_SCREEN_ADD("screen", RASTER)
1036   MDRV_SCREEN_REFRESH_RATE(60)
1037   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
1038   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
1039   MDRV_SCREEN_SIZE(40*8, 28*8)
1040   MDRV_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 28*8-1)
1041
1042   MDRV_GFXDECODE(sys16)
1043   MDRV_PALETTE_LENGTH((2048+2048)*ShadowColorsMultiplier) // 64 extra colours for vdp (but we use 2048 so shadow mask works)
1044
1045   MDRV_VIDEO_START(system18old)
1046   MDRV_VIDEO_UPDATE(system18old)
1047
1048   /* sound hardware */
1049   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
1050
1051   MDRV_SOUND_ADD("3438.0", YM3438, 8000000)
1052   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
1053   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
1054   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
1055   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
1056
1057   MDRV_SOUND_ADD("3438.1", YM3438, 8000000)
1058   MDRV_SOUND_ROUTE(0, "lspeaker", 0.40)
1059   MDRV_SOUND_ROUTE(1, "rspeaker", 0.40)
1060   MDRV_SOUND_ROUTE(2, "lspeaker", 0.40)
1061   MDRV_SOUND_ROUTE(3, "rspeaker", 0.40)
1062
1063   MDRV_SOUND_ADD("5c68", RF5C68, 8000000)
1064   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
1065   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
1066MACHINE_DRIVER_END
1067
1068
1069static MACHINE_DRIVER_START( astormbl )
1070
1071   /* basic machine hardware */
1072   MDRV_IMPORT_FROM(system18)
1073   MDRV_CPU_MODIFY("maincpu")
1074   MDRV_CPU_PROGRAM_MAP(astormbl_map)
1075
1076   MDRV_MACHINE_RESET(astormbl)
1077MACHINE_DRIVER_END
1078
1079
1080static MACHINE_DRIVER_START( mwalkbl )
1081
1082   /* basic machine hardware */
1083   MDRV_IMPORT_FROM(system18)
1084   MDRV_CPU_MODIFY("maincpu")
1085   MDRV_CPU_PROGRAM_MAP(mwalkbl_map)
1086
1087   MDRV_MACHINE_RESET(mwalkbl)
1088MACHINE_DRIVER_END
1089
1090
1091static MACHINE_DRIVER_START( shdancbl )
1092
1093   /* basic machine hardware */
1094   MDRV_IMPORT_FROM(system18)
1095   MDRV_CPU_MODIFY("maincpu")
1096   MDRV_CPU_PROGRAM_MAP(shdancbl_map)
1097
1098   MDRV_CPU_MODIFY("soundcpu")
1099   MDRV_CPU_PROGRAM_MAP(shdancbl_sound_map)
1100   MDRV_CPU_IO_MAP(shdancbl_sound_io_map)
1101   MDRV_SOUND_REMOVE("5c68")
1102
1103   MDRV_SOUND_ADD("5205", MSM5205, 200000)
1104   MDRV_SOUND_CONFIG(shdancbl_msm5205_interface)
1105   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.80)
1106   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.80)
1107
1108   MDRV_MACHINE_RESET(shdancbl)
1109MACHINE_DRIVER_END
1110
1111
1112/***************************************************************************/
1113
1114static INPUT_PORTS_START( astormbl )
1115   PORT_START("P1")   /* player 1 */
1116   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
1117   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
1118   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 )
1119   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1120   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
1121   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
1122   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
1123   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1124
1125   PORT_START("P2")   /* player 2 */
1126   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
1127   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
1128   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
1129   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1130   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
1131   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
1132   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
1133   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
1134
1135   PORT_START("SERVICE")
1136   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN3 )
1137   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1138   PORT_SERVICE_NO_TOGGLE(0x04, IP_ACTIVE_LOW)
1139   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
1140   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
1141   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
1142   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START3 )
1143   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
1144
1145   PORT_START("COINAGE")
1146   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
1147   PORT_DIPSETTING(    0x07, DEF_STR( 4C_1C ) )
1148   PORT_DIPSETTING(    0x08, DEF_STR( 3C_1C ) )
1149   PORT_DIPSETTING(    0x09, DEF_STR( 2C_1C ) )
1150   PORT_DIPSETTING(    0x05, "2 Coins/1 Credit 5/3 6/4" )
1151   PORT_DIPSETTING(    0x04, "2 Coins/1 Credit 4/3" )
1152   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
1153   PORT_DIPSETTING(    0x01, "1 Coin/1 Credit 2/3" )
1154   PORT_DIPSETTING(    0x02, "1 Coin/1 Credit 4/5" )
1155   PORT_DIPSETTING(    0x03, "1 Coin/1 Credit 5/6" )
1156   PORT_DIPSETTING(    0x06, DEF_STR( 2C_3C ) )
1157   PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
1158   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
1159   PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
1160   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
1161   PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
1162   PORT_DIPSETTING(    0x00, "Free Play (if Coin B too) or 1/1" )
1163   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
1164   PORT_DIPSETTING(    0x70, DEF_STR( 4C_1C ) )
1165   PORT_DIPSETTING(    0x80, DEF_STR( 3C_1C ) )
1166   PORT_DIPSETTING(    0x90, DEF_STR( 2C_1C ) )
1167   PORT_DIPSETTING(    0x50, "2 Coins/1 Credit 5/3 6/4" )
1168   PORT_DIPSETTING(    0x40, "2 Coins/1 Credit 4/3" )
1169   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
1170   PORT_DIPSETTING(    0x10, "1 Coin/1 Credit 2/3" )
1171   PORT_DIPSETTING(    0x20, "1 Coin/1 Credit 4/5" )
1172   PORT_DIPSETTING(    0x30, "1 Coin/1 Credit 5/6" )
1173   PORT_DIPSETTING(    0x60, DEF_STR( 2C_3C ) )
1174   PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
1175   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
1176   PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
1177   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
1178   PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
1179   PORT_DIPSETTING(    0x00, "Free Play (if Coin A too) or 1/1" )
1180
1181   PORT_START("DSW1")   /* DSW1 */
1182   PORT_DIPNAME( 0x01, 0x01, "2 Credits to Start" )
1183   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
1184   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1185   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
1186   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
1187   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1188   PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Difficulty ) )
1189   PORT_DIPSETTING(    0x04, DEF_STR( Easiest ) )
1190   PORT_DIPSETTING(    0x08, DEF_STR( Easier ) )
1191   PORT_DIPSETTING(    0x0c, DEF_STR( Easy ) )
1192   PORT_DIPSETTING(    0x1c, DEF_STR( Normal ) )
1193   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )
1194   PORT_DIPSETTING(    0x14, DEF_STR( Harder ) )
1195   PORT_DIPSETTING(    0x18, DEF_STR( Hardest ) )
1196   PORT_DIPSETTING(    0x00, "Special" )
1197   PORT_DIPNAME( 0x20, 0x20, "Coin Chutes" )
1198   PORT_DIPSETTING(    0x20, "3" )
1199   PORT_DIPSETTING(    0x00, "1" )
1200   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
1201   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
1202   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1203   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
1204   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
1205   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1206
1207   PORT_START("P3")   /* player 3 */
1208   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
1209   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
1210   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(3)
1211   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
1212   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
1213   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
1214   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
1215   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
1216INPUT_PORTS_END
1217
1218static INPUT_PORTS_START( mwalkbl )
1219   PORT_INCLUDE( astormbl )
1220
1221   PORT_MODIFY("SERVICE")   /* service */
1222   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1223   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
1224   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
1225
1226   PORT_MODIFY("DSW1")   /* DSW1 */
1227   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Lives ) )
1228   PORT_DIPSETTING(    0x04, "2" )
1229   PORT_DIPSETTING(    0x00, "3" )
1230   PORT_DIPNAME( 0x08, 0x08, "Player Vitality" )
1231   PORT_DIPSETTING(    0x08, DEF_STR( Low ) )
1232   PORT_DIPSETTING(    0x00, DEF_STR( High ) )
1233   PORT_DIPNAME( 0x10, 0x00, "Play Mode" )
1234   PORT_DIPSETTING(    0x10, "2 Players" )
1235   PORT_DIPSETTING(    0x00, "3 Players" )
1236   PORT_DIPNAME( 0x20, 0x20, "Coin Mode" )
1237   PORT_DIPSETTING(    0x20, "Common" )
1238   PORT_DIPSETTING(    0x00, "Individual" )
1239   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
1240   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1241   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1242   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1243   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
1244
1245   PORT_MODIFY("P3")   /* player 3 */
1246   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
1247INPUT_PORTS_END
1248
1249/*****************************************************************************/
1250
1251ROM_START( astormbl )
1252   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
1253   ROM_LOAD16_BYTE( "astorm.a6", 0x000000, 0x40000, CRC(7682ed3e) SHA1(b857352ad9c66488e91f60989472638c483e4ae8) )
1254   ROM_LOAD16_BYTE( "astorm.a5", 0x000001, 0x40000, CRC(efe9711e) SHA1(496fd9e30941fde1658fab7292a669ef7964cecb) )
1255
1256   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
1257   ROM_LOAD( "epr13073.bin", 0x00000, 0x40000, CRC(df5d0a61) SHA1(79ad71de348f280bad847566c507b7a31f022292) )
1258   ROM_LOAD( "epr13074.bin", 0x40000, 0x40000, CRC(787afab8) SHA1(a119042bb2dad54e9733bfba4eaab0ac5fc0f9e7) )
1259   ROM_LOAD( "epr13075.bin", 0x80000, 0x40000, CRC(4e01b477) SHA1(4178ce4a87ea427c3b0195e64acef6cddfb3485f) )
1260
1261   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
1262   ROM_LOAD16_BYTE( "mpr13082.bin", 0x000001, 0x40000, CRC(a782b704) SHA1(ba15bdfbc267b8d86f03e5310ce60846ff846de3) )
1263   ROM_LOAD16_BYTE( "astorm.a11",   0x000000, 0x40000, CRC(7829c4f3) SHA1(3adb7aa7f70163d3848c98316e18b9783c41d663) )
1264   ROM_LOAD16_BYTE( "mpr13081.bin", 0x080001, 0x40000, CRC(eb510228) SHA1(4cd387b160ec7050e1300ebe708853742169e643) )
1265   ROM_LOAD16_BYTE( "mpr13088.bin", 0x080000, 0x40000, CRC(3b6b4c55) SHA1(970495c54b3e1893ee8060f6ca1338c2cbbd1074) )
1266   ROM_LOAD16_BYTE( "mpr13080.bin", 0x100001, 0x40000, CRC(e668eefb) SHA1(d4a087a238b4d3ac2d23fe148d6a73018e348a89) )
1267   ROM_LOAD16_BYTE( "mpr13087.bin", 0x100000, 0x40000, CRC(2293427d) SHA1(4fd07763ff060afd594e3f64fa4750577f56c80e) )
1268   ROM_LOAD16_BYTE( "epr13079.bin", 0x180001, 0x40000, CRC(de9221ed) SHA1(5e2e434d1aa547be1e5652fc906d2e18c5122023) )
1269   ROM_LOAD16_BYTE( "epr13086.bin", 0x180000, 0x40000, CRC(8c9a71c4) SHA1(40b774765ac888792aad46b6351a24b7ef40d2dc) )
1270
1271   ROM_REGION( 0x100000, "soundcpu", 0 ) /* sound CPU */
1272   ROM_LOAD( "epr13083.bin", 0x10000, 0x20000, CRC(5df3af20) SHA1(e49105fcfd5bf37d14bd760f6adca5ce2412883d) )
1273   ROM_LOAD( "epr13076.bin", 0x30000, 0x40000, CRC(94e6c76e) SHA1(f99e58a9bf372c41af211bd9b9ea3ac5b924c6ed) )
1274   ROM_LOAD( "epr13077.bin", 0x70000, 0x40000, CRC(e2ec0d8d) SHA1(225b0d223b7282cba7710300a877fb4a2c6dbabb) )
1275   ROM_LOAD( "epr13078.bin", 0xb0000, 0x40000, CRC(15684dc5) SHA1(595051006de24f791dae937584e502ff2fa31d9c) )
1276ROM_END
1277
1278/*
1279
1280CPUs:
1281on main board:
1282
12831x MC68000P10 (main)
12841x Z8400BB1-Z80BCPU (sound)
12851x OKI M6295 (sound)
12861x oscillator 24.000MHz (close to main)
12871x oscillator 8.000MHz (close to sound)
1288
1289ROMs
1290on main board:
1291
12929x M27C512 (1,2,3,4,5,6,7,8,10)
12931x TMS27C256 (9)
129421x NM27C010Q (11-31)
1295
1296----------------------
1297
1298on roms board:
12996x NM27C010Q (32-37)
13002x N82S123N
1301
1302*/
1303
1304ROM_START( astormb2 )
1305   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
1306   ROM_LOAD16_BYTE( "1.a4", 0x000000, 0x10000, CRC(cca0d0af) SHA1(26fdbbeb8444d05f0ca2056a7c7fb81b0f1f2b5a) )
1307   ROM_LOAD16_BYTE( "2.a3", 0x020000, 0x10000, CRC(f95eb883) SHA1(b25d9c0fd46a534e7612f4a3ffa708b73654ae2b) )
1308   ROM_LOAD16_BYTE( "3.a2", 0x040000, 0x10000, CRC(4206ecd4) SHA1(45c65d7727cfaf215a7081159f6931185e92b39a) ) // epr13182.bin [3/4]      IDENTICAL
1309   ROM_LOAD16_BYTE( "4.a1", 0x060000, 0x10000, CRC(23247c95) SHA1(e4d78c453d2cb77946dd1b5266de823968eade77) ) // epr13182.bin [4/4]      98.648071%
1310   ROM_LOAD16_BYTE( "5.a9", 0x000001, 0x10000, CRC(6143039e) SHA1(8a5143c1e2c637149e988c423fa30b31e29a1193) )
1311   ROM_LOAD16_BYTE( "6.a8", 0x020001, 0x10000, CRC(0fd17bec) SHA1(e9a5dd93394fdf1561a925e4111dfce51b717b14) )
1312   ROM_LOAD16_BYTE( "7.a7", 0x040001, 0x10000, CRC(c901e228) SHA1(f459ba819a4e5f5174ff1b3957fb648c93beed53) ) // epr13181.bin [3/4]      IDENTICAL
1313   ROM_LOAD16_BYTE( "8.a6", 0x060001, 0x10000, CRC(bfb9d607) SHA1(8c3e10c1397fa0807d8df4715c9eb1945c774924) ) // epr13181.bin [4/4]      98.587036%
1314
1315   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
1316   ROM_LOAD( "32.01",  0x00000, 0x20000, CRC(d2aeb4ab) SHA1(9338ec5dc48f5d2b20511628a281236fe4646ef4) ) // epr13073.bin [1/2]      IDENTICAL
1317   ROM_LOAD( "33.011", 0x20000, 0x20000, CRC(2193f0ae) SHA1(84070f74693699c1ffc1a47517a97b5d058d08ec) ) // epr13073.bin [2/2]      IDENTICAL
1318   ROM_LOAD( "34.02",  0x40000, 0x20000, CRC(849aa725) SHA1(0f949dfe8a6c5796edc86a05339da80a158a95ae) ) // epr13074.bin [1/2]      IDENTICAL
1319   ROM_LOAD( "35.021", 0x60000, 0x20000, CRC(3f190347) SHA1(131953ccefb95eeef1ea90499ce521c3749f95c1) ) // epr13074.bin [2/2]      IDENTICAL
1320   ROM_LOAD( "36.03",  0x80000, 0x20000, CRC(c0f9628d) SHA1(aeacf5e409adfa0b9c28c90d4e89eb1f56cd5f4d) ) // epr13075.bin [1/2]      IDENTICAL
1321   ROM_LOAD( "37.031", 0xa0000, 0x20000, CRC(95af904e) SHA1(6574fa874c355c368109b417aab7d0b05c9d215d) ) // epr13075.bin [2/2]      IDENTICAL
1322
1323   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
1324   ROM_LOAD16_BYTE( "17.042", 0x000001, 0x20000, CRC(db08beb5) SHA1(c154d22c69b77637d6a9d0f2bffcfb47e6901ec8) ) // mpr13082.bin [1/2]      IDENTICAL
1325   ROM_LOAD16_BYTE( "16.043", 0x040001, 0x20000, CRC(41f78977) SHA1(9cf9fcf96722d148c4b2cf7aa33425b6efcd0379) ) // mpr13082.bin [2/2]      IDENTICAL
1326   ROM_LOAD16_BYTE( "29.012", 0x000000, 0x20000, CRC(22acf675) SHA1(80fd0d96017bf36d964a79f7e13e73fee7ed370a) ) // mpr13089.bin [1/2]      99.941254%
1327   ROM_LOAD16_BYTE( "28.013", 0x040000, 0x20000, CRC(32b37a3a) SHA1(70f268aa99a17739fd9d832b5f1d9e37247747e6) ) // mpr13089.bin [2/2]      IDENTICAL
1328    ROM_LOAD16_BYTE( "19.040", 0x080001, 0x20000, CRC(10c359ac) SHA1(9087cb824242ce5fc8eba45b61cca8b329c576e5) ) // mpr13081.bin [1/2]      IDENTICAL
1329   ROM_LOAD16_BYTE( "18.041", 0x0c0001, 0x20000, CRC(47146c1d) SHA1(cd5d92136f86128a9f304c4f8850f1efd652dd5c) ) // mpr13081.bin [2/2]      IDENTICAL
1330   ROM_LOAD16_BYTE( "31.010", 0x080000, 0x20000, CRC(e88fc39c) SHA1(f19c55c49771625a76e65b639a3b23969db8031d) ) // mpr13088.bin [1/2]      IDENTICAL
1331   ROM_LOAD16_BYTE( "30.011", 0x0c0000, 0x20000, CRC(6fe7e2a2) SHA1(94e5852377f72fd00daae302db4a5f93301213e4) ) // mpr13088.bin [2/2]      IDENTICAL
1332   ROM_LOAD16_BYTE( "21.032", 0x100001, 0x20000, CRC(c9e5a258) SHA1(809a3a3f88efe9c7a9dd9f6439ccb48fffb84df0) ) // mpr13080.bin [1/2]      IDENTICAL
1333   ROM_LOAD16_BYTE( "20.033", 0x140001, 0x20000, CRC(ddf8d00e) SHA1(0a9031063921bb03e7fd57eea369a1ddcfa85431) ) // mpr13080.bin [2/2]      IDENTICAL
1334   ROM_LOAD16_BYTE( "25.022", 0x100000, 0x20000, CRC(af8f3700) SHA1(3787f732eee5c6c9b6550bd4ce5387aff2c4072e) ) // mpr13087.bin [1/2]      IDENTICAL
1335   ROM_LOAD16_BYTE( "24.023", 0x140000, 0x20000, CRC(a092ecb6) SHA1(d7cc85eaea70c7947c497bc1d9743ab12a6fb43e) ) // mpr13087.bin [2/2]      IDENTICAL
1336   ROM_LOAD16_BYTE( "23.030", 0x180001, 0x20000, CRC(adc1b625) SHA1(496a1e92a833dbde37a0426165ff4250848b6ef4) ) // epr13079.bin [1/2]      IDENTICAL
1337   ROM_LOAD16_BYTE( "22.031", 0x1c0001, 0x20000, CRC(27c27f38) SHA1(439502250da4e376d2aa4bd9122455c6991e334d) ) // epr13079.bin [2/2]      IDENTICAL
1338   ROM_LOAD16_BYTE( "27.020", 0x180000, 0x20000, CRC(6c5312aa) SHA1(94b74c78f318fcc1881a2926cebc98033a7e535d) ) // epr13086.bin [1/2]      IDENTICAL
1339   ROM_LOAD16_BYTE( "26.021", 0x1c0000, 0x20000, CRC(c67fc986) SHA1(5fac826f9dde45201e3b93582dbe29c584a10229) ) // epr13086.bin [2/2]      99.987030%
1340
1341   /* Sound HW is very different to the originals */
1342   ROM_REGION( 0x210000, "soundcpu", ROMREGION_ERASEFF ) /* Z80 sound CPU */
1343   ROM_LOAD( "9.a5", 0x10000, 0x08000, CRC(0a4638e9) SHA1(0470e03a194464ff53c7583637193b585f5fd79f) )
1344
1345   ROM_REGION( 0x40000, "oki1", ROMREGION_ERASEFF ) /* Oki6295 Samples - fixed? samples */
1346   ROM_LOAD( "11.a10", 0x00000, 0x20000, CRC(7e0f752c) SHA1(a4070c3fa4848b5be223f9b927de4b6926dbb4e6) ) // contains sample table
1347   ROM_LOAD( "10.a11", 0x20000, 0x10000, CRC(722e5969) SHA1(9cf891c6533b2e2a5c4741aa4e405038a7bf4e97) )
1348   /* 0x30000- 0x3ffff banked? (guess) */
1349
1350   ROM_REGION( 0xc0000, "oki2", ROMREGION_ERASEFF ) /* Oki6295 Samples - banked? samples*/
1351   ROM_LOAD( "12.a15", 0x00000, 0x20000, CRC(cb4517db) SHA1(4c93376c2b3e70001bbc283d4485bb55514f6ef9) )
1352   ROM_LOAD( "13.a14", 0x20000, 0x20000, CRC(c60d6f18) SHA1(c9610729f19ae8414efd785948a1e6fb079bfe8d) )
1353   ROM_LOAD( "14.a13", 0x40000, 0x20000, CRC(07e6b3a5) SHA1(32da2a9aeb840b76e6f0117ac342ff5d612762b4) )
1354   ROM_LOAD( "15.a12", 0x60000, 0x20000, CRC(dffde929) SHA1(037b32470747d155385e532ee574b1234b3c2b26) )
1355
1356   ROM_REGION( 0x0120, "proms", 0 )
1357   ROM_LOAD( "n82s129n.129",  0x0000, 0x0100, CRC(a7c22d96) SHA1(160deae8053b09c09328325246598b3518c7e20b) )
1358   ROM_LOAD( "n82s123n.123",  0x0100, 0x0020, CRC(58bcf8bd) SHA1(e4d3d179b08c0f3424a6bec0f15058fb1b56f8d8) )
1359ROM_END
1360
1361
1362ROM_START( mwalkbl )
1363   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
1364   ROM_LOAD16_BYTE( "mwalkbl.01", 0x000000, 0x10000, CRC(f49cdb16) SHA1(34b7e98d31c3b9db2f0f055d7b249b0e5e5cb746) )
1365   ROM_LOAD16_BYTE( "mwalkbl.05", 0x000001, 0x10000, CRC(c483f29f) SHA1(8fdfa764d8e49754844a9dc001400d439f9af9f0) )
1366   ROM_LOAD16_BYTE( "mwalkbl.02", 0x020000, 0x10000, CRC(0bde1896) SHA1(42731ae90d56918dc50c0dcb53d092dcfb957159) )
1367   ROM_LOAD16_BYTE( "mwalkbl.06", 0x020001, 0x10000, CRC(5b9fc688) SHA1(53d8143c3876548f63b392f0ea16c0e7c30a7917) )
1368   ROM_LOAD16_BYTE( "mwalkbl.03", 0x040000, 0x10000, CRC(0c5fe15c) SHA1(626e3f37f019448c3c96bf73b2d2b5fe4b3716c0) )
1369   ROM_LOAD16_BYTE( "mwalkbl.07", 0x040001, 0x10000, CRC(9e600704) SHA1(efd3d450b26f81dc2b74f44b4aaf906fa017e437) )
1370   ROM_LOAD16_BYTE( "mwalkbl.04", 0x060000, 0x10000, CRC(64692f79) SHA1(ad7f32997b78863e3aa3214018cdd24e3ec9c5cb) )
1371   ROM_LOAD16_BYTE( "mwalkbl.08", 0x060001, 0x10000, CRC(546ca530) SHA1(51f74878fdc221fee026e2e6a7ca96f290c8947f) )
1372
1373   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
1374   ROM_LOAD( "mpr13216.b1", 0x00000, 0x40000, CRC(862d2c03) SHA1(3c5446d702a639b62a602c6d687f9875d8450218) )
1375   ROM_LOAD( "mpr13217.b2", 0x40000, 0x40000, CRC(7d1ac3ec) SHA1(8495357304f1df135bba77ef3b96e79a883b8ff0) )
1376   ROM_LOAD( "mpr13218.b3", 0x80000, 0x40000, CRC(56d3393c) SHA1(50a2d065060692c9ecaa56046a781cb21d93e554) )
1377
1378   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
1379   ROM_LOAD16_BYTE( "mpr13224.b11", 0x000001, 0x40000, CRC(c59f107b) SHA1(10fa60fca6e34eda277c483bb1c0e81bb88c8a47) )
1380   ROM_LOAD16_BYTE( "mpr13231.a11", 0x000000, 0x40000, CRC(a5e96346) SHA1(a854f4dd5dc16975373255110fdb8ab3d121b1af) )
1381   ROM_LOAD16_BYTE( "mpr13223.b10", 0x080001, 0x40000, CRC(364f60ff) SHA1(9ac887ec0b2e32b504b7c6a5f3bb1ce3fe41a15a) )
1382   ROM_LOAD16_BYTE( "mpr13230.a10", 0x080000, 0x40000, CRC(9550091f) SHA1(bb6e898f7b540e130fd338c10f74609a7604cef4) )
1383   ROM_LOAD16_BYTE( "mpr13222.b9",  0x100001, 0x40000, CRC(523df3ed) SHA1(2e496125e75decd674c3a08404fbdb53791a965d) )
1384   ROM_LOAD16_BYTE( "mpr13229.a9",  0x100000, 0x40000, CRC(f40dc45d) SHA1(e9468cef428f52ecdf6837c6d9a9fea934e7676c) )
1385   ROM_LOAD16_BYTE( "epr13221.b8",  0x180001, 0x40000, CRC(9ae7546a) SHA1(5413b0131881b0b32bac8de51da9a299835014bb) )
1386   ROM_LOAD16_BYTE( "epr13228.a8",  0x180000, 0x40000, CRC(de3786be) SHA1(2279bb390aa3efab9aeee0a643e5cb6a4f5933b6) )
1387
1388   ROM_REGION( 0x100000, "soundcpu", 0 ) /* sound CPU */
1389   ROM_LOAD( "epr13225.a4", 0x10000, 0x20000, CRC(56c2e82b) SHA1(d5755a1bb6e889d274dc60e883d4d65f12fdc877) )
1390   ROM_LOAD( "mpr13219.b4", 0x30000, 0x40000, CRC(19e2061f) SHA1(2dcf1718a43dab4da53b4f67722664e70ddd2169) )
1391   ROM_LOAD( "mpr13220.b5", 0x70000, 0x40000, CRC(58d4d9ce) SHA1(725e73a656845b02702ef131b4c0aa2a73cdd02e) )
1392   ROM_LOAD( "mpr13249.b6", 0xb0000, 0x40000, CRC(623edc5d) SHA1(c32d9f818d40f311877fbe6532d9e95b6045c3c4) )
1393ROM_END
1394
1395
1396// Shadow Dancer
1397ROM_START( shdancbl )
1398   ROM_REGION( 0x080000, "maincpu", 0 ) /* 68000 code */
1399   ROM_LOAD16_BYTE( "ic39", 0x000000, 0x10000, CRC(adc1781c) SHA1(b2ca2831a48779df7533e6b2a406ee539e1f650c) )
1400   ROM_LOAD16_BYTE( "ic53", 0x000001, 0x10000, CRC(1c1ac463) SHA1(21075f7afae372daef197f04f5f12d14479a8140) )
1401   ROM_LOAD16_BYTE( "ic38", 0x020000, 0x10000, CRC(cd6e155b) SHA1(e37b53cc431533091d26b37be9b8e30494de5faf) )
1402   ROM_LOAD16_BYTE( "ic52", 0x020001, 0x10000, CRC(bb3c49a4) SHA1(ab01a6de1a6d338d30f9cfea7b3bf80dda67f215) )
1403   ROM_LOAD16_BYTE( "ic37", 0x040000, 0x10000, CRC(1bd8d5c3) SHA1(4d663362c059e112ac6c742d80200be98d50d175) )
1404   ROM_LOAD16_BYTE( "ic51", 0x040001, 0x10000, CRC(ce2e71b4) SHA1(3e251319cd4c8c63c66e6b92b2eef514d79dba8e) )
1405   ROM_LOAD16_BYTE( "ic36", 0x060000, 0x10000, CRC(bb861290) SHA1(62ea8eec74c6b1f5530ee86f97ad821daeac26ad) )
1406   ROM_LOAD16_BYTE( "ic50", 0x060001, 0x10000, CRC(7f7b82b1) SHA1(675020b57ce689b2767ff83773e2b828cda5aeed) )
1407
1408   ROM_REGION( 0xc0000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
1409   ROM_LOAD( "ic4",  0x00000, 0x20000, CRC(f0a016fe) SHA1(1426f3fbf50a04a8c5e998e071ca0e78d15f37a8) )
1410   ROM_LOAD( "ic18", 0x20000, 0x20000, CRC(f6bee053) SHA1(39ee5edfcc67bb4855217c7428254f3e8c862ba0) )
1411   ROM_LOAD( "ic3",  0x40000, 0x20000, CRC(e07e6b5d) SHA1(bdeb1193415049d0c9261ca261073bdd9e251b88) )
1412   ROM_LOAD( "ic17", 0x60000, 0x20000, CRC(f59deba1) SHA1(21188d22fe607281bb7da1e1f418a33d4a315695) )
1413   ROM_LOAD( "ic2",  0x80000, 0x20000, CRC(60095070) SHA1(913c2ee51fb6f838f3c6cbd27032bdf754fbadf1) )
1414   ROM_LOAD( "ic16", 0xa0000, 0x20000, CRC(0f0d5dd3) SHA1(76812e2f831256a8b6598257dd84a7f07443642e) )
1415
1416   ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */
1417
1418   // 12719
1419   ROM_LOAD16_BYTE( "ic73", 0x000001, 0x10000, CRC(59e77c96) SHA1(08da058529ac83352a4528d3792a21edda348f7a) )
1420   ROM_LOAD16_BYTE( "ic74", 0x020001, 0x10000, CRC(90ea5407) SHA1(4bdd93c86cb35822517433d491aa8be6857dd36c) )
1421   ROM_LOAD16_BYTE( "ic75", 0x040001, 0x10000, CRC(27d2fa61) SHA1(0ba3cd9448e54ce9fc9433f3edd28de9a4e451e9) )
1422   ROM_LOAD16_BYTE( "ic76", 0x060001, 0x10000, CRC(f36db688) SHA1(a527298ce9ca1d9f5aa7b9eac93985f34ca8119f) )
1423
1424   // 12726
1425   ROM_LOAD16_BYTE( "ic58", 0x000000, 0x10000, CRC(9cd5c8c7) SHA1(54c2d0a683bda37eb9a75f90f4ca5e620c09c4cf) )
1426   ROM_LOAD16_BYTE( "ic59", 0x020000, 0x10000, CRC(ff40e872) SHA1(bd2c4aac427d106a46318f4cb2eb05c34d3c70b6) )
1427   ROM_LOAD16_BYTE( "ic60", 0x040000, 0x10000, CRC(826d7245) SHA1(bb3394de058bd63b9939cd05f22c925e0cdc840a) )
1428   ROM_LOAD16_BYTE( "ic61", 0x060000, 0x10000, CRC(dcf8068b) SHA1(9c78de224df76fc90fb90f1bbd9b22dad0874f69) )
1429
1430   // 12718
1431   ROM_LOAD16_BYTE( "ic77", 0x080001, 0x10000, CRC(f93470b7) SHA1(1041afa43aa8d0589d6def9743721cdbda617f78) )
1432//  ROM_LOAD16_BYTE( "ic78", 0x0A0001, 0x10000, CRC(4d523ea3) SHA1(053c30778017127dddeae0783af463aef17bcc9a) ) // corrupt? (bad sprite when dog attacts in attract mode)
1433   ROM_LOAD16_BYTE( "sdbl.78", 0x0A0001, 0x10000, CRC(e533be5d) SHA1(926d6ba3f7a3ac289b0ae40d7633c70b2819df4d) )
1434   ROM_LOAD16_BYTE( "ic95", 0x0C0001, 0x10000, CRC(828b8294) SHA1(f2cdb882fb0709a909e6ef98f0315aceeb8bf283) )
1435//  ROM_LOAD16_BYTE( "ic94", 0x0E0001, 0x10000, CRC(542b2d1e) SHA1(1ce91aea6c49e6e365a91c30ca3049682c2162da) )
1436   ROM_LOAD16_BYTE( "sdbl.94", 0x0E0001, 0x10000, CRC(e2fa2b41) SHA1(7186107734dac5763dee43addcea7c14fb0d9d74) )
1437
1438   // 12725
1439   ROM_LOAD16_BYTE( "ic62", 0x080000, 0x10000, CRC(50ca8065) SHA1(8c0d6ae34b9da6c376df387e8fc8b1068bcb4dcb) )
1440   ROM_LOAD16_BYTE( "ic63", 0x0A0000, 0x10000, CRC(d1866aa9) SHA1(524c82a12a1c484a246b8d49d9f05a774d008108) )
1441   ROM_LOAD16_BYTE( "ic90", 0x0C0000, 0x10000, CRC(3602b758) SHA1(d25b6c8420e07d0f2ac3e1d8717f14738466df16) )
1442   ROM_LOAD16_BYTE( "ic89", 0x0E0000, 0x10000, CRC(1ba4be93) SHA1(6f4fe2016e375be3df477436f5cde7508a24ecd1) )
1443
1444   // 12717
1445   ROM_LOAD16_BYTE( "ic79", 0x100001, 0x10000, CRC(f22548ee) SHA1(723cb7604784c6715817daa8c86c18c6bcd1388d) )
1446   ROM_LOAD16_BYTE( "ic80", 0x120001, 0x10000, CRC(6209f7f9) SHA1(09b33c99d972a62af8ef56dacfa6262f002aba0c) )
1447   ROM_LOAD16_BYTE( "ic81", 0x140001, 0x10000, CRC(34692f23) SHA1(56126a81ac279662e3e3423da5205f65a62c4600) )
1448   ROM_LOAD16_BYTE( "ic82", 0x160001, 0x10000, CRC(7ae40237) SHA1(fae97cfcfd3cd557da3330158831e4727c438745) )
1449
1450   // 12724
1451   ROM_LOAD16_BYTE( "ic64", 0x100000, 0x10000, CRC(7a8b7bcc) SHA1(00cbbbc4b3db48ca3ac65ff56b02c7d63a1b898a) )
1452   ROM_LOAD16_BYTE( "ic65", 0x120000, 0x10000, CRC(90ffca14) SHA1(00962e5309a79ce34c6f420036054bc607595dfe) )
1453   ROM_LOAD16_BYTE( "ic66", 0x140000, 0x10000, CRC(5d655517) SHA1(2a1c197dde62bd7946ca7b5f1c2833bdbc2e2e32) )
1454   ROM_LOAD16_BYTE( "ic67", 0x160000, 0x10000, CRC(0e5d0855) SHA1(3c15088f7fdda5c2bba9c89d244bbcff022f05fd) )
1455
1456   // 12716
1457   ROM_LOAD16_BYTE( "ic83", 0x180001, 0x10000, CRC(a9040a32) SHA1(7b0b375285f528b2833c50892b55b0d4c550506d) )
1458   ROM_LOAD16_BYTE( "ic84", 0x1A0001, 0x10000, CRC(d6810031) SHA1(a82857a9ac442fbe076cdafcf7390765391ed136) )
1459   ROM_LOAD16_BYTE( "ic92", 0x1C0001, 0x10000, CRC(b57d5cb5) SHA1(636f1a07a84d37cecbe388a2f585893c4611436c) )
1460   ROM_LOAD16_BYTE( "ic91", 0x1E0001, 0x10000, CRC(49def6c8) SHA1(d8b2cc1993f0808553f87bf56fdbe47374576c5a) )
1461
1462   // 12723
1463   ROM_LOAD16_BYTE( "ic68", 0x180000, 0x10000, CRC(8d684e53) SHA1(00e82ddaf875a7452ff978b7b7eb87a1a5a8fb64) )
1464   ROM_LOAD16_BYTE( "ic69", 0x1A0000, 0x10000, CRC(c47d32e2) SHA1(92b21f51abdd7950fb09d965b1d71b7bffac31ec) )
1465   ROM_LOAD16_BYTE( "ic88", 0x1C0000, 0x10000, CRC(9de140e1) SHA1(f1125e056a898a4fa519b49ae866c5c742e36bf7) )
1466   ROM_LOAD16_BYTE( "ic87", 0x1E0000, 0x10000, CRC(8172a991) SHA1(6d12b1533a19cb02613b473cc8ba73ece1f2a2fc) )
1467
1468   ROM_REGION( 0x30000, "soundcpu", 0 ) /* sound CPU */
1469   ROM_LOAD( "ic45", 0x10000, 0x10000, CRC(576b3a81) SHA1(b65356a3837ed3875634ab0cbcd61acce44f2bb9) )
1470   ROM_LOAD( "ic46", 0x20000, 0x10000, CRC(c84e8c84) SHA1(f57895bedb6152c30733e91e6f4795702a62ac3a) )
1471ROM_END
1472
1473
1474/*****************************************************************************/
1475
1476GAME( 1990, astormbl, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 1)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1477GAME( 1990, astormb2, astorm,   astormbl, astormbl, astormbl, ROT0, "bootleg", "Alien Storm (bootleg, set 2)", GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND )
1478
1479GAME( 1990, mwalkbl,  mwalk,    mwalkbl,  mwalkbl,  mwalkbl,  ROT0, "bootleg", "Michael Jackson's Moonwalker (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
1480
1481GAME( 1989, shdancbl, shdancer, shdancbl, mwalkbl,  shdancbl, ROT0, "bootleg", "Shadow Dancer (bootleg)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
src/mame/drivers/berzerk.c
r4878r4879
581581   AM_RANGE(0x48, 0x48) AM_READ_PORT("P1") AM_WRITENOP
582582   AM_RANGE(0x49, 0x49) AM_READ_PORT("SYSTEM") AM_WRITENOP
583583   AM_RANGE(0x4a, 0x4a) AM_READ_PORT("P2") AM_WRITENOP
584   AM_RANGE(0x4b, 0x4b) AM_READWRITE(SMH_NOP, magicram_control_w)
584   AM_RANGE(0x4b, 0x4b) AM_READNOP AM_WRITE(magicram_control_w)
585585   AM_RANGE(0x4c, 0x4c) AM_READWRITE(nmi_enable_r, nmi_enable_w)
586586   AM_RANGE(0x4d, 0x4d) AM_READWRITE(nmi_disable_r, nmi_disable_w)
587   AM_RANGE(0x4e, 0x4e) AM_READWRITE(intercept_v256_r, SMH_NOP)
588   AM_RANGE(0x4f, 0x4f) AM_READWRITE(SMH_NOP, irq_enable_w)
587   AM_RANGE(0x4e, 0x4e) AM_READ(intercept_v256_r) AM_WRITENOP
588   AM_RANGE(0x4f, 0x4f) AM_READNOP AM_WRITE(irq_enable_w)
589589   AM_RANGE(0x50, 0x57) AM_NOP /* second sound board, but not used */
590590   AM_RANGE(0x58, 0x5f) AM_NOP
591591   AM_RANGE(0x60, 0x60) AM_MIRROR(0x18) AM_READ_PORT("F3") AM_WRITENOP
src/mame/drivers/spy.c
r4878r4879
408408   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
409409   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
410410   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
411   PORT_DIPSETTING(    0x20, "Difficult" )
412   PORT_DIPSETTING(    0x00, "Very Difficult" )
411   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
412   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
413413   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
414414   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
415415   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/model3.c
r4878r4879
5858
5959===================================================================================
6060
61Harley Davidson (Rev.A)
62Sega, 1997
61Model 3 Hardware Overview.
62Sega, 1996-1998
6363
64This game runs on Sega Model3 Step2 hardware.
64This document covers all games running on the original Model 3 hardware and is produced with
65reference to a Scud Race PCB and Virtua Fighter 3TB PCB. ALL PCB numbers are identical.
66Scud Race runs on the original Sega Model 3 hardware. It's the same PCB as Virtua Fighter 3, there
67is no mention of 'Step 1.5' or even 'Step 1.0' on any of the PCBs and there is no 50MHz or
68100MHz OSC on the CPU board that would allow the CPU to run at 100MHz like the current
69documention lists.
70The CPU on Scud Race runs at 66MHz. I suspect the 100MHz clock and STEP 1 and STEP 1.5 is yet
71another system16.com wild guess. Therefore, until proven, STEP 1.0 and STEP 1.5 DO NOT EXIST!
6572
73Existing Model 3 hardware revisions as noted on the PCBs are ....
74MODEL3 (verified seen)
75MODEL3 STEP2 (verified seen)
76Other possibilites could be 'MODEL3 STEP 2.1' but no PCBs have been found yet with that
77written on the PCBs. If you have evidence that they do exist (i.e. you have a PCB), or you
78have a Model 3 game on a different version PCB to what is documented here, please let us know!
79
80This document is for MODEL3 (the first version).
81The games that exist on this hardware include....
82Boat Race GP
83Get Bass / Sega Bass Fishing
84Virtua Fighter 3
85Virtua Fighter 3 Team Battle
86Le Mans 24
87Scud Race / Super GT
88Scud Race Plus
89The Lost World
90The Lost World Special
91Virtua Striker 2
92Virtua Striker 2 Version '98
93
94
95[There is an external MPEG PCB used on some games but it was not available for documenting]
96
6697COMM Board
6798----------
68
69171-7053B  837-11861  NEP-16T MODEL3 COMMUNICATION BOARD
99171-7053B
100837-11861 MODEL3 COMMUNICATION BOARD
101SEGA 1995
70102|---------------------------------------------------------------------------------------------------|
71103|                                                                                                   |
72104|   LATTICE                     NKK N341256SJ-20     NKK N341256SJ-20     NKK N341256SJ-20    40MHz |
73105|   PLSI 2032   JP3                                                                      JP1        |
74|               JP4             NKK N341256SJ-20     NKK N341256SJ-20     NKK N341256SJ-20          |
106|   (315-5958)  JP4             NKK N341256SJ-20     NKK N341256SJ-20     NKK N341256SJ-20          |
75107|                                                                                             JP2   |
76108|                                                                                                   |
77109|   PALCE16V8                                                                                       |
78|   315-6075A      68000FN12       315-5804             315-5917              315-5917              |
110|   315-6075       68000FN12       315-5804             315-5917              315-5917              |
79111|                                  (QFP144)             (QFP80)               (QFP80)               |
80112|   PALCE16V8                                                                                       |
81113|   315-6074                                                                                        |
82|                                                                                                   |
114|  LEDx7                                                                                            |
83115|---------------------------------------------------------------------------------------------------|
84116JP1: 1-2
85117JP2: 2-3
r4878r4879
89121
90122ROM Board
91123---------
124837-11860 MODEL3 ROM BOARD
125171-7052C
126|---------------------------------------------------------------------------------------------------|
127| CN1                                              CN2                                    CN4       |
128|        MC88915FN70                               CN3   GAL16V8B                                   |
129| LED1 LED2                                              315-5983   JP1  JP10  JP2                  |
130|                                                                   1-2  1-2   2-3          JP3-JP9 |
131|                                                                                  SROM0.21 ALL 2-3 |
132| VROM01.26   VROM00.27        CROM03.1    CROM02.2                                                 |
133|                                                                                                   |
134| VROM03.28   VROM02.29        CROM01.3    CROM00.4                                                 |
135|                                                                                                   |
136| VROM05.30   VROM04.31        CROM13.5    CROM12.6          CROM2.18  CROM0.20  SROM1.22  SROM3.24 |
137|                                                                                                   |
138| VROM07.32   VROM06.33        CROM11.7    CROM10.8                                                 |
139|                                                                                                   |
140| VROM11.34   VROM10.35        CROM23.9    CROM22.10                                                |
141|                                                                                                   |
142| VROM13.36   VROM12.37        CROM21.11   CROM20.12                                                |
143|                                                                                                   |
144| VROM15.38   VROM14.39        CROM33.13   CROM32.14        CROM3.17  CROM1.19   SROM2.23  SROM4.25 |
145|                                                                                                   |
146| VROM17.40   VROM16.41        CROM31.15   CROM30.16                                                |
147|                                                                                                   |
148|---------------------------------------------------------------------------------------------------|
149Notes:
150      CN1/2/3/4 - Connectors joining ROM board to CPU board (below)
151      Jumpers   - These jumper settings match Scud Race and VF3TB. Jumpers may be different for other games, but
152                  if different, it's likely only for the games that use 64MBit MASKROMs.
153      ROMs      - Not all sockets are populated. See MAME src for exact ROM usage.
92154
155
156CPU Board
157---------
158
159837-11858 MODEL3 CPU BOARD
160171-7050D
161|---------------------------------------------------------------------------------------------------|
162|       CN22           JP21-26(ALL 2-3)             CN2                           CN7               |
163| 315-5941        KM4132G271AQ-10                   CN3                                 PC910   CN10|
164| GAL16V8                                                                        LED1 LED2 LED3 LED4|
165| (PLCC20)                                                                  JP42(2-3)  315-5942A    |
166|CN4    KM4132G271AQ-10                              45.158MHz        68000-12         GAL16V8      |
167|JP27(1-2)                    JP12(1-2)                               (PLCC68)         (DIP20)      |
168|JP28(1-2) JP15(2-3) MOTOROLA      PowerPC603ev    |---------|      |---------|                     |
169|JP49(2-3) JP16(1-2) XPC106ARX66CD (QFP240,        | SEGA    |      | SEGA    |             LMC6484 |
170|JP50(2-3) JP17(2-3) MPC106+        HEATSINKED)    | 315-5687|      | 315-5687|        TDA1386T     |
171|          JP18(2-3) (BGA304)                      | (QFP128)|      | (QFP128)|            JP40(2-3)|
172| GAL16V8           JP1(1-2)  JP11(OPEN)  JP6(1-2) |---------|      |---------|        TDA1386T     |
173| 315-5940          JP2(1-2)              JP7(1-2)                                         JP41(2-3)|
174| (DIP20)           JP3(2-3)   MPC950A    JP8(2-3) HM514270CJ7      HM514270CJ7                     |
175|         JP13(2-3) JP4(1-2)   (QFP32)    JP9(2-3)                                                  |
176|         JP14(2-3)  33.000MHz                                                          uPA2003     |
177|CN5                                                                                                |
178||--------|                      |--------|                                             uPA2003  CN8|
179||SEGA    |                      |SEGA    |                           3771                          |
180||315-5894|      SYMBIOS         |315-5893|                                             PC817       |
181||(QFP240)|      53C810A         |(QFP240)|                                                         |
182||--------|                      |--------|       |--------|   |--------|               PC817       |
183|                                                 |SEGA    |   |SEGA    |                           |
184|                                                 |315-5296|   |315-5649|               PC817       |
185|                CY7C199          32MHz           |(QFP100)|   |(QFP100)|                           |
186|JP29(1-2)       CY7C199                          |--------|   |--------| 93C46A        PC817       |
187|JP30(1-2)                                         JP10(1-2)                     A179B              |
188|                                                    RTC72421       BATT_3V             PC817       |
189| KM4132G271AQ-10                                                                                   |
190|                                                                  0.1uF                PC817    CN9|
191|              32MHz      JP39(2-3)        LH52B256  LH52B256      SUPERCAP                         |
192|        JP51-53(ALL 1-2)  NEC D71051-10                                   JP31-37(ALL 1-2)         |
193|LED15                         JP38(2-3)            LED14 LED13 LED12 LED11                         |
194|   LED16      24.576MHz      SW1   SW2        CN6  LED10 LED9 LED8 LED7 DIPSW(8) SW4 SW3  LED5 LED6|
195|---------------------------------------------------------------------------------------------------|
196Notes:
197      Note some jumpers are hardwired on the PCB but are identical except on Scud Race JP12 is open and in
198      position 1-2 for VF3TB, although changing the jumper didn't make any difference :-/
199      CN8/9/10   - Connectors to join filter board (external connectors to cabinet panel/monitor/power etc)
200      CN6        - Connector to join network board (above)
201      CN2/3/7/22 - Connectors to join ROM board (above)
202      CN4/5/22   - Connectors to join video board (below)
203
204
205Video Board
206-----------
207
208837-11859 MODEL3 VIDEO BOARD
209171-7051C
210|---------------------------------------------------------------------------------------------------|
211|     CN5                                   33MHz                                                   |
212|                                           PI49FCT3807S                                            |
213|  HM5241605  HM5241605                             M5M4V4169  M5M4V4169  M5M4V4169  M5M4V4169      |
214|                                                                                                CN6|
215|                     HM5241605  HM5241605       M5M410092FP                                        |
216|  HM5241605  HM5241605                          (TQFP128)                                M5M4V4169 |
217|                      |----------------|     |----------------|     |---------------|              |
218|  |----------|        |                |     |                |     |               |              |
219|  |SEGA      |        |    SEGA        |     |    SEGA        |     |   SEGA        |    M5M4V4169 |
220|  |315-5827-C|        |    315-5828-B  |     |    315-5829-C  |     |   315-5830-B  |              |
221|  |(QFP208)  |        |                |     |                |     |               |              |
222|  |          |        |                |     |                |     |               |    M5M4V4169 |
223|  |----------|        |   (QFP304)     |     |   (QFP304)     |     |  (QFP304)     |              |
224|CN1                   |----------------|     |----------------|     |---------------|              |
225|                                                                                         M5M4V4169 |
226|                     HM5241605  HM5241605                                                          |
227|                                                                                                   |
228|                                                                                                   |
229|                                             M5M410092FP            |---------------|    M5M4V4169 |
230|       |--------|          |----------|                             |               |              |
231|       |SEGA    |          |          |                             |   SEGA        |              |
232|       |315-5648|          |SEGA      |                             |   315-5830-B  |    M5M4V4169 |
233|       |(QFP64) |          |315-5831-B|                             |               |              |
234|       |--------|          |(QFP208)  |      M5M410092FP            |               |              |
235|CN2                        |----------|                             |  (QFP304)     |    M5M4V4169 |
236|       ADV7120KP30                                                  |---------------|              |
237|      (PLCC44)                                                                                     |
238|               AD589                                                                     M5M4V4169 |
239|                 JP2(1-2)                    M5M410092FP                                           |
240|                                                                                                   |
241|                                                   M5M4V4169  M5M4V4169  M5M4V4169  M5M4V4169      |
242|                                                                                                   |
243|   LED1 LED2                                                                                       |
244|---------------------------------------------------------------------------------------------------|
245Notes:
246      CN1/2/5      - Connectors to join CPU board
247      CN6          - Connectors to join Filter board (external connectors to cabinet panel/monitor/power etc)
248      ADV7120KP30  - Analog Devices ADV7120KP30 CMOS 80 MHz, Triple 8 Bit Video DAC
249      AD589        - Analog Devices 1.2 volt reference IC
250      PI49FCT3807S - Pericom 3.3V 1 to 10 Fast CMOS Clock Driver
251      HM5241605    - Hitachi HM5241605 4M (256k x 16 x 2 banks) SDRAM
252      M5M4V4169    - Mitsubishi M5M4V4169TP 4M (256k x 16) Cache DRAM with 1k x16 on-chip SRAM cache
253      M5M410092FP  - Mitsubishi 3D-RAM
254                     Specs....
255                              10-Mbits DRAM array supporting 1280 x 1024 x 8 frame buffer
256                              Four independent, interleaved DRAM banks
257                              2048-bit SRAM Pixel Buffer as the cache between DRAM and ALU
258                              Built-in tile-oriented memory addressing for rendering and scan line-oriented
259                              memory addressing for video refresh
260                              256-bit global bus connecting DRAM banks and Pixel Buffer
261
262      Note!! Scud Race uses a newer revision of some of the Sega custom chips. Swapping a VF3 Video board
263             onto a Scud Race will result in an error on bootup 'JUPITER ASIC HAS THE WRONG ID CODE' and the
264             game will not boot (some of the RED LEDs flash on/off continually)
265             The above layout is for Scud Race. The chip listing on VF3TB is....
266             IC76 - 315-5827-B
267             IC77 - 315-5828-A
268             IC90 - 315-5831-A
269             IC78 - 315-5829-B
270             IC79 - 315-5830-A
271             IC92 - 315-5830-A
272
273             Other than the revision of the listed chips, the PCBs are identical.
274
275
276
277Harley Davidson (Rev.A)
278Sega, 1997
279
280This game runs on Sega Model3 Step2 hardware.
281
282
283ROM Board
284---------
285
93286171-7427B  837-13022 MODEL3 STEP2 ROM BOARD
94287|---------------------------------------------------------------------------------------------------|
95288|                                                                                                   |
src/mame/drivers/namcos21.c
r4878r4879
558558   mpDspState->slaveOutputSize = 0;
559559   mpDspState->masterFinished = 0;
560560   mpDspState->slaveActive = 0;
561   cpu_set_input_line(machine->cpu[4], 0, HOLD_LINE); /* DSP: master */
562   cpu_set_input_line(machine->cpu[5], INPUT_LINE_RESET, PULSE_LINE); /* DSP: slave */
561   cputag_set_input_line(machine, "dspmaster", 0, HOLD_LINE);
562   cputag_set_input_line(machine, "dspslave", INPUT_LINE_RESET, PULSE_LINE);
563563}
564564
565565static UINT16
r4878r4879
611611         if (ENABLE_LOGGING) logerror( "IDC-CONTINUE\n" );
612612         TransferDspData(space->machine);
613613      }
614      else if( namcos2_gametype == NAMCOS21_SOLVALOU &&
614      else if (namcos2_gametype == NAMCOS21_SOLVALOU &&
615615               offset == 0x103 &&
616               space->cpu == space->machine->cpu[0] )
616               space->cpu == cputag_get_cpu(space->machine, "maincpu"))
617617      { /* hack; synchronization for solvalou */
618618         cpu_yield(space->cpu);
619619      }
r4878r4879
12691269   if( data )
12701270   {
12711271      winrun_flushpoly();
1272      cpu_set_input_line(space->machine->cpu[4], INPUT_LINE_RESET, PULSE_LINE);
1272      cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, PULSE_LINE);
12731273      namcos21_ClearPolyFrameBuffer();
12741274   }
12751275}
src/mame/drivers/pgm.c
r4878r4879
292292#include "includes/pgm.h"
293293
294294
295UINT16 *pgm_mainram, *pgm_bg_videoram, *pgm_tx_videoram, *pgm_videoregs, *pgm_rowscrollram, *pgm_videoram;
295UINT16 *pgm_mainram, *pgm_bg_videoram, *pgm_tx_videoram, *pgm_videoregs, *pgm_rowscrollram;
296static UINT16 *pgm_videoram;
296297static UINT8 *z80_mainram;
297298static UINT32 *arm7_shareram;
298299static UINT32 *svg_shareram[2];   //for 5585G MACHINE
r4878r4879
847848
848849
849850//5585G
850unsigned char svg_ram_sel;
851static unsigned char svg_ram_sel;
851852
852853static WRITE32_HANDLER( svg_arm7_ram_sel_w )
853854{
src/mame/drivers/beathead.c
r4878r4879
336336   AM_RANGE(0x41000220, 0x41000227) AM_WRITE(coin_count_w)
337337   AM_RANGE(0x41000300, 0x41000303) AM_READ(input_2_r)
338338   AM_RANGE(0x41000304, 0x41000307) AM_READ_PORT("IN3")
339   AM_RANGE(0x41000400, 0x41000403) AM_WRITE(SMH_RAM) AM_BASE(&beathead_palette_select)
339   AM_RANGE(0x41000400, 0x41000403) AM_WRITEONLY AM_BASE(&beathead_palette_select)
340340   AM_RANGE(0x41000500, 0x41000503) AM_WRITE(eeprom_enable_w)
341341   AM_RANGE(0x41000600, 0x41000603) AM_WRITE(beathead_finescroll_w)
342342   AM_RANGE(0x41000700, 0x41000703) AM_WRITE(watchdog_reset32_w)
r4878r4879
347347   AM_RANGE(0x8f900000, 0x8f97ffff) AM_WRITE(beathead_vram_transparent_w)
348348   AM_RANGE(0x8f980000, 0x8f9fffff) AM_RAM AM_BASE(&videoram32)
349349   AM_RANGE(0x8fb80000, 0x8fbfffff) AM_WRITE(beathead_vram_bulk_w)
350   AM_RANGE(0x8fff8000, 0x8fff8003) AM_WRITE(SMH_RAM) AM_BASE(&beathead_vram_bulk_latch)
350   AM_RANGE(0x8fff8000, 0x8fff8003) AM_WRITEONLY AM_BASE(&beathead_vram_bulk_latch)
351351   AM_RANGE(0x9e280000, 0x9e2fffff) AM_WRITE(beathead_vram_copy_w)
352352ADDRESS_MAP_END
353353
src/mame/drivers/suprgolf.c
r4878r4879
1717#include "driver.h"
1818#include "cpu/z80/z80.h"
1919#include "sound/2203intf.h"
20#include "sound/msm5205.h"
2021
2122static tilemap *suprgolf_tilemap;
2223static UINT8 *suprgolf_bg_vram;
r4878r4879
2425static int suprgolf_rom_bank;
2526static UINT8 suprgolf_bg_bank;
2627static UINT8 suprgolf_vreg;
28static UINT8 msm5205next,msm_nmi_mask;
2729
2830static TILE_GET_INFO( get_tile_info )
2931{
r4878r4879
5254
5355   mame_printf_debug("ROM_BANK 0x8000 - %X @%X\n",data,cpu_get_previouspc(space->cpu));
5456   memory_set_bankptr(space->machine, 2, region_base + (data&0x3f ) * 0x4000);
57
58   msm_nmi_mask = data & 0x40;
59   flip_screen_set(space->machine, data & 0x80);
5560}
5661
5762static WRITE8_HANDLER( rom2_bank_select_w )
r4878r4879
6065   mame_printf_debug("ROM_BANK 0x4000 - %X @%X\n",data,cpu_get_previouspc(space->cpu));
6166//  if(data == 0) data = 1; //test hack
6267   memory_set_bankptr(space->machine, 1, region_base + (data&0x0f ) * 0x4000);
68
69   if(data & 0xf0)
70      printf("Rom bank select 2 with data %02x activated\n",data);
6371}
6472
6573static MACHINE_RESET( suprgolf )
r4878r4879
180188   palette_switch = (data & 0x80);
181189   suprgolf_bg_bank = (data & 0x1f);
182190
183   if(data & 0x20) //TODO: understand the proper condition
184      cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
191   //if(data & 0x60)
192   //  printf("Video regs with data %02x activated\n",data);
185193}
186194
187195static UINT8 pen;
r4878r4879
197205   suprgolf_bg_pen[offset+suprgolf_bg_bank*0x2000] = data ? pen : 0;
198206}
199207
208/* maybe bit 7 isn't actually for the pen? */
200209static WRITE8_HANDLER( suprgolf_pen_w )
201210{
202211   pen = data;
203212}
204213
214static WRITE8_HANDLER( adpcm_data_w )
215{
216   msm5205next = data;
217}
218
205219static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
206220   AM_RANGE(0x0000, 0x3fff) AM_ROM
207221   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
r4878r4879
218232   AM_RANGE(0x00, 0x00) AM_READ_PORT("P1")
219233   AM_RANGE(0x01, 0x01) AM_READ_PORT("P2")
220234   AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") // ??
235//  AM_RANGE(0x03, 0x03)
221236   AM_RANGE(0x04, 0x04) AM_READ_PORT("SYSTEM")
222237   AM_RANGE(0x05, 0x05) AM_READ(rom_bank_select_r) AM_WRITE(rom_bank_select_w)
223238   AM_RANGE(0x06, 0x06) AM_READWRITE( suprgolf_vregs_r,suprgolf_vregs_w ) // game locks up or crashes? if this doesn't return right values?
224
239//  AM_RANGE(0x07, 0x07)
225240   AM_RANGE(0x08, 0x09) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)
241   AM_RANGE(0x0c, 0x0c) AM_WRITE(adpcm_data_w)
226242 ADDRESS_MAP_END
227243
228244static INPUT_PORTS_START( suprgolf )
r4878r4879
352368   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
353369   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
354370   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
355   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
371   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) )
356372   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
357373   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
358374   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
r4878r4879
381397
382398static void irqhandler(const device_config *device, int irq)
383399{
384//  cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE);
400   //cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
385401}
386402
387403static const ym2203_interface ym2203_config =
r4878r4879
396412   },
397413   irqhandler
398414};
415
416static void adpcm_int(const device_config *device)
417{
418   static int toggle = 0;
419
420   {
421      msm5205_reset_w(device,0);
422      toggle ^= 1;
423      if(toggle)
424      {
425         msm5205_data_w(device, (msm5205next & 0xf0) >> 4);
426         if(msm_nmi_mask) { cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); }
427      }
428      else
429      {
430         msm5205_data_w(device, (msm5205next & 0x0f) >> 0);
431      }
432   }
433}
434
435static const msm5205_interface msm5205_config =
436{
437   adpcm_int,      /* interrupt function */
438   MSM5205_S48_4B   /* 4KHz 4-bit */
439};
440
399441static const gfx_layout gfxlayout =
400442{
401443   8,8,
r4878r4879
413455
414456static MACHINE_DRIVER_START( suprgolf )
415457   /* basic machine hardware */
416   MDRV_CPU_ADD("maincpu", Z80,4000000)
458   MDRV_CPU_ADD("maincpu", Z80,4000000) /* guess */
417459   MDRV_CPU_PROGRAM_MAP(main_map)
418460   MDRV_CPU_IO_MAP(io_map)
419461   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
r4878r4879
437479   /* sound hardware */
438480   MDRV_SPEAKER_STANDARD_MONO("mono")
439481
440   MDRV_SOUND_ADD("ym", YM2203, 3000000)
482   MDRV_SOUND_ADD("ym", YM2203, 3000000) /* guess */
441483   MDRV_SOUND_CONFIG(ym2203_config)
442   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
484   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
485
486   MDRV_SOUND_ADD("msm", MSM5205, 400000) /* guess */
487   MDRV_SOUND_CONFIG(msm5205_config)
488   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
443489MACHINE_DRIVER_END
444490
445491
r4878r4879
505551   ROM_LOAD( "cg12.6k",0x00000, 0x10000, CRC(5707b3d5) SHA1(9102a40fefb6426f2cd9d92d66fdc77e078e3f4c) )
506552ROM_END
507553
508GAME( 1989, suprgolf, 0, suprgolf,  suprgolf,  0, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_NOT_WORKING )
554GAME( 1989, suprgolf, 0, suprgolf,  suprgolf,  0, ROT0, "Nasco", "Super Crowns Golf (Japan)", GAME_NOT_WORKING | GAME_NO_COCKTAIL )
src/mame/drivers/adp.c
r4878r4879
363363 vblank ^=0x40;
364364 hblank ^=0x20;
365365
366return mame_rand(space->machine) & 0x00f0;
366 return mame_rand(space->machine) & 0x00f0;
367367
368// FIXME: this code is never executed
368369// popmessage("%08x",cpu_get_pc(space->cpu));
369370// return 0x0000;
370371 return 0xff9f | vblank | hblank;
src/mame/drivers/cps3.c
r4878r4879
10421042            if (xsize2==0) // xsize of 0 tiles seems to be a special command to draw tilemaps
10431043            {
10441044               int tilemapnum = ((value3 & 0x00000030)>>4);
1045               int startline;// = value2 & 0x3ff;
1046               int endline;
1047               int height = (value3 & 0x7f000000)>>24;
1045               //int startline;// = value2 & 0x3ff;
1046               //int endline;
1047               //int height = (value3 & 0x7f000000)>>24;
10481048               int uu;
10491049               UINT32* tmapregs[4] = { tilemap20_regs_base, tilemap30_regs_base, tilemap40_regs_base, tilemap50_regs_base };
10501050               UINT32* regs;
10511051               regs = tmapregs[tilemapnum];
1052               endline = value2;
1053               startline = endline - height;
1052               //endline = value2;
1053               //startline = endline - height;
10541054
1055               startline &=0x3ff;
1056               endline &=0x3ff;
1055               //startline &=0x3ff;
1056               //endline &=0x3ff;
10571057
10581058               //printf("tilemap draw %01x %02x %02x %02x\n",tilemapnum, value2, height, regs[0]&0x000003ff );
10591059
src/mame/drivers/toaplan2.c
r4878r4879
317317      This is important for games with common RAM; the RAM test will fail
318318      when leaving service mode if the sound CPU is not reset.
319319    */
320   m68k_set_reset_callback(machine->cpu[0], toaplan2_reset);
320   m68k_set_reset_callback(cputag_get_cpu(machine, "maincpu"), toaplan2_reset);
321321}
322322
323323static MACHINE_RESET( ghox )
r4878r4879
394394   #if USE_V25
395395
396396   #else
397   memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x28f002, 0x28fbff, 0, 0, (read16_space_func)SMH_BANK(2), (write16_space_func)SMH_BANK(2) );
397   memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x28f002, 0x28fbff, 0, 0, (read16_space_func)SMH_BANK(2), (write16_space_func)SMH_BANK(2) );
398398   memory_set_bankptr(machine, 2, fixeight_sec_cpu_mem);
399399   #endif
400400
r4878r4879
529529
530530static TIMER_CALLBACK( toaplan2_raise_irq )
531531{
532   cpu_set_input_line(machine->cpu[0], param, HOLD_LINE);
532   cputag_set_input_line(machine, "maincpu", param, HOLD_LINE);
533533}
534534
535535static void toaplan2_vblank_irq(running_machine *machine, int irq_line)
r4878r4879
11571157{
11581158   // not sure whether this is correct
11591159   // the 68K writes here during the sound IRQ handler, and nowhere else...
1160   cpu_set_input_line(space->machine->cpu[0], raizing_sndirq_line, CLEAR_LINE);
1160   cputag_set_input_line(space->machine, "maincpu", raizing_sndirq_line, CLEAR_LINE);
11611161}
11621162
11631163
11641164static WRITE8_HANDLER( raizing_sndirq_w )
11651165{
11661166   // if raizing_clear_sndirq_w() is correct, should this be ASSERT_LINE?
1167   cpu_set_input_line(space->machine->cpu[0], raizing_sndirq_line, HOLD_LINE);
1167   cputag_set_input_line(space->machine, "maincpu", raizing_sndirq_line, HOLD_LINE);
11681168}
11691169
11701170
src/mame/drivers/jailbrek.c
r4878r4879
2121    6301 @ 6f and 7f (PROM's)
2222    6331 @ 1f and 2f (PROM's)
2323
24Jail Break
25Konami 1986
26
27PCB Layout
28----------
29
30GX507
31PWB 300394A
32|----------------------------------------|
33| KONAMI-1   507P03.11D    6264     4416 |
34|            507P02.9D    |-------| 4416 |
35|                         |KONAMI | 4416 |
36|       507L01.8C         |005849 | 4416 |
37|                         |-------|      |
38| VLM5030                       507J13.7F|
39|                    SN76489    507J12.6F|
40| 3.579545MHz        18.432MHz           |
41| DSW3                          507J09.5F|
42|                               507L08.4F|
43| DSW2                          507J07.3F|
44|           UPC324                       |
45| DSW1                          507J11.2F|
46|      LA4460                   507J10.1F|
47|             005273 005273              |
48|             005273 005273              |
49|     VOL           18-WAY        CN1    |
50|----------------------------------------|
51Notes:
52      KONAMI1   - Custom encrypted 6809 CPU, clock 1.536MHz [18.432/12] (DIP42)
53      VLM5030   - Sanyo VLM5030 speech chip, clock 3.579545MHz (DIP40)
54      SN76489   - Texas Instruments SN76489 noise generator IC, clock 1.536MHz [18.432/12] (DIP16)
55      UPC324    - NEC UPC324 op amp. Also compatible with LM324 and Mitsubishi M5224P (DIP14)
56      LA4460    - Power amp IC
57      DSW1/2    - 8-position dip switches
58      DSW3      - 4-position dip switch
59      CN1       - 4-pin connector for monitors that require separate syncs. Pin 1 is negative vertical sync output.
60                  Horizontal sync is taken from the regular composite sync on the PCB on pin B14.
61      18-WAY    - 18-way edge connector. Pinout matches standard Konami 18-way pinout (Scramble/Frogger/Yie-Ar Kung Fu etc)
62      6264      - 8kx8 SRAM (DIP28)
63      4416      - 16kx4 DRAM (DIP18)
64      005849    - Konami custom graphics generator (PGA179)
65      005273    - Konami custom resistor array (SIL10)
66      507J12/13 - MMI 63S141 256x4 Bipolar PROM (= 82S129 & 6301 etc)
67      507J10/11 - MMI 63S081 32x8 Bipolar PROM (= 82S123 & 6331 etc)
68      All ROMs type 27C128. Pin 26 of 8C is tied high, the lower half is empty.
69
70      Measurements
71      ------------
72      Xtal  - 3.57867MHz
73      OSC   - 18.43199MHz
74      HSync - 15.5185kHz
75      VSync - 60.6059Hz
76
77
2478***************************************************************************/
2579
2680/*
r4878r4879
143197   PORT_DIPNAME( 0x30, 0x10, DEF_STR( Difficulty ) )  PORT_DIPLOCATION( "SW2:5,6" )
144198   PORT_DIPSETTING(    0x30, DEF_STR( Easy ) )
145199   PORT_DIPSETTING(    0x20, DEF_STR( Normal ) )
146   PORT_DIPSETTING(    0x10, "Difficult" )
147   PORT_DIPSETTING(    0x00, "Very Difficult" )
200   PORT_DIPSETTING(    0x10, DEF_STR( Difficult ) )
201   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
148202   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )        PORT_DIPLOCATION( "SW2:7" )
149203   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION( "SW2:8" )
150204   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
src/mame/drivers/mlanding.c
r4878r4879
7474static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
7575{
7676   data=0;
77   memory_set_bankptr(device->machine,  1, memory_region(device->machine, "z80") + ((data) & 0x03) * 0x4000 + 0x10000 );
77   memory_set_bankptr(device->machine,  1, memory_region(device->machine, "audiocpu") + ((data) & 0x03) * 0x4000 + 0x10000 );
7878}
7979
8080static void ml_msm5205_vck(const device_config *device)
r4878r4879
314314
315315static void irq_handler(const device_config *device, int irq)
316316{
317   cputag_set_input_line(device->machine, "z80", 0, irq ? ASSERT_LINE : CLEAR_LINE);
317   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
318318}
319319
320320static GFXDECODE_START( mlanding )
r4878r4879
347347   MDRV_CPU_PROGRAM_MAP(mlanding_mem)
348348   MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)
349349
350   MDRV_CPU_ADD("z80", Z80, 4000000 )      /* 4 MHz ??? (guess) */
350   MDRV_CPU_ADD("audiocpu", Z80, 4000000 )      /* 4 MHz ??? (guess) */
351351   MDRV_CPU_PROGRAM_MAP(mlanding_z80_mem)
352352
353353   MDRV_CPU_ADD("sub", M68000, 12000000 )      /* 12 MHz ??? (guess) */
r4878r4879
396396   ROM_LOAD16_BYTE( "ml_b0925.epr", 0x40000, 0x10000, CRC(ff59f049) SHA1(aba490a28aba03728415f34d321fd599c31a5fde) )
397397   ROM_LOAD16_BYTE( "ml_b0924.epr", 0x40001, 0x10000, CRC(9bc3e1b0) SHA1(6d86804327df11a513a0f06dceb57b83b34ac007) )
398398
399   ROM_REGION( 0x20000, "z80", 0 )   /* z80 */
399   ROM_REGION( 0x20000, "audiocpu", 0 )   /* z80 */
400400   ROM_LOAD( "ml_b0935.epr", 0x00000, 0x4000, CRC(b85915c5) SHA1(656e97035ae304f84e90758d0dd6f0616c40f1db) )
401401   ROM_CONTINUE(             0x10000, 0x04000 )   /* banked stuff */
402402   ROM_LOAD( "ml_b0936.epr", 0x14000, 0x02000, CRC(51fd3a77) SHA1(1fcbadf1877e25848a1d1017322751560a4823c0) )
src/mame/drivers/btoads.c
r4878r4879
190190   AM_RANGE(0x20000180, 0x200001ff) AM_READ_PORT("UNK")
191191   AM_RANGE(0x20000200, 0x2000027f) AM_READ_PORT("SPECIAL")
192192   AM_RANGE(0x20000280, 0x200002ff) AM_READ_PORT("SW1")
193   AM_RANGE(0x20000000, 0x200000ff) AM_WRITE(SMH_RAM) AM_BASE(&btoads_sprite_scale)
194   AM_RANGE(0x20000100, 0x2000017f) AM_WRITE(SMH_RAM) AM_BASE(&btoads_sprite_control)
193   AM_RANGE(0x20000000, 0x200000ff) AM_WRITEONLY AM_BASE(&btoads_sprite_scale)
194   AM_RANGE(0x20000100, 0x2000017f) AM_WRITEONLY AM_BASE(&btoads_sprite_control)
195195   AM_RANGE(0x20000180, 0x200001ff) AM_WRITE(btoads_display_control_w)
196196   AM_RANGE(0x20000200, 0x2000027f) AM_WRITE(btoads_scroll0_w)
197197   AM_RANGE(0x20000280, 0x200002ff) AM_WRITE(btoads_scroll1_w)
src/mame/drivers/lastduel.c
r4878r4879
363363   PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Difficulty ) )
364364   PORT_DIPSETTING(      0x0200, DEF_STR( Easy ) )
365365   PORT_DIPSETTING(      0x0300, DEF_STR( Normal ) )
366   PORT_DIPSETTING(      0x0100, "Difficult" )
367   PORT_DIPSETTING(      0x0000, "Very Difficult" )
366   PORT_DIPSETTING(      0x0100, DEF_STR( Difficult ) )
367   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Difficult ) )
368368   PORT_DIPNAME( 0x0400, 0x0400, DEF_STR( Unknown ) )   /* Could be cabinet type? */
369369   PORT_DIPSETTING(      0x0400, DEF_STR( Off ) )
370370   PORT_DIPSETTING(      0x0000, DEF_STR( On ) )
r4878r4879
420420   PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Difficulty ) )
421421   PORT_DIPSETTING(      0x0008, DEF_STR( Easy ) )
422422   PORT_DIPSETTING(      0x000c, DEF_STR( Normal ) )
423   PORT_DIPSETTING(      0x0004, "Difficult" )
424   PORT_DIPSETTING(      0x0000, "Very Difficult" )
423   PORT_DIPSETTING(      0x0004, DEF_STR( Difficult ) )
424   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Difficult ) )
425425   PORT_DIPNAME( 0x0030, 0x0030, DEF_STR( Cabinet ) )
426426   PORT_DIPSETTING(      0x0030, "Upright One Player" )
427427   PORT_DIPSETTING(      0x0000, "Upright Two Players" )
src/mame/drivers/boxer.c
r4878r4879
191191   AM_RANGE(0x1b00, 0x1bff) AM_WRITE(boxer_crowd_w)
192192   AM_RANGE(0x1c00, 0x1cff) AM_WRITE(boxer_irq_reset_w)
193193   AM_RANGE(0x1d00, 0x1dff) AM_WRITE(boxer_bell_w)
194   AM_RANGE(0x1e00, 0x1eff) AM_WRITE(SMH_RAM) AM_BASE(&boxer_sprite_ram)
194   AM_RANGE(0x1e00, 0x1eff) AM_WRITEONLY AM_BASE(&boxer_sprite_ram)
195195   AM_RANGE(0x1f00, 0x1fff) AM_WRITE(watchdog_reset_w)
196196   AM_RANGE(0x3000, 0x3fff) AM_ROM
197197ADDRESS_MAP_END
src/mame/drivers/roul.c
r4878r4879
5353
5454#define VIDEOBUF_SIZE 256*256
5555
56UINT8 reg[0x10];
57UINT8 *videobuf;
56static UINT8 reg[0x10];
57static UINT8 *videobuf;
5858
5959static UINT8 lamp_old = 0;
6060
src/mame/drivers/namcos22.c
r4878r4879
143143 *  RR1.GAM (for Ridge Racer 1/2, Rave Racer)
144144 **********************************************************************************************************
145145 *
146 * Namco Super System 22 Hardware Overview (last updated 3rd July 2008 at 11:40pm)
146 * Namco Super System 22 Hardware Overview (last updated 26th April 2009 at 4:11pm)
147147 * ---------------------------------------
148148 *
149149 * Note! This document will be updated from time to time when more dumps are available.
r4878r4879
153153 * Alpine Racer 1   (C) Namco, 1995
154154 * Alpine Racer 2   (C) Namco, 1996
155155 * Alpine Surfer    (C) Namco, 1996
156 * !Aqua Jet        (C) Namco, 1996
156 * Aqua Jet         (C) Namco, 1996
157157 * *Armidillo Racing(C) Namco, 1997
158158 * Cyber Cycles     (C) Namco, 1995
159 * *Dirt Dash       (C) Namco, 1995
159 * !Dirt Dash       (C) Namco, 1995
160160 * Prop Cycle       (C) Namco, 1996
161161 * Time Crisis      (C) Namco, 1995
162 * !Tokyo Wars      (C) Namco, 1996
162 * Tokyo Wars       (C) Namco, 1996
163163 *
164164 * ! - denotes secured but not dumped yet.
165 * * - denotes not dumped yet. If you can help with the remaining undumped SS22 games,
166     * please contact http://www.mameworld.net/gurudumps/
165 * * - denotes not available. If you can help with the remaining undumped SS22 games,
166 *     please contact http://guru.mameworld.info/
167167 *
168168 * The Namco Super System 22 System comprises 4 PCB's plugged into a motherboard. The motherboard contains only
169169 * some slots and connectors. The 4 PCB's are housed in a metal box with a large fan on the side. The fan mostly cools
r4878r4879
177177 *             to defaults by holding down SERVICE + TEST on power-up. All games are swappable to ANY CPU PCB and will
178178 *             run ok (all dumped games have been swapped/tested and work fine)
179179 * DSP PCB   - There is only 1 revision of this PCB. All games use the exact same PCB. The DSP PCB can be swapped to
180 *             any other game and works fine (all dumped games tested)
180 *             any other game and works fine (all dumped games tested). Note that some games use different parts of the
181 *             DSP PCB and some do more thorough tests on bootup so a DSP PCB that works fine in one game may come
182 *             up as faulty in a different SS22 game.
181183 * MROM PCB  - These PCB's have many SOP44 ROMs on them and are identical for each game, but the contents of the ROMs
182184 *             and the number of ROMs vary per game. (a few of the dumped games have had their surface mounted ROMs
183185 *             swapped to other PCBs and worked fine)
184 * FLASH PCB - Flash ROM board used only for Armidillo Racing that contains TSOP56 16M FlashROMs
186 * FLASH PCB - Flash ROM board used only for Armidillo Racing and contains many TSOP56 16M FlashROMs
185187 * VIDEO PCB - There are three known revisions of this PCB. They're mostly identical apart from some component shuffling
186188 *             and in the earlier versions (A & B), an Altera FPGA chip is used instead of a Namco custom chip.
187 *             All revisions of the Video PCBs are swappable and fully compatible with any SS22 game.
189 *             All revisions of the Video PCBs are swappable and fully compatible with any SS22 game. The Altera FPGA runs
190 *             very hot and almost always fails even if heatsinked!
188191 * MOTHER PCB- There are probably 3 revisions of this PCB, but only the original revision and (C) are documented here.
189192 *             The differences are very minor, just the amount of connectors on the PCB. The Mother PCB is swappable to
190193 *             any game as long as the required connectors for that game are present on the PCB. (all dumped games tested
191 *             and worked fine)
194 *             and worked fine using any MOTHER PCB)
192195 *
193196 * Each game has a 2 or 3 digit letter code assigned to it. Then a number 1 or 2, Then a Rev. A/B/C/D which denotes the
194197 * software revision.
r4878r4879
458461 * Notes:
459462 *       There isn't much on this PCB other than 2 connectors and an oscillator plus a large amount of logic chips.
460463 *       J1 : Connector joining Gun PCB to a connector on the metal box (which joins to the gun interface PCB in the
461 *            cab which supplies 24V for the soleniod in the guns)
464 *            cab which supplies 24V for the solenoid in the guns)
462465 *       J2 : Connector joining to the CPU PCB (to JC410)
463466 *
464467 *
r4878r4879
9971000 *       J4 : 8 pin connector  Pin  Use
9981001 *                             -------------------------------------
9991002 *                              1   Start
1000 *                              2   Left select
1001 *                              3   Right select
1003 *                              2   Left Select
1004 *                              3   Right Select
10021005 *                              4   Safety Free Controls (Ski's etc)
10031006 *                              5   Safety Lock Controls (Ski's etc)
10041007 *                              6   NC
r4878r4879
13391342InitDSP( running_machine *machine, int bSuperSystem22 )
13401343{
13411344   mbSuperSystem22 = bSuperSystem22;
1342   cpu_set_input_line(machine->cpu[1],INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */
1343   cpu_set_input_line(machine->cpu[2],INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */
1344   cpu_set_input_line(machine->cpu[3],INPUT_LINE_RESET,ASSERT_LINE); /* MCU */
1345   cputag_set_input_line(machine, "master",INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */
1346   cputag_set_input_line(machine, "slave",INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */
1347   cputag_set_input_line(machine, "mcu",INPUT_LINE_RESET,ASSERT_LINE); /* MCU */
13451348} /* InitDSP */
13461349
13471350static READ16_HANDLER( pdp_status_r )
r4878r4879
15211524
15221525static void HaltSlaveDSP( running_machine *machine )
15231526{
1524   cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, ASSERT_LINE);
1527   cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, ASSERT_LINE);
15251528}
15261529
15271530static void EnableSlaveDSP( void )
15281531{
1529//  cpu_set_input_line(Machine->cpu[2], INPUT_LINE_RESET, CLEAR_LINE);
1532//  cputag_set_input_line(machine, "slave", INPUT_LINE_RESET, CLEAR_LINE);
15301533}
15311534
15321535static READ16_HANDLER( dsp_HOLD_signal_r )
r4878r4879
17041707   {
17051708      mSerialDataSlaveToMasterCurrent = mSerialDataSlaveToMasterNext;
17061709
1707      if( cpu_getiloops(device)==0 )
1710      if( cpu_getiloops(device) == 0 )
17081711      {
1709         cpu_set_input_line(device->machine->cpu[1], TMS32025_INT0, HOLD_LINE);
1712         cputag_set_input_line(device->machine, "master", TMS32025_INT0, HOLD_LINE);
17101713      }
1711      cpu_set_input_line(device->machine->cpu[1], TMS32025_RINT, HOLD_LINE);
1712      cpu_set_input_line(device->machine->cpu[1], TMS32025_XINT, HOLD_LINE);
1713      cpu_set_input_line(device->machine->cpu[2], TMS32025_RINT, HOLD_LINE);
1714      cpu_set_input_line(device->machine->cpu[2], TMS32025_XINT, HOLD_LINE);
1714      cputag_set_input_line(device->machine, "master", TMS32025_RINT, HOLD_LINE);
1715      cputag_set_input_line(device->machine, "master", TMS32025_XINT, HOLD_LINE);
1716      cputag_set_input_line(device->machine, "slave", TMS32025_RINT, HOLD_LINE);
1717      cputag_set_input_line(device->machine, "slave", TMS32025_XINT, HOLD_LINE);
17151718   }
17161719}
17171720
r4878r4879
21622165   {
21632166      if( newReg == 0 )
21642167      { /* disable DSPs */
2165         cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_RESET,ASSERT_LINE); /* master DSP */
2166         cpu_set_input_line(space->machine->cpu[2],INPUT_LINE_RESET,ASSERT_LINE); /* slave DSP */
2168         cputag_set_input_line(space->machine, "master", INPUT_LINE_RESET, ASSERT_LINE); /* master DSP */
2169         cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, ASSERT_LINE); /* slave DSP */
21672170         mbEnableDspIrqs = 0;
21682171      }
2169      else if( newReg==1 )
2172      else if( newReg == 1 )
21702173      { /*enable dsp and rendering subsystem */
2171         cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
2174         cputag_set_input_line(space->machine, "master", INPUT_LINE_RESET, CLEAR_LINE);
21722175         namcos22_enable_slave_simulation();
21732176         mbEnableDspIrqs = 1;
21742177      }
2175      else if( newReg==0xff )
2178      else if( newReg == 0xff )
21762179      { /* used to upload game-specific code to master/slave dsps */
2177         cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE);
2180         cputag_set_input_line(space->machine, "master", INPUT_LINE_RESET, CLEAR_LINE);
21782181         mbEnableDspIrqs = 0;
21792182      }
21802183   }
r4878r4879
22112214
22122215static READ32_HANDLER( namcos22_keycus_r )
22132216{
2217//  printf("Hit keycus mask %x PC=%x\n", mem_mask, cpu_get_pc(space->cpu));
2218
22142219   switch( namcos22_gametype )
22152220   {
22162221   case NAMCOS22_RIDGE_RACER:
r4878r4879
22332238   case NAMCOS22_CYBER_CYCLES:
22342239      return 0x0387;
22352240
2241   case NAMCOS22_TOKYO_WARS:
2242      return 0x01a8<<16;
2243
22362244   case NAMCOS22_ALPINE_SURFER:
22372245      return 0x01a9;
22382246
r4878r4879
23162324
23172325static WRITE32_HANDLER( spotram_w )
23182326{ /**
2319   * 0x860000: reset
2327   * 0x860000: set read and write address (TRUSTED by Tokyo Wars POST)
23202328   * 0x860002: append data
23212329   *
23222330   * 0x860006: enable
r4878r4879
23292337         {
23302338            mSpotRAM.portW = 0;
23312339         }
2332         logerror( "spotram[0x%x] == 0x%x\n", mSpotRAM.portW, data );
23332340         mSpotRAM.RAM[mSpotRAM.portW++] = data;
23342341      }
23352342      else
23362343      {
2337         mSpotRAM.portR = 0;
2338         mSpotRAM.portW = 0;
2344         mSpotRAM.portR = (data>>19)*3;
2345         mSpotRAM.portW = (data>>19)*3;
23392346      }
23402347   }
23412348} /* spotram_w */
r4878r4879
26802687   }
26812688}
26822689
2690static READ8_HANDLER( tokyowar_mcu_adc_r )
2691{
2692   UINT16 gas,brake,steer;
2693   ReadAnalogDrivingPorts( space->machine, &gas, &brake, &steer );
2694
2695   gas <<= 2;
2696   brake <<= 2;
2697   steer <<= 2;
2698
2699   switch (offset)
2700   {
2701      case 0:
2702         return steer & 0xff;
2703
2704      case 1:
2705         return (steer>>8);
2706
2707      case 4:
2708         return gas & 0xff;
2709
2710      case 5:
2711         return (gas>>8);
2712
2713      case 6:
2714         return brake & 0xff;
2715
2716      case 7:
2717         return (brake>>8);
2718
2719      default:
2720         return 0;
2721   }
2722}
2723
2724static READ8_HANDLER( aquajet_mcu_adc_r )
2725{
2726   UINT16 gas, steer, ddy;
2727
2728   gas   = input_port_read(space->machine, "GAS") ^ 0x7f;
2729   steer = input_port_read(space->machine, "STEER") ^ 0xff;
2730   ddy = input_port_read(space->machine, "STICKY");
2731   if (ddy > 0) ddy -= 1;
2732
2733   gas <<= 2;
2734   steer <<= 2;
2735   ddy <<= 2;
2736
2737   /*
2738        0 & 1 = handle left/right
2739        2 & 3 = accelerator
2740        4 & 5 = handle pole (Y axis)
2741
2742    */
2743
2744   switch (offset)
2745   {
2746      case 0:
2747         return steer & 0xff;
2748
2749      case 1:
2750         return (steer>>8);
2751
2752      case 2:
2753         return gas & 0xff;
2754
2755      case 3:
2756         return (gas>>8);
2757
2758      case 4:
2759         return ddy & 0xff;
2760
2761      case 5:
2762                return (ddy>>8);
2763
2764      default:
2765         return 0;
2766   }
2767}
2768
26832769static READ8_HANDLER( airco22_mcu_adc_r )
26842770{
26852771   UINT16 pedal, x, y;
r4878r4879
31673253   MDRV_CPU_PROGRAM_MAP(namcos22_am)
31683254   MDRV_CPU_VBLANK_INT_HACK(namcos22_interrupt,2)
31693255
3170   MDRV_CPU_ADD("dspmaster", TMS32025,SS22_MASTER_CLOCK) /* ? */
3256   MDRV_CPU_ADD("master", TMS32025,SS22_MASTER_CLOCK) /* ? */
31713257   MDRV_CPU_PROGRAM_MAP(master_dsp_program)
31723258   MDRV_CPU_DATA_MAP(master_dsp_data)
31733259   MDRV_CPU_IO_MAP(master_dsp_io)
31743260   MDRV_CPU_VBLANK_INT_HACK(dsp_serial_pulse1,SERIAL_IO_PERIOD)
31753261
3176   MDRV_CPU_ADD("dspslave", TMS32025,SS22_MASTER_CLOCK) /* ? */
3262   MDRV_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK) /* ? */
31773263   MDRV_CPU_PROGRAM_MAP(slave_dsp_program)
31783264   MDRV_CPU_DATA_MAP(slave_dsp_data)
31793265   MDRV_CPU_IO_MAP(slave_dsp_io)
r4878r4879
34313517        ROM_LOAD( "ars2waveb.1l", 0x800000, 0x400000, CRC(deab4ad1) SHA1(580ad88d516280baaf6cc92b2e07cdc0cfc486f3) )
34323518ROM_END
34333519
3520ROM_START( alpinr2a )
3521   ROM_REGION( 0x800000, "maincpu", 0 ) /* main program */
3522        ROM_LOAD32_BYTE( "ars2ver-a.2",  0x000003, 0x200000, CRC(b07b15a4) SHA1(ea3b2d7b4ef4ccf3aafeef7e7eac92e8d446f4e7) )
3523        ROM_LOAD32_BYTE( "ars2ver-a.3",  0x000002, 0x200000, CRC(90a92e40) SHA1(bf8083256e56e7e33e61b4cdaf9fd03dabfb36ba) )
3524        ROM_LOAD32_BYTE( "ars2ver-a.4",  0x000001, 0x200000, CRC(9e9d771d) SHA1(6fb983e3f4f8233544667b1bbf87864e4fb8698c) )
3525        ROM_LOAD32_BYTE( "ars2ver-a.5",  0x000000, 0x200000, CRC(e93c7771) SHA1(305f35488a55be1b845702df972bba8334c0726c) )
3526
3527   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
3528   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
3529
3530   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
3531   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
3532
3533   ROM_REGION( 0x080000, "mcu", ROMREGION_ERASE00 ) /* S22-BIOS ver1.30 */
3534
3535   ROM_REGION16_LE( 0x080000, "user4", 0 ) /* MCU BIOS */
3536        ROM_LOAD( "ars2data.8k",  0x000000, 0x080000, CRC(29b36dcb) SHA1(70fde130c11789c822829493a70ecefb077c0c15) )
3537
3538   ROM_REGION( 0x200000*2, "sprite", ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */
3539        ROM_LOAD( "ars1scg0.12f", 0x000000, 0x200000, CRC(bc49ed86) SHA1(289b39f2cb21c723dbe4ddd64ee4b2c5fa65c368) )
3540
3541   ROM_REGION( 0xc00000, "textile", ROMREGION_DISPOSE) /* 16x16x8bpp texture tiles */
3542        ROM_LOAD( "ars1cg0.8d",   0x000000, 0x200000, CRC(74f4515c) SHA1(1e3a96281d543213d10c962b4d387c414d76e0c3) )
3543        ROM_LOAD( "ars1cg1.10d",  0x200000, 0x200000, CRC(329a95c1) SHA1(2cad7fd9e5ca7c64729ca2548ef4f873a0b8de64) )
3544        ROM_LOAD( "ars1cg2.12d",  0x400000, 0x200000, CRC(5648345a) SHA1(0dc7aedba65b7d97687a9e38a63597f16cee6179) )
3545        ROM_LOAD( "ars1cg3.13d",  0x600000, 0x200000, CRC(a752f205) SHA1(373b5a69e4488bc30763568ceae512ab7039f5f8) )
3546        ROM_LOAD( "ars1cg4.14d",  0x800000, 0x200000, CRC(54bf35b6) SHA1(aec43b66e7597ad7d113ae785417bf26164c1bca) )
3547        ROM_LOAD( "ars1cg5.16d",  0xa00000, 0x200000, CRC(e24a19a2) SHA1(34c1b51eea954ae3000602e550eb1cef0a10e651) )
3548
3549   ROM_REGION16_LE( 0x280000, "textilemap", 0 ) /* texture tilemap */
3550        ROM_LOAD( "ars1ccrl.3d",  0x000000, 0x200000, CRC(fc8c9161) SHA1(ad0fcfae27e02d68a6f8d1d03c514dc2f12d9ee8) )
3551        ROM_LOAD( "ars1ccrh.1d",  0x200000, 0x080000, CRC(a17660bb) SHA1(bae2c3f20772c6cea99f271ee3f39b1f999038c6) )
3552
3553   ROM_REGION( 0x80000*12, "pointrom", 0 ) /* 3d model data */
3554        ROM_LOAD( "ars1ptrl0.18k", 0x000000, 0x080000, CRC(f04e0e61) SHA1(d58a1d3ca1d0922e134db21a04feaee7dc97b020) )
3555        ROM_LOAD( "ars1ptrl1.16k", 0x080000, 0x080000, CRC(8bdb4970) SHA1(a504cd4beca4bedd1a7a228c83dd6b844ca3a1e0) )
3556        ROM_LOAD( "ars1ptrl2.15k", 0x100000, 0x080000, CRC(ec993a4f) SHA1(883f64e3e8d951415e9cef589c354eba9406c0aa) )
3557        ROM_LOAD( "ars1ptrl3.14k", 0x180000, 0x080000, CRC(4d453f3c) SHA1(7a82e5d8f974d9e56d0031b35e73647fe6aeec2e) )
3558
3559        ROM_LOAD( "ars1ptrm0.18j", 0x200000, 0x080000, CRC(d1bdc524) SHA1(b898bb38de397551ada4da4677dd733bf8fa5010) )
3560        ROM_LOAD( "ars1ptrm1.16j", 0x280000, 0x080000, CRC(86b81c81) SHA1(45096abf46794f06a4b647f5e4222798d8467632) )
3561        ROM_LOAD( "ars1ptrm2.15j", 0x300000, 0x080000, CRC(24116b83) SHA1(41c6a880abce7b543c409fda767682b2537b0d99) )
3562        ROM_LOAD( "ars1ptrm3.14j", 0x380000, 0x080000, CRC(772bede3) SHA1(f9565b7a40f0bbf11081d619fe5a46feafce2e56) )
3563
3564        ROM_LOAD( "ars1ptru0.18f", 0x400000, 0x080000, CRC(a4cf197a) SHA1(ee78cc259e87395df75179bbe5b6e521e762b582) )
3565        ROM_LOAD( "ars1ptru1.16f", 0x480000, 0x080000, CRC(1deb1fc0) SHA1(bfd1dfcaccf5a0f851b6757995fa7195452a3965) )
3566        ROM_LOAD( "ars1ptru2.15f", 0x500000, 0x080000, CRC(bcfad0ba) SHA1(bee7f2f9ecd2b289c6706e19fa86863913b286b5) )
3567        ROM_LOAD( "ars1ptru3.14f", 0x580000, 0x080000, CRC(73ce6958) SHA1(918b0fb0fca33dbe3be3ac679b8b28f58213f75b) )
3568
3569   ROM_REGION( 0x1000000, "c352", 0 ) /* sound samples */
3570        ROM_LOAD( "ars1wavea.2l", 0x000000, 0x400000, CRC(f8d107e9) SHA1(5c418691f0b35403553f21f5570eda8bbb66890f) )
3571        ROM_LOAD( "ars2waveb.1l", 0x800000, 0x400000, CRC(deab4ad1) SHA1(580ad88d516280baaf6cc92b2e07cdc0cfc486f3) )
3572ROM_END
3573
34343574ROM_START( alpinesa )
34353575   ROM_REGION( 0x800000, "maincpu", 0 ) /* main program */
34363576        ROM_LOAD32_BYTE( "af2ver-a_ll.ic2", 0x000003, 0x200000, CRC(e776159d) SHA1(5110364afb7ec606074d58a1d216d7d687b9df62) )
r4878r4879
34823622   ROM_LOAD32_BYTE( "cy1prgum.8d", 0x00001, 0x80000, CRC(c9c4a921) SHA1(76a52461165a8bd8d984a34063fbeb4cb73624af) )
34833623   ROM_LOAD32_BYTE( "cy1prguu.6d", 0x00000, 0x80000, CRC(5f22975b) SHA1(a1a5cb66358d64a3c564b912f2eeafa182786b1e) )
34843624
3485   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
3625   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
34863626   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
34873627
3488   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
3628   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
34893629   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
34903630
34913631   ROM_REGION( 0x080000, "mcu", ROMREGION_ERASE00 ) /* BIOS */
r4878r4879
36593799   ROM_LOAD32_BYTE( "ad2prgum.8d", 0x00001, 0x80000, CRC(d5042d6e) SHA1(9ae93e7ea7126302831a879ba0aadcb6e5b842f5) )
36603800   ROM_LOAD32_BYTE( "ad2prguu.6d", 0x00000, 0x80000, CRC(86d4661d) SHA1(2a1529a51ca5466994a2d0d84c7aab13cef95a11) )
36613801
3662   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
3802   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
36633803   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
36643804
3665   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
3805   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
36663806   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
36673807
36683808   ROM_REGION( 0x080000, "mcu", 0 ) /* BIOS */
r4878r4879
37113851   ROM_LOAD32_BYTE( "advprgum.8d", 0x00001, 0x80000, CRC(af67f2fb) SHA1(f391843ee0d053e33660c60e3718871142d932f2) )
37123852   ROM_LOAD32_BYTE( "advprguu.6d", 0x00000, 0x80000, CRC(b60e5d2b) SHA1(f5740615c2864c5c6433275cf4388bda5122b7a7) )
37133853
3714   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
3854   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
37153855   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
37163856
3717   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
3857   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
37183858   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
37193859
37203860   ROM_REGION( 0x080000, "mcu", 0 ) /* BIOS */
r4878r4879
37703910   ROM_LOAD32_BYTE( "rv2prumb.8d", 0x00001, 0x80000, CRC(6414a800) SHA1(c278ff644909d12a43ba6fc2bf8d2092e469c3e6) )
37713911   ROM_LOAD32_BYTE( "rv2pruub.6d", 0x00000, 0x80000, CRC(a9f18714) SHA1(8e7b17749d151f92020f68d1ac06003cf1f5c573) )
37723912
3773   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
3913   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
37743914   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
37753915
3776   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
3916   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
37773917   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
37783918
37793919   ROM_REGION( 0x80000, "mcu", 0 ) /* BIOS */
r4878r4879
38323972   ROM_LOAD32_BYTE( "rv1prumb.8d", 0x00001, 0x80000, CRC(375fabcf) SHA1(448e3db3e3fab8c7c27e214ab5a5fa84e5f84366) )
38333973   ROM_LOAD32_BYTE( "rv1pruub.6d", 0x00000, 0x80000, CRC(92f834d6) SHA1(028368790f0293fcfea5c7b12f7f315e27a62f77) )
38343974
3835   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
3975   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
38363976   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
38373977
3838   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
3978   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
38393979   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
38403980
38413981   ROM_REGION( 0x80000, "mcu", 0 ) /* BIOS */
r4878r4879
38944034   ROM_LOAD32_BYTE( "rv1prum.8d", 0x00001, 0x80000, CRC(28e503e3) SHA1(a3071461f840f28c65c660de215c73f812f356b3) )
38954035   ROM_LOAD32_BYTE( "rv1pruu.6d", 0x00000, 0x80000, CRC(c47d9ff4) SHA1(4d7c4ac4151a3b306e7277937add8eee26e561a6) )
38964036
3897   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4037   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
38984038   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
38994039
3900   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4040   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
39014041   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
39024042
39034043   ROM_REGION( 0x80000, "mcu", 0 ) /* BIOS */
r4878r4879
39564096   ROM_LOAD32_BYTE( "rrs1prumb.8d", 0x00001, 0x80000, CRC(78c360b6) SHA1(8ee502291359cbc8aef39145c8fe7538311cc58f) )
39574097   ROM_LOAD32_BYTE( "rrs1pruub.6d", 0x00000, 0x80000, CRC(60d6d4a4) SHA1(759762a9b7d7aee7ee1b44b1721e5356898aa7ea) )
39584098
3959   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4099   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
39604100   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
39614101
3962   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4102   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
39634103   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
39644104
39654105   ROM_REGION( 0x80000, "mcu", 0 ) /* BIOS */
r4878r4879
40074147   ROM_LOAD32_BYTE( "rrs1prumb.8d", 0x00001, 0x80000, CRC(78c360b6) SHA1(8ee502291359cbc8aef39145c8fe7538311cc58f) )
40084148   ROM_LOAD32_BYTE( "rrs1pruub.6d", 0x00000, 0x80000, CRC(60d6d4a4) SHA1(759762a9b7d7aee7ee1b44b1721e5356898aa7ea) )
40094149
4010   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4150   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
40114151   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
40124152
4013   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4153   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
40144154   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
40154155
40164156   ROM_REGION( 0x80000, "mcu", 0 ) /* BIOS */
r4878r4879
40594199   ROM_LOAD32_BYTE( "rrs1prum.8d", 0x00001, 0x80000, CRC(93259fb0) SHA1(c29787e873797a003db27adbd20d7b852e26d8c6) )
40604200   ROM_LOAD32_BYTE( "rrs1pruu.6d", 0x00000, 0x80000, CRC(31cdefe8) SHA1(ae836d389bed43dd156eb4cf3e97b6f1ad68181e) )
40614201
4062   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4202   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
40634203   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
40644204
4065   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4205   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
40664206   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
40674207
40684208   ROM_REGION( 0x80000, "mcu", 0 ) /* BIOS */
r4878r4879
41104250   ROM_LOAD32_BYTE( "rr3prgum.8d", 0x00001, 0x80000, CRC(e160f63f) SHA1(9b4b7a13eb4bc19fcb53daedb87e4945c20a1b8e) )
41114251   ROM_LOAD32_BYTE( "rr3prguu.6d", 0x00000, 0x80000, CRC(f07c78c0) SHA1(dbed76d868b761711faf5b6e11f2c9affb91db5d) )
41124252
4113   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4253   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
41144254   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
41154255
4116   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4256   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
41174257   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
41184258
41194259   ROM_REGION( 0x080000, "mcu", 0 ) /* BIOS */
r4878r4879
41614301   ROM_LOAD32_BYTE( "rr1prum.8d", 0x00001, 0x80000, CRC(705ef78a) SHA1(881903413e66d6fd83d46eb18c4e1230531832ae) )
41624302   ROM_LOAD32_BYTE( "rr2pruu.6d", 0x00000, 0x80000, CRC(a79e456f) SHA1(049c596e01e53e3a401c5c4260517f170688d387) )
41634303
4164   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4304   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
41654305   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
41664306
4167   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4307   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
41684308   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
41694309
41704310   ROM_REGION( 0x080000, "mcu", 0 ) /* BIOS */
r4878r4879
42124352   ROM_LOAD32_BYTE( "rr1prum.8d", 0x00001, 0x80000, CRC(705ef78a) SHA1(881903413e66d6fd83d46eb18c4e1230531832ae) )
42134353   ROM_LOAD32_BYTE( "rr1pruu.6d", 0x00000, 0x80000, CRC(c1371f96) SHA1(a78e0bf6c147c034487a85efa0a8470f4e8f4bf0) )
42144354
4215   ROM_REGION( 0x10000*2, "dspmaster", 0 ) /* Master DSP */
4355   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
42164356   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
42174357
4218   ROM_REGION( 0x10000*2, "dspslave", 0 ) /* Slave DSP */
4358   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
42194359   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
42204360
42214361   ROM_REGION( 0x080000, "mcu", 0 ) /* BIOS */
r4878r4879
42744414   ROM_REGION16_LE( 0x080000, "user4", 0 ) /* MCU BIOS */
42754415   ROM_LOAD( "ts1data.8k", 0, 0x080000, CRC(e68aa973) SHA1(663e80d249be5d5841139d98a9d72e2396851272) )
42764416
4277   ROM_REGION( 0x200000*6, "sprite", ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */
4278   ROM_LOAD( "ts1scg0.12f",0x200000*0, 0x200000,CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) )
4279   ROM_LOAD( "ts1scg1.10f",0x200000*1, 0x200000,CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) )
4280   ROM_LOAD( "ts1scg2.8f", 0x200000*2, 0x200000,CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) )
4281   ROM_LOAD( "ts1scg3.7f", 0x200000*3, 0x200000,CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) )
4282   ROM_LOAD( "ts1scg4.5f", 0x200000*4, 0x200000,CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) )
4283   ROM_LOAD( "ts1scg5.3f", 0x200000*5, 0x200000,CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) )
4417   ROM_REGION( 0xe00000, "sprite", ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */
4418   ROM_LOAD( "ts1scg0.12f",0x200000, 0x200000,CRC(14a3674d) SHA1(c5792a385572452b43bbc7eb8428335b19daa3c0) )
4419   ROM_LOAD( "ts1scg1.10f",0x400000, 0x200000,CRC(11791dbf) SHA1(3d75b468d69a8bf398d45f310cdb8bc88b63f25c) )
4420   ROM_LOAD( "ts1scg2.8f", 0x600000, 0x200000,CRC(d630fff9) SHA1(691394027b858702f06282f965f5b53e6fed496b) )
4421   ROM_LOAD( "ts1scg3.7f", 0x800000, 0x200000,CRC(1a62f015) SHA1(7d09ae480ae7813391616ae0090929ba845a345a) )
4422   ROM_LOAD( "ts1scg4.5f", 0xa00000, 0x200000,CRC(511b8dd6) SHA1(936649c0a61d29f024a28e4ab64cce4b55d58f64) )
4423   ROM_LOAD( "ts1scg5.3f", 0xc00000, 0x200000,CRC(553bb246) SHA1(94659bee4fd0afe834a8bf3414d8825411cf9e86) )
42844424
42854425   ROM_REGION( 0x200000*8, "textile", ROMREGION_DISPOSE) /* 16x16x8bpp texture tiles */
42864426   ROM_LOAD( "ts1cg0.8d",   0x200000*0x0, 0x200000,CRC(de07b22c) SHA1(f4d07b8840ec8be625eff634bce619e960c334a5) )
r4878r4879
43644504   ROM_LOAD( "ts1waveb.1l", 0x800000, 0x200000, CRC(bf4d7272) SHA1(c7c7b3620e7b3176644b6784ee36e679c9e31cc1) )
43654505ROM_END
43664506
4507ROM_START( tokyowar )
4508   ROM_REGION( 0x400000, "maincpu", 0 ) /* main program */
4509        ROM_LOAD32_BYTE( "tw2ver-a.1",   0x000003, 0x100000, CRC(2b17ca92) SHA1(7bcb1658059c59fb1a0131a41ede7157855130a8) )
4510        ROM_LOAD32_BYTE( "tw2ver-a.2",   0x000002, 0x100000, CRC(12da84e3) SHA1(a9406d0b77f60ba930c30e60bf4b3656c8905585) )
4511        ROM_LOAD32_BYTE( "tw2ver-a.3",   0x000001, 0x100000, CRC(7d42c516) SHA1(28c1596dd55c15207bbb41a8b9a5abc97abc2bc8) )
4512        ROM_LOAD32_BYTE( "tw2ver-a.4",   0x000000, 0x100000, CRC(b904ed16) SHA1(773e11536e1b3fe4971608a63a8e6eca702f8667) )
4513
4514   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
4515   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
4516
4517   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
4518   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
4519
4520   ROM_REGION( 0x80000, "mcu", ROMREGION_ERASE00 ) /* BIOS */
4521
4522   ROM_REGION16_LE( 0x080000, "user4", 0 ) /* MCU BIOS */
4523        ROM_LOAD( "tw1data.8k",   0x000000, 0x080000, CRC(bd046e4b) SHA1(162bc4ab69959ccab49fd69de291d34d472fb1c8) )
4524
4525   ROM_REGION( 0x800000, "sprite", ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */
4526        ROM_LOAD( "tw1scg0.12f",  0x000000, 0x200000, CRC(e3ec4daa) SHA1(f3a71ae9820d62075b814ffa2fecf3343ae09ffe) )
4527        ROM_LOAD( "tw1scg1.10f",  0x200000, 0x200000, CRC(b18a06e9) SHA1(ecf6a1e11603b8ea5119a036a57595dea021d778) )
4528        ROM_LOAD( "tw1scg2.8f",   0x400000, 0x200000, CRC(36f8c3d8) SHA1(d5c965d5cdd258c77b9db3137ce33404a5a3641c) )
4529        ROM_LOAD( "tw1scg3.7f",   0x600000, 0x200000, CRC(8e14d013) SHA1(ca63105a5c07bb9653499eef7a757db52612b59b) )
4530
4531   ROM_REGION( 0x200000*8, "textile", ROMREGION_DISPOSE) /* 16x16x8bpp texture tiles */
4532        ROM_LOAD( "tw1cg0.8d",    0x000000, 0x200000, CRC(98b9b070) SHA1(cb920a34700dab330c967cc634717134c04b7e1d) )
4533        ROM_LOAD( "tw1cg1.10d",   0x200000, 0x200000, CRC(f96a723a) SHA1(5ba14963a4c51c875ac8d3b42049bc334de90038) )
4534        ROM_LOAD( "tw1cg2.12d",   0x400000, 0x200000, CRC(573e9ded) SHA1(815bda1ac000532c915c2d65ffdb04fee6fa8201) )
4535        ROM_LOAD( "tw1cg3.13d",   0x600000, 0x200000, CRC(302d5c74) SHA1(5a823f6842cf0f79eb93da47d5bf8c5f51e420db) )
4536        ROM_LOAD( "tw1cg4.14d",   0x800000, 0x200000, CRC(ab8aa1df) SHA1(355192d999f493e0761fbc822fa9b30c33d8e1c4) )
4537        ROM_LOAD( "tw1cg5.16d",   0xa00000, 0x200000, CRC(5063f3d0) SHA1(ad8dd2f4184373a3a3ca748b411a5eec1835dc97) )
4538        ROM_LOAD( "tw1cg6.18d",   0xc00000, 0x200000, CRC(d764027c) SHA1(5cbf93392683885c220628936ba50c09cb40fcfb) )
4539        ROM_LOAD( "tw1cg7.19d",   0xe00000, 0x200000, CRC(8d89877e) SHA1(7d76d48d64d7ac5411d714a4bb83f37e3e5b8df6) )
4540
4541   ROM_REGION16_LE( 0x280000, "textilemap", 0 ) /* texture tilemap */
4542        ROM_LOAD( "tw1ccrl.3d",   0x000000, 0x200000, CRC(d08f5794) SHA1(336a97a2b060505e259e3bcedb9eb8aa4ea8815e) )
4543        ROM_LOAD( "tw1ccrh.1d",   0x200000, 0x080000, CRC(ad17e693) SHA1(4f06dc82c03159894fb8e10383862920f94563b1) )
4544
4545   ROM_REGION( 0x600000, "pointrom", 0 ) /* 3d model data */
4546        ROM_LOAD( "tw1ptrl0.18k", 0x000000, 0x080000, CRC(44ac5e86) SHA1(5e42db58f2e352c0fe5e49588a9283817dd15ab1) )
4547        ROM_LOAD( "tw1ptrl1.16k", 0x080000, 0x080000, CRC(3c769860) SHA1(19b32c3d262f2a9d07354fbd6ac6be97b05f176e) )
4548        ROM_LOAD( "tw1ptrl2.15k", 0x100000, 0x080000, CRC(6e94103c) SHA1(ee90b77939a9f5780ce271882133cdf977eb643e) )
4549        ROM_LOAD( "tw1ptrl3.14k", 0x180000, 0x080000, CRC(e3ce5eb2) SHA1(4e15a6f630be15eb017cd51c5e7901db3138a061) )
4550        ROM_LOAD( "tw1ptrm0.18j", 0x200000, 0x080000, CRC(e170cea2) SHA1(ca259508d76fdab97a9d0502f871f0e560e6c308) )
4551        ROM_LOAD( "tw1ptrm1.16j", 0x280000, 0x080000, CRC(36a32237) SHA1(f46851dc5c094810ddc42d56310a9f85908bf715) )
4552        ROM_LOAD( "tw1ptrm2.15j", 0x300000, 0x080000, CRC(c426c278) SHA1(64232ac3c1649e0d0adb4b03e58b8b5ea4013f83) )
4553        ROM_LOAD( "tw1ptrm3.14j", 0x380000, 0x080000, CRC(d9b9a651) SHA1(0c49a051526081149d894d629f19cb0f2b66a698) )
4554        ROM_LOAD( "tw1ptru0.18f", 0x400000, 0x080000, CRC(62a9e9fb) SHA1(24739adba029b0acf2d7078962c9d01098a29a6c) )
4555        ROM_LOAD( "tw1ptru1.16f", 0x480000, 0x080000, CRC(2fd36177) SHA1(368b915261d914be01ae9daeb52571bead52d14d) )
4556        ROM_LOAD( "tw1ptru2.15f", 0x500000, 0x080000, CRC(ceacb1c9) SHA1(b86cf576e16bbe26ad0d6d6df8bf28d0071c25e2) )
4557        ROM_LOAD( "tw1ptru3.14f", 0x580000, 0x080000, CRC(939044c2) SHA1(f4c1c0a1c2f07ca7f784d59ef4162a2a6a8bbc43) )
4558
4559   ROM_REGION( 0xa00000, "c352", 0 ) /* sound samples */
4560        ROM_LOAD( "tw1wavea.2l",  0x000000, 0x400000, CRC(ebce6366) SHA1(44ebe90ff3c7af5bebbf1baba3b7a2b1863daebb) )
4561ROM_END
4562
4563ROM_START( aquajet )
4564   ROM_REGION( 0x400000, "maincpu", 0 ) /* main program */
4565        ROM_LOAD32_BYTE( "aj2ver-b.1",   0x000003, 0x100000, CRC(3a67b9f4) SHA1(8cd51f319e082297fdb99634486fe297a0ace654) )
4566        ROM_LOAD32_BYTE( "aj2ver-b.2",   0x000002, 0x100000, CRC(f5e8fc96) SHA1(e23fcf6f84724d1de15870ff578ff8a6b26e8f31) )
4567        ROM_LOAD32_BYTE( "aj2ver-b.3",   0x000001, 0x100000, CRC(ef6ebcf7) SHA1(358973b678b9a3065e945fb589af16e8102d437b) )
4568        ROM_LOAD32_BYTE( "aj2ver-b.4",   0x000000, 0x100000, CRC(7799b909) SHA1(e40005f96f51742b2778605926b8184c9b2c1ad2) )
4569
4570   ROM_REGION( 0x10000*2, "master", 0 ) /* Master DSP */
4571   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
4572
4573   ROM_REGION( 0x10000*2, "slave", 0 ) /* Slave DSP */
4574   ROM_LOAD16_WORD( "c71.bin", 0,0x1000*2, CRC(47c623ab) SHA1(e363ac50f5556f83308d4cc191b455e9b62bcfc8) )
4575
4576   ROM_REGION( 0x80000, "mcu", ROMREGION_ERASE00 ) /* BIOS */
4577
4578   ROM_REGION16_LE( 0x080000, "user4", 0 ) /* MCU BIOS */
4579        ROM_LOAD( "aj1data.8k",   0x000000, 0x080000, CRC(52bcc6d5) SHA1(25319ea6db35cc9bdcb39cc83d597a2a9f1690f3) )
4580
4581   ROM_REGION( 0x800000, "sprite", ROMREGION_DISPOSE ) /* 32x32x8bpp sprite tiles */
4582        ROM_LOAD( "aj1scg0.12f",  0x000000, 0x200000, CRC(13ea766c) SHA1(a1a259bd8f468b90cbc891f1c2875fe03bba9802) )
4583        ROM_LOAD( "aj1scg1.10f",  0x200000, 0x200000, CRC(cb3638de) SHA1(0af99aaf00782036d7f479b00b0c3d9d7ad4fc37) )
4584        ROM_LOAD( "aj1scg2.8f",   0x400000, 0x200000, CRC(1048a09b) SHA1(6859533e24db5ac54e28d480aaac7b411a648dfe) )
4585
4586   ROM_REGION( 0x200000*8, "textile", ROMREGION_DISPOSE) /* 16x16x8bpp texture tiles */
4587        ROM_LOAD( "aj1cg0.8d",    0x000000, 0x200000, CRC(b814e1eb) SHA1(1af29897dcfd0a58743b4fcdd5049d9e6e3d4cbd) )
4588        ROM_LOAD( "aj1cg1.10d",   0x200000, 0x200000, CRC(dc63d496) SHA1(d3c3eea6b134850004062dd513c0f26096101227) )
4589        ROM_LOAD( "aj1cg2.12d",   0x400000, 0x200000, CRC(71fbb571) SHA1(40f84ab5a4a7bb4438fb53751762609671d17800) )
4590        ROM_LOAD( "aj1cg3.13d",   0x600000, 0x200000, CRC(e28052e2) SHA1(3dbc446d7a13312ed4c1d20c2e1209947853f2c4) )
4591        ROM_LOAD( "aj1cg4.14d",   0x800000, 0x200000, CRC(c77ae1a0) SHA1(e15f2ccbadb8634f6e5cfd2cf48f428d68bd92e1) )
4592        ROM_LOAD( "aj1cg5.16d",   0xa00000, 0x200000, CRC(15be0080) SHA1(ca14dfd2a66996f0b32fa1155c04f21d300e8f30) )
4593        ROM_LOAD( "aj1cg6.18d",   0xc00000, 0x200000, CRC(1a4f733a) SHA1(60a991f06e73667fa2c9016189999c4301cba24f) )
4594        ROM_LOAD( "aj1cg7.19d",   0xe00000, 0x200000, CRC(ea118130) SHA1(24ef22e5c8c6f6e8a01c72466be1e7acbfba63bc) )
4595
4596   ROM_REGION16_LE( 0x280000, "textilemap", 0 ) /* texture tilemap */
4597        ROM_LOAD( "aj1ccrl.3d",   0x000000, 0x200000, CRC(3cc7a247) SHA1(336e4dd506d932987e20a5890dd3b0db75c02ccf) )
4598        ROM_LOAD( "aj1ccrh.1d",   0x200000, 0x080000, CRC(9d936030) SHA1(a383bcca494a9f8d9a08fbe9940c8071d4525d65) )
4599
4600   ROM_REGION( 0x600000, "pointrom", 0 ) /* 3d model data */
4601        ROM_LOAD( "aj1ptrl0.18k", 0x000000, 0x080000, CRC(16205d45) SHA1(7e9681af852e2e875f80cbbe350e4982eaf80884) )
4602        ROM_LOAD( "aj1ptrl1.16k", 0x080000, 0x080000, CRC(6f114da7) SHA1(a1e7349ef8eb0ef043fce06f88bfbb76c2967393) )
4603        ROM_LOAD( "aj1ptrl2.15k", 0x100000, 0x080000, CRC(719b73f0) SHA1(bf8530a706097ae663769090177f1f259c540aa6) )
4604        ROM_LOAD( "aj1ptrl3.14k", 0x180000, 0x080000, CRC(9555fe31) SHA1(03bdd0784817191b3600d643b775191181a21706) )
4605        ROM_LOAD( "aj1ptrm0.18j", 0x200000, 0x080000, CRC(89bee2e0) SHA1(d84b06ef1318814fcf4782fef09a85ae1a87beb8) )
4606        ROM_LOAD( "aj1ptrm1.16j", 0x280000, 0x080000, CRC(0ecf88c7) SHA1(20b7cb09a6a13599cac024ef19c73612ce2952f6) )
4607        ROM_LOAD( "aj1ptrm2.15j", 0x300000, 0x080000, CRC(829bc7ba) SHA1(7104d66a027911e38ecf521f01ff098ccb76d5fb) )
4608        ROM_LOAD( "aj1ptrm3.14j", 0x380000, 0x080000, CRC(7d0a222a) SHA1(e78c405d00429580015c6c7d1bcd35393317a769) )
4609        ROM_LOAD( "aj1ptru0.18f", 0x400000, 0x080000, CRC(90d4e36a) SHA1(bdc44aac6aef5266d289f03c816aa2abdb263e9b) )
4610        ROM_LOAD( "aj1ptru1.16f", 0x480000, 0x080000, CRC(bf0cf4bf) SHA1(bbf06c7605c083d2fb8c72528c5c9d3b8b067073) )
4611        ROM_LOAD( "aj1ptru2.15f", 0x500000, 0x080000, CRC(91ffbb77) SHA1(fbfe7d32ef22037f7190d1b8263b5e8c55f2d892) )
4612        ROM_LOAD( "aj1ptru3.14f", 0x580000, 0x080000, CRC(d83d8d42) SHA1(e1561ce4538b01db92b7e645ad008cd1a2ddaf8a) )
4613
4614   ROM_REGION( 0xa00000, "c352", 0 ) /* sound samples */
4615        ROM_LOAD( "aj1waveb.1l",  0x000000, 0x400000, CRC(ab5a457f) SHA1(c34531fd574eb0c3e78fc31a9af8658df3446adc) )
4616        ROM_LOAD( "aj1wavea.2l",  0x400000, 0x400000, CRC(8c72ea59) SHA1(3ae8dbd8baae08f1daab2b218932ba9d9451231d) )
4617ROM_END
4618
43674619/*******************************************************************/
43684620
43694621static INPUT_PORTS_START( alpiner )
r4878r4879
45394791   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
45404792INPUT_PORTS_END /* Cyber Cycles */
45414793
4794static INPUT_PORTS_START( tokyowar )
4795   PORT_START("DSW0")
4796   PORT_DIPNAME( 0x01, 0x01, "DIP4-1 (Test Mode)" )
4797   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4798   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4799   PORT_DIPNAME( 0x02, 0x02, "DIP4-2" )
4800   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4801   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4802   PORT_DIPNAME( 0x04, 0x04, "DIP4-3" )
4803   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4804   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4805   PORT_DIPNAME( 0x08, 0x08, "DIP4-4" )
4806   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4807   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4808   PORT_DIPNAME( 0x10, 0x10, "DIP4-5" )
4809   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4810   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4811   PORT_DIPNAME( 0x20, 0x20, "DIP4-6" )
4812   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4813   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4814   PORT_DIPNAME( 0x40, 0x40, "DIP4-7" )
4815   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4816   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4817   PORT_DIPNAME( 0x80, 0x80, "DIP4-8" )
4818   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4819   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4820
4821   DRIVING_ANALOG_PORTS
4822
4823   PORT_START("MCUP5A")
4824   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
4825   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4826   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
4827   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
4828   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 ) /* VIEW */
4829   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON4 ) /* RIGHT */
4830   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON5 ) /* LEFT */
4831   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4832
4833   PORT_START("MCUP5B")
4834   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
4835   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4836   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
4837   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
4838   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
4839   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
4840   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
4841   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4842INPUT_PORTS_END /* Tokyo Wars */
4843
4844static INPUT_PORTS_START( aquajet )
4845   PORT_START("DSW0")
4846   PORT_DIPNAME( 0x01, 0x01, "DIP4-1 (Test Mode)" )
4847   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
4848   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4849   PORT_DIPNAME( 0x02, 0x02, "DIP4-2" )
4850   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
4851   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4852   PORT_DIPNAME( 0x04, 0x04, "DIP4-3" )
4853   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
4854   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4855   PORT_DIPNAME( 0x08, 0x08, "DIP4-4" )
4856   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
4857   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4858   PORT_DIPNAME( 0x10, 0x10, "DIP4-5" )
4859   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
4860   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4861   PORT_DIPNAME( 0x20, 0x20, "DIP4-6" )
4862   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
4863   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4864   PORT_DIPNAME( 0x40, 0x40, "DIP4-7" )
4865   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
4866   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4867   PORT_DIPNAME( 0x80, 0x80, "DIP4-8" )
4868   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
4869   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
4870
4871   PORT_START("GAS")
4872   PORT_BIT( 0x7f, 0x00, IPT_PEDAL ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
4873
4874   PORT_START("STEER")
4875   PORT_BIT( 0xff, 0x80, IPT_PADDLE ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
4876
4877   PORT_START("STICKY")
4878   PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y ) PORT_SENSITIVITY(100) PORT_KEYDELTA(10)
4879
4880   PORT_START("MCUP5A")
4881   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
4882   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4883   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
4884   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
4885   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
4886   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
4887   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
4888   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4889
4890   PORT_START("MCUP5B")
4891   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
4892   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
4893   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
4894   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
4895   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
4896   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
4897   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
4898   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
4899INPUT_PORTS_END /* Aqua Jet */
4900
45424901static INPUT_PORTS_START( propcycl )
45434902   PORT_START("DSW0")   /* DIP4 */
45444903   PORT_DIPNAME( 0x01, 0x01, "DIP1" )
r4878r4879
52465605   // install_130_speedup(machine); // with speed up the SUBCPU START WAIT test fails
52475606}
52485607
5608static DRIVER_INIT( tokyowar )
5609{
5610   namcos22s_init(machine, NAMCOS22_TOKYO_WARS);
5611
5612   memory_install_read8_handler(cputag_get_address_space(machine, "mcu", ADDRESS_SPACE_IO), M37710_ADC0_L, M37710_ADC7_H, 0, 0, tokyowar_mcu_adc_r);
5613}
5614
5615static DRIVER_INIT( aquajet )
5616{
5617   namcos22s_init(machine, NAMCOS22_AQUA_JET);
5618
5619   memory_install_read8_handler(cputag_get_address_space(machine, "mcu", ADDRESS_SPACE_IO), M37710_ADC0_L, M37710_ADC7_H, 0, 0, aquajet_mcu_adc_r);
5620}
5621
52495622/************************************************************************************/
52505623
52515624/*     YEAR, NAME,    PARENT,    MACHINE,   INPUT,    INIT,     MNTR,  COMPANY, FULLNAME,                                    FLAGS */
r4878r4879
52645637GAME( 1996, victlapw, 0,        namcos22,  victlap,  victlap,  ROT0, "Namco", "Ace Driver: Victory Lap (Rev. ADV2, World)", GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52655638
52665639/* Super System22 games */
5267GAME( 1995, airco22b, 0,        namcos22s, airco22,  airco22,  ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B, Japan)"           , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) /* fails DSP RAM test */
5640GAME( 1995, airco22b, 0,        namcos22s, airco22,  airco22,  ROT0, "Namco", "Air Combat 22 (Rev. ACS1 Ver.B, Japan)"           , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING ) /* boots but missing sprite clear DMA? */
52685641GAME( 1995, alpinerd, 0,        namcos22s, alpiner,  alpiner,  ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.D)"             , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52695642GAME( 1995, alpinerc, alpinerd, namcos22s, alpiner,  alpiner,  ROT0, "Namco", "Alpine Racer (Rev. AR2 Ver.C)"             , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52705643GAME( 1995, cybrcycc, 0,        namcos22s, cybrcycc, cybrcyc,  ROT0, "Namco", "Cyber Cycles (Rev. CB2 Ver.C)"             , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
r4878r4879
52725645GAME( 1995, timecris, 0,        namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.B)"              , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52735646GAME( 1995, timecrsa, timecris, namcos22s, timecris, timecris, ROT0, "Namco", "Time Crisis (Rev. TS2 Ver.A)"              , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52745647GAME( 1996, alpinr2b, 0,        namcos22s, alpiner,  alpiner2, ROT0, "Namco", "Alpine Racer 2 (Rev. ARS2 Ver.B)"          , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
5648GAME( 1996, alpinr2a, alpinr2b, namcos22s, alpiner,  alpiner2, ROT0, "Namco", "Alpine Racer 2 (Rev. ARS2 Ver.A)"          , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING )   /* issues with step lock */
52755649GAME( 1996, alpinesa, 0,        namcos22s, alpiner,  alpinesa, ROT0, "Namco", "Alpine Surfer (Rev. AF2 Ver.A)"            , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
5276GAME( 1996, propcycl, 0,        namcos22s, propcycl, propcycl, ROT0, "Namco", "Prop Cycle (Rev PR2 Ver.A)"                , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
5277//GAME( 1996, tokyowrx, "Tokyo Wars")
5278//GAME( 1996, aquajetx, "Aqua Jet")
5650GAME( 1996, propcycl, 0,        namcos22s, propcycl, propcycl, ROT0, "Namco", "Prop Cycle (Rev. PR2 Ver.A)"                , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
5651GAME( 1996, tokyowar, 0,        namcos22s, tokyowar, tokyowar, ROT0, "Namco", "Tokyo Wars (Rev. TW2 Ver.A)"                , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS|GAME_NOT_WORKING )   /* missing sprite clear DMA?  or protection? */
5652GAME( 1996, aquajet,  0,        namcos22s, aquajet,  aquajet,  ROT0, "Namco", "Aqua Jet (Rev. AJ2 Ver.B)"                , GAME_IMPERFECT_SOUND|GAME_IMPERFECT_GRAPHICS )
52795653//GAME( 1997, armdilox, "Armidillo Racing")
src/mame/drivers/dec0.c
r4878r4879
16641664   ROM_LOAD( "ep03-3", 0x08000, 0x08000, CRC(5b164b24) SHA1(b217a2ac8b26aebd208631a13030487ed27d232e) )
16651665
16661666   ROM_REGION( 0x200000, "sub", 0 )   /* HuC6280 CPU */
1667   ROM_LOAD( "en_24.a2", 0x01e00, 0x0200, CRC(b8e2ca98) SHA1(bd1e193c544dc17a665aa6c4d3b844775ed08b43) )
1667   ROM_LOAD( "en_24_mb7124e.a2", 0x01e00, 0x0200, CRC(b8e2ca98) SHA1(bd1e193c544dc17a665aa6c4d3b844775ed08b43) )
16681668
16691669   ROM_REGION( 0x20000, "gfx1", ROMREGION_DISPOSE ) /* chars */
16701670   ROM_LOAD( "ep23", 0x00000, 0x10000, CRC(a77e4ab1) SHA1(d06cc847192b6c7f642e4ff7128e298d0aa034b2) )
r4878r4879
16941694
16951695   ROM_REGION( 0x10000, "oki", 0 )   /* ADPCM samples */
16961696   ROM_LOAD( "ep02", 0x00000, 0x10000, CRC(711ce46f) SHA1(939a8545e53776ff2180d2c7e63bc997689c088e) )
1697
1698/*
1699MB7116E at 12C on CPU board - Removing this causes all sprites to disappear
1700
1701MB7124E at 12A on ROM Board (although the board
1702is screened as MB7130) - Removing this causes the
1703display to disappear, although coining up makes
1704the correct text appear (and sound to play),
1705intro graphics appear on starting a game, then
1706nothing, it won't even play blind (although the
1707coin up sound still plays on coin insert)
1708*/
1709   ROM_REGION( 0xc00, "proms", 0 )   /* PROMs */
1710   ROM_LOAD( "mb7116e.12c", 0x000, 0x400, CRC(c288a256) SHA1(cb6813507cfa6fa0b74f4692247fd1d4466c659b) )
1711   ROM_LOAD( "mb7122e.17e", 0x400, 0x800, CRC(64764ecf) SHA1(9385a8a2fae8b8f6310194331a77d97eca7917bd) )
16971712ROM_END
16981713
16991714ROM_START( robocopw )
src/mame/drivers/aquarium.c
r4878r4879
146146   AM_RANGE(0xc02000, 0xc03fff) AM_RAM_WRITE(aquarium_txt_videoram_w) AM_BASE(&aquarium_txt_videoram)
147147   AM_RANGE(0xc80000, 0xc81fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
148148   AM_RANGE(0xd00000, 0xd00fff) AM_RAM_WRITE(paletteram16_RRRRGGGGBBBBRGBx_word_w) AM_BASE(&paletteram16)
149   AM_RANGE(0xd80014, 0xd8001f) AM_WRITE(SMH_RAM) AM_BASE(&aquarium_scroll)
149   AM_RANGE(0xd80014, 0xd8001f) AM_WRITEONLY AM_BASE(&aquarium_scroll)
150150   AM_RANGE(0xd80068, 0xd80069) AM_WRITENOP      /* probably not used */
151151   AM_RANGE(0xd80080, 0xd80081) AM_READ_PORT("DSW")
152152   AM_RANGE(0xd80082, 0xd80083) AM_READNOP   /* stored but not read back ? check code at 0x01f440 */
src/mame/drivers/maygayv1.c
r4878r4879
464464   for (i = 0; i < 16; i++)
465465      if (which & (1 << i))
466466      {
467         int val;
467/*
468            int val;
468469
469         val = i8279.ram[i] & 0xff;
470/*
470            val = i8279.ram[i] & 0xff;
471
471472            val = i8279.ram[i] & 0x0f;
472473            if (i8279.inhibit & 0x01)
473474                val = i8279.clear & 0x0f;
src/mame/drivers/opwolf.c
r4878r4879
3636To keep the input span 0-255 a multiplier (300/256 ?)
3737would be used.
3838
39Operation Wolf
40Taito, 1987
3941
42PCB Layouts
43-----------
44
45SOUND BOARD
46J1100122A (J1100122B) \ <-- minor rev, but no difference on PCB
47K1100268A (K1100268B) /
48K1100268A OPERATION WOLF (sticker)
49|-----------------------------------------|
50|X                S              8464     |
51|        VR1         PC060HA     B20-07.10|
52|N       MB3735       YM2151        Z80   |
53|               SEIBU YM3012          8MHz|
54|               HB-41                     |
55|                                         |
56|        VR2                              |
57|        MB3735                           |
58|    TL074                                |
59|T       TC0060DCA                        |
60|        TC0060DCA                        |
61|    TL074                                |
62|                                         |
63|    M5205                                |
64|    384kHz                               |
65|    M5205                       B20-08.21|
66|-----------------------------------------|
67Notes:
68      Z80       - clock 4.000MHz [8/2]
69      YM2151    - clock 4.000MHz [8/2]
70      YM3012    - 2-channel serial input floating D/A converter
71      M5205     - clock 384kHz (via resonator)
72      HB-41     - Seibu HB-41 ceramic module (sound/filter related)
73      MB3735    - Audio power amp IC
74      TL074     - Op amp
75      8464      - 8kx8 SRAM
76      PC060HA   - Taito PC060HA CIU custom IC (DIP28). Manufactured by Fujitsu
77      B20-07.10 - 27C512 EPROM (DIP28)
78      B20-08.21 - 234000 mask ROM (DIP40)
79      VR1/2     - Volume pots
80      S         - 30 pin flat cable joining to main board (for main board/sound board communication)
81      X         - 5 pin connector for sound output (left+right speakers)
82      N         - 10 pin connector for power inputs
83      T         - 18-way edge connector (single sided, pins on solder side only)
84
85      Pinouts
86      -------
87              X  Connector            N  Connector      T  Connector
88              ------------            ------------      ------------
89              1  Right Speaker (+)    1  GND            1  GND
90              2  Right Speaker (-)    2  GND            2  GND
91              3  Left  Speaker (+)    3  not used       3  GND
92              4  not used             4  +5 Volts       4  GND
93              5  Left  Speaker (-)    5  +5 Volts       5  Optical sensor input from gun
94                                      6  not used       6  not used
95                                      7  -5 Volts       7  not used
96                                      8  +12 Volts      8  not used
97                                      9  not used       9  not used
98                                      10 not used       10 not used
99                                                        11 not used
100                                                        12 not used
101                                                        13 not used
102                                                        14 not used
103                                                        15 +5 Volts
104                                                        16 +5 Volts
105                                                        17 +5 Volts
106                                                        18 +5 Volts
107MAIN PCB
108J1100130A
109K1100288A
110M4300084F OPERATION WOLF (sticker)
111K1100303A OPERATION WOLF (sticker)
112|----------------------------------------------------|
113|         SWB SWA        S      M                    |
114| 12MHz                                       16MHz  |
115|H               6116                       26.686MHz|
116|      TC0070RGB 6116             B20-09.19 MB3771   |
117|                                                    |
118|                                  |-------|B20-13.13|
119|                    2018 2018     |TAITO  |         |
120|G     PC050CM       2018 2018     |PC080SN|         |
121|                       |-------|  |-------|         |
122|   B20-18.73           |TAITO  |               DIP28|
123|   B20-14.72           |PC0900J|      43256  DIP28  |
124| B20-12.92             |-------|          43256     |
125|               DIP28      B20-03-2.30               |
126|    68000      DIP28      B20-19.29  8464  8464     |
127| B20-11.85     B20-05-2.40  DIP28                   |
128| B20-10.84     B20-04.39    DIP28                   |
129|----------------------------------------------------|
130Notes:
131      68000       - clock 8.000MHz [16/2]
132      6116        - 2k x8 SRAM (color RAM)
133      43256       - 32k x8 SRAM (tile RAM)
134      8464        - 8k x8 SRAM (work RAM)
135      2018        - 2k x8 SRAM (sprite RAM)
136      PC080SN     - Taito custom tilemap generator IC (connected to 43256 SRAM)
137      PC0900J     - Taito custom sprite generator IC (connected to 2018 SRAM)
138      DIP28       - unpopulated DIP28 socket
139      B20-18.73   - Taito custom C-Chip marked 'TC0030CMD, with sticker 'B20-18'
140      TC0070RGB   - Taito custom ceramic module RGB mixer IC
141      PC050CM     - Taito custom ceramic module (input related functions)
142      MB3771      - Fujitsu MB3771 master reset IC
143      S           - 30 pin flat cable connector joining to sound PCB
144      M           - 4 pin connector for gun vibration motor power and grenade button
145      H           - 12 pin connector for power input
146      G           - 44-way edge connector
147      B20-13/14   - MN234000 mask ROM
148      B20-03.30   - \
149      B20-19.29   -  |
150      B20-04.39   -  | 27C512 EPROM
151      B20-05.40   - _|
152      B20-09.19   - \
153      B20-10.84   -  |
154      B20-11.85   -  | MMI PAL16L8ACN
155      B20-12.92   - _|
156
157      Measurements
158      ------------
159      XTAL1 - 26.68558MHz
160      XTAL2 - 15.99965MHz
161      XTAL3 - 11.9999MHz
162      VSync - 60.0551Hz
163      HSync - 15.6742kHz
164
165      Pinouts
166      -------
167              M  Connector               H  Connector           G  Connector
168              ------------               ------------           ------------
169              1  BUTTON 2 (grenade)      1  GND                Solder   Parts
170              2  not used                2  GND                GND  A   1  GND
171              3  +12V (to motor in gun)  3  GND          VIDEO GND  B   2  RED
172              4  -12V (to motor in gun)  4  GND               BLUE  C   3  GREEN
173                                         5  +5 Volts      not used  D   4  SYNC
174                                         6  +5 Volts      not used  E   5  not used
175                                         7  +5 Volts      not used  F   6  not used
176                                         8  -5 Volts      not used  H   7  not used
177                                         9  +13 Volts*      COIN B  J   8  COIN A
178                                         10 not used       METER B  K   9  METER A
179                                         11 +12 Volts    LOCKOUT B  L  10  LOCKOUT A
180                                         12 +12 Volts         TILT  M  11  SERVICE CREDIT
181                                   * leave unconnected!   not used  N  12  START
182                                                          not used  P  13  not used
183                                                          not used  R  14  not used
184                                                          not used  S  15  not used
185                                                          not used  T  16  not used
186                                                          not used  U  17  not used
187                                                          not used  V  18  not used
188                                                          not used  W  19  not used
189                                                          not used  X  20  not used
190                                                          not used  Y  21  BUTTON 1 (bullets)
191                                                          not used  Z  22  not used
192
193
194
195Gun board (inside gun)
196
197J9100095A
198K9100122A
199|-----------|
200|CN1        |
201|           |
202|-----------|
203Notes:
204      PCB contains mostly caps/resistors and three small opto-related 8-pin ICs
205      CN1 - 4 pin connector joins to connector M on main board
206
207
40208Stephh's notes (based on the game M68000 code and some tests) :
41209
422101) 'opwolf' and 'opwolfu'
src/mame/drivers/surpratk.c
r4878r4879
138138   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
139139   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
140140   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
141   PORT_DIPSETTING(    0x20, "Difficult" )
142   PORT_DIPSETTING(    0x00, "Very Difficult" )
141   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
142   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
143143   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
144144   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
145145   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/speedbal.c
r4878r4879
149149   PORT_DIPNAME( 0x30, 0x30, "Difficulty 1" )
150150   PORT_DIPSETTING(    0x30, DEF_STR( Very_Easy) )
151151   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
152   PORT_DIPSETTING(    0x10, "Difficult" )
153   PORT_DIPSETTING(    0x00, "Very Difficult" )
152   PORT_DIPSETTING(    0x10, DEF_STR( Difficult ) )
153   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
154154   PORT_DIPNAME( 0xc0, 0xc0, "Difficulty 2" )
155155   PORT_DIPSETTING(    0xc0, DEF_STR( Very_Easy) )
156156   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
157   PORT_DIPSETTING(    0x40, "Difficult" )
158   PORT_DIPSETTING(    0x00, "Very Difficult" )
157   PORT_DIPSETTING(    0x40, DEF_STR( Difficult ) )
158   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
159159
160160   PORT_START("P1")
161161   PORT_BIT( 0x01, IP_ACTIVE_LOW , IPT_BUTTON1 )
src/mame/drivers/bagman.c
r4878r4879
180180   //AM_RANGE(0xa800, 0xa805) AM_READ(bagman_ls259_r) /*just for debugging purposes*/
181181   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w)
182182   AM_RANGE(0xa001, 0xa002) AM_WRITE(bagman_flipscreen_w)
183   AM_RANGE(0xa003, 0xa003) AM_WRITE(SMH_RAM) AM_BASE(&bagman_video_enable)
184   AM_RANGE(0xc000, 0xffff) AM_WRITE(SMH_ROM)   /* Super Bagman only */
185   AM_RANGE(0x9800, 0x981f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* hidden portion of color RAM */
183   AM_RANGE(0xa003, 0xa003) AM_WRITEONLY AM_BASE(&bagman_video_enable)
184   AM_RANGE(0xc000, 0xffff) AM_ROM /* Super Bagman only */
185   AM_RANGE(0x9800, 0x981f) AM_WRITEONLY AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* hidden portion of color RAM */
186186                           /* here only to initialize the pointer, */
187187                           /* writes are handled by bagman_colorram_w */
188188   AM_RANGE(0xa800, 0xa805) AM_WRITE(bagman_ls259_w) /* TMS5110 driving state machine */
r4878r4879
205205   AM_RANGE(0x7000, 0x77ff) AM_RAM
206206   AM_RANGE(0x8800, 0x8bff) AM_RAM_WRITE(bagman_videoram_w) AM_BASE(&videoram)
207207   AM_RANGE(0x9800, 0x9bff) AM_RAM_WRITE(bagman_colorram_w) AM_BASE(&colorram)
208   AM_RANGE(0x9800, 0x981f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* hidden portion of color RAM */
208   AM_RANGE(0x9800, 0x981f) AM_WRITEONLY AM_BASE(&spriteram) AM_SIZE(&spriteram_size)   /* hidden portion of color RAM */
209209                           /* here only to initialize the pointer, */
210210                           /* writes are handled by bagman_colorram_w */
211211   AM_RANGE(0x9c00, 0x9fff) AM_WRITENOP   /* written to, but unused */
212212   AM_RANGE(0xa000, 0xa000) AM_WRITE(interrupt_enable_w)
213213   AM_RANGE(0xa001, 0xa002) AM_WRITE(bagman_flipscreen_w)
214   AM_RANGE(0xa003, 0xa003) AM_WRITE(SMH_RAM) AM_BASE(&bagman_video_enable)
214   AM_RANGE(0xa003, 0xa003) AM_WRITEONLY AM_BASE(&bagman_video_enable)
215215   AM_RANGE(0xa004, 0xa004) AM_WRITE(bagman_coin_counter_w)
216216   AM_RANGE(0xa800, 0xa800) AM_READ_PORT("DSW")
217217
src/mame/drivers/chihiro.c
r4878r4879
1717ADDRESS_MAP_END
1818
1919
20VIDEO_START(chihiro)
20static VIDEO_START(chihiro)
2121{
2222
2323}
2424
25VIDEO_UPDATE(chihiro)
25static VIDEO_UPDATE(chihiro)
2626{
2727   return 0;
2828}
src/mame/drivers/namcos23.c
r4878r4879
2323    TODO:
2424    - Palette is not right.
2525
26    - H8/3002 does not handshake.  Looks like it needs to speak serially with the I/O board.
26    - H8/3002 now communicates with the H8/3334 on the I/O board, but it's not reliable yet.
2727
2828    - Hook up actual inputs (?) via the 2 serial latches at d00004 and d00006.
2929      Works like this: write to d00004, then read d00004 12 times.  Ditto at
r4878r4879
745745static tilemap *bgtilemap;
746746static UINT32 *namcos23_textram, *namcos23_shared_ram;
747747static UINT32 *namcos23_charram;
748static UINT8 namcos23_jvssense;
748749
749750static UINT16 nthword( const UINT32 *pSource, int offs )
750751{
r4878r4879
994995}
995996
996997// must return this magic number
998static UINT32 s23_vbl = 0;
999
1000static INTERRUPT_GEN(s23_interrupt)
1001{
1002   s23_vbl ^= 0x80008000;
1003}
1004
9971005static READ32_HANDLER(s23_unk_r)
9981006{
999   return 0x008e008e;
1007   return 0x008e008e | s23_vbl;
10001008}
10011009
10021010// this & 8 and this & 4 are checked
r4878r4879
10681076{
10691077   UINT16 *shared16 = (UINT16 *)namcos23_shared_ram;
10701078
1079   // fake that an I/O board is connected
1080   if ((offset == 0x4052/2) && (data == 0x78))
1081   {
1082      data = 0;
1083   }
1084
10711085   COMBINE_DATA(&shared16[BYTE_XOR_BE(offset)]);
10721086}
10731087
r4878r4879
10781092   return shared16[BYTE_XOR_BE(offset)];
10791093}
10801094
1081static WRITE16_HANDLER(cause_sync_w)
1082{
1083   UINT16 *shared16 = (UINT16 *)namcos23_shared_ram;
1084
1085   shared16[BYTE_XOR_BE(0x4052/2)] = 0;
1086}
1087
10881095/* H8/3002 MCU stuff */
10891096static ADDRESS_MAP_START( s23h8rwmap, ADDRESS_SPACE_PROGRAM, 16 )
10901097   AM_RANGE(0x000000, 0x07ffff) AM_READ(SMH_ROM)
r4878r4879
10931100   AM_RANGE(0x300000, 0x300001) AM_READNOP //AM_READ_PORT("IN1")
10941101   AM_RANGE(0x300002, 0x300003) AM_READNOP //AM_READ_PORT("IN2")
10951102   AM_RANGE(0x300010, 0x300011) AM_NOP
1096   AM_RANGE(0x300030, 0x300031) AM_WRITE(cause_sync_w)   // cheats comms with I/O board and makes SUBCPU TEST pass
1103   AM_RANGE(0x300030, 0x300031) AM_WRITENOP   // timecrs2 writes this when writing to the sync shared ram location, motoxgo doesn't
10971104ADDRESS_MAP_END
10981105
10991106static READ8_HANDLER( s23_mcu_p8_r )
r4878r4879
12131220   s23_setstate ^= 1;
12141221}
12151222
1216static UINT8 maintoio[16], mi_rd, mi_wr;
1217static UINT8 iotomain[16], im_rd, im_wr;
1223static UINT8 maintoio[64], mi_rd, mi_wr;
1224static UINT8 iotomain[64], im_rd, im_wr;
12181225
12191226static READ8_HANDLER( s23_mcu_iob_r )
12201227{
12211228   UINT8 ret = iotomain[im_rd];
12221229
12231230   im_rd++;
1224   im_rd &= 0xf;
1231   im_rd &= 0x3f;
12251232
12261233   if (im_rd == im_wr)
12271234   {
12281235      cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, CLEAR_LINE);
12291236   }
1237   else
1238   {
1239      cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, CLEAR_LINE);
1240      cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, ASSERT_LINE);
1241   }
12301242
12311243   return ret;
12321244}
r4878r4879
12341246static WRITE8_HANDLER( s23_mcu_iob_w )
12351247{
12361248   maintoio[mi_wr++] = data;
1237   mi_wr &= 0xf;
1249   mi_wr &= 0x3f;
12381250
12391251   cputag_set_input_line(space->machine, "ioboard", H8_SCI_0_RX, ASSERT_LINE);
12401252}
r4878r4879
12431255   PORT_START("H8PORT")
12441256INPUT_PORTS_END
12451257
1258
1259static READ8_HANDLER(s23_mcu_p6_r)
1260{
1261   // bit 1 = JVS cable present sense (1 = I/O board plugged in)
1262      return (namcos23_jvssense << 1) | 0xfd;
1263}
1264
1265static WRITE8_HANDLER(s23_mcu_p6_w)
1266{
1267//  printf("%02x to port 6\n", data);
1268}
1269
12461270static ADDRESS_MAP_START( s23h8iomap, ADDRESS_SPACE_IO, 8 )
1271   AM_RANGE(H8_PORT_6, H8_PORT_6) AM_READWRITE( s23_mcu_p6_r, s23_mcu_p6_w )
12471272   AM_RANGE(H8_PORT_7, H8_PORT_7) AM_READ_PORT( "H8PORT" )
12481273   AM_RANGE(H8_PORT_8, H8_PORT_8) AM_READ( s23_mcu_p8_r ) AM_WRITENOP
12491274   AM_RANGE(H8_PORT_A, H8_PORT_A) AM_READWRITE( s23_mcu_pa_r, s23_mcu_pa_w )
r4878r4879
12751300   UINT8 ret = maintoio[mi_rd];
12761301
12771302   mi_rd++;
1278   mi_rd &= 0xf;
1303   mi_rd &= 0x3f;
12791304
12801305   if (mi_rd == mi_wr)
12811306   {
r4878r4879
12881313static WRITE8_HANDLER( s23_iob_mcu_w )
12891314{
12901315   iotomain[im_wr++] = data;
1291   im_wr &= 0xf;
1316   im_wr &= 0x3f;
12921317
12931318   cputag_set_input_line(space->machine, "audiocpu", H8_SCI_0_RX, ASSERT_LINE);
12941319}
12951320
1321static UINT8 s23_tssio_port_4 = 0;
1322
1323static READ8_HANDLER( s23_iob_p4_r )
1324{
1325   return s23_tssio_port_4;
1326}
1327
1328static WRITE8_HANDLER( s23_iob_p4_w )
1329{
1330   s23_tssio_port_4 = data;
1331
1332   namcos23_jvssense = (data & 0x04) ? 0 : 1;
1333 }
1334
12961335/* H8/3334 (Namco C78) I/O board MCU */
12971336static ADDRESS_MAP_START( s23iobrdmap, ADDRESS_SPACE_PROGRAM, 8 )
12981337   AM_RANGE(0x0000, 0x0fff) AM_READ(SMH_ROM)
12991338   AM_RANGE(0xc000, 0xdfff) AM_RAM
13001339ADDRESS_MAP_END
13011340
1341/*
1342    port 5 bit 2 = LED to indicate transmitting packet to main
1343    port 4 bit 2 = SENSE line back to main (0 = asserted, 1 = dropped)
1344*/
13021345static ADDRESS_MAP_START( s23iobrdiomap, ADDRESS_SPACE_IO, 8 )
1346   AM_RANGE(H8_PORT_4, H8_PORT_4) AM_READWRITE( s23_iob_p4_r, s23_iob_p4_w )
13031347   AM_RANGE(H8_SERIAL_0, H8_SERIAL_0) AM_READWRITE( s23_iob_mcu_r, s23_iob_mcu_w )
13041348ADDRESS_MAP_END
13051349
13061350static DRIVER_INIT(ss23)
13071351{
13081352   mi_rd = mi_wr = im_rd = im_wr = 0;
1353   namcos23_jvssense = 1;
13091354}
13101355
13111356static const gfx_layout namcos23_cg_layout =
r4878r4879
14021447   MDRV_CPU_ADD("maincpu", R4650BE, 166000000)
14031448   MDRV_CPU_CONFIG(config)
14041449   MDRV_CPU_PROGRAM_MAP(ss23_map)
1450   MDRV_CPU_VBLANK_INT("screen", s23_interrupt)
14051451
14061452   MDRV_CPU_ADD("audiocpu", H83002, 14745600 )
14071453   MDRV_CPU_PROGRAM_MAP( s23h8rwmap)
r4878r4879
14121458   MDRV_CPU_PROGRAM_MAP( s23iobrdmap)
14131459   MDRV_CPU_IO_MAP( s23iobrdiomap)
14141460
1415   MDRV_QUANTUM_TIME(HZ(60000))
1461   MDRV_QUANTUM_TIME(HZ(60*4000))
14161462
14171463   MDRV_SCREEN_ADD("screen", RASTER)
14181464   MDRV_SCREEN_REFRESH_RATE(60)
src/mame/drivers/commando.c
r4878r4879
157157   PORT_DIPSETTING(    0x08, DEF_STR( On ) )
158158   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:4")
159159   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
160   PORT_DIPSETTING(    0x00, "Difficult" )
160   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
161161   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:3")
162162   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
163163   PORT_DIPSETTING(    0x20, DEF_STR( On ) )
src/mame/drivers/atarisy2.c
r4878r4879
853853   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("5/6A:!8,!7")
854854   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
855855   PORT_DIPSETTING(    0x02, DEF_STR( Medium ) )
856   PORT_DIPSETTING(    0x00, "Med. Hard" )
856   PORT_DIPSETTING(    0x00, DEF_STR( Medium_Hard ) )
857857   PORT_DIPSETTING(    0x03, DEF_STR( Hard ) )
858858   PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("5/6A:!6,!5")
859859   PORT_DIPSETTING(    0x08, "10000" )
r4878r4879
956956   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("5/6A:!8,!7")
957957   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
958958   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
959   PORT_DIPSETTING(    0x02, "Med. Hard" )
959   PORT_DIPSETTING(    0x02, DEF_STR( Medium_Hard ) )
960960   PORT_DIPSETTING(    0x03, DEF_STR( Hard ) )
961961   PORT_DIPNAME( 0x0c, 0x00, "Obstacles" )            PORT_DIPLOCATION("5/6A:!6,!5")
962962   PORT_DIPSETTING(    0x04, DEF_STR( Easy ) )
963963   PORT_DIPSETTING(    0x00, DEF_STR( Medium ) )
964   PORT_DIPSETTING(    0x08, "Med. Hard" )
964   PORT_DIPSETTING(    0x08, DEF_STR( Medium_Hard ) )
965965   PORT_DIPSETTING(    0x0c, DEF_STR( Hard ) )
966966   PORT_DIPNAME( 0x30, 0x00, "Wrenches" )            PORT_DIPLOCATION("5/6A:!4,!3")
967967   PORT_DIPSETTING(    0x10, "2" )
r4878r4879
10441044   PORT_DIPSETTING(    0x38, DEF_STR( Easiest ) )                                 /* 11                       5000                    Yes                 */
10451045   PORT_DIPSETTING(    0x30, DEF_STR( Very_Easy ) )                              /* 10                       6000                    Yes                 */
10461046   PORT_DIPSETTING(    0x28, DEF_STR( Easy ) )                                    /* 9                        8000                    Yes                 */
1047   PORT_DIPSETTING(    0x00, "Medium Easy" )                                    /* 8                        10000                   Yes                 */
1048   PORT_DIPSETTING(    0x20, "Medium Hard" )                                    /* 7                        11000                   Yes                 */
1047   PORT_DIPSETTING(    0x00, DEF_STR( Medium_Easy ) )                                    /* 8                        10000                   Yes                 */
1048   PORT_DIPSETTING(    0x20, DEF_STR( Medium_Hard ) )                                    /* 7                        11000                   Yes                 */
10491049   PORT_DIPSETTING(    0x10, DEF_STR( Hard ) )                                    /* 6                        13000                   Yes                 */
10501050   PORT_DIPSETTING(    0x08, DEF_STR( Very_Hard ) )                              /* 5                        15000                   No                  */
10511051   PORT_DIPSETTING(    0x18, DEF_STR( Hardest ) )                                 /* 4                        18000                   No                  */
src/mame/drivers/ninjakd2.c
r4878r4879
635635   PORT_DIPSETTING(    0x00, "50k and every 80k" )
636636   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6")
637637   PORT_DIPSETTING(    0x04, DEF_STR( Normal ) )
638   PORT_DIPSETTING(    0x00, "Difficult" )
638   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
639639   PORT_DIPNAME( 0x08, 0x08, "Infinite Lives" ) PORT_DIPLOCATION("SW1:5")
640640   PORT_DIPSETTING(    0x08, DEF_STR( Off )  )
641641   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/cubocd32.c
r4878r4879
138138   AM_RANGE(0xf80000, 0xffffff) AM_ROM AM_REGION("user1", 0x0)      /* Kickstart */
139139ADDRESS_MAP_END
140140
141int cubo_input_port_val = 0;
142int cubo_input_select = 0;
143UINT16 potgo_value = 0;
144int cd32_shifter[2];
141//int cubo_input_port_val = 0;
142//int cubo_input_select = 0;
143static UINT16 potgo_value = 0;
144static int cd32_shifter[2];
145145
146146static void cubocd32_potgo_w(running_machine *machine, UINT16 data)
147147{
src/mame/drivers/gng.c
r4878r4879
178178   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
179179   PORT_DIPSETTING(   0x40, DEF_STR( Easy ) )
180180   PORT_DIPSETTING(   0x60, DEF_STR( Normal ) )
181   PORT_DIPSETTING(   0x20, "Difficult" )
182   PORT_DIPSETTING(   0x00, "Very Difficult" )
181   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
182   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
183183   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
184184   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
185185   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/wc90b.c
r4878r4879
9090
9191#define TEST_DIPS false /* enable to test unmapped dip switches */
9292
93#define MASTER_CLOCK XTAL_14_31818MHz/2
94#define SOUND_CLOCK XTAL_20MHz/4
95#define YM2203_CLOCK XTAL_20MHz/16
96#define MSM5205_CLOCK XTAL_384kHz
97
9398extern UINT8 *wc90b_fgvideoram,*wc90b_bgvideoram,*wc90b_txvideoram;
9499
95100extern UINT8 *wc90b_scroll1x;
r4878r4879
108113
109114static int msm5205next;
110115
111static UINT8 *wc90b_shared;
112
113static READ8_HANDLER( wc90b_shared_r )
114{
115   return wc90b_shared[offset];
116}
117
118static WRITE8_HANDLER( wc90b_shared_w )
119{
120   wc90b_shared[offset] = data;
121}
122
123116static WRITE8_HANDLER( wc90b_bankswitch_w )
124117{
125118   int bankaddress;
126   UINT8 *RAM = memory_region(space->machine, "maincpu");
119   UINT8 *ROM = memory_region(space->machine, "maincpu");
127120
128
129121   bankaddress = 0x10000 + ((data & 0xf8) << 8);
130   memory_set_bankptr(space->machine, 1,&RAM[bankaddress]);
122   memory_set_bankptr(space->machine, 1,&ROM[bankaddress]);
131123}
132124
133125static WRITE8_HANDLER( wc90b_bankswitch1_w )
134126{
135127   int bankaddress;
136   UINT8 *RAM = memory_region(space->machine, "sub");
128   UINT8 *ROM = memory_region(space->machine, "sub");
137129
138
139130   bankaddress = 0x10000 + ((data & 0xf8) << 8);
140   memory_set_bankptr(space->machine, 2,&RAM[bankaddress]);
131   memory_set_bankptr(space->machine, 2,&ROM[bankaddress]);
141132}
142133
143134static WRITE8_HANDLER( wc90b_sound_command_w )
r4878r4879
149140static WRITE8_DEVICE_HANDLER( adpcm_control_w )
150141{
151142   int bankaddress;
152   UINT8 *RAM = memory_region(device->machine, "sub");
143   UINT8 *ROM = memory_region(device->machine, "audiocpu");
153144
154145   /* the code writes either 2 or 3 in the bottom two bits */
155146   bankaddress = 0x10000 + (data & 0x01) * 0x4000;
156   memory_set_bankptr(device->machine, 3,&RAM[bankaddress]);
147   memory_set_bankptr(device->machine, 3,&ROM[bankaddress]);
157148
158149   msm5205_reset_w(device,data & 0x08);
159150}
r4878r4879
171162   AM_RANGE(0xc000, 0xcfff) AM_RAM_WRITE(wc90b_bgvideoram_w) AM_BASE(&wc90b_bgvideoram)
172163   AM_RANGE(0xe000, 0xefff) AM_RAM_WRITE(wc90b_txvideoram_w) AM_BASE(&wc90b_txvideoram)
173164   AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(1)
174   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90b_shared_r, wc90b_shared_w) AM_BASE(&wc90b_shared)
165   AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE(1)
175166   AM_RANGE(0xfc00, 0xfc00) AM_WRITE(wc90b_bankswitch_w)
176167   AM_RANGE(0xfd00, 0xfd00) AM_WRITE(wc90b_sound_command_w)
177168   AM_RANGE(0xfd04, 0xfd04) AM_WRITEONLY AM_BASE(&wc90b_scroll1y)
r4878r4879
193184   AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_be_w) AM_BASE(&paletteram)
194185   AM_RANGE(0xe800, 0xefff) AM_ROM
195186   AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(2)
196   AM_RANGE(0xf800, 0xfbff) AM_READWRITE(wc90b_shared_r, wc90b_shared_w)
187   AM_RANGE(0xf800, 0xfbff) AM_RAM AM_SHARE(1)
197188   AM_RANGE(0xfc00, 0xfc00) AM_WRITE(wc90b_bankswitch1_w)
198189ADDRESS_MAP_END
199190
r4878r4879
351342/* handler called by the 2203 emulator when the internal timers cause an IRQ */
352343static void irqhandler(const device_config *device, int irq)
353344{
354   cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
345   /* NMI writes to MSM ports *only*! -AS */
346   //cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
355347}
356348
357349static const ym2203_interface ym2203_config =
r4878r4879
368360{
369361   static int toggle = 0;
370362
371   msm5205_data_w(device, msm5205next);
372   msm5205next >>= 4;
373
374363   toggle ^= 1;
375364   if(toggle)
365   {
366      msm5205_data_w(device, (msm5205next & 0xf0) >> 4);
376367      cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
368   }
369   else
370      msm5205_data_w(device, (msm5205next & 0x0f) >> 0);
377371}
378372
379373static const msm5205_interface msm5205_config =
380374{
381   adpcm_int,               /* interrupt function */
382   MSM5205_S96_4B      /* 4KHz 4-bit */
375   adpcm_int,      /* interrupt function */
376   MSM5205_S96_4B   /* 4KHz 4-bit */
383377};
384378
385379static MACHINE_DRIVER_START( wc90b )
386380
387381   /* basic machine hardware */
388   MDRV_CPU_ADD("maincpu", Z80, XTAL_14MHz/2)
382   MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK)
389383   MDRV_CPU_PROGRAM_MAP(wc90b_map1)
390384   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
391385
392   MDRV_CPU_ADD("sub", Z80, XTAL_14MHz/2)
386   MDRV_CPU_ADD("sub", Z80, MASTER_CLOCK)
393387   MDRV_CPU_PROGRAM_MAP(wc90b_map2)
394388   MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)
395389
396   MDRV_CPU_ADD("audiocpu", Z80, XTAL_19_6608MHz/8)
390   MDRV_CPU_ADD("audiocpu", Z80, SOUND_CLOCK)
397391   MDRV_CPU_PROGRAM_MAP(sound_cpu)
398392   /* IRQs are triggered by the main CPU */
399393
r4878r4879
414408   /* sound hardware */
415409   MDRV_SPEAKER_STANDARD_MONO("mono")
416410
417   MDRV_SOUND_ADD("ym", YM2203, 2510000/2)
411   MDRV_SOUND_ADD("ym", YM2203, YM2203_CLOCK)
418412   MDRV_SOUND_CONFIG(ym2203_config)
419413   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
420414
421   MDRV_SOUND_ADD("msm", MSM5205, 384000)
415   MDRV_SOUND_ADD("msm", MSM5205, MSM5205_CLOCK)
422416   MDRV_SOUND_CONFIG(msm5205_config)
423417   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
424418MACHINE_DRIVER_END
r4878r4879
565559#endif
566560
567561
568GAME( 1989, wc90b1, wc90, wc90b, wc90b, 0, ROT0, "bootleg", "Euro League", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
562GAME( 1989, wc90b1, wc90, wc90b, wc90b, 0, ROT0, "bootleg", "Euro League (Italian hack of Tecmo World Cup '90)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
569563GAME( 1989, wc90b2, wc90, wc90b, wc90b, 0, ROT0, "bootleg", "Worldcup '90", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
570564//GAME( 1989, wc90ba,  wc90, wc90b, wc90b, 0, ROT0, "bootleg", "Euro League (alt version)", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
src/mame/drivers/liberate.c
r4878r4879
655655   ROM_LOAD( "ic45ar17.bin",   0x01000, 0x1000, CRC(5f1c621e) SHA1(29ce85d3d5da5ee16bb67644b0555ab9bce52d05) )
656656ROM_END
657657
658ROM_START( prosporta )
659   ROM_REGION(0x10000, "maincpu", 0)
660   ROM_LOAD( "ar09.21", 0x4000, 0x2000,  CRC(c839b404) SHA1(58d9ffd851ea09a2ca43da37c03433d9b327e547) )
661   ROM_LOAD( "ar10.22", 0x6000, 0x2000,  CRC(5b70af2c) SHA1(2e14afde4f6443754a420f14190eab5d2a2d99cd) )
662   ROM_LOAD( "ar11.23", 0x8000, 0x2000,  CRC(af05edd7) SHA1(655e56773a734999b1c4031cade5545279dd20b9) )
663   ROM_LOAD( "ar12.24", 0xa000, 0x2000,  CRC(4acaa986) SHA1(c8c1e60f2a401514e111d15e78ecd4bdb6898a34) )
664   ROM_LOAD( "ar13.25", 0xc000, 0x2000,  CRC(736f19ac) SHA1(ecfe8c0cdcef32187165d7d4ef0013c57a6fd969) )
665   ROM_LOAD( "ar14.26", 0xe000, 0x2000,  CRC(38521ba3) SHA1(65bae8c1c15b8376c9b29771149fda36ee2c27d0) )
666
667   ROM_REGION( 0x10000, "audiocpu", 0 )
668   ROM_LOAD( "ar16.43", 0xc000, 0x2000,  CRC(113a4f89) SHA1(abbc7f5ad543f3500c0194100d236ac942e4739f) )
669   ROM_LOAD( "ar15.42", 0xe000, 0x2000,  CRC(635425a6) SHA1(2b95c3252046462f8886a309d02ea3a15b693780) )
670
671   ROM_REGION( 0x12000, "gfx1", ROMREGION_DISPOSE )
672   ROM_LOAD( "ar00.52",   0x00000, 0x2000, CRC(1e16adde) SHA1(229f68a687cbc9ac0d393e4db49d91f646eea7a6) )
673   ROM_LOAD( "ar01.53",   0x02000, 0x2000, CRC(4b7a6431) SHA1(a8a23dffc3bf9fb3b806985272822904578e460e) )
674   ROM_LOAD( "ar02.54",   0x04000, 0x2000, CRC(cb22c60a) SHA1(0c83c15781cedb17ade7d48a606d1c49e8b80819) )
675
676   ROM_LOAD( "ar03.55",   0x06000, 0x2000, CRC(caecafcb) SHA1(74c0e5aad65c162b9e58c1c37ec481cf3aa99056) )
677   ROM_LOAD( "ar04.56",   0x08000, 0x2000, CRC(d555835e) SHA1(4e3f1b6418aec948aaf27d05a4736995763dd1aa) )
678   ROM_LOAD( "ar05.57",   0x0a000, 0x2000, CRC(55b9b846) SHA1(cd2536acd58aec01815de8f609e0faeadfa00c43) )
679
680   ROM_LOAD( "ar06.58",   0x0c000, 0x2000, CRC(903ea834) SHA1(93fc69a2b460ed4cc8945f34a761b9841eba15a3) )
681   ROM_LOAD( "ar07.59",   0x0e000, 0x2000, CRC(e6527838) SHA1(e40acbcfda7d73ce4c1faa1c05e17d21bfc7f0d4) )
682   ROM_LOAD( "ar08.60",   0x10000, 0x2000, CRC(37a2178b) SHA1(28655d0ebe5813b4fc7eb6dae2a64575214ebc6a) )
683
684   ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
685   ROM_LOAD( "ar18.46",   0x00000, 0x1000, CRC(d23998d3) SHA1(4d3545a0e1df2eb7927ec6fa4a35abd21321016c) )
686   ROM_LOAD( "ar17.45",   0x01000, 0x1000, CRC(5f1c621e) SHA1(29ce85d3d5da5ee16bb67644b0555ab9bce52d05) )
687ROM_END
688
658689ROM_START( boomrang )
659690   ROM_REGION(0x10000, "maincpu", 0)
660691   ROM_LOAD( "bp13.9k",  0x8000, 0x4000,  CRC(b70439b1) SHA1(a020e9f6a71f72dfa72b8b202b4a08cca5e26ee0) )
r4878r4879
680711   ROM_LOAD( "82s123.5l",  0, 32,  CRC(a71e19ff) SHA1(fc7bf69f7971bf763aeeb1d9eb0861470acbf5d8) )
681712ROM_END
682713
683ROM_START( boomrana )
714ROM_START( boomranga )
684715   ROM_REGION(0x10000, "maincpu", 0)
685716   ROM_LOAD( "bp12-2",  0x8000, 0x2000,  CRC(87fc2f0b) SHA1(a5142cb3ee2c85906df2b5eccf7495486b162ae2) )
686717   ROM_RELOAD(          0x0000, 0x2000 )
r4878r4879
739770   ROM_LOAD( "bp15", 0, 32,  CRC(30d3acce) SHA1(be88d74250edc2920fc0f95cfdd93468ac9c640e) )
740771ROM_END
741772
742ROM_START( yellowcj )
773ROM_START( yellowcbj )
743774   ROM_REGION(0x10000, "maincpu", 0)
744775   ROM_LOAD( "bp11.bin", 0xe000, 0x2000, CRC(63cdee83) SHA1(c4a5c3d7761336f4fc3fe83490b69812d70b2cde) )
745776   ROM_RELOAD(            0x2000, 0x2000 )
r4878r4879
769800   ROM_LOAD( "bp15", 0, 32,  CRC(30d3acce) SHA1(be88d74250edc2920fc0f95cfdd93468ac9c640e) )
770801ROM_END
771802
772ROM_START( yellowcb )
803ROM_START( yellowcbb )
773804   ROM_REGION(0x10000, "maincpu", 0)
774805   ROM_LOAD( "rom11.rom", 0xc000, 0x2000, CRC(af97d530) SHA1(b8b9bfcb2e9164daa115b91a533418a39c40c31d) )
775806   ROM_RELOAD(            0x0000, 0x2000 )
r4878r4879
858889   ROM_LOAD( "bt14.bin", 0x0000, 32,  CRC(20281d61) SHA1(905dd2744c148d50332fcad34a57dc573d41bb0a) )
859890ROM_END
860891
861ROM_START( liberatb )
892ROM_START( liberateb )
862893   ROM_REGION( 0x10000, "maincpu", 0 )
863894   ROM_LOAD( "liber6.c17", 0x8000, 0x2000, CRC(c1811fe0) SHA1(1f857042ce00e489c2e73bb459b81a2461ea0b25) )
864895   ROM_RELOAD(             0x0000, 0x2000)
r4878r4879
955986 *
956987 *************************************/
957988
958GAME( 1983, prosoccr, 0,        prosoccr,  liberate, prosport, ROT270, "Data East Corporation", "Pro Soccer", GAME_NOT_WORKING )
959GAME( 1983, prosport, 0,        prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NOT_WORKING )
960GAME( 1983, boomrang, 0,        boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", 0 )
961GAME( 1983, boomrana, boomrang, boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", 0 )
962GAME( 1984, kamikcab, 0,        boomrang,  kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", 0 )
963GAME( 1984, yellowcj, kamikcab, boomrang,  yellowcb, yellowcb, ROT270, "Data East Corporation", "Yellow Cab (Japan)", 0 )
964GAME( 1984, yellowcb, kamikcab, boomrang,  yellowcb, yellowcb, ROT270, "bootleg",               "Yellow Cab (bootleg)", 0 )
965GAME( 1984, liberate, 0,        liberate,  liberate, liberate, ROT270, "Data East Corporation", "Liberation", 0 )
966GAME( 1984, dualaslt, liberate, liberate,  dualaslt, liberate, ROT270, "Data East USA",         "Dual Assault", 0 )
967GAME( 1984, liberatb, liberate, liberatb,  liberatb, prosport, ROT270, "bootleg",               "Liberation (bootleg)", 0 )
989GAME( 1983, prosoccr,  0,        prosoccr,  liberate, prosport, ROT270, "Data East Corporation", "Pro Soccer", GAME_NOT_WORKING )
990GAME( 1983, prosport,  0,        prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports", GAME_NOT_WORKING )
991GAME( 1983, prosporta, prosport, prosport,  liberate, prosport, ROT270, "Data East Corporation", "Pro. Sports (alternate)", GAME_NOT_WORKING )
992GAME( 1983, boomrang,  0,        boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 1)", 0 )
993GAME( 1983, boomranga, boomrang, boomrang,  boomrang, prosport, ROT270, "Data East Corporation", "Boomer Rang'r / Genesis (set 2)", 0 )
994GAME( 1984, kamikcab,  0,        boomrang,  kamikcab, prosport, ROT270, "Data East Corporation", "Kamikaze Cabbie", 0 )
995GAME( 1984, yellowcbj, kamikcab, boomrang,  yellowcb, yellowcb, ROT270, "Data East Corporation", "Yellow Cab (Japan)", 0 )
996GAME( 1984, yellowcbb, kamikcab, boomrang,  yellowcb, yellowcb, ROT270, "bootleg",               "Yellow Cab (bootleg)", 0 )
997GAME( 1984, liberate,  0,        liberate,  liberate, liberate, ROT270, "Data East Corporation", "Liberation", 0 )
998GAME( 1984, dualaslt,  liberate, liberate,  dualaslt, liberate, ROT270, "Data East USA",         "Dual Assault", 0 )
999GAME( 1984, liberateb, liberate, liberatb,  liberatb, prosport, ROT270, "bootleg",               "Liberation (bootleg)", 0 )
src/mame/drivers/gunsmoke.c
r4878r4879
186186   PORT_DIPNAME( 0x30, 0x30, DEF_STR( Difficulty ) )
187187   PORT_DIPSETTING(    0x20, DEF_STR( Easy ) )
188188   PORT_DIPSETTING(    0x30, DEF_STR( Normal ) )
189   PORT_DIPSETTING(    0x10, "Difficult" )
190   PORT_DIPSETTING(    0x00, "Very Difficult" )
189   PORT_DIPSETTING(    0x10, DEF_STR( Difficult ) )
190   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
191191   PORT_DIPNAME( 0x40, 0x40, "Freeze" )
192192   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
193193   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/tnzs.c
r4878r4879
629629#include "includes/tnzs.h"
630630#include "sound/2151intf.h"
631631
632UINT8 *tnzs_objram, *tnzs_sharedram;
632UINT8 *tnzs_objram;
633633UINT8 *tnzs_vdcram, *tnzs_scrollram, *tnzs_objctrl, *tnzs_bg_flag;
634634
635635
src/mame/drivers/rohga.c
r4878r4879
11821182
11831183ROM_START( wizdfire )
11841184   ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */
1185   ROM_LOAD16_BYTE( "jf-01.3d",   0x000000, 0x20000, CRC(bde42a41) SHA1(0379de9c4cdcce35554b5dc15241ed2c4f0d7611) )
1186   ROM_LOAD16_BYTE( "jf-00.3a",   0x000001, 0x20000, CRC(bca3c995) SHA1(dbebc9e301c04ee82ca4b658d3ab870790d1605b) )
1187   ROM_LOAD16_BYTE( "jf-03.5d",   0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) )
1188   ROM_LOAD16_BYTE( "jf-02.5a",   0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) )
1189   ROM_LOAD16_BYTE( "mas13",   0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) )
1190   ROM_LOAD16_BYTE( "mas12",   0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) )
1185   ROM_LOAD16_BYTE( "je-01.3d", 0x000000, 0x20000, CRC(b6d62367) SHA1(e9521b28660f62b70e6e33c3e9cf345fc106eff6) ) /* Version 2.1 Over Sea */
1186   ROM_LOAD16_BYTE( "je-00.3a", 0x000001, 0x20000, CRC(f33de278) SHA1(9407a73f578ec312944fc69f247e83704d713174) )
1187   ROM_LOAD16_BYTE( "je-03.5d", 0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) )
1188   ROM_LOAD16_BYTE( "je-02.5a", 0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) )
1189   ROM_LOAD16_BYTE( "mas13",    0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) )
1190   ROM_LOAD16_BYTE( "mas12",    0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) )
11911191
11921192   ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
1193   ROM_LOAD( "je-06.20r",  0x00000,  0x10000,  CRC(79042546) SHA1(231561df9415a289756a533709f610894fb9176e) )
1194
1195   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE )
1196   ROM_LOAD16_BYTE( "je-04.10d",  0x00000,  0x10000,  CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) /* Chars */
1197   ROM_LOAD16_BYTE( "je-05.12d",  0x00001,  0x10000,  CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) )
1198
1199   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE )
1200   ROM_LOAD( "mas00", 0x000000, 0x100000,  CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) /* Tiles */
1201   ROM_LOAD( "mas01", 0x100000, 0x100000,  CRC(6d0c9d0b) SHA1(63e19dfd6451810637664b08e880aef139ca6ed5) )
1202
1203   ROM_REGION( 0x100000, "gfx3", ROMREGION_DISPOSE )
1204   ROM_LOAD( "mas02", 0x000000, 0x080000,  CRC(af00e620) SHA1(43f4680b22ac6baf840274462c07fee68a2fbdfb) )
1205   ROM_LOAD( "mas03", 0x080000, 0x080000,  CRC(2fe61ea2) SHA1(0909e6c689c3e10225d7c074bd654ff2ada96983) )
1206
1207   ROM_REGION( 0x400000, "gfx4", ROMREGION_DISPOSE )
1208   ROM_LOAD16_BYTE( "mas04", 0x000001, 0x100000,  CRC(1e56953b) SHA1(0655ac7f3c5030a80c2d6bad5c3a79b2cb1ae4a2) ) /* Sprites #1 */
1209   ROM_LOAD16_BYTE( "mas05", 0x000000, 0x100000,  CRC(3826b8f8) SHA1(d59197b4e0525b86876f9cce6fbf80caba976851) )
1210   ROM_LOAD16_BYTE( "mas06", 0x200001, 0x100000,  CRC(3b8bbd45) SHA1(c9f9d4daf9c0cba5385af26f3762b29c291ff62b) )
1211   ROM_LOAD16_BYTE( "mas07", 0x200000, 0x100000,  CRC(31303769) SHA1(509604be06ec8e0c1b56a81a8ffccdf0f79e9fd7) )
1212
1213   ROM_REGION( 0x100000, "gfx5", ROMREGION_DISPOSE )
1214   ROM_LOAD16_BYTE( "mas08", 0x000001, 0x080000,  CRC(e224fb7a) SHA1(9aa92fb98bddff313db2077c4db102e94c7af09b) ) /* Sprites #2 */
1215   ROM_LOAD16_BYTE( "mas09", 0x000000, 0x080000,  CRC(5f6deb41) SHA1(850d0e157b4355e866ec770a2012293b2c55648f) )
1216
1217   ROM_REGION(0x80000, "oki1", 0 ) /* Oki samples */
1218   ROM_LOAD( "mas10",  0x00000,  0x80000,  CRC(6edc06a7) SHA1(8ab92cca9d4a5d4fed3d99737c6f023f3f606db2) )
1219
1220   ROM_REGION(0x80000, "oki2", 0 ) /* Oki samples */
1221   ROM_LOAD( "mas11",  0x00000,  0x80000,  CRC(c2f0a4f2) SHA1(af71d649aea273c17d7fbcf8693e8a1d4b31f7f8) )
1222
1223   ROM_REGION( 1024, "proms", 0 )
1224   ROM_LOAD( "mb7122h.16l", 0x00000,  0x400,  CRC(2bee57cc) SHA1(bc48670aa7c39f6ff7fae4c819eab22ed2db875b) )   /* Priority (unused) */
1225ROM_END
1226
1227ROM_START( wizdfiru )
1228   ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */
1229   ROM_LOAD16_BYTE( "jf-01.3d", 0x000000, 0x20000, CRC(bde42a41) SHA1(0379de9c4cdcce35554b5dc15241ed2c4f0d7611) ) /* Version 1.1 US */
1230   ROM_LOAD16_BYTE( "jf-00.3a", 0x000001, 0x20000, CRC(bca3c995) SHA1(dbebc9e301c04ee82ca4b658d3ab870790d1605b) )
1231   ROM_LOAD16_BYTE( "jf-03.5d", 0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) )
1232   ROM_LOAD16_BYTE( "jf-02.5a", 0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) )
1233   ROM_LOAD16_BYTE( "mas13",    0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) )
1234   ROM_LOAD16_BYTE( "mas12",    0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) )
1235
1236   ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
11931237   ROM_LOAD( "jf-06.20r",  0x00000,  0x10000,  CRC(79042546) SHA1(231561df9415a289756a533709f610894fb9176e) )
11941238
11951239   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE )
r4878r4879
12261270
12271271ROM_START( darksel2 )
12281272   ROM_REGION(0x200000, "maincpu", 0 ) /* 68000 code */
1229   ROM_LOAD16_BYTE( "jb01-3",  0x000000, 0x20000, CRC(82308c01) SHA1(aa0733e244f14f2c84b6929236771cbc99532bb2) )
1230   ROM_LOAD16_BYTE( "jb00-3",  0x000001, 0x20000, CRC(1d38113a) SHA1(69dc5a4dbe9d9737df198240f3db6f2115e311a5) )
1231   ROM_LOAD16_BYTE( "jf-03.5d",0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) )
1232   ROM_LOAD16_BYTE( "jf-02.5a",0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) )
1233   ROM_LOAD16_BYTE( "mas13",   0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) )
1234   ROM_LOAD16_BYTE( "mas12",   0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) )
1273   ROM_LOAD16_BYTE( "jb-01-3.3d", 0x000000, 0x20000, CRC(82308c01) SHA1(aa0733e244f14f2c84b6929236771cbc99532bb2) ) /* Version 2.1 Japan */
1274   ROM_LOAD16_BYTE( "jb-00-3.3a", 0x000001, 0x20000, CRC(1d38113a) SHA1(69dc5a4dbe9d9737df198240f3db6f2115e311a5) )
1275   ROM_LOAD16_BYTE( "jb-03.5d",   0x040000, 0x20000, CRC(5217d404) SHA1(7cfcdb9e2c812bf0d4ac8306834242876ac47844) )
1276   ROM_LOAD16_BYTE( "jb-02.5a",   0x040001, 0x20000, CRC(36a1ce28) SHA1(62d52d720c89022de97759777230c45c460d8fb6) )
1277   ROM_LOAD16_BYTE( "mas13",      0x080000, 0x80000, CRC(7e5256ce) SHA1(431d78ad185ba0216097f131fb2583a1a067e4f0) )
1278   ROM_LOAD16_BYTE( "mas12",      0x080001, 0x80000, CRC(005bd499) SHA1(862079022f97bd11f2f33677dce55bd3b144a81b) )
12351279
12361280   ROM_REGION(0x10000, "audiocpu", 0 ) /* Sound CPU */
1237   ROM_LOAD( "jb06",  0x00000,  0x10000,  CRC(2066a1dd) SHA1(a0d136e90825fa9c089894a6852c634676d64579) )
1281   ROM_LOAD( "jb-06.20r",  0x00000,  0x10000,  CRC(2066a1dd) SHA1(a0d136e90825fa9c089894a6852c634676d64579) )
12381282
12391283   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE )
1240   ROM_LOAD16_BYTE( "jf-04.10d",  0x00000,  0x10000,  CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) /* Chars */
1241   ROM_LOAD16_BYTE( "jf-05.12d",  0x00001,  0x10000,  CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) )
1284   ROM_LOAD16_BYTE( "jb-04.10d",  0x00000,  0x10000,  CRC(73cba800) SHA1(dd7612fe1482713fcee5960b7db158be872d7fda) ) /* Chars */
1285   ROM_LOAD16_BYTE( "jb-05.12d",  0x00001,  0x10000,  CRC(22e2c49d) SHA1(06cc2d0476156d1f521c4c57621ce3922a23aa04) )
12421286
12431287   ROM_REGION( 0x200000, "gfx2", ROMREGION_DISPOSE )
12441288   ROM_LOAD( "mas00", 0x000000, 0x100000,  CRC(3d011034) SHA1(167d6d088d51a41f196be104d795ffe24297c96a) ) /* Tiles */
r4878r4879
14391483GAME( 1991, rohgah,   rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Rohga Armor Force (Hong Kong v3.0)", 0 )
14401484GAME( 1991, rohgau,   rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Rohga Armor Force (US v1.0)", 0 )
14411485GAME( 1991, wolffang, rohga,   rohga,    rohga,    rohga,    ROT0,   "Data East Corporation", "Wolf Fang -Kuhga 2001- (Japan)", 0 )
1442GAME( 1992, wizdfire, 0,       wizdfire, wizdfire, wizdfire, ROT0,   "Data East Corporation", "Wizard Fire (US v1.1)", 0 )
1486GAME( 1992, wizdfire, 0,       wizdfire, wizdfire, wizdfire, ROT0,   "Data East Corporation", "Wizard Fire (Over Sea v2.1)", 0 )
1487GAME( 1992, wizdfiru, wizdfire,wizdfire, wizdfire, wizdfire, ROT0,   "Data East Corporation", "Wizard Fire (US v1.1)", 0 )
14431488GAME( 1992, darksel2, wizdfire,wizdfire, wizdfire, wizdfire, ROT0,   "Data East Corporation", "Dark Seal 2 (Japan v2.1)", 0 )
14441489GAME( 1992, nitrobal, 0,       nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Nitro Ball (US)", 0 )
14451490GAME( 1992, gunball,  nitrobal,nitrobal, nitrobal, nitrobal, ROT270, "Data East Corporation", "Gun Ball (Japan)", 0 )
src/mame/drivers/higemaru.c
r4878r4879
166166static MACHINE_DRIVER_START( higemaru )
167167
168168   /* basic machine hardware */
169   MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/3)   /* 4 MHz? Sharp LH0080A Z80A-CPU-D */
169   MDRV_CPU_ADD("maincpu", Z80, XTAL_12MHz/4)   /* 3 MHz Sharp LH0080A Z80A-CPU-D */
170170   MDRV_CPU_PROGRAM_MAP(higemaru_map)
171171   MDRV_CPU_VBLANK_INT_HACK(higemaru_interrupt,2)
172172
src/mame/drivers/naomi.c
r4878r4879
264264Zombie Revenge             840-0003C  21707        19         315-6213   317-0249-COM   joystick + 3 buttons
265265
266266
267Sega I/O boards
268---------------
269
270These are used on NAOMI and all other Sega games from 1999 onwards.
271Not all I/O boards are listed here. If you know of others, please let us know.
272
273
274838-13683
275838-13683-91 (sticker)
276838-13683-92 (sticker)
277838-13683-93 (sticker)
278|-----------------------------|
279| CN6     CN7   CN2  CN1 RELAY|
280| IC4 IC7          IC5    CN5 |
281| IC3                  IC6    |
282|CN3         IC1    IC2    IC9|
283|    OSC1     JP1             |
284|CN4                          |
285|  IC8               IC10     |
286|--|        JAMMA        |----|
287   |---------------------|
288Notes:
289      JVS to JAMMA I/O board. Has both digital and analog inputs
290
291              JVS test mode strings
292              ---------------------
293              NAME         SEGA ENTERPRISES,LTD.
294                           I/O 838-13683B
295                           Ver1.07
296                           99/06
297              CMD VER      1.1
298              JVS VER      2.0
299              COM VER      1.0
300              SWITCH       2 PLAYER(S) 11 BITS
301              COIN         2 SLOT
302              ANALOG       8 CH
303              ROTARY       0 CH
304              KEYCODE      0
305              SCREEN       X:0 Y:0 CH:0
306              CARD         0 SLOT
307              HOPPER OUT   0 CH
308              DRIVER OUT   8 SLOT
309              ANALOG OUT   0 CH
310              CHARACTER    CHARA:0 LINE:0
311              BACKUP       0
312
313      CN1   - USB connector type A
314      CN2   - USB connector type B
315      CN3   - 14 pin connector used for switch input or lamp output via jumper setting
316              1-2    +5V
317              3      NC
318              4-6    1P SW6-SW8
319              7      NC
320              8-10   2P SW6-SW8
321              11-12  NC
322              13-14  GND
323      CN4   - 2 pin connector
324      CN5   - 15 pin VGA connector
325      CN6   - 6 pin connector used for 5 volt and 12 volt power input/output
326              1-2 +5V
327              3-4 +12V
328              5-6 GND
329      CN7   - 26 pin analog controls connector
330              1-2  +5V              15     Reserved
331              3    1P Analog Y      16     Reserved
332              4    2P Analog Y      21     Reserved
333              9    1P Analog X      22     Reserved
334              10   2P Analog X      23-24  GND
335      IC1   - Toshiba TMP90PH44 microcontroller with sticker 'SP5001-B' (SDIP64)
336      IC2   - location for TMP90PH44 QFP64 (not used)
337      IC3   - 74HC541 (SOIC20)
338      IC4   - BA6212 (DIP20)
339      IC5   - Analog Devices ADM485 (SOIC8)
340      IC6   - 5W393 (SOIC8)
341      IC7   - 74HC4052 (SOIC16)
342      IC8   - Toshiba TD62384 (SOIC16)
343      IC9   - A7666FS (SOIC16)
344      IC10  - 74F86 (SOIC14)
345      JP1   - Set in position A to use CN3 as input for switches. Set in position B to use as output (for lamps etc)
346              When in position A, in the JVS test mode, 'SWITCH' becomes '2 PLAYER(S) 15 BITS' and 'DRIVER OUT' becomes '0 SLOT'
347      RELAY - Omron G6S-2 relay
348      OSC1  - 14.74MHz
349
350
351837-13551
352837-13551-92 (sticker)
353837-13551-93 (sticker)
354|-----------------------------|
355|CN4 CN5         CN6   CN7 CN8|
356|LED   ADM485                 |
357|  RELAY         IC1A    *    |
358|                             |
359|                    14.745MHz|
360|            PS2801-4(x8)     |
361|                          LED|
362|CN1 CN2      CN3             |
363|-----------------------------|
364Notes:
365             JVS I/O board. Has both digital and analogue inputs.
366             This is the most common type. Used on Sega driving games, NAOMI, Hikaru, Triforce, Chihiro etc
367
368             JVS test mode strings
369             ---------------------
370             NAME         SEGA ENTERPRISES,LTD.
371                          I/O BD JVS
372                          837-13551
373                          Ver1.00
374             CMD VER      1.1
375             JVS VER      2.0
376             COM VER      1.0
377             SWITCH       2 PLAYER(S) 13 BITS
378             COIN         2 SLOT(S)
379             ANALOG       8 CH
380             ROTARY       0 CH
381             KEYCODE      0
382             SCREEN       X:0 Y:0 CH:0
383             CARD         0 SLOT(S)
384             HOPPER OUT   0 CH
385             DRIVER OUT   6 CH
386             ANALOG OUT   0 CH
387             CHARACTER    CHARA:0 LINE:0
388             BACKUP       0
389
390      IC1A - Toshiba TMP90PH44 microcontroller marked '315-6215' (SDIP64)
391         * - location under the PCB for TMP90PH44 QFP64 (not used)
392     RELAY - NEC EB2-4.5NU relay
393    ADM485 - Analog Devices ADM485
394       CN1 - 5 pin connector 12 volt power input
395             1-2 +12V
396             3 NC
397             4-5 GND
398       CN2 - 5 pin connector 12 volt power output
399             1-2 +12V
400             3 NC
401             4-5 GND
402       CN3 - 60 pin digital input connector
403             1-8   +5V          33    1P SW4
404             9-15  GND          34    2P SW4
405             16    NC           35    1P SW5
406             17    1P Start     36    2P SW5
407             18    2P Start     37    1P SW6
408             19    1P Right     38    2P SW6
409             20    2P Right     39    1P SW7
410             21    1P Left      40    2P SW7
411             22    2P Left      41    1P Service Credit
412             23    1P Up        42    2P Service Credit
413             24    2P Up        43    Test SW
414             25    1P Down      44    Tilt SW
415             26    2P Down      45    Coin SW1
416             27    1P SW1       46    Coin SW2
417             28    2P SW1       47-48 NC
418             29    1P SW2       49-50 Coin Meter 1 & 2
419             30    2P SW2       51-56 Output 1-6
420             31    1P SW3       57-60 +12V
421             32    2P SW3
422             Note: For coin input to work, the coin meters need to be connected to
423             pins 49 and 50, or tie +5 volts to pin 49 and 50 via a resistor.
424       CN4 - USB connector type B
425       CN5 - USB connector type A
426       CN6 - Analog I/O connector
427             1-2   VCC     15    AD 2
428             3     AD 0    16    AD 6
429             4     AD 4    17-18 NC
430             5     GND     19-20 VCC
431             6     GND     21    AD 3
432             7-8   NC      22    AD 7
433             9     AD 1    23    GND
434             10    AD 5    24    GND
435             11-14 NC      25-26 NC
436       CN7 - 4 pin connector 5V power input
437             1-2 +5v       3-4 GND
438       CN8 - 4 pin connector 5V power out
439             1-2 +5v       3-4 GND
440
441
442837-13741
443837-13844-02 (sticker)
444|-----------------------------|
445|       CN8        CN9        |
446|DB9                       CN1|
447|RESET_SW |----|              |
448|         |IC6 |  OSC1     CN5|
449|         |----|              |
450|CN7      LED  DSW1(5)     CN2|
451|   OSC2   RELAY              |
452|CNx  USB USB  IC7 LED     CN6|
453|-----------------------------|
454Notes: (most info taken from poor quality pics/scans, better info is needed)
455
456             JVS I/O board 2. Has both digital and analogue inputs.
457             This board is used with F355, Ghost Squad, and many
458             others including network/satellite games.
459
460             JVS test mode strings
461             ---------------------
462
463             NAME         SEGA ENTERPRISES,LTD.;837-13741
464                          I/O CONTROL BD2;Ver0.15;99/06
465             CMD VER      1.1
466             JVS VER      2.0
467             COM VER      1.0
468             SWITCH       2 PLAYERS 12BITS
469             COIN         2 SLOTS
470             ANALOG       8CH
471             DRIVER OUT   22CH
472
473      IC6  - Sega 315-6146 custom IC (QFP176)
474      IC7  - 27C512 EPROM with label 'EPR-22082' (DIP28)
475      IC8  - Sharp LH52256 32k x8 SRAM (SOP28)
476      IC10 - Something by NEC? (QFP44)
477      OSC1 - 14.7456MHz
478      OSC2 - 32MHz
479      CNx  - 6 pin connector
480      CN1  - 5 pin connector 12 volt power input
481             1-2 +12V
482             3 NC
483             4-5 GND
484      CN2  - 4 pin connector 5V power input
485             1-2 +5v
486             3-4 GND
487      CN5  - 5 pin connector 12 volt power output
488             1-2 +12V
489             3 NC
490             4-5 GND
491      CN6  - 4 pin connector 5V power output
492             1-2 +5v
493             3-4 GND
494      CN7  - 26 pin connector (many pins unknown)
495             1  +5V              14
496             2                   15  Analog Output
497             3  Analog Output    16
498             4                   17  GND
499             5  GND              18
500             6                   19  +5V
501             7  +5V              20
502             8                   21  Analog Output
503             9  Analog Output    22
504             10                  23  GND
505             11 GND              24
506             12                  25
507             13 +5V              26
508      CN8  - 40 pin connector (many pins unknown)
509             3-5   +5V           21    Switch
510             7-9   GND           22    Switch
511             13-14 Coin SW1/2    23    Switch
512             15    Test SW       24    Switch
513             17    1P Start SW   25    2P Start SW
514             18    Service SW    31    Switch
515             19    Switch        32    Switch
516             20    Switch        33-40 RX1-RX8 (for communications)
517      CN9  - 34 pin connector (some pins unknown)
518             1-4   +5V
519             5-8   GND
520             9-10  Coin Meter 1 & 2
521             11    Lamp
522             12    Lamp
523             13    Lamp
524             14    Lamp
525             15    Lamp
526             16    Lamp
527             17    Lamp
528             18    Lamp
529             19    Lamp
530             20    Lamp
531             21    Coin LED
532             22-24 ?
533             25-32 TX1-TX8 (for communications)
534             33-34 12V
535
536
537837-13938
538171-7807A
539|--------------------|
540|CN2      CN1    IC9S|
541|         OSC1       |
542|      |-----|       |
543|      | IC2 |OSC2   |
544| CN3  |     |       |
545|  IC7S|-----|    IC3|
546|LED    CN4     IC4  |
547|--------------------|
548Notes:
549      This is the I/O board used for Dynamic Golf which is
550      located under the panel. It's also used for spinner
551      controls such as those used on Outtrigger.
552      It must be daisy-chained to the normal I/O board with a USB cable.
553
554      CN1 - 24 pin connector (not used on Dynamic Golf, other use unknown)
555      CN2 - 4 pin connector used for 5 volt power input
556      CN3 - USB connector type B
557      CN4 - 16 pin connector used for buttons and trackball
558      IC1 - HC240 logic IC (SOIC20)
559      IC2 - Sega 315-6146 custom IC (QFP176)
560      IC3 - 27C512 EPROM with label 'EPR-22084' (DIP28)
561      IC4 - HC4020 logic IC (SOIC16)
562      These parts on the other side of the PCB....
563      IC7S - Analog Devices ADM485 (SOIC8)
564      IC9S - Sharp LH52256 32k x8 SRAM (SOP28)
565      OSC1 - 14.7456MHz
566      OSC2 - 32MHz
567      Not shown above.... Sharp PC410 (x8, at PC9S to PC16S)
568                          HC74 at IC8S
569                          34164 (?) at IC10S (SOIC8)
570
267571Sega's I/O board has:
268572- spare output of 5V, 12V, and GND (from JAMMA power input via noise filter)
269573- analog input
r4878r4879
8011105 * Common address map for Naomi 1, Naomi GD-Rom, Naomi 2, Atomiswave ...
8021106 */
8031107
804static ADDRESS_MAP_START( naomi_base_map, ADDRESS_SPACE_PROGRAM, 64 )
805   AM_RANGE(0x00000000, 0x001fffff) AM_ROM                                             // BIOS
806   AM_RANGE(0x00200000, 0x00207fff) AM_RAM                                             // bios uses it (battery backed ram ?)
807   AM_RANGE(0x005f6800, 0x005f69ff) AM_READWRITE( dc_sysctrl_r, dc_sysctrl_w )
808   AM_RANGE(0x005f6c00, 0x005f6cff) AM_READWRITE( dc_maple_r, dc_maple_w )
809   AM_RANGE(0x005f7400, 0x005f74ff) AM_READWRITE( dc_g1_ctrl_r, dc_g1_ctrl_w )
810   AM_RANGE(0x005f7800, 0x005f78ff) AM_READWRITE( dc_g2_ctrl_r, dc_g2_ctrl_w )
811   AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE( pvr_ctrl_r, pvr_ctrl_w )
812   AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE( pvr_ta_r, pvr_ta_w )
813   AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE( dc_modem_r, dc_modem_w )
814   AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE( "aica", dc_aica_reg_r, dc_aica_reg_w )
815   AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE( dc_rtc_r, dc_rtc_w )
816   AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE( naomi_arm_r, naomi_arm_w )           // sound RAM (8 MB)
817   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known
818   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
819   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                                 // mirror of texture RAM 32 bit access
820   AM_RANGE(0x0c000000, 0x0dffffff) AM_RAM AM_BASE(&naomi_ram64)
821   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
822   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
823   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)                                 // another mirror of texture memory
824   AM_RANGE(0x13000000, 0x13ffffff) AM_RAM AM_SHARE(2)                                 // another mirror of texture memory
825   AM_RANGE(0xa0000000, 0xa01fffff) AM_ROM AM_REGION("maincpu", 0)
826ADDRESS_MAP_END
1108 // SB_LMMODE0
1109 static WRITE64_HANDLER( ta_texture_directpath0_w )
1110 {
1111   int mode = pvrctrl_regs[SB_LMMODE0]&1;
1112   if (mode&1)
1113   {
1114      printf("ta_texture_directpath0_w 32-bit access!\n");
1115      COMBINE_DATA(&dc_framebuffer_ram[offset]);
1116   }
1117   else
1118   {
1119      COMBINE_DATA(&dc_texture_ram[offset]);
1120   }
1121 }
8271122
1123 // SB_LMMODE1
1124 static WRITE64_HANDLER( ta_texture_directpath1_w )
1125 {
1126    int mode = pvrctrl_regs[SB_LMMODE1]&1;
1127   if (mode&1)
1128   {
1129      printf("ta_texture_directpath0_w 32-bit access!\n");
1130      COMBINE_DATA(&dc_framebuffer_ram[offset]);
1131   }
1132   else
1133   {
1134      COMBINE_DATA(&dc_texture_ram[offset]);
1135   }
1136 }
1137
1138
8281139/*
8291140 * Naomi 1 address map
8301141 */
r4878r4879
8511162   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known
8521163
8531164   /* Area 1 */
854   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
855   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                                 // mirror of texture RAM 32 bit access
1165   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
1166   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now
8561167
8571168   /* Area 2*/
8581169   AM_RANGE(0x08000000, 0x0bffffff) AM_NOP // 'Unassigned'
r4878r4879
8661177   /* Area 4 */
8671178   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
8681179   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
869   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)
1180   AM_RANGE(0x11000000, 0x11ffffff) AM_WRITE( ta_texture_directpath0_w ) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE0 register - cannot be written directly, only through dma / store queue
8701181   /*       0x12000000 -0x13ffffff Mirror area of  0x10000000 -0x11ffffff */
8711182   AM_RANGE(0x12000000, 0x127fffff) AM_WRITE( ta_fifo_poly_w )
8721183   AM_RANGE(0x12800000, 0x12ffffff) AM_WRITE( ta_fifo_yuv_w )
873   AM_RANGE(0x13000000, 0x13ffffff) AM_RAM AM_SHARE(2)
1184   AM_RANGE(0x13000000, 0x13ffffff) AM_WRITE( ta_texture_directpath1_w )  // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE1 register - cannot be written directly, only through dma / store queue
8741185
8751186   /* Area 5 */
8761187   //AM_RANGE(0x14000000, 0x17ffffff) AM_NOP // MPX Ext.
r4878r4879
9131224
9141225   AM_RANGE(0x0103ff00, 0x0103ffff) AM_READWRITE( naomi_unknown1_r, naomi_unknown1_w ) // bios uses it, actual start and end addresses not known
9151226
916   /* Area 1 */
917   AM_RANGE(0x04000000, 0x04ffffff) AM_RAM   AM_SHARE(2) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
918   AM_RANGE(0x05000000, 0x05ffffff) AM_RAM AM_SHARE(2)                                 // mirror of texture RAM 32 bit access
1227   /* Area 1 - half the texture memory, like dreamcast, not naomi */
1228   AM_RANGE(0x04000000, 0x047fffff) AM_RAM   AM_MIRROR(0x00800000) AM_BASE( &dc_texture_ram )      // texture memory 64 bit access
1229   AM_RANGE(0x05000000, 0x057fffff) AM_RAM AM_MIRROR(0x00800000) AM_BASE( &dc_framebuffer_ram ) // apparently this actually accesses the same memory as the 64-bit texture memory access, but in a different format, keep it apart for now
9191230
9201231   /* Area 2*/
9211232   AM_RANGE(0x08000000, 0x0bffffff) AM_NOP // 'Unassigned'
r4878r4879
9291240   AM_RANGE(0x8c000000, 0x8cffffff) AM_RAM AM_SHARE(4) // RAM access through cache
9301241   AM_RANGE(0x8d000000, 0x8dffffff) AM_RAM AM_SHARE(4) // RAM access through cache
9311242
932   /* Area 4 */
1243   /* Area 4 - half the texture memory, like dreamcast, not naomi */
9331244   AM_RANGE(0x10000000, 0x107fffff) AM_WRITE( ta_fifo_poly_w )
9341245   AM_RANGE(0x10800000, 0x10ffffff) AM_WRITE( ta_fifo_yuv_w )
935   AM_RANGE(0x11000000, 0x11ffffff) AM_RAM AM_SHARE(2)
1246   AM_RANGE(0x11000000, 0x117fffff) AM_WRITE( ta_texture_directpath0_w ) AM_MIRROR(0x00800000)  // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE0 register - cannot be written directly, only through dma / store queue
9361247   /*       0x12000000 -0x13ffffff Mirror area of  0x10000000 -0x11ffffff */
9371248   AM_RANGE(0x12000000, 0x127fffff) AM_WRITE( ta_fifo_poly_w )
9381249   AM_RANGE(0x12800000, 0x12ffffff) AM_WRITE( ta_fifo_yuv_w )
939   AM_RANGE(0x13000000, 0x13ffffff) AM_RAM AM_SHARE(2)
1250   AM_RANGE(0x13000000, 0x137fffff) AM_WRITE( ta_texture_directpath1_w ) AM_MIRROR(0x00800000) // access to texture / fraembfufer memory (either 32-bit or 64-bit area depending on SB_LMMODE1 register - cannot be written directly, only through dma / store queue
9401251
1252
9411253   /* Area 5 */
9421254   //AM_RANGE(0x14000000, 0x17ffffff) AM_NOP // MPX Ext.
9431255
src/mame/drivers/nemesis.c
r4878r4879
12411241   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7")
12421242   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
12431243   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1244   PORT_DIPSETTING(    0x20, "Difficult" )
1245   PORT_DIPSETTING(    0x00, "Very Difficult" )
1244   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1245   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
12461246   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
12471247   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12481248   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
12841284   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:4,5")
12851285   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
12861286   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1287   PORT_DIPSETTING(    0x20, "Difficult" )
1288   PORT_DIPSETTING(    0x00, "Very Difficult" )
1287   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1288   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
12891289   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:6")
12901290   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
12911291   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
13261326   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,4")
13271327   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
13281328   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1329   PORT_DIPSETTING(    0x20, "Difficult" )
1330   PORT_DIPSETTING(    0x00, "Very Difficult" )
1329   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1330   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
13311331   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5")
13321332   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
13331333   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
14041404   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:6,7")
14051405   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
14061406   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
1407   PORT_DIPSETTING(    0x20, "Difficult" )
1408   PORT_DIPSETTING(    0x00, "Very Difficult" )
1407   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
1408   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
14091409   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
14101410   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
14111411   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/cheekyms.c
r4878r4879
4141   ADDRESS_MAP_GLOBAL_MASK(0xff)
4242   AM_RANGE(0x00, 0x00) AM_READ_PORT("DSW")
4343   AM_RANGE(0x01, 0x01) AM_READ_PORT("INPUTS")
44   AM_RANGE(0x20, 0x3f) AM_WRITE(SMH_RAM) AM_BASE(&cheekyms_spriteram)
44   AM_RANGE(0x20, 0x3f) AM_WRITEONLY AM_BASE(&cheekyms_spriteram)
4545   AM_RANGE(0x40, 0x40) AM_WRITE(cheekyms_port_40_w)
4646   AM_RANGE(0x80, 0x80) AM_WRITE(cheekyms_port_80_w) AM_BASE(&cheekyms_port_80)
4747ADDRESS_MAP_END
r4878r4879
180180
181181
182182
183GAME( 1980, cheekyms, 0, cheekyms, cheekyms, 0, ROT270, "Universal", "Cheeky Mouse", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
183GAME( 1980, cheekyms, 0, cheekyms, cheekyms, 0, ROT270, "Universal", "Cheeky Mouse", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
src/mame/drivers/stv.c
r4878r4879
3838 -shadow effects;
3939 -global rgb brightness control,separate for every plane;
4040
41this hardware comes above hell on the great list of hellish things as far as emulation goes anyway ;-)
42
4341Memory map:
4442-----------
4543
r4878r4879
792790static READ32_HANDLER ( stv_io_r32 )
793791{
794792//  if(LOG_IOGA) logerror("(PC=%08X): I/O r %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, mem_mask);
795//  popmessage("SEL: %02x MUX: %02x %02x %02x %02x %02x",port_sel,mux_data,ioga[1],ioga[2],ioga[3],ioga[5]);
793//  popmessage("SEL: %02x MUX: %02x OFF: %02x",port_sel,mux_data,offset*4);
796794
795//  printf("(PC=%08X): I/O r %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, mem_mask);
796
797797   switch(offset)
798798   {
799      case 0:
799      case 0x00/4:
800800      switch(port_sel)
801801      {
802802         case 0x77: return 0xff000000|(input_port_read(space->machine, "P1") << 16) |0x0000ff00|(input_port_read(space->machine, "P2"));
r4878r4879
834834            }
835835         }
836836         //default:
837         //case 0x40: return mame_rand(space->machine);
837838         default:
838839         //popmessage("%02x PORT SEL",port_sel);
839840         return (input_port_read(space->machine, "P1") << 16) | (input_port_read(space->machine, "P2"));
840841      }
841      case 1:
842      case 0x04/4:
842843      if ( strcmp(space->machine->gamedrv->name,"critcrsh") == 0 )
843844         return ((input_port_read(space->machine, "SYSTEM") << 16) & ((input_port_read(space->machine, "P1") & 1) ? 0xffef0000 : 0xffff0000)) | (ioga[1]);
844845      else
845846         return (input_port_read(space->machine, "SYSTEM") << 16) | (ioga[1]);
846847
847      case 2:
848      case 0x08/4:
848849      switch(port_sel)
849850      {
850851         case 0x77:   return (input_port_read(space->machine, "UNUSED") << 16) | (input_port_read(space->machine, "EXTRA"));
r4878r4879
855856         default:
856857         return 0xffffffff;
857858      }
858      break;
859      case 3:
859      case 0x0c/4:
860860      switch(port_sel)
861861      {
862862         case 0x60:  return ((ioga[2] & 0xffff) << 16) | 0xffff;
r4878r4879
864864         //popmessage("offs: 3 %02x",port_sel);
865865         return 0xffffffff;
866866      }
867      break;
868      case 5:
867      //case 0x10/4:
868      case 0x14/4:
869869      switch(port_sel)
870870      {
871871         case 0x77:
r4878r4879
879879         }
880880         default: return 0xffffffff;
881881      }
882      break;
883      case 6:
882      case 0x18/4:
884883      switch(port_sel)
885884      {
886885         case 0x60:  return ioga[5];
r4878r4879
894893         //popmessage("offs: 6 %02x",port_sel);
895894         return 0xffffffff;
896895      }
897      break;
898      case 7:
896      case 0x1c/4:
899897      if(LOG_IOGA) logerror("(PC %s=%06x) Warning: READ from PORT_AD\n", space->cpu->tag, cpu_get_pc(space->cpu));
900898      popmessage("Read from PORT_AD");
901899      port_i++;
r4878r4879
909907{
910908//  if(LOG_IOGA) logerror("(PC=%08X): I/O w %08X = %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, data, mem_mask);
911909
910//  printf("(PC=%08X): I/O w %08X = %08X & %08X\n", cpu_get_pc(space->cpu), offset*4, data, mem_mask);
911
912912   switch(offset)
913913   {
914      case 1:
914      case 0x04/4:
915915         if(ACCESSING_BITS_0_7)
916916         {
917            /*Why does the BIOS tests these as ACTIVE HIGH?A program bug?*/
917            /*Why does the BIOS tests these as ACTIVE HIGH? A program bug?*/
918918            ioga[1] = (data) & 0xff;
919919            coin_counter_w(0,~data & 0x01);
920920            coin_counter_w(1,~data & 0x02);
r4878r4879
924924                other bits reserved
925925                */
926926         }
927      break;
928      case 2:
927         break;
928      case 0x08/4:
929929         if(ACCESSING_BITS_16_23)
930930         {
931931            ioga[2] = data >> 16;
r4878r4879
933933         }
934934         else if(ACCESSING_BITS_0_7)
935935            ioga[2] = data;
936      break;
937      case 3:
936         break;
937      case 0x0c/4:
938938         if(ACCESSING_BITS_16_23)
939939            ioga[3] = data;
940      break;
941      case 4:
940         break;
941      case 0x10/4:
942942         if(ACCESSING_BITS_16_23)
943943            port_sel = (data & 0xffff0000) >> 16;
944      break;
945      case 5:
944         break;
945      case 0x14/4:
946946         if(ACCESSING_BITS_16_23)
947947            ioga[5] = data;
948      break;
948         break;
949      //case 0x18/4:
950      case 0x1c/4:
951         //technical bowling tests here
952         if(ACCESSING_BITS_16_23)
953            ioga[7] = data;
954         break;
955
949956   }
950957}
951958
r4878r4879
21022109   PORT_START("UNUSED")
21032110   PORT_BIT ( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
21042111
2105   /* Extra button layout, used by Power Instinct 3, Suikoenbu, Elan Doree, Golden Axe Duel & Astra SuperStar */
2112   /* Extra button layout, used by Power Instinct 3, Suikoenbu, Elan Doree, Golden Axe Duel & Astra SuperStars */
21062113   PORT_START("EXTRA")
21072114   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
21082115   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
r4878r4879
21432150   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("X") PORT_CODE(KEYCODE_E)
21442151   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("R trig") PORT_CODE(KEYCODE_S)
21452152   #endif
2153
2154   PORT_START("UNKNOWN")
2155   PORT_DIPNAME( 0x01, 0x01, "UNK" )
2156   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
2157   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2158   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
2159   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
2160   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2161   PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
2162   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
2163   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2164   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
2165   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
2166   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2167   PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
2168   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
2169   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2170   PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
2171   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
2172   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2173   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
2174   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
2175   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
2176   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
2177   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
2178   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
21462179INPUT_PORTS_END
21472180
21482181static INPUT_PORTS_START( critcrsh )
r4878r4879
27982831
27992832ROM_START( stvbios )
28002833   STV_BIOS
2801   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASEFF ) /* SH2 code */
2834   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
28022835ROM_END
28032836
28042837/*
r4878r4879
28332866ROM_START( astrass )
28342867   STV_BIOS
28352868
2836   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2869   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
28372870
28382871   ROM_LOAD16_BYTE( "epr20825.13",                0x0000001, 0x0100000, CRC(94a9ad8f) SHA1(861311c14cfa9f560752aa5b023c147a539cf135) )
28392872
r4878r4879
28552888ROM_START( bakubaku )
28562889   STV_BIOS
28572890
2858   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2891   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
28592892
28602893   ROM_LOAD16_BYTE( "fpr17969.13",               0x0000001, 0x0100000, CRC(bee327e5) SHA1(1d226db72d6ef68fd294f60659df7f882b25def6) )
28612894
r4878r4879
28682901ROM_START( colmns97 )
28692902   STV_BIOS
28702903
2871   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2904   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
28722905
28732906   ROM_LOAD16_BYTE( "fpr19553.13",    0x000001, 0x100000, CRC(d4fb6a5e) SHA1(bd3cfb4f451b6c9612e42af5ddcbffa14f057329) )
28742907
r4878r4879
28792912ROM_START( cotton2 )
28802913   STV_BIOS
28812914
2882   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2883   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
2915   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
28842916   ROM_LOAD16_WORD_SWAP( "mpr20122.7",    0x0200000, 0x0200000, CRC(d616f78a) SHA1(8039dcdfdafb8327a19a1da46a67c0b3f7eee53a) ) // good
28852917   ROM_LOAD16_WORD_SWAP( "mpr20117.2",    0x0400000, 0x0400000, CRC(893656ea) SHA1(11e3160083ba018fbd588f07061a4e55c1efbebb) ) // good
28862918   ROM_LOAD16_WORD_SWAP( "mpr20118.3",    0x0800000, 0x0400000, CRC(1b6a1d4c) SHA1(6b234d6b2d24df7f6d400a56698c0af2f78ce0e7) ) // good
r4878r4879
28942926ROM_START( cottonbm )
28952927   STV_BIOS
28962928
2897   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2898   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
2929   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
28992930   ROM_LOAD16_WORD_SWAP( "mpr21075.7",    0x0200000, 0x0200000, CRC(200b58ba) SHA1(6daad6d70a3a41172e8d9402af775c03e191232d) ) // good
29002931   ROM_LOAD16_WORD_SWAP( "mpr21070.2",    0x0400000, 0x0400000, CRC(56c0bf1d) SHA1(c2b564ce536c637bb723ed96683b27596e87ebe7) ) // good
29012932   ROM_LOAD16_WORD_SWAP( "mpr21071.3",    0x0800000, 0x0400000, CRC(2bb18df2) SHA1(e900adb94ad3f48be00a4ce33e915147dc6a8737) ) // good
r4878r4879
29082939ROM_START( decathlt )
29092940   STV_BIOS
29102941
2911   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2942   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29122943
29132944   ROM_LOAD16_BYTE( "epr18967a.13",               0x0000001, 0x0100000, CRC(ac59c186) SHA1(7d4924d1e4c1b9257b58a690de988b3f6486e86f) )
29142945
r4878r4879
29222953ROM_START( decathlo )
29232954   STV_BIOS
29242955
2925   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2956   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29262957
29272958   ROM_LOAD16_BYTE( "epr18967.13",               0x0000001, 0x0100000, CRC(c0446674) SHA1(4917089d95613c9d2a936ed9fe3ebd22f461aa4f) )
29282959
r4878r4879
29372968   STV_BIOS
29382969   ROM_DEFAULT_BIOS( "us" )
29392970
2940   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2971   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29412972
29422973   ROM_LOAD16_BYTE( "fpr19119.13",               0x0000001, 0x0100000, CRC(de5c4f7c) SHA1(35f670a15e9c86edbe2fe718470f5a75b5b096ac) )
29432974
r4878r4879
29502981ROM_START( dnmtdeka )
29512982   STV_BIOS
29522983
2953   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2984   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29542985
29552986   ROM_LOAD16_BYTE( "fpr19114.13",               0x0000001, 0x0100000, CRC(1fd22a5f) SHA1(c3d9653b12354a73a3e15f23a2ab7992ffb83e46) )
29562987
r4878r4879
29632994ROM_START( ejihon )
29642995   STV_BIOS
29652996
2966   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2997   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29672998   ROM_LOAD16_BYTE( "epr18137.13",               0x0000001, 0x0080000, CRC(151aa9bc) SHA1(0959c60f31634816825acb57413838dcddb17d31) )
29682999   ROM_RELOAD( 0x100001, 0x0080000 )
29693000
r4878r4879
29773008ROM_START( elandore )
29783009   STV_BIOS
29793010
2980   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2981   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3011   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29823012   ROM_LOAD16_WORD_SWAP( "mpr21307.7",    0x0200000, 0x0200000, CRC(966ad472) SHA1(d6db41d1c40d08eb6bce8a8a2f491e7533daf670) ) // good (was .11s)
29833013   ROM_LOAD16_WORD_SWAP( "mpr21301.2",    0x0400000, 0x0400000, CRC(1a23b0a0) SHA1(f9dbc7ba96dadfb00e5827622b557080449acd83) ) // good (was .12)
29843014   ROM_LOAD16_WORD_SWAP( "mpr21302.3",    0x0800000, 0x0400000, CRC(1c91ca33) SHA1(ae11209088e3bf8fc4a92dca850d7303ce949b29) ) // good (was .13)
r4878r4879
29923022ROM_START( ffreveng )
29933023   STV_BIOS
29943024
2995   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
2996   ROM_FILL(                             0x0000000, 0x0200000, 0x00 )
3025   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
29973026   ROM_LOAD16_WORD_SWAP( "opr21872.7",   0x0200000, 0x0200000, CRC(32d36fee) SHA1(441c4254ef2e9301e1006d69462a850ce339314b) ) // good (was .11s)
29983027   ROM_LOAD16_WORD_SWAP( "mpr21873.2",   0x0400000, 0x0400000, CRC(dac5bd98) SHA1(6102035ce9eb2f83d7d9b20f989a151f45087c67) ) // good (was .12)
29993028   ROM_LOAD16_WORD_SWAP( "mpr21874.3",   0x0800000, 0x0400000, CRC(0a7be2f1) SHA1(e2d13f36e54d1e2cb9d584db829c04a6ff65108c) ) // good (was .13)
r4878r4879
30073036ROM_START( fhboxers )
30083037   STV_BIOS
30093038
3010   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3039   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
30113040   ROM_LOAD16_BYTE( "fr18541a.13",               0x0000001, 0x0100000, CRC(8c61a17c) SHA1(a8aef27b53482923a506f7daa4b7a38653b4d8a4) ) //(header is read from here, not ic7 even if both are populated on this board)
30123041
30133042   ROM_LOAD16_WORD_SWAP( "mpr18538.7",    0x0200000, 0x0200000, CRC(7b5230c5) SHA1(70cebc3281580b43adf42c37318e12159c28a13d) ) // good
r4878r4879
30253054ROM_START( findlove )
30263055   STV_BIOS
30273056
3028   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3057   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
30293058   ROM_LOAD16_BYTE( "epr20424.13",               0x0000001, 0x0100000, CRC(4e61fa46) SHA1(e34624d98cbdf2dd04d997167d3c4decd2f208f7) ) //(header is read from here, not ic7 even if both are populated on this board)
30303059
30313060   ROM_LOAD16_WORD_SWAP( "mpr20431.7",    0x0200000, 0x0200000, CRC(ea656ced) SHA1(b2d6286081bd46a89d1284a2757b87d0bca1bbde) ) // good
r4878r4879
30453074ROM_START( finlarch )
30463075   STV_BIOS
30473076
3048   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3077   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
30493078   ROM_LOAD16_BYTE( "finlarch.13",               0x0000001, 0x0100000, CRC(4505fa9e) SHA1(96c6399146cf9c8f1d27a8fb6a265f937258004a) )
30503079   ROM_RELOAD ( 0x0100001, 0x0080000 )
30513080
r4878r4879
30633092ROM_START( gaxeduel )
30643093   STV_BIOS
30653094
3066   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3095   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
30673096   ROM_LOAD16_BYTE( "epr17766.13",               0x0000001, 0x0080000, CRC(a83fcd62) SHA1(4ce77ebaa0e93c6553ad8f7fb87cbdc32433402b) )
30683097   ROM_RELOAD( 0x0100001, 0x0080000 )
30693098
r4878r4879
30783107ROM_START( grdforce )
30793108   STV_BIOS
30803109
3081   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3082   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3110   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
30833111   ROM_LOAD16_WORD_SWAP( "mpr20844.7",    0x0200000, 0x0200000, CRC(283e7587) SHA1(477fabc27cfe149ad17757e31f10665dcf8c0860) ) // good
30843112   ROM_LOAD16_WORD_SWAP( "mpr20839.2",    0x0400000, 0x0400000, CRC(facd4dd8) SHA1(2582894c98b31ab719f1865d4623dad6736dc877) ) // good
30853113   ROM_LOAD16_WORD_SWAP( "mpr20840.3",    0x0800000, 0x0400000, CRC(fe0158e6) SHA1(73460effe69fb8f16dd952271542b7803471a599) ) // good
r4878r4879
30913119ROM_START( groovef )
30923120   STV_BIOS
30933121
3094   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3095   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3122   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
30963123   ROM_LOAD16_WORD_SWAP( "mpr19820.7",    0x0200000, 0x0100000, CRC(e93c4513) SHA1(f9636529224880c49bd2cc5572bd5bf41dbf911a) ) // good
30973124   ROM_LOAD16_WORD_SWAP( "mpr19815.2",    0x0400000, 0x0400000, CRC(1b9b14e6) SHA1(b1828c520cb108e2927a23273ebd2939dca52304) ) // good
30983125   ROM_LOAD16_WORD_SWAP( "mpr19816.3",    0x0800000, 0x0400000, CRC(83f5731c) SHA1(2f645737f945c59a1a2fabf3b21a761be9e8c8a6) ) // good
r4878r4879
31073134ROM_START( hanagumi )
31083135   STV_BIOS
31093136
3110   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3111   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3137   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
31123138   ROM_LOAD16_WORD_SWAP( "mpr20143.7",    0x0200000, 0x0100000, CRC(7bfc38d0) SHA1(66f223e7ff2b5456a6f4185b7ab36f9cd833351a) ) // good
31133139   ROM_LOAD16_WORD_SWAP( "mpr20138.2",    0x0400000, 0x0400000, CRC(fdcf1046) SHA1(cbb1f03879833c17feffdd6f5a4fbff06e1059a2) ) // good
31143140   ROM_LOAD16_WORD_SWAP( "mpr20139.3",    0x0800000, 0x0400000, CRC(7f0140e5) SHA1(f2f7de7620d66a596d552e1af491a0592ebc4e51) ) // good
r4878r4879
31263152ROM_START( introdon )
31273153   STV_BIOS
31283154
3129   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3155   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
31303156   ROM_LOAD16_BYTE( "epr18937.13",               0x0000001, 0x0080000, CRC(1f40d766) SHA1(35d9751c1b23cfbf448f2a9e9cf3b121929368ae) )
31313157   ROM_RELOAD( 0x0100001, 0x0080000)
31323158
r4878r4879
31433169ROM_START( kiwames )
31443170   STV_BIOS
31453171
3146   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3172   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
31473173   ROM_LOAD16_BYTE( "epr18737.13",               0x0000001, 0x0080000, CRC(cfad6c49) SHA1(fc69980a351ed13307706db506c79c774eabeb66) ) // bad
31483174   ROM_RELOAD( 0x0100001, 0x0080000)
31493175
r4878r4879
31553181ROM_START( maruchan )
31563182   STV_BIOS
31573183
3158   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3184   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
31593185   ROM_LOAD16_BYTE( "epr20416.13",               0x0000001, 0x0100000, CRC(8bf0176d) SHA1(5bd468e2ffed042ee84e2ceb8712ff5883a1d824) ) // bad
31603186
31613187   ROM_LOAD16_WORD_SWAP( "mpr20417.2",    0x0400000, 0x0400000, CRC(636c2a08) SHA1(47986b71d68f6a1852e4e2b03ca7b6e48e83718b) ) // good
r4878r4879
31723198ROM_START( myfairld )
31733199   STV_BIOS
31743200
3175   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3176   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3201   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
31773202   ROM_LOAD16_WORD_SWAP( "mpr21000.7",    0x0200000, 0x0200000, CRC(2581c560) SHA1(5fb64f0e09583d50dfea7ad613d45aad30b677a5) ) // good
31783203   ROM_LOAD16_WORD_SWAP( "mpr20995.2",    0x0400000, 0x0400000, CRC(1bb73f24) SHA1(8773654810de760c5dffbb561f43e259b074a61b) ) // good
31793204   ROM_LOAD16_WORD_SWAP( "mpr20996.3",    0x0800000, 0x0400000, CRC(993c3859) SHA1(93f95e3e080a08961784482607919c1ab3eeb5e5) ) // good
r4878r4879
31873212ROM_START( othellos )
31883213   STV_BIOS
31893214
3190   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3191   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3215   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
31923216   ROM_LOAD16_WORD_SWAP( "mpr20967.7",    0x0200000, 0x0200000, CRC(efc05b97) SHA1(a533366c3aaba90dcac8f3654db9ad902efca258) ) // good
31933217   ROM_LOAD16_WORD_SWAP( "mpr20963.2",    0x0400000, 0x0400000, CRC(2cc4f141) SHA1(8bd1998aff8615b34d119fab3637a08ed6e8e1e4) ) // good
31943218   ROM_LOAD16_WORD_SWAP( "mpr20964.3",    0x0800000, 0x0400000, CRC(5f5cda94) SHA1(616be219a2512e80c875eddf05137c23aedf6f65) ) // good
r4878r4879
31993223ROM_START( pblbeach )
32003224   STV_BIOS
32013225
3202   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3226   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
32033227   ROM_LOAD16_BYTE( "epr18852.13",               0x0000001, 0x0080000, CRC(d12414ec) SHA1(0f42ec9e41983781b6892622b00398a102072aa7) ) // bad
32043228   ROM_RELOAD ( 0x0100001, 0x0080000 )
32053229
r4878r4879
32123236ROM_START( prikura )
32133237   STV_BIOS
32143238
3215   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3216   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3239   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
32173240   ROM_LOAD16_WORD_SWAP( "mpr19337.7",    0x0200000, 0x0200000, CRC(76f69ff3) SHA1(5af2e1eb3288d70c2a1c71d0b6370125d65c7757) ) // good
32183241   ROM_LOAD16_WORD_SWAP( "mpr19333.2",    0x0400000, 0x0400000, CRC(eb57a6a6) SHA1(cdacaa7a2fb1a343195e2ac5fd02eabf27f89ccd) ) // good
32193242   ROM_LOAD16_WORD_SWAP( "mpr19334.3",    0x0800000, 0x0400000, CRC(c9979981) SHA1(be491a4ac118d5025d6a6f2d9267a6d52f21d2b6) ) // good
r4878r4879
32243247ROM_START( puyosun )
32253248   STV_BIOS
32263249
3227   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3250   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
32283251   ROM_LOAD16_BYTE( "epr19531.13",               0x0000001, 0x0080000, CRC(ac81024f) SHA1(b22c7c1798fade7ae992ff83b138dd23e6292d3f) ) // bad
32293252   ROM_RELOAD ( 0x0100001, 0x0080000 )
32303253
r4878r4879
32413264ROM_START( rsgun )
32423265   STV_BIOS
32433266
3244   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3245   ROM_FILL(                             0x0000000, 0x0200000, 0x00 )
3267   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
32463268   ROM_LOAD16_WORD_SWAP( "mpr20958.7",   0x0200000, 0x0200000, CRC(cbe5a449) SHA1(b4744ab71ccbadda1921ba43dd1148e57c0f84c5) ) // good (was .11s)
32473269   ROM_LOAD16_WORD_SWAP( "mpr20959.2",   0x0400000, 0x0400000, CRC(a953330b) SHA1(965274a7297cb88e281fcbdd3ec5025c6463cc7b) ) // good (was .12)
32483270   ROM_LOAD16_WORD_SWAP( "mpr20960.3",   0x0800000, 0x0400000, CRC(b5ab9053) SHA1(87c5d077eb1219c35fa65b4e11d5b62e826f5236) ) // good (was .13)
32493271   ROM_LOAD16_WORD_SWAP( "mpr20961.4",   0x0c00000, 0x0400000, CRC(0e06295c) SHA1(0ec2842622f3e9dc5689abd58aeddc7e5603b97a) ) // good (was .14)
32503272   ROM_LOAD16_WORD_SWAP( "mpr20962.5",   0x1000000, 0x0400000, CRC(f1e6c7fc) SHA1(0ba0972f1bc7c56f4e0589d3e363523cea988bb0) ) // good (was .15)
32513273   /*Without the following the game crashes,maybe we need to mirror the previous roms in this location?*/
3252   ROM_FILL(                             0x1400000, 0x0c00000, 0x00 )
3274   //ROM_FILL(                             0x1400000, 0x0c00000, 0x00 )
32533275ROM_END
32543276
32553277ROM_START( sandor )
32563278   STV_BIOS
32573279
3258   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3280   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
32593281   ROM_LOAD16_BYTE( "sando-r.13",               0x0000001, 0x0100000, CRC(fe63a239) SHA1(01502d4494f968443581cd2c74f25967d41f775e) )
32603282
32613283   ROM_LOAD16_WORD_SWAP( "mpr18635.8",   0x1c00000, 0x0400000, CRC(441e1368) SHA1(acb2a7e8d44c2203b8d3c7a7b70e20ffb120bebf) ) // good
r4878r4879
32873309ROM_START( thunt )
32883310   STV_BIOS
32893311
3290   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3291   ROM_FILL(                           0x0000000, 0x0200000, 0x00 )
3312   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
32923313   ROM_LOAD16_BYTE( "th-ic7_2.stv",    0x0200000, 0x0080000, CRC(c4e993de) SHA1(7aa433bc2623cb19a09d4ef4c8233a2d29901020) )
32933314   ROM_LOAD16_BYTE( "th-ic7_1.stv",    0x0200001, 0x0080000, CRC(1355cc18) SHA1(a9b731228a807b2b01f933fe0f7dcdbadaf89b7e) )
32943315
r4878r4879
33013322ROM_START( thuntk )
33023323   STV_BIOS
33033324
3304   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3305   ROM_FILL(                       0x0000000, 0x0400000, 0x00 )
3325   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33063326   ROM_LOAD16_BYTE( "2.ic13_2",    0x0200000, 0x0080000, CRC(6cae2926) SHA1(e8d5745b4228de24672da5017cb3dab58344f59f) )
33073327   ROM_LOAD16_BYTE( "1.ic13_1",    0x0200001, 0x0080000, CRC(460727c8) SHA1(da7171b65734264e10692e3408ac93beb374c65e) )
33083328
r4878r4879
33203340ROM_START( sanjeon )
33213341   STV_BIOS
33223342
3323   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3343   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33243344   ROM_LOAD16_BYTE( "ic11",               0x0000001, 0x0200000, CRC(9abae8d4) SHA1(ddbe4c8fff8fa59d63e278e95f245145d2da8aeb) )
33253345
33263346   ROM_LOAD( "ic13",    0x0400000, 0x0200000, CRC(f72c1d13) SHA1(a2b168d187034024b83fbbe2f5eec78816285da9) ) // ic2 good
r4878r4879
33403360ROM_START( sasissu )
33413361   STV_BIOS
33423362
3343   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3363   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33443364   ROM_LOAD16_BYTE( "epr20542.13",               0x0000001, 0x0100000, CRC(0e632db5) SHA1(9bc52794892eec22d381387d13a0388042e30714) )
33453365
33463366   ROM_LOAD16_WORD_SWAP( "mpr20544.2",    0x0400000, 0x0400000, CRC(661fff5e) SHA1(41f4ddda7adf004b52cc9a076606a60f31947d19) ) // good
r4878r4879
33553375ROM_START( seabass )
33563376   STV_BIOS
33573377
3358   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3378   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33593379   ROM_LOAD16_BYTE( "seabassf.13",               0x0000001, 0x0100000, CRC(6d7c39cc) SHA1(d9d1663134420b75c65ee07d7d547254785f2f83) )
33603380
33613381   ROM_LOAD16_WORD_SWAP( "mpr20551.2",    0x0400000, 0x0400000, CRC(9a0c6dd8) SHA1(26600372cc673ce3678945f4b5dc4e3ab31643a4) ) // good
r4878r4879
33713391ROM_START( shanhigw )
33723392   STV_BIOS
33733393
3374   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3375   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3394   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33763395   ROM_LOAD16_WORD_SWAP( "mpr18341.7",    0x0200000, 0x0200000, CRC(cc5e8646) SHA1(a733616c118140ff3887d30d595533f9a1beae06) ) // good
33773396   ROM_LOAD16_WORD_SWAP( "mpr18340.2",    0x0400000, 0x0200000, CRC(8db23212) SHA1(85d604a5c6ab97188716dbcd77d365af12a238fe) ) // good
33783397ROM_END
r4878r4879
33803399ROM_START( shienryu )
33813400   STV_BIOS
33823401
3383   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3384   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3402   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33853403   ROM_LOAD16_WORD_SWAP( "mpr19631.7",    0x0200000, 0x0200000, CRC(3a4b1abc) SHA1(3b14b7fdebd4817da32ea374c15a38c695ffeff1) ) // good
33863404   ROM_LOAD16_WORD_SWAP( "mpr19632.2",    0x0400000, 0x0400000, CRC(985fae46) SHA1(f953bde91805b97b60d2ab9270f9d2933e064d95) ) // good
33873405   ROM_LOAD16_WORD_SWAP( "mpr19633.3",    0x0800000, 0x0400000, CRC(e2f0b037) SHA1(97861d09e10ce5d2b10bf5559574b3f489e28077) ) // good
r4878r4879
33913409   STV_BIOS
33923410   ROM_DEFAULT_BIOS( "us" )
33933411
3394   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3412   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
33953413   ROM_LOAD16_BYTE( "epr18777.13",               0x0000001, 0x0080000, CRC(8d180866) SHA1(d47ebabab6e06400312d39f68cd818852e496b96) )
33963414   ROM_RELOAD ( 0x0100001, 0x0080000 )
33973415
r4878r4879
34053423ROM_START( sokyugrt )
34063424   STV_BIOS
34073425
3408   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3426   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34093427   ROM_LOAD16_BYTE( "fpr19188.13",               0x0000001, 0x0100000, CRC(45a27e32) SHA1(96e1bab8bdadf7071afac2a0a6dd8fd8989f12a6) )
34103428
34113429   ROM_LOAD16_WORD_SWAP( "mpr19189.2",    0x0400000, 0x0400000, CRC(0b202a3e) SHA1(6691b5af2cacd6092ec03886b78c2565953fa297) ) // good
r4878r4879
34183436ROM_START( sss )
34193437   STV_BIOS
34203438
3421   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3439   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34223440   ROM_LOAD16_BYTE( "epr21488.13",               0x0000001, 0x0080000, CRC(71c9def1) SHA1(a544a0b4046307172d2c1bf426ed24845f87d894) )
34233441   ROM_RELOAD ( 0x0100001, 0x0080000 )
34243442
r4878r4879
34323450ROM_START( suikoenb )
34333451   STV_BIOS
34343452
3435   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3453   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34363454   ROM_LOAD16_BYTE( "fpr17834.13",               0x0000001, 0x0100000, CRC(746ef686) SHA1(e31c317991a687662a8a2a45aed411001e5f1941) )
34373455
34383456   ROM_LOAD16_WORD_SWAP( "mpr17836.2",    0x0400000, 0x0400000, CRC(55e9642d) SHA1(5198291cd1dce0398eb47760db2c19eae99273b0) ) // good
r4878r4879
34483466ROM_START( twcup98 )
34493467   STV_BIOS
34503468
3451   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3469   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34523470   ROM_LOAD16_BYTE( "epr20819.13",    0x0000001, 0x0100000, CRC(d930dfc8) SHA1(f66cc955181720661a0334fe67fa5750ddf9758b) )
34533471
34543472   ROM_LOAD16_WORD_SWAP( "mpr20821.2",    0x0400000, 0x0400000, CRC(2d930d23) SHA1(5fcaf4257f3639cb3aa407d2936f616499a09d97) ) // ic2 good (was .12)
r4878r4879
34603478ROM_START( vfkids )
34613479   STV_BIOS
34623480
3463   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3481   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34643482   ROM_LOAD16_BYTE( "fpr18914.13",               0x0000001, 0x0100000, CRC(cd35730a) SHA1(645b52b449766beb740ab8f99957f8f431351ceb) )
34653483
34663484   ROM_LOAD16_WORD_SWAP( "mpr18916.4",    0x0c00000, 0x0400000, CRC(4aae3ddb) SHA1(b75479e73f1bce3f0c27fbd90820fa51eb1914a6) ) // good
r4878r4879
34773495ROM_START( vfremix )
34783496   STV_BIOS
34793497
3480   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3498   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34813499   ROM_LOAD16_BYTE( "epr17944.13",               0x0000001, 0x0100000, CRC(a5bdc560) SHA1(d3830480a611b7d88760c672ce46a2ea74076487) )
34823500
34833501   ROM_LOAD16_WORD_SWAP( "mpr17946.2",    0x0400000, 0x0400000, CRC(4cb245f7) SHA1(363d9936b27043b5858c956a45736ac05aefc54e) ) // good
r4878r4879
34923510ROM_START( vmahjong )
34933511   STV_BIOS
34943512
3495   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3496   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3513   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
34973514   ROM_LOAD16_WORD_SWAP( "mpr19620.7",    0x0200000, 0x0200000, CRC(c98de7e5) SHA1(5346f884793bcb080aa01967e91b54ced4a9802f) ) // good
34983515   ROM_LOAD16_WORD_SWAP( "mpr19615.2",    0x0400000, 0x0400000, CRC(c62896da) SHA1(52a5b10ca8af31295d2d700349eca038c418b522) ) // good
34993516   ROM_LOAD16_WORD_SWAP( "mpr19616.3",    0x0800000, 0x0400000, CRC(f62207c7) SHA1(87e60183365c6f7e62c7a0667f88df0c7f5457fd) ) // good
r4878r4879
35073524ROM_START( winterht )
35083525   STV_BIOS
35093526
3510   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3527   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
35113528   ROM_LOAD16_BYTE( "fpr20108.13",    0x0000001, 0x0100000, CRC(1ef9ced0) SHA1(abc90ce341cd17bb77349d611d6879389611f0bf) ) // bad
35123529
35133530   ROM_LOAD16_WORD_SWAP( "mpr20110.2",    0x0400000, 0x0400000, CRC(238ef832) SHA1(20fade5730ff8e249a1450c41bfdff6e133f4768) ) // good
r4878r4879
35223539ROM_START( znpwfv )
35233540   STV_BIOS
35243541
3525   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3542   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
35263543   ROM_LOAD16_BYTE( "epr20398.13",    0x0000001, 0x0100000, CRC(3fb56a0b) SHA1(13c2fa2d94b106d39e46f71d15fbce3607a5965a) ) // bad
35273544
35283545   ROM_LOAD16_WORD_SWAP( "mpr20400.2",    0x0400000, 0x0400000, CRC(1edfbe05) SHA1(b0edd3f3d57408101ae6eb0aec742afbb4d289ca) ) // good
r4878r4879
35393556ROM_START( danchih )
35403557   STV_BIOS
35413558
3542   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3543   ROM_FILL(                              0x0000000, 0x0200000, 0x00 )
3559   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
35443560   ROM_LOAD16_WORD_SWAP( "mpr21974.7",    0x0200000, 0x0200000, CRC(e7472793) SHA1(11b7b11cf492eb9cf69b50e7cfac46a5b86849ac) )// good
35453561   ROM_LOAD16_WORD_SWAP( "mpr21970.2",    0x0400000, 0x0400000, CRC(34dd7f4d) SHA1(d5c45da94ec5b6584049caf09516f1ad4ba3adb5) )// good
35463562   ROM_LOAD16_WORD_SWAP( "mpr21971.3",    0x0800000, 0x0400000, CRC(8995158c) SHA1(fbbd171d67eebf43630d6054bc1b9132f6b38183) )// good
r4878r4879
35513567ROM_START( mausuke )
35523568   STV_BIOS
35533569
3554   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3570   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
35553571   ROM_LOAD16_BYTE(             "ic13.bin",      0x0000001, 0x0100000, CRC(b456f4cd) SHA1(91cbe703ec7c1dd45eb3b05bdfeb06e3570599d1) )
35563572   ROM_RELOAD_PLAIN ( 0x0200000, 0x0100000 ) // needs the rom mapped here to appear 'normal'
35573573   ROM_RELOAD_PLAIN ( 0x0300000, 0x0100000 )
r4878r4879
35693585ROM_START( batmanfr )
35703586   STV_BIOS
35713587
3572   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3588   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
35733589   /* Many thanks to Runik to point this out*/
35743590   ROM_LOAD16_BYTE( "350-mpa1.u19",    0x0000000, 0x0100000, CRC(2a5a8c3a) SHA1(374ec55a39ea909cc672e4a629422681d1f2da05) )
35753591   ROM_RELOAD(                         0x0200000, 0x0100000 )
r4878r4879
35843600   ROM_LOAD16_WORD_SWAP( "gfx6.u18",   0x1c00000, 0x0400000, CRC(c6b381a3) SHA1(46431f1e47c084a0bf85535d35af27471653b008) )
35853601
35863602   /* it also has an extra adsp sound board, i guess this isn't tested */
3587   ROM_REGION( 0x080000, "user2", 0 ) /* ADSP code */
3603   ROM_REGION( 0x080000, "wave", 0 ) /* Wave data */
35883604   ROM_LOAD( "350snda1.u52",   0x000000, 0x080000, CRC(9027e7a0) SHA1(678df530838b078964a044ce734776f391654e6c) )
35893605
3590   ROM_REGION( 0x800000, "user3", 0 ) /* Sound */
3606   ROM_REGION( 0x800000, "adsp_code", 0 ) /* ADSP code */
35913607   ROM_LOAD( "snd0.u48",   0x000000, 0x200000, CRC(02b1927c) SHA1(08b21d8b31b0f15c59fb5bb7eaf425e6fe04f7b5) )
35923608   ROM_LOAD( "snd1.u49",   0x200000, 0x200000, CRC(58b18eda) SHA1(7f3105fe04d9c0cdfd76e3323f623a4d0f7dad06) )
35933609   ROM_LOAD( "snd2.u50",   0x400000, 0x200000, CRC(51d626d6) SHA1(0e68b79dcb653dcba48121ca2d4f692f90afa85e) )
r4878r4879
36143630   STV_BIOS
36153631   ROM_DEFAULT_BIOS( "euro" )
36163632
3617   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3633   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
36183634   ROM_LOAD16_BYTE( "epr-18821.ic13",  0x0000001, 0x0080000, CRC(9a6658e2) SHA1(16dbae3d9ab584713afcb403f89fe71049609245) )
36193635   ROM_RELOAD ( 0x0100001, 0x0080000 )
36203636
r4878r4879
36363652   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
36373653   ROM_COPY( "maincpu",0,0,0x080000)
36383654
3639   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3655   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
36403656   ROM_LOAD(             "epr18427.bin",      0x0000000, 0x0100000, CRC(3f25bec8) SHA1(43a5342b882d5aec0f35a8777cb475659f43b1c4) )
36413657   ROM_LOAD16_WORD_SWAP( "mpr18273.ic2",      0x0400000, 0x0200000, NO_DUMP )
36423658   ROM_LOAD16_WORD_SWAP( "mpr18274.ic3",      0x0800000, 0x0200000, NO_DUMP )
r4878r4879
36543670   ROM_REGION( 0x080000, "slave", 0 ) /* SH2 code */
36553671   ROM_COPY( "maincpu",0,0,0x080000)
36563672
3657   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3673   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
36583674   ROM_LOAD16_BYTE(             "epr18344.a",      0x0000001, 0x0100000,  CRC(5a7de018) SHA1(88e0c2a9a9d4ebf699878c0aa9737af85f95ccf8) )
36593675
36603676   ROM_LOAD16_WORD_SWAP( "mpr18273.ic2",      0x0400000, 0x0200000, NO_DUMP )
r4878r4879
36683684ROM_START( magzun )
36693685   STV_BIOS
36703686
3671   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3687   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
36723688   ROM_LOAD16_BYTE( "flash.ic13",               0x0000001, 0x0100000, CRC(e6f0aca0) SHA1(251d4d9c5a332d13af3a144c5eb9d8e7836bdd1b) ) // good
36733689
36743690   ROM_LOAD16_WORD_SWAP( "mpr-19354.ic2",    0x0400000, 0x0400000, CRC(a23822e7) SHA1(10ca5d39dcaaf35b80168a08d8a18d77fba1d2ce) ) // good
r4878r4879
36833699ROM_START( stress )
36843700   STV_BIOS
36853701
3686   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3702   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
36873703   ROM_LOAD16_BYTE( "epr-21300a.ic13",    0x0000001, 0x0100000, CRC(899d829e) SHA1(b6c6da92dc108353998b29c0659d288645541519) ) // good
36883704
36893705   ROM_LOAD16_WORD_SWAP( "mpr-21290.ic2",    0x0400000, 0x0400000, CRC(a49d29f3) SHA1(8f6c26fd9e94a9e03dd0029026d205cf481fe151) ) // good
r4878r4879
37023718ROM_START( nclubv3 )
37033719   STV_BIOS
37043720
3705   ROM_REGION32_BE( 0x3000000, "user1", 0 ) /* SH2 code */
3721   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
37063722
37073723   ROM_LOAD16_WORD_SWAP( "ic22",    0x0200000, 0x0200000, CRC(b4008ed0) SHA1(acb3784acad971eb5f4920760dc23a16330e7bad) ) // OK
37083724   ROM_LOAD16_WORD_SWAP( "ic24",    0x0400000, 0x0200000, CRC(4e894850) SHA1(eb7c3399505a45816701197a45062b9f34e5a3e1) ) // OK
r4878r4879
37163732   ROM_LOAD16_WORD_SWAP( "ic25",    0x1400000, 0x0200000, CRC(f77f9e24) SHA1(9a9636114e74c1fd7bd67db8005af02ef6a75ab1) ) // OK
37173733ROM_END
37183734
3735ROM_START( techbowl ) // set to 1p
3736   STV_BIOS
3737
3738   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
3739
3740   ROM_LOAD16_WORD_SWAP( "ic22",    0x0200000, 0x0200000, CRC(5058db21) SHA1(eec908bbfb9ec0fdca0002e69f32c1c030086456) ) // OK
3741   ROM_LOAD16_WORD_SWAP( "ic24",    0x0400000, 0x0200000, CRC(34090f6d) SHA1(b8bc344ab826d5c9584afb01dba1c720b8dbc74d) ) // OK
3742   ROM_LOAD16_WORD_SWAP( "ic26",    0x0600000, 0x0200000, CRC(fb073352) SHA1(a5164aa5854ab3095f704ab73b6e4fb9ed0e0785) ) // OK
3743   ROM_LOAD16_WORD_SWAP( "ic28",    0x0800000, 0x0200000, CRC(530e0ceb) SHA1(8d14eb9dbf253a4563587d256a15492384e7ca5c) ) // OK
3744   ROM_LOAD16_WORD_SWAP( "ic30",    0x0a00000, 0x0200000, CRC(8d89877e) SHA1(7d76d48d64d7ac5411d714a4bb83f37e3e5b8df6) ) // OK
3745ROM_END
3746
3747ROM_START( micrombc ) // set to 1p
3748   STV_BIOS
3749
3750   ROM_REGION32_BE( 0x3000000, "user1", ROMREGION_ERASE00 ) /* SH2 code */
3751
3752   ROM_LOAD16_WORD_SWAP( "ic22",    0x0200000, 0x0200000, CRC(8385bc45) SHA1(0bd60d7560cb2313d68470d0572850a7b8c501fd) ) // OK
3753   ROM_LOAD16_WORD_SWAP( "ic24",    0x0400000, 0x0200000, CRC(84ecb42f) SHA1(005dee9a0912d4b1b7f5157bc3cde96548c1e348) ) // OK
3754   ROM_LOAD16_WORD_SWAP( "ic26",    0x0600000, 0x0200000, CRC(869bc19c) SHA1(638125007d331beef567c976ea6f4e7a21acdb64) ) // OK
3755   ROM_LOAD16_WORD_SWAP( "ic28",    0x0800000, 0x0200000, CRC(0c3db354) SHA1(c4d43da7cea1b4d5ca3ac545afde10344a4a385b) ) // OK
3756   ROM_LOAD16_WORD_SWAP( "ic30",    0x0a00000, 0x0200000, CRC(03b9eacf) SHA1(d69c10f7613d9f52042dd6cce64e74e2b1ecc2d8) ) // OK
3757   ROM_LOAD16_WORD_SWAP( "ic32",    0x0c00000, 0x0200000, CRC(62c10626) SHA1(58cb0ca0330fa7a62b277ab0ff84bff65b81bb23) ) // OK
3758   ROM_LOAD16_WORD_SWAP( "ic34",    0x1000000, 0x0200000, CRC(8d89877e) SHA1(7d76d48d64d7ac5411d714a4bb83f37e3e5b8df6) ) // OK
3759   ROM_LOAD16_WORD_SWAP( "ic36",    0x1200000, 0x0200000, CRC(8d89877e) SHA1(7d76d48d64d7ac5411d714a4bb83f37e3e5b8df6) ) // OK
3760ROM_END
3761
37193762/*
37203763country codes:
37213764J = Japan
r4878r4879
38203863GAME( 1996, decathlt,  stvbios, stv, stv,        decathlt,     ROT0,   "Sega",                       "Decathlete (JUET 960709 V1.001)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
38213864GAME( 1996, decathlo,  decathlt,stv, stv,        decathlt,    ROT0,     "Sega",                       "Decathlete (JUET 960424 V1.000)", GAME_NO_SOUND | GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION )
38223865
3823/* not working,black screen */
3866/* Gives I/O errors */
3867GAME( 1996, magzun,    stvbios, stv, stv,        stv,         ROT0,   "Sega",                       "Magical Zunou Power (J 961031 V1.000)", GAME_NOT_WORKING )
3868GAME( 1997, techbowl,  stvbios, stv, stv,        stv,         ROT0,   "Sega",                       "Technical Bowling (J 971212 V1.000)", GAME_NOT_WORKING )
3869GAME( 1999, micrombc,  stvbios, stv, stv,        stv,         ROT0,   "Sega",                       "Microman Battle Charge (J 990326 V1.000)", GAME_NOT_WORKING )
3870
3871/* Black screen */
38243872GAME( 1999, ffreveng,  stvbios, stv, stv,        ffreveng,     ROT0,   "Capcom",                      "Final Fight Revenge (JUET 990714 V1.000)", GAME_UNEMULATED_PROTECTION | GAME_NO_SOUND | GAME_NOT_WORKING )
3825GAME( 1996, magzun,    stvbios, stv, stv,        stv,         ROT0,   "Sega",                       "Magical Zunou Power (J 961031 V1.000)", GAME_NOT_WORKING )
3873
38263874/* CD games */
38273875GAME( 1995, sfish2,    0,       stv, stv,        stv,      ROT0,   "Sega",                         "Sport Fishing 2 (UET 951106 V1.10e)", GAME_NO_SOUND | GAME_NOT_WORKING )
38283876GAME( 1995, sfish2j,   sfish2,    stv, stv,        stv,         ROT0,   "Sega",                         "Sport Fishing 2 (J 951201 V1.100)", GAME_NO_SOUND | GAME_NOT_WORKING )
src/mame/drivers/megatech.c
r4878r4879
5656PCB 171-5783 has locations for 2 ROMs and is dated 1989.
5757PCB 171-5784 has locations for 2 ROMs and is dated 1989. It also contains a custom Sega IC 315-5235
5858
59                                                                         |------------------------------- ROMs -----------------------------|
60                                                                         |                                                                  |
61Game                    PCB #       Sticker on PCB    Sticker on cart      IC1                    IC2                    IC3
62---------------------------------------------------------------------------------------------------------------------------------------------
63Space Harrier II        171-5782    837-6963-02       610-0239-02          MPR-11934    (834200)  EPR-12368-02 (27256)   n/a
64Out Run                 171-5783    837-6963-06       610-0239-06          MPR-11078    (Mask)    EPR-12368-06 (27256)   n/a
65Alien Syndrome          171-5783    837-6963-07       610-0239-07          MPR-11194    (232011)  EPR-12368-07 (27256)   n/a
66Afterburner             171-5784    837-6963-10       610-0239-10          315-5235     (custom)  MPR-11271-T  (834000)  EPR-12368-10 (27256)
67Tetris                  171-5834    837-6963-22       610-0239-22          MPR-12356F   (831000)  MPR-12357F   (831000)  EPR-12368-22 (27256)
68Ghouls & Ghosts         171-5869A   -                 610-0239-23          MPR-12605    (40 pins) MPR-12606    (40 pins) EPR-12368-23 (27256)
69Super Hang On           171-5782    837-6963-24       610-0239-24          MPR-12640    (234000)  EPR-12368-24 (27256)   n/a
70Forgotten Worlds        171-5782    837-6963-26       610-0239-26          MPR-12672-H  (Mask)    EPR-12368-26 (27256)   n/a
71Arnold Palmer Tour Golf 171-5782    837-6963-31       610-0239-31          MPR-12645F   (23C4000) EPR-12368-31 (27256)   n/a
72Super Real Basket Ball  171-5782    837-6963-32       610-0239-32          MPR-12904F   (838200A) EPR-12368-32 (27256)   n/a
73Shadow Dancer           171-5782    837-6963-43       610-0239-43          MPR-13571-S  (23C4000) EPR-12368-43 (27256)   n/a
74Wrestle War             171-5782    837-6963-48       610-0239-48          MPR-14025-F  (23C4000) EPR-12368-48 (27256)   n/a
75Bonanza Bros.           171-5782    837-6963-49       610-0239-49          MPR-13905A-F (23C4000) EPR-12368-49 (27256)   n/a
76Streets of Rage         171-5782    837-6963-51       610-0239-51          MPR-14125-SM (234000)  EPR-12368-51 (27256)   n/a
77Mario Lemeux Hockey     171-5782    837-6963-59       610-0239-59          MPR-14376-H  (234000)  EPR-12368-59 (27256)   n/a
78Sonic Hedgehog 2        171-6215A   837-6963-62       610-0239-62          MPR-15000A-F (838200)  EPR-12368-62 (27256)   n/a
59                                                                           |------------------------------- ROMs --------------------------------|
60                                                                           |                                                                     |
61Game                       PCB #       Sticker on PCB    Sticker on cart     IC1                          IC2                      IC3
62-------------------------------------------------------------------------------------------------------------------------------------------------
63Altered Beast              171-5782    837-6963-01       610-0239-01         MPR-12538F     (834200A)     EPR-12368-01   (27C256)  n/a
64Space Harrier II           171-5782    837-6963-02       610-0239-02         MPR-11934      (834200)      EPR-12368-02   (27256)   n/a
65Out Run                    171-5783    837-6963-06       610-0239-06         MPR-11078      (Mask)        EPR-12368-06   (27256)   n/a
66Alien Syndrome             171-5783    837-6963-07       610-0239-07         MPR-11194      (232011)      EPR-12368-07   (27256)   n/a
67Afterburner                171-5784    837-6963-10       610-0239-10         315-5235       (custom)      MPR-11271-T    (834000)  EPR-12368-10 (27256)
68Tetris                     171-5834    837-6963-22       610-0239-22         MPR-12356F     (831000)      MPR-12357F     (831000)  EPR-12368-22 (27256)
69World Championship Soccer  171-5782    837-6963-21       610-0239-21         MPR-126078     (uPD23C4000)  EPR-12607B     (27256)   n/a
70Ghouls & Ghosts            171-5869A   -                 610-0239-23         MPR-12605      (40 pins)     MPR-12606      (40 pins) EPR-12368-23 (27256)
71Super Hang On              171-5782    837-6963-24       610-0239-24         MPR-12640      (234000)      EPR-12368-24   (27256)   n/a
72Forgotten Worlds           171-5782    837-6963-26       610-0239-26         MPR-12672-H    (Mask)        EPR-12368-26   (27256)   n/a
73The Revenge Of Shinobi     171-5782    837-6963-28       610-0239-28         MPR-12675 S44  (uPD23C4000)  EPR-12368-28   (27C256)  n/a
74Arnold Palmer Tour Golf    171-5782    837-6963-31       610-0239-31         MPR-12645F     (23C4000)     EPR-12368-31   (27256)   n/a
75Super Real Basket Ball     171-5782    837-6963-32       610-0239-32         MPR-12904F     (838200A)     EPR-12368-32   (27256)   n/a
76Tommy Lasorda Baseball     171-5782    837-6963-35       610-0239-35         MPR-12706F     (834200A)     EPR-12368-35   (27256)   n/a
77ESWAT                      171-5782    837-6963-38       610-0239-38         MPR-13192-H    (uPD23C4000)  EPR-12368-38   (27256)   n/a
78Moonwalker                 171-5782    837-6963-40       610-0239-40         MPR-13285A S61 (uPD23C4000)  EPR-12368-40   (27256)   n/a
79Shadow Dancer              171-5782    837-6963-43       610-0239-43         MPR-13571-S    (uPD23C4000)  EPR-12368-43   (27256)   n/a
80Wrestle War                171-5782    837-6963-48       610-0239-48         MPR-14025-F    (23C4000)     EPR-12368-48   (27256)   n/a
81Bonanza Bros.              171-5782    837-6963-49       610-0239-49         MPR-13905A-F   (23C4000)     EPR-12368-49   (27256)   n/a
82Streets of Rage            171-5782    837-6963-51       610-0239-51         MPR-14125-SM   (uPD23C4000)  EPR-12368-51   (27C256)  n/a
83Sonic The Hedgehog         171-5782    837-6963-52       610-0239-52         MPR-13913-F    (834200A)     EPR-12368-52   (27C256)  n/a
84Mario Lemeux Hockey        171-5782    837-6963-59       610-0239-59         MPR-14376-H    (234000)      EPR-12368-59   (27256)   n/a
85Sonic Hedgehog 2           171-6215A   837-6963-62       610-0239-62         MPR-15000A-F   (838200)      EPR-12368-62   (27256)   n/a
7986
80
8187*/
8288#include "driver.h"
8389#include "cpu/z80/z80.h"
r4878r4879
654660
655661/* 12368-xx  xx is the game number? if so there are a _lot_ of carts, mt_beast is 01, mt_sonic is 52! */
656662
657
658663/* add a single extra byte after the instruction rom as an indicator to if the cart is SMS or GENESIS,
659664   the real hardware knows from the pinout */
660665#define MEGATECH_GAME_IS_GEN 1
r4878r4879
674679   MEGATECH_BIOS
675680ROM_END
676681
677
678682/* Game 01 - Altered Beast (Genesis) */
679683#define MEGATECH_GAME01(GAME_REGION, INSTRUCTION_REGION) \
680684   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
r4878r4879
682686    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
683687    ROM_LOAD( "12368-01.ic2", 0x000000, 0x08000, CRC(40cb0088) SHA1(e1711532c29f395a35a1cb34d789015881b5a1ed) ) \
684688
685ROM_START( mt_beast )
689ROM_START( mt_beast ) /* Altered Beast */
686690   MEGATECH_BIOS
687691   MEGATECH_GAME01("game0", "inst0")
688692ROM_END
689693
690/* Game 06 - Out Run (SMS) */
694/* Game 02 - Space Harrier 2 */
695#define MEGATECH_GAME02(GAME_REGION, INSTRUCTION_REGION) \
696   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
697   ROM_LOAD16_WORD_SWAP( "mp11934.ic1", 0x000000, 0x080000, CRC(932daa09) SHA1(a2d7a76f3604c6227d43229908bfbd02b0ef5fd9) ) \
698    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
699   ROM_LOAD( "12368-02.ic2", 0x000000, 0x08000, CRC(c129c66c) SHA1(e7c0c97db9df9eb04e2f9ff561b64305219b8f1f) ) \
691700
701ROM_START( mt_shar2 ) /* Space Harrier 2 */
702   MEGATECH_BIOS
703   MEGATECH_GAME02("game0", "inst0")
704ROM_END
705
706/* Game 03 - Super Thunder Blade */
707#define MEGATECH_GAME03(GAME_REGION, INSTRUCTION_REGION) \
708   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
709   ROM_LOAD16_WORD_SWAP( "mp11996f.ic1", 0x000000, 0x080000,  CRC(9355c34e) SHA1(26ff91c2921408673c644b0b1c8931d98524bf63) ) \
710    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
711   ROM_LOAD( "12368-03.ic2", 0x000000, 0x08000,  CRC(1ba4ac5d) SHA1(9bde57d70189d159ebdc537a9026001abfd0deae) ) \
712
713ROM_START( mt_stbld ) /* Super Thunder Blade */
714   MEGATECH_BIOS
715   MEGATECH_GAME03("game0", "inst0")
716ROM_END
717
718/* Game 04 - Great Golf (SMS) */
719#define MEGATECH_GAME04(GAME_REGION, INSTRUCTION_REGION) \
720   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
721   ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC(c6611c84) SHA1(eab0eed872dd26b13bcf0b2dd74fcbbc078812c9) ) \
722    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
723   ROM_LOAD( "12368-04.ic2", 0x000000, 0x08000, CRC(62e5579b) SHA1(e1f531be5c40a1216d4192baeda9352384444410) ) \
724   /* Also known to have the ID# MPR-11128 instead of MPR-11129F, same contents */
725
726ROM_START( mt_ggolf ) /* Great Golf */
727   MEGATECH_BIOS
728   MEGATECH_GAME04("game0", "inst0")
729ROM_END
730
731/* Game 05 - Great Soccer (SMS) - bad dump */
732#define MEGATECH_GAME05(GAME_REGION, INSTRUCTION_REGION) \
733   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
734   ROM_LOAD( "mp10747f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(9cf53703) SHA1(c6b4d1de56bd5bf067ec7fc80449c07686d01337) ) \
735    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
736   ROM_LOAD( "12368-05.ic2", 0x000000, 0x08000, CRC(bab91fcc) SHA1(a160c9d34b253e93ac54fdcef33f95f44d8fa90c) ) \
737
738ROM_START( mt_gsocr ) /* Great Soccer */
739   MEGATECH_BIOS
740   MEGATECH_GAME05("game0", "inst0")
741ROM_END
742
743/* Game 06 - Out Run (SMS) */
692744#define MEGATECH_GAME06(GAME_REGION, INSTRUCTION_REGION) \
693745   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
694746   ROM_LOAD( "mpr-11078.ic1", 0x000000, 0x040000, CRC(5589d8d2) SHA1(4f9b61b24f0d9fee0448cdbbe8fc05411dbb1102) ) \
695747    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
696748   ROM_LOAD( "epr-12368-06.ic2", 0x000000, 0x08000, CRC(c7c74429) SHA1(22ee261a653e10d66e0d6703c988bb7f236a7571) ) \
697749
698
699ROM_START( mt_orun ) /* Outrun */
750ROM_START( mt_orun ) /* Out Run */
700751   MEGATECH_BIOS
701752   MEGATECH_GAME06("game0", "inst0")
702753ROM_END
703754
755/* Game 07 - Alien Syndrome (SMS) */
756#define MEGATECH_GAME07(GAME_REGION, INSTRUCTION_REGION) \
757   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
758   ROM_LOAD( "mpr-11194.ic1", 0x000000, 0x040000, CRC(4cc11df9) SHA1(5d786476b275de34efb95f576dd556cf4b335a83) ) \
759    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
760   ROM_LOAD( "epr-12368-07.ic2", 0x000000, 0x08000, CRC(14f4a17b) SHA1(0fc010ac95762534892f1ae16986dbf1c25399d3) ) \
761
762ROM_START( mt_asyn ) /* Alien Syndrome */
763   MEGATECH_BIOS
764   MEGATECH_GAME07("game0", "inst0")
765ROM_END
766
767/* Game 08 - Shinobi (SMS) */
768#define MEGATECH_GAME08(GAME_REGION, INSTRUCTION_REGION) \
769   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
770   ROM_LOAD( "mp11706.ic1", 0x000000, 0x040000, CRC(0C6FAC4E) SHA1(7C0778C055DC9C2B0AAE1D166DBDB4734E55B9D1) ) \
771    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
772   ROM_LOAD( "12368-08.ic2", 0x000000, 0x08000, CRC(103A0459) SHA1(D803DDF7926B83785E8503C985B8C78E7CCB5DAC) ) \
773
774ROM_START( mt_shnbi ) /* Shinobi */
775   MEGATECH_BIOS
776   MEGATECH_GAME08("game0", "inst0")
777ROM_END
778
779/* Game 10 - AFterburner (SMS) */
780#define MEGATECH_GAME10(GAME_REGION, INSTRUCTION_REGION) \
781   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
782   ROM_LOAD( "mp11271.ic1", 0x000000, 0x080000, CRC(1C951F8E) SHA1(51531DF038783C84640A0CAB93122E0B59E3B69A) ) \
783    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
784   ROM_LOAD( "12368-10.ic2", 0x000000, 0x08000, CRC(2A7CB590) SHA1(2236963BDDC89CA9045B530259CC7B5CCF889EAF) ) \
785
786ROM_START( mt_aftrb ) /* Afterburner */
787   MEGATECH_BIOS
788   MEGATECH_GAME10("game0", "inst0")
789ROM_END
790
791/* Game 11 - Thunder Force 2 */
792#define MEGATECH_GAME11(GAME_REGION, INSTRUCTION_REGION) \
793   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
794   ROM_LOAD16_WORD_SWAP( "mp12559.ic1", 0x000000, 0x080000, CRC(b093bee3) SHA1(0bf6194c3d228425f8cf1903ed70d8da1b027b6a) ) \
795    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
796   ROM_LOAD( "12368-11.ic2", 0x000000, 0x08000, CRC(f4f27e8d) SHA1(ae1a2823deb416c53838115966f1833d5dac72d4) ) \
797
798ROM_START( mt_tfor2 ) /* Thunder Force 2 */
799   MEGATECH_BIOS
800   MEGATECH_GAME11("game0", "inst0")
801ROM_END
802
704803/* Game 13 - Astro Warrior (SMS) */
705804#define MEGATECH_GAME13(GAME_REGION, INSTRUCTION_REGION) \
706805   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
r4878r4879
708807    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
709808   ROM_LOAD( "12368-13.ic1", 0x000000, 0x08000,  CRC(4038cbd1) SHA1(696bc1efce45d9f0052b2cf0332a232687c8d6ab) ) \
710809
711ROM_START( mt_astro )
810ROM_START( mt_astro ) /* Astro Warrior */
712811   MEGATECH_BIOS
713812   MEGATECH_GAME13("game0", "inst0")
714813ROM_END
715814
716/* Game 21 - World Cup Soccer (Genesis) */
815/* Game 20 - Last Battle */
816#define MEGATECH_GAME20(GAME_REGION, INSTRUCTION_REGION) \
817   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
818   ROM_LOAD16_WORD_SWAP( "mp12578f.ic1", 0x000000, 0x080000, CRC(531191a0) SHA1(f6bc26e975c01a3e10ab4033e4c5f494627a1e2f) ) \
819    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
820   ROM_LOAD( "12368-20.ic2", 0x000000, 0x08000, CRC(e1a71c91) SHA1(c250da18660d8aea86eb2abace41ba46130dabc8) ) \
821
822ROM_START( mt_lastb ) /* Last Battle */
823   MEGATECH_BIOS
824   MEGATECH_GAME20("game0", "inst0")
825ROM_END
826
827/* Game 21 - World Championship Soccer (Genesis) */
717828#define MEGATECH_GAME21(GAME_REGION, INSTRUCTION_REGION) \
718829   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
719830   ROM_LOAD16_WORD_SWAP( "mp12607b.ic1", 0x000000, 0x080000, CRC(bc591b30) SHA1(55e8577171c0933eee53af1dabd0f4c6462d5fc8) ) \
720831    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
721832   ROM_LOAD( "12368-21.ic2", 0x000000, 0x08000, CRC(028ee46b) SHA1(cd8f81d66e5ae62107eb20e0ca5db4b66d4b2987) ) \
722833
723ROM_START( mt_wcsoc )
834ROM_START( mt_wcsoc ) /* World Championship Soccer */
724835   MEGATECH_BIOS
725836   MEGATECH_GAME21("game0", "inst0")
726837ROM_END
727838
839/* Game 22 - Tetris */
840#define MEGATECH_GAME22(GAME_REGION, INSTRUCTION_REGION) \
841   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
842   ROM_LOAD16_BYTE( "mpr-12356f.ic1", 0x000001, 0x020000, CRC(1e71c1a0) SHA1(44b2312792e49d46d71e0417a7f022e5ffddbbfe) ) \
843   ROM_LOAD16_BYTE( "mpr-12357f.ic2", 0x000000, 0x020000, CRC(d52ca49c) SHA1(a9159892eee2c0cf28ebfcfa99f81f80781851c6) ) \
844    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
845   ROM_LOAD( "12368-22.ic3", 0x000000, 0x08000, CRC(1c1b6468) SHA1(568a38f4186167486e39ab4aa2c1ceffd0b81156) ) \
846
847ROM_START( mt_tetri ) /* Tetris */
848   MEGATECH_BIOS
849   MEGATECH_GAME22("game0", "inst0")
850ROM_END
851
728852/* Game 23 - Ghouls and Ghosts (Genesis) */
729853#define MEGATECH_GAME23(GAME_REGION, INSTRUCTION_REGION) \
730854   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
r4878r4879
734858    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
735859   ROM_LOAD( "12368-23.ic3", 0x000000, 0x08000, CRC(7ee58546) SHA1(ad5bb0934475eacdc5e354f67c96fe0d2512d33b) ) \
736860
737ROM_START( mt_gng )
861ROM_START( mt_gng ) /* Ghouls and Ghosts */
738862   MEGATECH_BIOS
739863   MEGATECH_GAME23("game0", "inst0")
740864ROM_END
741865
742/* Game 24 - Super Hang On (Genesis) */
743
866/* Game 24 - Super Hang-On (Genesis) */
744867#define MEGATECH_GAME24(GAME_REGION, INSTRUCTION_REGION) \
745868   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
746869   ROM_LOAD16_WORD_SWAP( "mpr-12640.ic1", 0x000000, 0x080000, CRC(2fe2cf62) SHA1(4728bcc847deb38b16338cbd0154837cd4a07b7d) ) \
747870    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
748871   ROM_LOAD( "epr-12368-24.ic2", 0x000000, 0x08000, CRC(6c2db7e3) SHA1(8de0a10ed9185c9e98f17784811a79d3ce8c4c03) ) \
749872
750ROM_START( mt_shang ) /* Super HangOn */
873ROM_START( mt_shang ) /* Super Hang-On */
751874   MEGATECH_BIOS
752875   MEGATECH_GAME24("game0", "inst0")
753876ROM_END
754877
755878/* Game 25 - Golden Axe (Genesis) */
756
757879#define MEGATECH_GAME25(GAME_REGION, INSTRUCTION_REGION) \
758880   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
759881   ROM_LOAD16_WORD_SWAP( "12806.ic1", 0x000000, 0x080000, CRC(43456820) SHA1(2f7f1fcd979969ac99426f11ab99999a5494a121) ) \
760882    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
761883   ROM_LOAD( "12368-25.ic2", 0x000000, 0x08000, CRC(1f07ed28) SHA1(9d54192f4c6c1f8a51c38a835c1dd1e4e3e8279e) ) \
762884
763ROM_START( mt_gaxe )
885ROM_START( mt_gaxe ) /* Golden Axe */
764886   MEGATECH_BIOS
765887   MEGATECH_GAME25("game0", "inst0")
766888ROM_END
767889
768/* Game 39 - Super Monaco Grand Prix (Genesis) */
769
770#define MEGATECH_GAME39(GAME_REGION, INSTRUCTION_REGION) \
890/* Game 26 - Forgotten Worlds */
891/* why is this pre-swapped like a console dump?? */
892#define MEGATECH_GAME26(GAME_REGION, INSTRUCTION_REGION) \
771893   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
772   ROM_LOAD16_WORD_SWAP( "13250.ic1", 0x000000, 0x080000, CRC(189b885f) SHA1(31c06ffcb48b1604989a94e584261457de4f1f46) ) \
894   ROM_LOAD( "mpr-12672-h.ic1", 0x000000, 0x080000, CRC(d0ee6434) SHA1(8b9a37c206c332ef23dc71f09ec40e1a92b1f83a) ) \
773895    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
774   ROM_LOAD( "12368-39.ic2", 0x000000, 0x08000, CRC(64b3ce25) SHA1(83a9f2432d146a712b037f96f261742f7dc810bb) ) \
896   ROM_LOAD( "epr-12368-26.ic2", 0x000000, 0x08000, CRC(4623b573) SHA1(29df4a5c5de66cd9cb7519e4f30000f7dddc2138) ) \
775897
776ROM_START( mt_smgp ) /* Super Monaco Grand Prix */
898ROM_START( mt_fwrld ) /* Forgotten Worlds */
777899   MEGATECH_BIOS
778   MEGATECH_GAME39("game0", "inst0")
900   MEGATECH_GAME26("game0", "inst0")
779901ROM_END
780902
781/* Game 52 - Sonic (Genesis) */
782#define MEGATECH_GAME52(GAME_REGION, INSTRUCTION_REGION) \
903/* Game 27 - Mystic Defender */
904#define MEGATECH_GAME27(GAME_REGION, INSTRUCTION_REGION) \
783905   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
784   ROM_LOAD16_WORD_SWAP( "mp13913.ic1", 0x000000, 0x080000, CRC(480b4b5c) SHA1(ab1dc1f738e3b2d0898a314b123fa71182bf572e) ) \
906   ROM_LOAD16_WORD_SWAP( "mp12707.1", 0x000000, 0x080000, CRC(4f2c513d) SHA1(f9bb548b3688170fe18bb3f1b5b54182354143cf) ) \
785907    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
786   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000, CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) ) \
908   ROM_LOAD( "12368-27.ic2", 0x000000, 0x08000, CRC(caf46f78) SHA1(a9659e86a6a223646338cd8f29c346866e4406c7) ) \
787909
788ROM_START( mt_sonic )
910ROM_START( mt_mystd ) /* Mystic Defender */
789911   MEGATECH_BIOS
790   MEGATECH_GAME52("game0", "inst0")
912   MEGATECH_GAME27("game0", "inst0")
791913ROM_END
792914
793#define MEGATECH_GAME52ALT(GAME_REGION, INSTRUCTION_REGION) \
915/* Game 28 - The Revenge of Shinobi */
916#define MEGATECH_GAME28(GAME_REGION, INSTRUCTION_REGION) \
794917   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
795   ROM_LOAD16_WORD_SWAP( "mp13933.ic1", 0x000000, 0x080000, CRC(13775004) SHA1(5decfd35944a2d0e7b996b9a4a12b616a309fd5e) ) \
918   ROM_LOAD16_WORD_SWAP( "mp12675.ic1", 0x000000, 0x080000, CRC(672A1D4D) SHA1(5FD0AF14C8F2CF8CEAB1AE61A5A19276D861289A) ) \
796919    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
797   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000, CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) ) \
920   ROM_LOAD( "12368-28.ic2", 0x000000, 0x08000, CRC(0D30BEDE) SHA1(73A090D84B78A570E02FB54A33666DCADA52849B) ) \
798921
799ROM_START( mt_sonia ) /* Sonic (alt)*/
922ROM_START( mt_revsh ) /* The Revenge Of Shinobi */
800923   MEGATECH_BIOS
801   MEGATECH_GAME52ALT("game0", "inst0")
924   MEGATECH_GAME28("game0", "inst0")
802925ROM_END
803926
804/* Game 57 - Golden Axe 2 (Genesis) */
805#define MEGATECH_GAME57(GAME_REGION, INSTRUCTION_REGION) \
806   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
807   ROM_LOAD16_WORD_SWAP( "mp14272.ic1", 0x000000, 0x080000, CRC(d4784cae) SHA1(b6c286027d06fd850016a2a1ee1f1aeea080c3bb) ) \
808    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
809   ROM_LOAD( "12368-57.ic2", 0x000000, 0x08000, CRC(dc9b4433) SHA1(efd3a598569010cdc4bf38ecbf9ed1b4e14ffe36) ) \
927/* Game 29 - Parlour Games (SMS) */
928#define MEGATECH_GAME29(GAME_REGION, INSTRUCTION_REGION) \
929   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
930   ROM_LOAD( "mp11404.ic1", 0x000000, 0x020000, CRC(E030E66C) SHA1(06664DAF208F07CB00B603B12ECCFC3F01213A17) ) \
931    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
932   ROM_LOAD( "12368-29.ic2", 0x000000, 0x08000, CRC(534151e8) SHA1(219238d90c1d3ac07ff64c9a2098b490fff68f04) ) \
810933
811ROM_START( mt_gaxe2 ) /* Golden Axe 2 */
934ROM_START( mt_parlg ) /* Parlour Games */
812935   MEGATECH_BIOS
813   MEGATECH_GAME57("game0", "inst0")
936   MEGATECH_GAME29("game0", "inst0")
814937ROM_END
815938
816/* Game 58 - Sports Talk Football */
817#define MEGATECH_GAME58(GAME_REGION, INSTRUCTION_REGION) \
939/* Game 31 - Arnold Palmer Tournament Gold */
940#define MEGATECH_GAME31(GAME_REGION, INSTRUCTION_REGION) \
818941   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
819   ROM_LOAD16_WORD_SWAP( "mp14356a-f.ic1", 0x000000, 0x100000, CRC(20cf32f6) SHA1(752314346a7a98b3808b3814609e024dc0a4108c) ) \
942   ROM_LOAD16_WORD_SWAP( "mp12645f.ic1", 0x000000, 0x080000, CRC(c07ef8d2) SHA1(9d111fdc7bb92d52bfa048cd134aa488b4f475ef) ) \
820943    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
821   ROM_LOAD( "ep12368-58.ic2", 0x000000, 0x08000, CRC(dce2708e) SHA1(fcebb1899ee11468f6bda705899f074e7de9d723) ) \
944   ROM_LOAD( "12368-31.ic2", 0x000000, 0x08000, CRC(30af7e4a) SHA1(baf91d527393dc90aba9371abcb1e690bcc83c7e) ) \
822945
823ROM_START( mt_stf ) /* Sports Talk Football */
946ROM_START( mt_tgolf ) /* Arnold Palmer Tournament Golf */
824947   MEGATECH_BIOS
825   MEGATECH_GAME58("game0", "inst0")
948   MEGATECH_GAME31("game0", "inst0")
826949ROM_END
827950
828/* Game 53 - Fire Shark */
829#define MEGATECH_GAME53(GAME_REGION, INSTRUCTION_REGION) \
951/* Game 32 - Super Real Basketball */
952/* why is this pre-swapped like a console dump?? */
953#define MEGATECH_GAME32(GAME_REGION, INSTRUCTION_REGION) \
830954   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
831   ROM_LOAD16_WORD_SWAP( "mp14341.ic1", 0x000000, 0x080000, CRC(04d65ebc) SHA1(24338aecdc52b6f416548be722ca475c83dbae96) ) \
955   ROM_LOAD( "mpr-12904f.ic1", 0x000000, 0x080000, CRC(4346e11a) SHA1(c86725780027ef9783cb7884c8770cc030b0cd0d) ) \
832956    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
833   ROM_LOAD( "12368-53.ic2", 0x000000, 0x08000, CRC(4fa61044) SHA1(7810deea221c10b0b2f5233443d81f4f1998ee58) ) \
957   ROM_LOAD( "epr-12368-32.ic2", 0x000000, 0x08000, CRC(f70adcbe) SHA1(d4412a7cd59fe282a1c6619aa1051a2a2e00e1aa) ) \
834958
835   /* alt version with these roms exists, but the content is the same */
836   /* (6a221fd6) ep14706.ic1             mp14341.ic1  [even]     IDENTICAL */
837   /* (09fa48af) ep14707.ic2             mp14341.ic1  [odd]      IDENTICAL */
838
839ROM_START( mt_fshrk ) /* Fire Shark */
959ROM_START( mt_srbb ) /* Super Real Basketball */
840960   MEGATECH_BIOS
841   MEGATECH_GAME53("game0", "inst0")
961   MEGATECH_GAME32("game0", "inst0")
842962ROM_END
843963
844/* Game 38 - E-Swat */
845#define MEGATECH_GAME38(GAME_REGION, INSTRUCTION_REGION) \
964/* Game 35 - Tommy Lasorda Baseball */
965#define MEGATECH_GAME35(GAME_REGION, INSTRUCTION_REGION) \
846966   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
847   ROM_LOAD16_WORD_SWAP( "mp13192-h.ic1", 0x000000, 0x080000, CRC(82f458ef) SHA1(58444b783312def71ecffc4ad021b72a609685cb) ) \
967   ROM_LOAD16_WORD_SWAP( "mp12706.ic1", 0x000000, 0x080000, CRC(8901214f) SHA1(f5ec166be1cf9b86623b9d7a78ec903b899da32a) ) \
848968    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
849   ROM_LOAD( "12368-38.ic2", 0x000000, 0x08000, CRC(43c5529b) SHA1(104f85adea6da1612c0aa96d553efcaa387d7aaf) ) \
969   ROM_LOAD( "12368-35.ic2", 0x000000, 0x08000, CRC(67bbe482) SHA1(6fc283b22e68befabb44b2cc61a7f82a71d6f029) ) \
850970
851ROM_START( mt_eswat ) /* E-Swat */
971ROM_START( mt_tlbba ) /* Tommy Lasorda Baseball */
852972   MEGATECH_BIOS
853   MEGATECH_GAME38("game0", "inst0")
973   MEGATECH_GAME35("game0", "inst0")
854974ROM_END
855975
856/* Game 49 - Bonanza Bros */
857
858#define MEGATECH_GAME49(GAME_REGION, INSTRUCTION_REGION) \
976/* Game 36 - Columns */
977#define MEGATECH_GAME36(GAME_REGION, INSTRUCTION_REGION) \
859978   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
860   ROM_LOAD16_WORD_SWAP( "mp13905a.ic1", 0x000000, 0x100000, CRC(68a88d60) SHA1(2f56e8a2b0999de4fa0d14a1527f4e1df0f9c7a2) ) \
979   ROM_LOAD16_WORD_SWAP( "mp13193-t.ic1", 0x000000, 0x080000, CRC(8c770e2f) SHA1(02a3626025c511250a3f8fb3176eebccc646cda9) ) \
861980    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
862   ROM_LOAD( "12368-49.ic2", 0x000000, 0x08000, CRC(c5101da2) SHA1(636f30043e2e9291e193ef9a2ead2e97a0bf7380) ) \
981   ROM_LOAD( "ep12368-36.ic3", 0x000000, 0x08000, CRC(a4b29bac) SHA1(c9be866ac96243897d09612fe17562e0481f66e3) ) \
863982
864ROM_START( mt_bbros ) /* Bonanza Bros */
983ROM_START( mt_cols ) /* Columns */
865984   MEGATECH_BIOS
866   MEGATECH_GAME49("game0", "inst0")
985   MEGATECH_GAME36("game0", "inst0")
867986ROM_END
868987
869/* Game 48 - Wrestle War */
870
871#define MEGATECH_GAME48(GAME_REGION, INSTRUCTION_REGION) \
988/* Game 38 - ESWAT */
989#define MEGATECH_GAME38(GAME_REGION, INSTRUCTION_REGION) \
872990   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
873   ROM_LOAD16_WORD_SWAP( "mpr-14025-f.ic1", 0x000000, 0x080000, CRC(26e899fe) SHA1(6d28e154ae2e4196097a2aa96c5acd5dfe7e3d2b) ) \
991   ROM_LOAD16_WORD_SWAP( "mp13192-h.ic1", 0x000000, 0x080000, CRC(82f458ef) SHA1(58444b783312def71ecffc4ad021b72a609685cb) ) \
874992    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
875   ROM_LOAD( "12368-48.ic2", 0x000000, 0x08000, CRC(25817bc2) SHA1(ba1bbb952aff12fb4d3ecfb10d82c54128439395) ) \
993   ROM_LOAD( "12368-38.ic2", 0x000000, 0x08000, CRC(43c5529b) SHA1(104f85adea6da1612c0aa96d553efcaa387d7aaf) ) \
876994
877ROM_START( mt_wwar ) /* Wrestle War */
995ROM_START( mt_eswat ) /* ESWAT */
878996   MEGATECH_BIOS
879   MEGATECH_GAME48("game0", "inst0")
997   MEGATECH_GAME38("game0", "inst0")
880998ROM_END
881999
882/* Game 62 - Sonic 2 */
883
884#define MEGATECH_GAME62(GAME_REGION, INSTRUCTION_REGION) \
1000/* Game 39 - Super Monaco Grand Prix (Genesis) */
1001#define MEGATECH_GAME39(GAME_REGION, INSTRUCTION_REGION) \
8851002   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
886   ROM_LOAD16_WORD_SWAP( "mp15000a-f.ic1", 0x000000, 0x100000, CRC(679ebb49) SHA1(557482064677702454562f753460993067ef9e16) ) \
1003   ROM_LOAD16_WORD_SWAP( "13250.ic1", 0x000000, 0x080000, CRC(189b885f) SHA1(31c06ffcb48b1604989a94e584261457de4f1f46) ) \
8871004    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
888   ROM_LOAD( "ep12368-62.ic2", 0x000000, 0x08000, CRC(14a8566f) SHA1(d1d14162144bf068ddd19e9736477ff98fb43f9e) ) \
1005   ROM_LOAD( "12368-39.ic2", 0x000000, 0x08000, CRC(64b3ce25) SHA1(83a9f2432d146a712b037f96f261742f7dc810bb) ) \
8891006
890
891ROM_START( mt_soni2 ) /* Sonic 2 */
1007ROM_START( mt_smgp ) /* Super Monaco Grand Prix */
8921008   MEGATECH_BIOS
893   MEGATECH_GAME62("game0", "inst0")
1009   MEGATECH_GAME39("game0", "inst0")
8941010ROM_END
8951011
896/* Game 59 - Mario Lemieux Hockey */
897
898#define MEGATECH_GAME59(GAME_REGION, INSTRUCTION_REGION) \
899   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
900   ROM_LOAD16_WORD_SWAP( "mpr-14376-h.ic1", 0x000000, 0x80000, CRC(aa9be87e) SHA1(dceed94eaeb30e534f6953a4bc25ff37673b1e6b) ) \
901    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
902   ROM_LOAD( "epr-12368-59.ic2", 0x000000, 0x08000, CRC(6d47b438) SHA1(0a145f6438e4e55c957ae559663c37662b685246) ) \
903
904ROM_START( mt_mlh )
905   MEGATECH_BIOS
906   MEGATECH_GAME59("game0", "inst0")
907ROM_END
908
909/* Game 60 - Kid Chameleon */
910
911#define MEGATECH_GAME60(GAME_REGION, INSTRUCTION_REGION) \
912   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
913   ROM_LOAD16_WORD_SWAP( "mp14557.ic1", 0x000000, 0x100000, CRC(e1a889a4) SHA1(a2768eacafc47d371e5276f0cce4b12b6041337a) ) \
914    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
915   ROM_LOAD( "12368-60.ic2", 0x000000, 0x08000, CRC(a8e4af18) SHA1(dfa49f6ec4047718f33dba1180f6204dbaff884c) ) \
916
917
918ROM_START( mt_kcham ) /* Kid Chameleon */
919   MEGATECH_BIOS
920   MEGATECH_GAME60("game0", "inst0")
921ROM_END
922
923/* Game 20 - Last Battle */
924
925#define MEGATECH_GAME20(GAME_REGION, INSTRUCTION_REGION) \
926   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
927   ROM_LOAD16_WORD_SWAP( "mp12578f.ic1", 0x000000, 0x080000, CRC(531191a0) SHA1(f6bc26e975c01a3e10ab4033e4c5f494627a1e2f) ) \
928    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
929   ROM_LOAD( "12368-20.ic2", 0x000000, 0x08000, CRC(e1a71c91) SHA1(c250da18660d8aea86eb2abace41ba46130dabc8) ) \
930
931ROM_START( mt_lastb ) /* Last Battle */
932   MEGATECH_BIOS
933   MEGATECH_GAME20("game0", "inst0")
934ROM_END
935
9361012/* Game 40 - Moon Walker */
937
9381013#define MEGATECH_GAME40(GAME_REGION, INSTRUCTION_REGION) \
9391014   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
9401015   ROM_LOAD16_WORD_SWAP( "mp13285a.ic1", 0x000000, 0x080000, CRC(189516e4) SHA1(2a79e07da2e831832b8d448cae87a833c85e67c9) ) \
9411016    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
9421017   ROM_LOAD( "12368-40.ic2", 0x000000, 0x08000, CRC(0482378c) SHA1(734772f3ddb5ff82b76c3514d18a464b2bce8381) ) \
9431018
944
9451019ROM_START( mt_mwalk ) /* Moon Walker */
9461020   MEGATECH_BIOS
9471021   MEGATECH_GAME40("game0", "inst0")
9481022ROM_END
9491023
9501024/* Game 41 - Crackdown */
951
9521025#define MEGATECH_GAME41(GAME_REGION, INSTRUCTION_REGION) \
9531026   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
9541027   ROM_LOAD16_WORD_SWAP( "mp13578a-s.ic1", 0x000000, 0x080000, CRC(23f19893) SHA1(09aca793871e2246af4dc24925bc1eda8ff34446) ) \
9551028    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
9561029   ROM_LOAD( "ep12368-41.ic2", 0x000000, 0x08000, CRC(3014acec) SHA1(07953e9ae5c23fc7e7d08993b215f4dfa88aa5d7) ) \
9571030
958
959ROM_START( mt_crack )
1031ROM_START( mt_crack ) /* Crackdown */
9601032   MEGATECH_BIOS
9611033   MEGATECH_GAME41("game0", "inst0")
9621034ROM_END
9631035
964
965/* Game 27 - Mystic Defender */
966
967#define MEGATECH_GAME27(GAME_REGION, INSTRUCTION_REGION) \
1036/* Game 43 - Shadow Dancer */
1037#define MEGATECH_GAME43(GAME_REGION, INSTRUCTION_REGION) \
9681038   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
969   ROM_LOAD16_WORD_SWAP( "mp12707.1", 0x000000, 0x080000, CRC(4f2c513d) SHA1(f9bb548b3688170fe18bb3f1b5b54182354143cf) ) \
1039   ROM_LOAD16_WORD_SWAP( "mpr-13571-s.ic1", 0x000000, 0x080000, CRC(56a29310) SHA1(55836177e4a1e2deb68408976b29d0282cf661a9) ) \
9701040    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
971   ROM_LOAD( "12368-27.ic2", 0x000000, 0x08000, CRC(caf46f78) SHA1(a9659e86a6a223646338cd8f29c346866e4406c7) ) \
1041   ROM_LOAD( "epr-12368-43.ic2", 0x000000, 0x08000, CRC(1116cbc7) SHA1(ba6dd21ceadeedf730b71b67acbd20d9067114f3) ) \
9721042
973ROM_START( mt_mystd ) /* Mystic Defender */
1043ROM_START( mt_shado ) /* Shadow Dancer */
9741044   MEGATECH_BIOS
975   MEGATECH_GAME27("game0", "inst0")
1045   MEGATECH_GAME43("game0", "inst0")
9761046ROM_END
9771047
978/* Game 02 - Space Harrier 2 */
979
980#define MEGATECH_GAME02(GAME_REGION, INSTRUCTION_REGION) \
1048/* Game 44 - Arrow Flash */
1049#define MEGATECH_GAME44(GAME_REGION, INSTRUCTION_REGION) \
9811050   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
982   ROM_LOAD16_WORD_SWAP( "mp11934.ic1", 0x000000, 0x080000, CRC(932daa09) SHA1(a2d7a76f3604c6227d43229908bfbd02b0ef5fd9) ) \
1051   ROM_LOAD16_WORD_SWAP( "mpr13396h.ic1", 0x000000, 0x080000, CRC(091226e3) SHA1(cb15c6277314f3c4a86b5ae5823f72811d5d269d) ) \
9831052    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
984   ROM_LOAD( "12368-02.ic2", 0x000000, 0x08000, CRC(c129c66c) SHA1(e7c0c97db9df9eb04e2f9ff561b64305219b8f1f) ) \
1053   ROM_LOAD( "epr12368-44.ic2", 0x000000, 0x08000, CRC(e653065d) SHA1(96b014fc4df8eb2188ac94ed0a778d974fe6dcad) ) \
9851054
986ROM_START( mt_shar2 ) /* Space Harrier 2 */
1055ROM_START( mt_arrow ) /* Arrow Flash */
9871056   MEGATECH_BIOS
988   MEGATECH_GAME02("game0", "inst0")
1057   MEGATECH_GAME44("game0", "inst0")
9891058ROM_END
9901059
991/* Game 03 - Super Thunder Blade */
992#define MEGATECH_GAME03(GAME_REGION, INSTRUCTION_REGION) \
1060/* Game 47 - Alien Storm */
1061#define MEGATECH_GAME47(GAME_REGION, INSTRUCTION_REGION) \
9931062   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
994   ROM_LOAD16_WORD_SWAP( "mp11996f.ic1", 0x000000, 0x080000, CRC(9355c34e) SHA1(26ff91c2921408673c644b0b1c8931d98524bf63) ) \
1063   ROM_LOAD16_WORD_SWAP( "mp13941.ic1", 0x000000, 0x080000, CRC(D71B3EE6) SHA1(05F272DAD243D132D517C303388248DC4C0482ED) ) \
9951064    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
996   ROM_LOAD( "12368-03.ic2", 0x000000, 0x08000, CRC(1ba4ac5d) SHA1(9bde57d70189d159ebdc537a9026001abfd0deae) ) \
1065   ROM_LOAD( "12368-47.ic2", 0x000000, 0x08000, CRC(31FB683D) SHA1(E356DA020BBF817B97FB10C27F75CF5931EDF4FC) ) \
9971066
998
999ROM_START( mt_stbld ) /* Super Thunder Blade */
1067ROM_START( mt_astrm ) /* Alien Storm */
10001068   MEGATECH_BIOS
1001   MEGATECH_GAME03("game0", "inst0")
1069   MEGATECH_GAME47("game0", "inst0")
10021070ROM_END
10031071
1004/* Game 22 - Tetris */
1005#define MEGATECH_GAME22(GAME_REGION, INSTRUCTION_REGION) \
1072/* Game 48 - Wrestle War */
1073#define MEGATECH_GAME48(GAME_REGION, INSTRUCTION_REGION) \
10061074   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1007   ROM_LOAD16_BYTE( "mpr-12356f.ic1", 0x000001, 0x020000, CRC(1e71c1a0) SHA1(44b2312792e49d46d71e0417a7f022e5ffddbbfe) ) \
1008   ROM_LOAD16_BYTE( "mpr-12357f.ic2", 0x000000, 0x020000, CRC(d52ca49c) SHA1(a9159892eee2c0cf28ebfcfa99f81f80781851c6) ) \
1075   ROM_LOAD16_WORD_SWAP( "mpr-14025-f.ic1", 0x000000, 0x080000, CRC(26e899fe) SHA1(6d28e154ae2e4196097a2aa96c5acd5dfe7e3d2b) ) \
10091076    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1010   ROM_LOAD( "12368-22.ic3", 0x000000, 0x08000, CRC(1c1b6468) SHA1(568a38f4186167486e39ab4aa2c1ceffd0b81156) ) \
1077   ROM_LOAD( "12368-48.ic2", 0x000000, 0x08000, CRC(25817bc2) SHA1(ba1bbb952aff12fb4d3ecfb10d82c54128439395) ) \
10111078
1012ROM_START( mt_tetri ) /* Tetris */
1079ROM_START( mt_wwar ) /* Wrestle War */
10131080   MEGATECH_BIOS
1014   MEGATECH_GAME22("game0", "inst0")
1081   MEGATECH_GAME48("game0", "inst0")
10151082ROM_END
10161083
1017/* Game 11 - Thunder Force 2 */
1018
1019#define MEGATECH_GAME11(GAME_REGION, INSTRUCTION_REGION) \
1084/* Game 49 - Bonanza Bros. */
1085#define MEGATECH_GAME49(GAME_REGION, INSTRUCTION_REGION) \
10201086   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1021   ROM_LOAD16_WORD_SWAP( "mp12559.ic1", 0x000000, 0x080000, CRC(b093bee3) SHA1(0bf6194c3d228425f8cf1903ed70d8da1b027b6a) ) \
1087   ROM_LOAD16_WORD_SWAP( "mp13905a.ic1", 0x000000, 0x100000, CRC(68a88d60) SHA1(2f56e8a2b0999de4fa0d14a1527f4e1df0f9c7a2) ) \
10221088    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1023   ROM_LOAD( "12368-11.ic2", 0x000000, 0x08000, CRC(f4f27e8d) SHA1(ae1a2823deb416c53838115966f1833d5dac72d4) ) \
1089   ROM_LOAD( "12368-49.ic2", 0x000000, 0x08000, CRC(c5101da2) SHA1(636f30043e2e9291e193ef9a2ead2e97a0bf7380) ) \
10241090
1025ROM_START( mt_tfor2 ) /* Thunder Force 2 */
1091ROM_START( mt_bbros ) /* Bonanza Bros. */
10261092   MEGATECH_BIOS
1027   MEGATECH_GAME11("game0", "inst0")
1093   MEGATECH_GAME49("game0", "inst0")
10281094ROM_END
10291095
1030/* Game 35 - Tommy Lasorda Baseball */
1031
1032#define MEGATECH_GAME35(GAME_REGION, INSTRUCTION_REGION) \
1096/* Game 51 - Streets of Rage */
1097#define MEGATECH_GAME51(GAME_REGION, INSTRUCTION_REGION) \
10331098   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1034   ROM_LOAD16_WORD_SWAP( "mp12706.ic1", 0x000000, 0x080000, CRC(8901214f) SHA1(f5ec166be1cf9b86623b9d7a78ec903b899da32a) ) \
1099   ROM_LOAD16_WORD_SWAP( "mpr-13571-s.ic1", 0x000000, 0x080000, CRC(db4ac746) SHA1(c7cc24e2329f279574513fa32bbf79f72f75aeea) ) \
10351100    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1036   ROM_LOAD( "12368-35.ic2", 0x000000, 0x08000, CRC(67bbe482) SHA1(6fc283b22e68befabb44b2cc61a7f82a71d6f029) ) \
1101   ROM_LOAD( "epr-12368-51.ic2", 0x000000, 0x08000, CRC(49b7d6f4) SHA1(96e69851c92715e7daf35b184cf374147a8d2880) ) \
10371102
1038
1039ROM_START( mt_tlbba ) /* Tommy Lasorda Baseball */
1103ROM_START( mt_srage ) /* Streets of Rage */
10401104   MEGATECH_BIOS
1041   MEGATECH_GAME35("game0", "inst0")
1105   MEGATECH_GAME51("game0", "inst0")
10421106ROM_END
10431107
1044/* Game 36 - Columns */
1045
1046#define MEGATECH_GAME36(GAME_REGION, INSTRUCTION_REGION) \
1108/* Game 52 - Sonic The Hedgehog (Genesis) */
1109#define MEGATECH_GAME52(GAME_REGION, INSTRUCTION_REGION) \
10471110   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1048   ROM_LOAD16_WORD_SWAP( "mp13193-t.ic1", 0x000000, 0x080000, CRC(8c770e2f) SHA1(02a3626025c511250a3f8fb3176eebccc646cda9) ) \
1111   ROM_LOAD16_WORD_SWAP( "mp13913.ic1", 0x000000, 0x080000, CRC(480b4b5c) SHA1(ab1dc1f738e3b2d0898a314b123fa71182bf572e) ) \
10491112    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1050   ROM_LOAD( "ep12368-36.ic3", 0x000000, 0x08000,  CRC(a4b29bac) SHA1(c9be866ac96243897d09612fe17562e0481f66e3) ) \
1113   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000,  CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) ) \
10511114
1052ROM_START( mt_cols ) /* Columns */
1115ROM_START( mt_sonic ) /* Sonic The Hedgehog */
10531116   MEGATECH_BIOS
1054   MEGATECH_GAME36("game0", "inst0")
1117   MEGATECH_GAME52("game0", "inst0")
10551118ROM_END
10561119
1057/* Game 04 - Great Golf (SMS) */
1058
1059#define MEGATECH_GAME04(GAME_REGION, INSTRUCTION_REGION) \
1060   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1061   ROM_LOAD( "mp11129f.ic1", 0x000000, 0x020000, CRC(c6611c84) SHA1(eab0eed872dd26b13bcf0b2dd74fcbbc078812c9) ) \
1062    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1063   ROM_LOAD( "12368-04.ic2", 0x000000, 0x08000, CRC(62e5579b) SHA1(e1f531be5c40a1216d4192baeda9352384444410) ) \
1064   /* Also known to have the ID# MPR-11128 instead of MPR-11129F, same contents */
1065
1066ROM_START( mt_ggolf )
1067   MEGATECH_BIOS
1068   MEGATECH_GAME04("game0", "inst0")
1069ROM_END
1070
1071/* Game 05 - Great Soccer (SMS) - bad dump */
1072
1073#define MEGATECH_GAME05(GAME_REGION, INSTRUCTION_REGION) \
1074   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1075   ROM_LOAD( "mp10747f.ic1", 0x000000, 0x020000, BAD_DUMP CRC(9cf53703) SHA1(c6b4d1de56bd5bf067ec7fc80449c07686d01337) ) \
1076    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1077   ROM_LOAD( "12368-05.ic2", 0x000000, 0x08000, CRC(bab91fcc) SHA1(a160c9d34b253e93ac54fdcef33f95f44d8fa90c) ) \
1078
1079ROM_START( mt_gsocr )
1080   MEGATECH_BIOS
1081   MEGATECH_GAME05("game0", "inst0")
1082ROM_END
1083
1084/* Game 07 - Alien Syndrome (SMS) */
1085
1086#define MEGATECH_GAME07(GAME_REGION, INSTRUCTION_REGION) \
1087   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1088   ROM_LOAD( "mpr-11194.ic1", 0x000000, 0x040000, CRC(4cc11df9) SHA1(5d786476b275de34efb95f576dd556cf4b335a83) ) \
1089    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1090   ROM_LOAD( "epr-12368-07.ic2", 0x000000, 0x08000, CRC(14f4a17b) SHA1(0fc010ac95762534892f1ae16986dbf1c25399d3) ) \
1091
1092ROM_START( mt_asyn ) /* Alien Syndrome (SMS based) */
1093   MEGATECH_BIOS
1094   MEGATECH_GAME07("game0", "inst0")
1095ROM_END
1096
1097/* Game 29 - Parlour Games (SMS) */
1098#define MEGATECH_GAME29(GAME_REGION, INSTRUCTION_REGION) \
1099   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1100   ROM_LOAD( "mp11404.ic1", 0x000000, 0x020000, CRC(E030E66C) SHA1(06664DAF208F07CB00B603B12ECCFC3F01213A17) ) \
1101    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1102   ROM_LOAD( "12368-29.ic2", 0x000000, 0x08000, CRC(534151e8) SHA1(219238d90c1d3ac07ff64c9a2098b490fff68f04) ) \
1103
1104
1105ROM_START( mt_parlg ) /* Parlour Games (SMS Based)  */
1106   MEGATECH_BIOS
1107   MEGATECH_GAME29("game0", "inst0")
1108ROM_END
1109
1110/* Game 08 - Shinobi (SMS) */
1111
1112#define MEGATECH_GAME08(GAME_REGION, INSTRUCTION_REGION) \
1113   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1114   ROM_LOAD( "mp11706.ic1", 0x000000, 0x040000, CRC(0C6FAC4E) SHA1(7C0778C055DC9C2B0AAE1D166DBDB4734E55B9D1) ) \
1115    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1116   ROM_LOAD( "12368-08.ic2", 0x000000, 0x08000, CRC(103A0459) SHA1(D803DDF7926B83785E8503C985B8C78E7CCB5DAC) ) \
1117
1118ROM_START( mt_shnbi ) /* Shinobi. */
1119   MEGATECH_BIOS
1120   MEGATECH_GAME08("game0", "inst0")
1121ROM_END
1122
1123/* Game 10 - AFterburner (SMS) */
1124
1125#define MEGATECH_GAME10(GAME_REGION, INSTRUCTION_REGION) \
1126   ROM_REGION( 0x300000, GAME_REGION, 0 ) \
1127   ROM_LOAD( "mp11271.ic1", 0x000000, 0x080000, CRC(1C951F8E) SHA1(51531DF038783C84640A0CAB93122E0B59E3B69A) ) \
1128    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_SMS ) \
1129   ROM_LOAD( "12368-10.ic2", 0x000000, 0x08000, CRC(2A7CB590) SHA1(2236963BDDC89CA9045B530259CC7B5CCF889EAF) ) \
1130
1131ROM_START( mt_aftrb ) /* Afterburner. */
1132   MEGATECH_BIOS
1133   MEGATECH_GAME10("game0", "inst0")
1134ROM_END
1135
1136/* Game 28 - Revenge of Shinobi */
1137
1138#define MEGATECH_GAME28(GAME_REGION, INSTRUCTION_REGION) \
1120#define MEGATECH_GAME52ALT(GAME_REGION, INSTRUCTION_REGION) \
11391121   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1140   ROM_LOAD16_WORD_SWAP( "mp12675.ic1", 0x000000, 0x080000, CRC(672A1D4D) SHA1(5FD0AF14C8F2CF8CEAB1AE61A5A19276D861289A) ) \
1122   ROM_LOAD16_WORD_SWAP( "mp13933.ic1", 0x000000, 0x080000, CRC(13775004) SHA1(5decfd35944a2d0e7b996b9a4a12b616a309fd5e) ) \
11411123    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1142   ROM_LOAD( "12368-28.ic2", 0x000000, 0x08000, CRC(0D30BEDE) SHA1(73A090D84B78A570E02FB54A33666DCADA52849B) ) \
1124   ROM_LOAD( "12368-52.ic2", 0x0000, 0x8000, CRC(6a69d20c) SHA1(e483b39ff6eca37dc192dc296d004049e220554a) ) \
11431125
1144
1145ROM_START( mt_revsh ) /* The Revenge Of Shinobi. */
1126ROM_START( mt_sonia ) /* Sonic (alt)*/
11461127   MEGATECH_BIOS
1147   MEGATECH_GAME28("game0", "inst0")
1128   MEGATECH_GAME52ALT("game0", "inst0")
11481129ROM_END
11491130
1150/* Game 31 - Arnold Palmer Tournament Gold */
1151
1152#define MEGATECH_GAME31(GAME_REGION, INSTRUCTION_REGION) \
1131/* Game 53 - Fire Shark */
1132#define MEGATECH_GAME53(GAME_REGION, INSTRUCTION_REGION) \
11531133   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1154   ROM_LOAD16_WORD_SWAP( "mp12645f.ic1", 0x000000, 0x080000, CRC(c07ef8d2) SHA1(9d111fdc7bb92d52bfa048cd134aa488b4f475ef) ) \
1134   ROM_LOAD16_WORD_SWAP( "mp14341.ic1", 0x000000, 0x080000, CRC(04d65ebc) SHA1(24338aecdc52b6f416548be722ca475c83dbae96) ) \
11551135    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1156   ROM_LOAD( "12368-31.ic2", 0x000000, 0x08000, CRC(30af7e4a) SHA1(baf91d527393dc90aba9371abcb1e690bcc83c7e) ) \
1136   ROM_LOAD( "12368-53.ic2", 0x000000, 0x08000, CRC(4fa61044) SHA1(7810deea221c10b0b2f5233443d81f4f1998ee58) ) \
11571137
1138   /* alt version with these roms exists, but the content is the same */
1139   /* (6a221fd6) ep14706.ic1             mp14341.ic1  [even]     IDENTICAL */
1140   /* (09fa48af) ep14707.ic2             mp14341.ic1  [odd]      IDENTICAL */
11581141
1159ROM_START( mt_tgolf ) /* Arnold Palmer Tournament Golf */
1142ROM_START( mt_fshrk ) /* Fire Shark */
11601143   MEGATECH_BIOS
1161   MEGATECH_GAME31("game0", "inst0")
1144   MEGATECH_GAME53("game0", "inst0")
11621145ROM_END
11631146
1164
1165/* Game 47 - Alien Storm */
1166
1167#define MEGATECH_GAME47(GAME_REGION, INSTRUCTION_REGION) \
1147/* Game 57 - Golden Axe 2 (Genesis) */
1148#define MEGATECH_GAME57(GAME_REGION, INSTRUCTION_REGION) \
11681149   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1169   ROM_LOAD16_WORD_SWAP( "mp13941.ic1", 0x000000, 0x080000, CRC(D71B3EE6) SHA1(05F272DAD243D132D517C303388248DC4C0482ED) ) \
1150   ROM_LOAD16_WORD_SWAP( "mp14272.ic1", 0x000000, 0x080000, CRC(d4784cae) SHA1(b6c286027d06fd850016a2a1ee1f1aeea080c3bb) ) \
11701151    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1171   ROM_LOAD( "12368-47.ic2", 0x000000, 0x08000, CRC(31FB683D) SHA1(E356DA020BBF817B97FB10C27F75CF5931EDF4FC) ) \
1152   ROM_LOAD( "12368-57.ic2", 0x000000, 0x08000, CRC(dc9b4433) SHA1(efd3a598569010cdc4bf38ecbf9ed1b4e14ffe36) ) \
11721153
1173ROM_START( mt_astrm ) /* Alien Storm. */
1154ROM_START( mt_gaxe2 ) /* Golden Axe 2 */
11741155   MEGATECH_BIOS
1175   MEGATECH_GAME47("game0", "inst0")
1156   MEGATECH_GAME57("game0", "inst0")
11761157ROM_END
11771158
1178/* Game 44 - Arrow Flash */
1179
1180#define MEGATECH_GAME44(GAME_REGION, INSTRUCTION_REGION) \
1159/* Game 58 - Sports Talk Football */
1160#define MEGATECH_GAME58(GAME_REGION, INSTRUCTION_REGION) \
11811161   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1182   ROM_LOAD16_WORD_SWAP( "mpr13396h.ic1", 0x000000, 0x080000, CRC(091226e3) SHA1(cb15c6277314f3c4a86b5ae5823f72811d5d269d) ) \
1162   ROM_LOAD16_WORD_SWAP( "mp14356a-f.ic1", 0x000000, 0x100000, CRC(20cf32f6) SHA1(752314346a7a98b3808b3814609e024dc0a4108c) ) \
11831163    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1184   ROM_LOAD( "epr12368-44.ic2", 0x000000, 0x08000, CRC(e653065d) SHA1(96b014fc4df8eb2188ac94ed0a778d974fe6dcad) ) \
1164   ROM_LOAD( "ep12368-58.ic2", 0x000000, 0x08000, CRC(dce2708e) SHA1(fcebb1899ee11468f6bda705899f074e7de9d723) ) \
11851165
1186
1187ROM_START( mt_arrow ) /* Arrow Flash */
1166ROM_START( mt_stf ) /* Sports Talk Football */
11881167   MEGATECH_BIOS
1189   MEGATECH_GAME44("game0", "inst0")
1168   MEGATECH_GAME58("game0", "inst0")
11901169ROM_END
11911170
1192/* Game 32 - Super Real Basketball */
1193/* why is this pre-swapped like a console dump?? */
1194#define MEGATECH_GAME32(GAME_REGION, INSTRUCTION_REGION) \
1171/* Game 59 - Mario Lemieux Hockey */
1172#define MEGATECH_GAME59(GAME_REGION, INSTRUCTION_REGION) \
11951173   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1196   ROM_LOAD( "mpr-12904f.ic1", 0x000000, 0x080000, CRC(4346e11a) SHA1(c86725780027ef9783cb7884c8770cc030b0cd0d) ) \
1174   ROM_LOAD16_WORD_SWAP( "mpr-14376-h.ic1", 0x000000, 0x80000, CRC(aa9be87e) SHA1(dceed94eaeb30e534f6953a4bc25ff37673b1e6b) ) \
11971175    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1198   ROM_LOAD( "epr-12368-32.ic2", 0x000000, 0x08000, CRC(f70adcbe) SHA1(d4412a7cd59fe282a1c6619aa1051a2a2e00e1aa) ) \
1176   ROM_LOAD( "epr-12368-59.ic2", 0x000000, 0x08000, CRC(6d47b438) SHA1(0a145f6438e4e55c957ae559663c37662b685246) ) \
11991177
1200ROM_START( mt_srbb ) /* Super Real Basketball */
1178ROM_START( mt_mlh ) /* Mario Lemieux Hockey */
12011179   MEGATECH_BIOS
1202   MEGATECH_GAME32("game0", "inst0")
1180   MEGATECH_GAME59("game0", "inst0")
12031181ROM_END
12041182
1205/* Game 26 - Forgotten Worlds */
1206/* why is this pre-swapped like a console dump?? */
1207#define MEGATECH_GAME26(GAME_REGION, INSTRUCTION_REGION) \
1183/* Game 60 - Kid Chameleon */
1184#define MEGATECH_GAME60(GAME_REGION, INSTRUCTION_REGION) \
12081185   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1209   ROM_LOAD( "mpr-12672-h.ic1", 0x000000, 0x080000, CRC(d0ee6434) SHA1(8b9a37c206c332ef23dc71f09ec40e1a92b1f83a) ) \
1186   ROM_LOAD16_WORD_SWAP( "mp14557.ic1", 0x000000, 0x100000, CRC(e1a889a4) SHA1(a2768eacafc47d371e5276f0cce4b12b6041337a) ) \
12101187    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1211   ROM_LOAD( "epr-12368-26.ic2", 0x000000, 0x08000, CRC(4623b573) SHA1(29df4a5c5de66cd9cb7519e4f30000f7dddc2138) ) \
1188   ROM_LOAD( "12368-60.ic2", 0x000000, 0x08000, CRC(a8e4af18) SHA1(dfa49f6ec4047718f33dba1180f6204dbaff884c) ) \
12121189
1213
1214ROM_START( mt_fwrld ) /* Forgotten Worlds */
1190ROM_START( mt_kcham ) /* Kid Chameleon */
12151191   MEGATECH_BIOS
1216   MEGATECH_GAME26("game0", "inst0")
1192   MEGATECH_GAME60("game0", "inst0")
12171193ROM_END
12181194
1219/* Game 43 - Shadow Dancer */
1220
1221#define MEGATECH_GAME43(GAME_REGION, INSTRUCTION_REGION) \
1195/* Game 62 - Sonic The Hedgehog 2 */
1196#define MEGATECH_GAME62(GAME_REGION, INSTRUCTION_REGION) \
12221197   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1223   ROM_LOAD16_WORD_SWAP( "mpr-13571-s.ic1", 0x000000, 0x080000, CRC(56a29310) SHA1(55836177e4a1e2deb68408976b29d0282cf661a9) ) \
1198   ROM_LOAD16_WORD_SWAP( "mp15000a-f.ic1", 0x000000, 0x100000, CRC(679ebb49) SHA1(557482064677702454562f753460993067ef9e16) ) \
12241199    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1225   ROM_LOAD( "epr-12368-43.ic2", 0x000000, 0x08000, CRC(1116cbc7) SHA1(ba6dd21ceadeedf730b71b67acbd20d9067114f3) ) \
1200   ROM_LOAD( "ep12368-62.ic2", 0x000000, 0x08000, CRC(14a8566f) SHA1(d1d14162144bf068ddd19e9736477ff98fb43f9e) ) \
12261201
1227ROM_START( mt_shado ) /* Bonanza Bros */
1202ROM_START( mt_soni2 ) /* Sonic The Hedgehog 2 */
12281203   MEGATECH_BIOS
1229   MEGATECH_GAME43("game0", "inst0")
1204   MEGATECH_GAME62("game0", "inst0")
12301205ROM_END
12311206
1232/* Game 51 - Streets of Rage */
1233
1234#define MEGATECH_GAME51(GAME_REGION, INSTRUCTION_REGION) \
1235   ROM_REGION16_BE( 0x300000, GAME_REGION, 0 ) \
1236   ROM_LOAD16_WORD_SWAP( "mpr-13571-s.ic1", 0x000000, 0x080000, CRC(db4ac746) SHA1(c7cc24e2329f279574513fa32bbf79f72f75aeea) ) \
1237    MEGATECH_INSTRUCTION_REGION( INSTRUCTION_REGION, MEGATECH_GAME_IS_GEN ) \
1238   ROM_LOAD( "epr-12368-51.ic2", 0x000000, 0x08000, CRC(49b7d6f4) SHA1(96e69851c92715e7daf35b184cf374147a8d2880) ) \
1239
1240ROM_START( mt_srage ) /* Bonanza Bros */
1241   MEGATECH_BIOS
1242   MEGATECH_GAME51("game0", "inst0")
1243ROM_END
1244
12451207/* Compilations of games to show the multi-cart support */
12461208
12471209ROM_START( mt_comp1 )
r4878r4879
12561218   MEGATECH_GAME60("game7", "inst7")
12571219ROM_END
12581220
1259
12601221ROM_START( mt_comp2 )
12611222   MEGATECH_BIOS
12621223   MEGATECH_GAME10("game0", "inst0")
src/mame/drivers/bishi.c
r4878r4879
200200    PORT_DIPSETTING(      0x0006, DEF_STR( Very_Easy) )
201201   PORT_DIPSETTING(      0x0005, DEF_STR( Easy ) )
202202   PORT_DIPSETTING(      0x0004, DEF_STR( Medium ) )
203   PORT_DIPSETTING(      0x0003, "Medium Hard" )
203   PORT_DIPSETTING(      0x0003, DEF_STR( Medium_Hard ) )
204204   PORT_DIPSETTING(      0x0002, DEF_STR( Hard ) )
205205   PORT_DIPSETTING(      0x0001, DEF_STR( Very_Hard ) )
206206   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
r4878r4879
301301    PORT_DIPSETTING(      0x0006, DEF_STR( Very_Easy) )
302302   PORT_DIPSETTING(      0x0005, DEF_STR( Easy ) )
303303   PORT_DIPSETTING(      0x0004, DEF_STR( Medium ) )
304   PORT_DIPSETTING(      0x0003, "Medium Hard" )
304   PORT_DIPSETTING(      0x0003, DEF_STR( Medium_Hard ) )
305305   PORT_DIPSETTING(      0x0002, DEF_STR( Hard ) )
306306   PORT_DIPSETTING(      0x0001, DEF_STR( Very_Hard ) )
307307   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
src/mame/drivers/1942.c
r4878r4879
212212   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SWB:3,2")
213213   PORT_DIPSETTING(    0x40, DEF_STR( Easy ) )
214214   PORT_DIPSETTING(    0x60, DEF_STR( Normal ) )
215   PORT_DIPSETTING(    0x20, "Difficult" )
216   PORT_DIPSETTING(    0x00, "Very Difficult" )
215   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
216   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
217217   PORT_DIPNAME( 0x80, 0x80, "Screen Stop" )         PORT_DIPLOCATION("SWB:1")
218218   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
219219   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/bombjack.c
r4878r4879
144144   AM_RANGE(0x8000, 0x8fff) AM_RAM
145145   AM_RANGE(0x9000, 0x93ff) AM_RAM_WRITE(bombjack_videoram_w) AM_BASE(&videoram)
146146   AM_RANGE(0x9400, 0x97ff) AM_RAM_WRITE(bombjack_colorram_w) AM_BASE(&colorram)
147   AM_RANGE(0x9820, 0x987f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
147   AM_RANGE(0x9820, 0x987f) AM_WRITEONLY AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
148148   AM_RANGE(0x9a00, 0x9a00) AM_WRITENOP
149149   AM_RANGE(0x9c00, 0x9cff) AM_WRITE(paletteram_xxxxBBBBGGGGRRRR_le_w) AM_BASE(&paletteram)
150150   AM_RANGE(0x9e00, 0x9e00) AM_WRITE(bombjack_background_w)
src/mame/drivers/bnstars.c
r4878r4879
12431243   AM_RANGE(0xfce00058, 0xfce0005b) AM_WRITENOP
12441244   AM_RANGE(0xfce0005c, 0xfce0005f) AM_WRITENOP
12451245
1246   AM_RANGE(0xfce00400, 0xfce0045f) AM_WRITE(SMH_RAM) AM_BASE(&ms32_roz_ctrl[0])
1247   AM_RANGE(0xfce00700, 0xfce0075f) AM_WRITE(SMH_RAM) AM_BASE(&ms32_roz_ctrl[1]) // guess
1248   AM_RANGE(0xfce00a00, 0xfce00a17) AM_WRITE(SMH_RAM) AM_BASE(&ms32_tx0_scroll)
1249   AM_RANGE(0xfce00a20, 0xfce00a37) AM_WRITE(SMH_RAM) AM_BASE(&ms32_bg0_scroll)
1250   AM_RANGE(0xfce00c00, 0xfce00c17) AM_WRITE(SMH_RAM) AM_BASE(&ms32_tx1_scroll)
1251   AM_RANGE(0xfce00c20, 0xfce00c37) AM_WRITE(SMH_RAM) AM_BASE(&ms32_bg1_scroll)
1246   AM_RANGE(0xfce00400, 0xfce0045f) AM_WRITEONLY AM_BASE(&ms32_roz_ctrl[0])
1247   AM_RANGE(0xfce00700, 0xfce0075f) AM_WRITEONLY AM_BASE(&ms32_roz_ctrl[1]) // guess
1248   AM_RANGE(0xfce00a00, 0xfce00a17) AM_WRITEONLY AM_BASE(&ms32_tx0_scroll)
1249   AM_RANGE(0xfce00a20, 0xfce00a37) AM_WRITEONLY AM_BASE(&ms32_bg0_scroll)
1250   AM_RANGE(0xfce00c00, 0xfce00c17) AM_WRITEONLY AM_BASE(&ms32_tx1_scroll)
1251   AM_RANGE(0xfce00c20, 0xfce00c37) AM_WRITEONLY AM_BASE(&ms32_bg1_scroll)
12521252
12531253   AM_RANGE(0xfce00e00, 0xfce00e03) AM_WRITE(bnstars1_mahjong_select_w) // ?
12541254
r4878r4879
12661266   AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM_WRITE(ms32_bg0_ram_w) AM_BASE(&ms32_bg0_ram)
12671267
12681268   AM_RANGE(0xfee00000, 0xfee1ffff) AM_RAM
1269   AM_RANGE(0xffe00000, 0xffffffff) AM_READWRITE(SMH_BANK(1), SMH_ROM)
1269   AM_RANGE(0xffe00000, 0xffffffff) AM_ROMBANK(1)
12701270ADDRESS_MAP_END
12711271
12721272#if 0
src/mame/drivers/blockhl.c
r4878r4879
7979   AM_RANGE(0x0000, 0x3fff) AM_READWRITE(K052109_051960_r, K052109_051960_w)
8080   AM_RANGE(0x4000, 0x57ff) AM_RAM
8181   AM_RANGE(0x5800, 0x5fff) AM_READWRITE(bankedram_r, bankedram_w) AM_BASE(&ram)
82   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(SMH_BANK(1), SMH_ROM)
82   AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(1)
8383   AM_RANGE(0x8000, 0xffff) AM_ROM
8484ADDRESS_MAP_END
8585
r4878r4879
120120   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
121121   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
122122   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
123   PORT_DIPSETTING(    0x20, "Difficult" )
124   PORT_DIPSETTING(    0x00, "Very Difficult" )
123   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
124   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
125125   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
126126   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
127127   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/gcpinbal.c
r4878r4879
2121
2222Eprom?
2323
24MSM6295 banking?  (also missing in Raine)
24BGMs (controlled by MSM-6585 sound chip)
2525
2626Stephh's notes (based on the game M68000 code and some tests) :
2727
r4878r4879
3838
3939/* M6585 */
4040
41static int start, end, bank;
41static UINT32 msm_start, msm_end, msm_bank;
42static UINT32 adpcm_start, adpcm_end, adpcm_idle;
4243
4344/***********************************************************
4445                      INTERRUPTS
r4878r4879
132133
133134      // MSM6585 bank, coin LEDs, maybe others?
134135      case 0x44:
135         if (data & 0x10)
136         {
137            bank = 0x100000;
138         }
139         else
140         {
141            bank = 0;
142         }
136         msm_bank = data & 0x1000 ? 0x100000 : 0;
137         okim6295_set_bank_base(devtag_get_device(space->machine, "oki"), 0x40000 * ((data & 0x800)>>11));
143138         break;
144139
145140      case 0x45:
141         //adpcm_idle = 1;
146142         break;
147143
148144      // OKIM6295
r4878r4879
153149
154150      // MSM6585 ADPCM - mini emulation
155151      case 0x60:
156         start &= 0xffff00;
157         start |= (data>>8);
152         msm_start &= 0xffff00;
153         msm_start |= (data>>8);
158154         break;
159155      case 0x61:
160         start &= 0xff00ff;
161         start |= data;
156         msm_start &= 0xff00ff;
157         msm_start |= data;
162158         break;
163159      case 0x62:
164         start &= 0x00ffff;
165         start |= (data<<8);
160         msm_start &= 0x00ffff;
161         msm_start |= (data<<8);
166162         break;
167163      case 0x63:
168         end &= 0xffff00;
169         end |= (data>>8);
164         msm_end &= 0xffff00;
165         msm_end |= (data>>8);
170166         break;
171167      case 0x64:
172         end &= 0xff00ff;
173         end |= data;
168         msm_end &= 0xff00ff;
169         msm_end |= data;
174170         break;
175171      case 0x65:
176         end &= 0x00ffff;
177         end |= (data<<8);
172         msm_end &= 0x00ffff;
173         msm_end |= (data<<8);
178174         break;
179175      case 0x66:
180         if (start < end)
176         if (msm_start < msm_end)
181177         {
178            /* data written here is adpcm param? */
179            //popmessage("%08x %08x",msm_start+msm_bank,msm_end);
180            adpcm_idle = 0;
181            msm5205_reset_w(devtag_get_device(space->machine, "msm"),0);
182            adpcm_start = msm_start+msm_bank;
183            adpcm_end = msm_end;
182184//              ADPCM_stop(0);
183185//              ADPCM_play(0, start+bank, end-start);
184186         }
r4878r4879
198200
199201
200202/* Controlled through ioc? */
203static void gcp_adpcm_int(const device_config *device)
204{
205   static UINT8 trigger,adpcm_data;
201206
207   if (adpcm_idle)
208      msm5205_reset_w(device,1);
209   if (adpcm_start >= 0x200000 || adpcm_start > adpcm_end)
210   {
211      //msm5205_reset_w(device,1);
212      adpcm_start = msm_start+msm_bank;
213      trigger = 0;
214   }
215   else
216   {
217      UINT8 *ROM = memory_region(device->machine, "msm");
202218
219      adpcm_data = ((trigger ? (ROM[adpcm_start] & 0x0f) : (ROM[adpcm_start] & 0xf0)>>4) );
220      msm5205_data_w(device,adpcm_data & 0xf);
221      trigger^=1;
222      if(trigger == 0) { adpcm_start++; }
223   }
224}
203225
226
204227/***********************************************************
205228                     MEMORY STRUCTURES
206229***********************************************************/
r4878r4879
358381
359382static const msm5205_interface msm5205_config =
360383{
361   NULL,            /* VCK function */
384   gcp_adpcm_int,      /* VCK function */
362385   MSM5205_S48_4B      /* 8 kHz */
363386};
364387
388static MACHINE_RESET( gcpinbal )
389{
390   adpcm_idle = 1;
391}
392
365393/***********************************************************
366394                        MACHINE DRIVERS
367395***********************************************************/
r4878r4879
384412   MDRV_GFXDECODE(gcpinbal)
385413   MDRV_PALETTE_LENGTH(4096)
386414
415   MDRV_MACHINE_RESET(gcpinbal)
416
387417   MDRV_VIDEO_START(gcpinbal)
388418   MDRV_VIDEO_UPDATE(gcpinbal)
389419
src/mame/drivers/bottom9.c
r4878r4879
147147   AM_RANGE(0x2000, 0x27ff) AM_READWRITE(bottom9_bankedram2_r, bottom9_bankedram2_w) AM_BASE(&paletteram)
148148   AM_RANGE(0x0000, 0x3fff) AM_READWRITE(K052109_051960_r, K052109_051960_w)
149149   AM_RANGE(0x4000, 0x5fff) AM_RAM
150   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(SMH_BANK(1), SMH_ROM)
150   AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(1)
151151   AM_RANGE(0x8000, 0xffff) AM_ROM
152152ADDRESS_MAP_END
153153
r4878r4879
190190   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
191191   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
192192   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
193   PORT_DIPSETTING(   0x20, "Difficult" )
194   PORT_DIPSETTING(   0x00, "Very Difficult" )
193   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
194   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
195195   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
196196   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
197197   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/galaga.c
r4878r4879
698698#include "cpu/z80/z80.h"
699699#include "cpu/mb88xx/mb88xx.h"
700700#include "machine/atari_vg.h"
701#include "machine/namcoio.h"
701#include "machine/namco06.h"
702702#include "machine/namco50.h"
703#include "machine/namco51.h"
704#include "machine/namco53.h"
703705#include "includes/galaga.h"
704706#include "sound/namco.h"
705#include "sound/namco52.h"
707#include "audio/namco52.h"
706708#include "machine/rescap.h"
707709#include "sound/samples.h"
708710#include "audio/namco54.h"
709#include "nam_cust.h"
710711
711712#define MASTER_CLOCK (XTAL_18_432MHz)
712713
713714
714715static emu_timer *cpu3_interrupt_timer;
716static UINT8 custom_mod;
715717
716718
717719
r4878r4879
743745   switch (offset)
744746   {
745747      case 0x00:   /* IRQ1 */
746         cpu_interrupt_enable(space->machine->cpu[0],bit);
748         cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit);
747749         if (!bit)
748            cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE);
750            cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
749751         break;
750752
751753      case 0x01:   /* IRQ2 */
752         cpu_interrupt_enable(space->machine->cpu[1],bit);
754         cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit);
753755         if (!bit)
754            cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE);
756            cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
755757         break;
756758
757759      case 0x02:   /* NMION */
758         cpu_interrupt_enable(space->machine->cpu[2],!bit);
760         cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), !bit);
759761         break;
760762
761763      case 0x03:   /* RESET */
762         cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
763         cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
764         cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
765         cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
764766         break;
765767
766768      case 0x04:   /* n.c. */
767769         break;
768770
769771      case 0x05:   /* MOD 0 (xevious: n.c.) */
772         custom_mod = (custom_mod & ~0x01) | (bit << 0);
773         break;
774
770775      case 0x06:   /* MOD 1 (xevious: n.c.) */
776         custom_mod = (custom_mod & ~0x02) | (bit << 1);
777         break;
778
771779      case 0x07:   /* MOD 2 (xevious: n.c.) */
780         custom_mod = (custom_mod & ~0x04) | (bit << 2);
772781         break;
773782   }
774783}
775784
785static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine, param) >> 4; }
776786
777static READ8_HANDLER( in0_l )   { return input_port_read(space->machine, "IN0"); }      // fire and start buttons
778static READ8_HANDLER( in0_h )   { return input_port_read(space->machine, "IN0") >> 4; }   // coins
779static READ8_HANDLER( in1_l )   { return input_port_read(space->machine, "IN1"); }      // P1 joystick
780static READ8_HANDLER( in1_h )   { return input_port_read(space->machine, "IN1") >> 4; }   // P2 joystick
781static READ8_HANDLER( dipA_l )   { return input_port_read(space->machine, "DSWA"); }      // dips A
782static READ8_HANDLER( dipA_h )   { return input_port_read(space->machine, "DSWA") >> 4; }   // dips A
783static READ8_HANDLER( dipB_l )   { return input_port_read(space->machine, "DSWB"); }      // dips B
784static READ8_HANDLER( dipB_h )   { return input_port_read(space->machine, "DSWB") >> 4; }   // dips B
785static WRITE8_HANDLER( out_0 )
787static WRITE8_DEVICE_HANDLER( out_0 )
786788{
787789   set_led_status(1,data & 1);
788790   set_led_status(0,data & 2);
789791   coin_counter_w(1,~data & 4);
790792   coin_counter_w(0,~data & 8);
791793}
792static WRITE8_HANDLER( out_1 )
794
795static WRITE8_DEVICE_HANDLER( out_1 )
793796{
794797   coin_lockout_global_w(data & 1);
795798}
796799
797static const struct namcoio_interface intf0 =
800static const namco_51xx_interface namco_51xx_intf =
798801{
799   { in0_l, in0_h, in1_l, in1_h },   /* port read handlers */
800   { out_0, out_1 }            /* port write handlers */
802   {   /* port read handlers */
803      DEVCB_INPUT_PORT("IN0L"),
804      DEVCB_INPUT_PORT("IN0H"),
805      DEVCB_INPUT_PORT("IN1L"),
806      DEVCB_INPUT_PORT("IN1H")
807   },
808   {   /* port write handlers */
809      DEVCB_HANDLER(out_0),
810      DEVCB_HANDLER(out_1)
811   }
801812};
802static const struct namcoio_interface intf1 =
813
814
815static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
803816{
804   { dipA_l, dipA_h, dipB_l, dipB_h },   /* port read handlers */
805   { NULL, NULL }                  /* port write handlers */
817   UINT32 length = memory_region_length(device->machine, "52xx");
818//printf("ROM read %04X\n", offset);
819   if (!(offset & 0x1000))
820      offset = (offset & 0xfff) | 0x0000;
821   else if (!(offset & 0x2000))
822      offset = (offset & 0xfff) | 0x1000;
823   else if (!(offset & 0x4000))
824      offset = (offset & 0xfff) | 0x2000;
825   else if (!(offset & 0x8000))
826      offset = (offset & 0xfff) | 0x3000;
827   return (offset < length) ? memory_region(device->machine, "52xx")[offset] : 0xff;
828}
829
830static READ8_DEVICE_HANDLER( namco_52xx_si_r )
831{
832   /* pulled to GND */
833   return 0;
834}
835
836static const namco_52xx_interface namco_52xx_intf =
837{
838   "discrete",                     /* name of the discrete sound device */
839   NODE_04,                     /* index of the first node */
840   ATTOSECONDS_IN_NSEC(PERIOD_OF_555_ASTABLE_NSEC(RES_K(33), RES_K(10), CAP_U(0.0047))),   /* external clock rate */
841   DEVCB_HANDLER(namco_52xx_rom_r),   /* ROM read handler */
842   DEVCB_HANDLER(namco_52xx_si_r)      /* SI (pin 6) read handler */
806843};
807844
808845
846static READ8_DEVICE_HANDLER( custom_mod_r )
847{
848   /* MOD0-2 is connected to K1-3; K0 is left unconnected */
849   return custom_mod << 1;
850}
851
852static const namco_53xx_interface namco_53xx_intf =
853{
854   DEVCB_HANDLER(custom_mod_r),      /* K port */
855   {
856      DEVCB_INPUT_PORT("DSWA"),      /* R0 port */
857      DEVCB_INPUT_PORT("DSWA_HI"),   /* R1 port */
858      DEVCB_INPUT_PORT("DSWB"),      /* R2 port */
859      DEVCB_INPUT_PORT("DSWB_HI")      /* R3 port */
860   },
861   DEVCB_NULL                     /* P port */
862};
863
864
809865static TIMER_CALLBACK( cpu3_interrupt_callback )
810866{
811867   int scanline = param;
812868
813   nmi_line_pulse(machine->cpu[2]);
869   nmi_line_pulse(cputag_get_cpu(machine, "sub2"));
814870
815871   scanline = scanline + 128;
816872   if (scanline >= 272)
r4878r4879
829885
830886static void bosco_latch_reset(running_machine *machine)
831887{
832   const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
888   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
833889   int i;
834890
835891   /* Reset all latches */
r4878r4879
842898   /* Reset all latches */
843899   bosco_latch_reset(machine);
844900
845   namco_06xx_init(machine, 0, 0,
846      NAMCOIO_51XX, &intf0,
847      NAMCOIO_NONE, NULL,
848      NAMCOIO_50XX, NULL,
849      NAMCOIO_54XX, NULL);
850
851   namco_06xx_init(machine, 1, 1,
852      NAMCOIO_50XX_2, NULL,
853      NAMCOIO_52XX, NULL,
854      NAMCOIO_NONE, NULL,
855      NAMCOIO_NONE, NULL);
856
857901   timer_adjust_oneshot(cpu3_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64);
858902}
859903
r4878r4879
862906   /* Reset all latches */
863907   bosco_latch_reset(machine);
864908
865   namco_06xx_init(machine, 0, 0,
866      NAMCOIO_51XX, &intf0,
867      NAMCOIO_NONE, NULL,
868      NAMCOIO_NONE, NULL,
869      NAMCOIO_54XX, NULL);
870
871909   timer_adjust_oneshot(cpu3_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64);
872910}
873911
r4878r4879
876914   /* Reset all latches */
877915   bosco_latch_reset(machine);
878916
879   namco_06xx_init(machine, 0, 0,
880      NAMCOIO_51XX, &intf0,
881      NAMCOIO_NONE, NULL,
882      NAMCOIO_50XX, NULL,
883      NAMCOIO_54XX, NULL);
884
885917   timer_adjust_oneshot(cpu3_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64);
886918}
887919
r4878r4879
900932   /* Reset all latches */
901933   bosco_latch_reset(machine);
902934
903   namco_06xx_init(machine, 0, 0,
904      NAMCOIO_51XX, &intf0,
905      NAMCOIO_53XX_DIGDUG, &intf1,
906      NAMCOIO_NONE, NULL,
907      NAMCOIO_NONE, NULL);
908
909935   timer_adjust_oneshot(cpu3_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64);
910936}
911937
r4878r4879
918944   AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs)
919945   AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w)                  /* misc latches */
920946   AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
921   AM_RANGE(0x7000, 0x70ff) AM_READWRITE(namco_06xx_0_data_r, namco_06xx_0_data_w)
922   AM_RANGE(0x7100, 0x7100) AM_READWRITE(namco_06xx_0_ctrl_r, namco_06xx_0_ctrl_w)
947   AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx_0", namco_06xx_data_r, namco_06xx_data_w)
948   AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx_0", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
923949   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE(1)
924950   AM_RANGE(0x8000, 0x8fff) AM_READWRITE(bosco_videoram_r, bosco_videoram_w) AM_BASE(&bosco_videoram)   /* + sprite registers */
925   AM_RANGE(0x9000, 0x90ff) AM_READWRITE(namco_06xx_1_data_r, namco_06xx_1_data_w)
926   AM_RANGE(0x9100, 0x9100) AM_READWRITE(namco_06xx_1_ctrl_r, namco_06xx_1_ctrl_w)
951   AM_RANGE(0x9000, 0x90ff) AM_DEVREADWRITE("06xx_1", namco_06xx_data_r, namco_06xx_data_w)
952   AM_RANGE(0x9100, 0x9100) AM_DEVREADWRITE("06xx_1", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
927953   AM_RANGE(0x9800, 0x980f) AM_WRITE(SMH_RAM) AM_SHARE(2) AM_BASE(&bosco_radarattr)
928954   AM_RANGE(0x9810, 0x9810) AM_WRITE(bosco_scrollx_w)
929955   AM_RANGE(0x9820, 0x9820) AM_WRITE(bosco_scrolly_w)
r4878r4879
940966   AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs)
941967   AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w)                  /* misc latches */
942968   AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
943   AM_RANGE(0x7000, 0x70ff) AM_READWRITE(namco_06xx_0_data_r, namco_06xx_0_data_w)
944   AM_RANGE(0x7100, 0x7100) AM_READWRITE(namco_06xx_0_ctrl_r, namco_06xx_0_ctrl_w)
969   AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
970   AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
945971   AM_RANGE(0x8000, 0x87ff) AM_READWRITE(galaga_videoram_r, galaga_videoram_w) AM_BASE(&galaga_videoram)
946972   AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE(1) AM_BASE(&galaga_ram1)
947973   AM_RANGE(0x9000, 0x93ff) AM_RAM AM_SHARE(2) AM_BASE(&galaga_ram2)
r4878r4879
957983   AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs)
958984   AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w)   /* misc latches */
959985   AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
960   AM_RANGE(0x7000, 0x70ff) AM_READWRITE(namco_06xx_0_data_r, namco_06xx_0_data_w)
961   AM_RANGE(0x7100, 0x7100) AM_READWRITE(namco_06xx_0_ctrl_r, namco_06xx_0_ctrl_w)
986   AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
987   AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
962988   AM_RANGE(0x7800, 0x7fff) AM_RAM AM_SHARE(1)                     /* work RAM */
963989   AM_RANGE(0x8000, 0x87ff) AM_RAM AM_SHARE(2) AM_BASE(&xevious_sr1)   /* work RAM + sprite registers */
964990   AM_RANGE(0x9000, 0x97ff) AM_RAM AM_SHARE(3) AM_BASE(&xevious_sr2)   /* work RAM + sprite registers */
r4878r4879
9771003   AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs)
9781004   AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w)                  /* misc latches */
9791005   AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w)
980   AM_RANGE(0x7000, 0x70ff) AM_READWRITE(namco_06xx_0_data_r, namco_06xx_0_data_w)
981   AM_RANGE(0x7100, 0x7100) AM_READWRITE(namco_06xx_0_ctrl_r, namco_06xx_0_ctrl_w)
1006   AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w)
1007   AM_RANGE(0x7100, 0x7100) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w)
9821008   AM_RANGE(0x8000, 0x83ff) AM_READWRITE(digdug_videoram_r, digdug_videoram_w) AM_BASE(&digdug_videoram)   /* tilemap RAM (bottom half of RAM 0 */
9831009   AM_RANGE(0x8400, 0x87ff) AM_RAM AM_SHARE(1)                     /* work RAM (top half for RAM 0 */
9841010   AM_RANGE(0x8800, 0x8bff) AM_RAM AM_SHARE(2) AM_BASE(&digdug_objram)   /* work RAM + sprite registers */
r4878r4879
10151041
10161042
10171043static INPUT_PORTS_START( bosco )
1018   PORT_START("IN0")
1044   PORT_START("IN0L")
10191045   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
10201046   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
10211047   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
10221048   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
1023   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1024   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1025   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
1026   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
10271049
1028   PORT_START("IN1")
1050   PORT_START("IN0H")
1051   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1052   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1053   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1054   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
1055
1056   PORT_START("IN1L")
10291057   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
10301058   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
10311059   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
10321060   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1033   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1034   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1035   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1036   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
10371061
1062   PORT_START("IN1H")
1063   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1064   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1065   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1066   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1067
10381068   PORT_START("DSWA")
10391069   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
10401070   PORT_DIPSETTING(    0x01, DEF_STR( Easy ) )
r4878r4879
11181148
11191149
11201150static INPUT_PORTS_START( galaga )
1121   PORT_START("IN0")
1151   PORT_START("IN0L")
11221152   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
11231153   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
11241154   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
11251155   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
1126   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1127   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1128   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
1129   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
11301156
1131   PORT_START("IN1")
1157   PORT_START("IN0H")
1158   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1159   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1160   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1161   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
1162
1163   PORT_START("IN1L")
11321164   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
11331165   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY
11341166   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
11351167   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY
1136   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
1137   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1138   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
1139   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
11401168
1169   PORT_START("IN1H")
1170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )
1171   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY PORT_COCKTAIL
1172   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
1173   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_COCKTAIL
1174
11411175   PORT_START("DSWA")
11421176   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )
11431177   PORT_DIPSETTING(    0x03, DEF_STR( Easy ) )
r4878r4879
12231257static INPUT_PORTS_START( gatsbee )
12241258   PORT_INCLUDE( galaga )
12251259
1226   PORT_MODIFY("IN1")
1260   PORT_MODIFY("IN1L")
12271261   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )
12281262   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT )
12291263   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )
12301264   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
1231   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_COCKTAIL
1232   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1233   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_COCKTAIL
1234   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_COCKTAIL
1265
1266   PORT_MODIFY("IN1L")
1267   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP )    PORT_COCKTAIL
1268   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_COCKTAIL
1269   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN )  PORT_COCKTAIL
1270   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )  PORT_COCKTAIL
12351271INPUT_PORTS_END
12361272
12371273
12381274static INPUT_PORTS_START( xevious )
1239   PORT_START("IN0")
1275   PORT_START("IN0L")
12401276   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
12411277   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
12421278   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
12431279   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
1244   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1245   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1246   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
1247   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
12481280
1249   PORT_START("IN1")
1281   PORT_START("IN0H")
1282   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1283   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1284   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1285   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
1286
1287   PORT_START("IN1L")
12501288   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
12511289   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
12521290   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
12531291   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
1254   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1255   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1256   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1257   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
12581292
1293   PORT_START("IN1H")
1294   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
1295   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
1296   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
1297   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
1298
12591299   PORT_START("DSWA")
12601300   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) )
12611301   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )
r4878r4879
13881428
13891429
13901430static INPUT_PORTS_START( digdug )
1391   PORT_START("IN0")
1431   PORT_START("IN0L")
13921432   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
13931433   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
13941434   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
13951435   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )
1396   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
1397   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
1398   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
1399   PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
14001436
1401   PORT_START("IN1")
1437   PORT_START("IN0H")
1438   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
1439   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
1440   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
1441   PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
1442
1443   PORT_START("IN1L")
14021444   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
14031445   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
14041446   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
14051447   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
1406   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1407   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1408   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1409   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
14101448
1449   PORT_START("IN1H")
1450   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
1451   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
1452   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
1453   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
1454
14111455   PORT_START("DSWA")
14121456   PORT_DIPNAME( 0x07, 0x01, DEF_STR( Coin_B ) )
14131457   PORT_DIPSETTING(    0x07, DEF_STR( 3C_1C ) )
r4878r4879
14411485   PORT_DIPSETTING(    0x80, "3" )
14421486   PORT_DIPSETTING(    0xc0, "5" )
14431487
1488   PORT_START("DSWA_HI")
1489   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWA")
1490
14441491   PORT_START("DSWB")
14451492   PORT_DIPNAME( 0xc0, 0x00, DEF_STR( Coin_A ) )
14461493   PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
r4878r4879
14641511   PORT_DIPSETTING(    0x02, DEF_STR( Medium ) )
14651512   PORT_DIPSETTING(    0x01, DEF_STR( Hard ) )
14661513   PORT_DIPSETTING(    0x03, DEF_STR( Hardest ) )
1514
1515   PORT_START("DSWB_HI")
1516   PORT_BIT( 0x0f, 0x00, IPT_SPECIAL ) PORT_CUSTOM(shifted_port_r, "DSWB")
14671517INPUT_PORTS_END
14681518
14691519
r4878r4879
15891639   0            /* stereo */
15901640};
15911641
1592/* Only used by bosco.  After filtering the 4V 52xx output,
1593 * the signal is 1V, or 25%.  The relative volume between
1594 * 52xx & 54xx is the same.
1595 */
1596static const namco_52xx_interface namco_52xx_config =
1597{
1598   4000,         /* Playback frequency - from 555 timer 6M */
1599   80,            /* High pass filter fc */
1600   0.3,         /* High pass filter Q */
1601   2400,         /* Low pass filter fc */
1602   0.9,         /* Low pass filter Q */
1603   .25            /* Combined gain of both filters */
1604};
1605
16061642static const char *const battles_sample_names[] =
16071643{
16081644   "*battles",
r4878r4879
16331669   MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
16341670   MDRV_CPU_PROGRAM_MAP(bosco_map)
16351671
1636   MDRV_CPU_ADD(CPUTAG_50XX, MB8842, MASTER_CLOCK/12/6)   /* 1.536 MHz, internally divided by 6 */
1637   MDRV_CPU_PROGRAM_MAP(namco_50xx_map_program)
1638   MDRV_CPU_DATA_MAP(namco_50xx_map_data)
1639   MDRV_CPU_IO_MAP(namco_50xx_map_io)
1672   MDRV_NAMCO_50XX_ADD("50xx_1", MASTER_CLOCK/12)   /* 1.536 MHz */
1673   MDRV_NAMCO_50XX_ADD("50xx_2", MASTER_CLOCK/12)   /* 1.536 MHz */
1674   MDRV_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/12, namco_51xx_intf)      /* 1.536 MHz */
1675   MDRV_NAMCO_52XX_ADD("52xx", MASTER_CLOCK/12, namco_52xx_intf)      /* 1.536 MHz */
1676   MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/12, "discrete", NODE_01)   /* 1.536 MHz */
16401677
1641   MDRV_CPU_ADD(CPUTAG_50XX_2, MB8842, MASTER_CLOCK/12/6)   /* 1.536 MHz, internally divided by 6 */
1642   MDRV_CPU_PROGRAM_MAP(namco_50xx_2_map_program)
1643   MDRV_CPU_DATA_MAP(namco_50xx_2_map_data)
1644   MDRV_CPU_IO_MAP(namco_50xx_2_map_io)
1678   MDRV_NAMCO_06XX_ADD("06xx_0", "maincpu", "51xx",   NULL,   "50xx_1", "54xx")
1679   MDRV_NAMCO_06XX_ADD("06xx_1", "sub",     "50xx_2", "52xx", NULL,     NULL)
16451680
1646   MDRV_CPU_ADD(CPUTAG_54XX, MB8844, MASTER_CLOCK/12/6)   /* 1.536 MHz, internally divided by 6 */
1647   MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program)
1648   MDRV_CPU_DATA_MAP(namco_54xx_map_data)
1649   MDRV_CPU_IO_MAP(namco_54xx_map_io)
1650
16511681   MDRV_WATCHDOG_VBLANK_INIT(8)
16521682   MDRV_QUANTUM_TIME(HZ(6000))   /* 100 CPU slices per frame - an high value to ensure proper */
16531683                     /* synchronization of the CPUs */
r4878r4879
16771707   MDRV_SOUND_CONFIG(namco_config)
16781708   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90 * 10.0 / 16.0)
16791709
1680   MDRV_SOUND_ADD("namco52", NAMCO_52XX, MASTER_CLOCK/12)   /* 1.536 MHz */
1681   MDRV_SOUND_CONFIG(namco_52xx_config)
1682   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.90)
1683
16841710   /* discrete circuit on the 54XX outputs */
16851711   MDRV_SOUND_ADD("discrete", DISCRETE, 0)
16861712   MDRV_SOUND_CONFIG_DISCRETE(bosco)
r4878r4879
17021728   MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
17031729   MDRV_CPU_PROGRAM_MAP(galaga_map)
17041730
1705   MDRV_CPU_ADD(CPUTAG_54XX, MB8844, MASTER_CLOCK/12/6)   /* 1.536 MHz, internally divided by 6 */
1706   MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program)
1707   MDRV_CPU_DATA_MAP(namco_54xx_map_data)
1708   MDRV_CPU_IO_MAP(namco_54xx_map_io)
1731   MDRV_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/12, namco_51xx_intf)      /* 1.536 MHz */
1732   MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/12, "discrete", NODE_01)   /* 1.536 MHz */
17091733
1734   MDRV_NAMCO_06XX_ADD("06xx", "maincpu", "51xx", NULL, NULL, "54xx")
1735
17101736   MDRV_WATCHDOG_VBLANK_INIT(8)
17111737   MDRV_QUANTUM_TIME(HZ(6000))   /* 100 CPU slices per frame - an high value to ensure proper */
17121738                     /* synchronization of the CPUs */
r4878r4879
17471773   /* basic machine hardware */
17481774   MDRV_IMPORT_FROM(galaga)
17491775
1750   MDRV_CPU_REMOVE(CPUTAG_54XX)
1776   MDRV_NAMCO_54XX_REMOVE("54xx")
17511777
17521778   MDRV_CPU_ADD("sub3", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
17531779   MDRV_CPU_PROGRAM_MAP(galaga_mem4)
r4878r4879
17711797   MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
17721798   MDRV_CPU_PROGRAM_MAP(xevious_map)
17731799
1774   MDRV_CPU_ADD(CPUTAG_50XX, MB8842, MASTER_CLOCK/12/6)   /* 1.536 MHz, internally divided by 6 */
1775   MDRV_CPU_PROGRAM_MAP(namco_50xx_map_program)
1776   MDRV_CPU_DATA_MAP(namco_50xx_map_data)
1777   MDRV_CPU_IO_MAP(namco_50xx_map_io)
1800   MDRV_NAMCO_50XX_ADD("50xx", MASTER_CLOCK/12)   /* 1.536 MHz */
1801   MDRV_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/12, namco_51xx_intf)      /* 1.536 MHz */
1802   MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/12, "discrete", NODE_01)   /* 1.536 MHz */
17781803
1779   MDRV_CPU_ADD(CPUTAG_54XX, MB8844, MASTER_CLOCK/12/6)   /* 1.536 MHz, internally divided by 6 */
1780   MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program)
1781   MDRV_CPU_DATA_MAP(namco_54xx_map_data)
1782   MDRV_CPU_IO_MAP(namco_54xx_map_io)
1804   MDRV_NAMCO_06XX_ADD("06xx", "maincpu", "51xx", NULL, "50xx", "54xx")
17831805
17841806   MDRV_WATCHDOG_VBLANK_INIT(8)
17851807   MDRV_QUANTUM_TIME(HZ(60000))   /* 1000 CPU slices per frame - an high value to ensure proper */
r4878r4879
18201842   /* basic machine hardware */
18211843   MDRV_IMPORT_FROM( xevious )
18221844
1823   MDRV_CPU_REMOVE(CPUTAG_50XX)
1824   MDRV_CPU_REMOVE(CPUTAG_54XX)
1845   MDRV_NAMCO_50XX_REMOVE("50xx")
1846   MDRV_NAMCO_54XX_REMOVE("54xx")
18251847
18261848   MDRV_CPU_ADD("sub3", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
18271849   MDRV_CPU_PROGRAM_MAP(battles_mem4)
r4878r4879
18551877   MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK/6)   /* 3.072 MHz */
18561878   MDRV_CPU_PROGRAM_MAP(digdug_map)
18571879
1880   MDRV_NAMCO_51XX_ADD("51xx", MASTER_CLOCK/12, namco_51xx_intf)      /* 1.536 MHz */
1881   MDRV_NAMCO_53XX_ADD("53xx", MASTER_CLOCK/12, namco_53xx_intf)      /* 1.536 MHz */
1882
1883   MDRV_NAMCO_06XX_ADD("06xx", "maincpu", "51xx", "53xx", NULL, NULL)
1884
18581885   MDRV_QUANTUM_TIME(HZ(6000))   /* 100 CPU slices per frame - an high value to ensure proper */
18591886                     /* synchronization of the CPUs */
18601887   MDRV_MACHINE_START(galaga)
r4878r4879
19121939
19131940*/
19141941
1915#define BOSCO_CUSTOMS \
1916   ROM_REGION_NAMCO_50XX( CPUTAG_50XX ) \
1917   ROM_REGION_NAMCO_50XX( CPUTAG_50XX_2 ) \
1918   ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \
1919   ROM_REGION_NAMCO_51XX( "51xx" ) \
1920   ROM_REGION_NAMCO_52XX( "52xx" ) \
1921
1922
19231942ROM_START( bosco )
19241943   ROM_REGION( 0x10000, "maincpu", 0 )   /* 64k for code for the first CPU  */
19251944   ROM_LOAD( "bos3_1.bin",   0x0000, 0x1000, CRC(96021267) SHA1(bd49b0caabcccf9df45a272d767456a4fc8a7c07) )
r4878r4879
19341953   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
19351954   ROM_LOAD( "2900.3e",      0x0000, 0x1000, CRC(d45a4911) SHA1(547236adca9174f5cc0ec05b9649618bb92ba630) )
19361955
1937   BOSCO_CUSTOMS
1938
19391956   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
19401957   ROM_LOAD( "5300.5d",      0x0000, 0x1000, CRC(a956d3c5) SHA1(c5a9d7b1f9b4acda8fb9762414e085cb5fb80c9e) )
19411958
r4878r4879
19551972   ROM_LOAD( "prom.1d",      0x0000, 0x0100, CRC(de2316c6) SHA1(0e55c56046331888d1d3f0d9823d2ceb203e7d3f) )
19561973   ROM_LOAD( "prom.5c",      0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
19571974
1958   ROM_REGION( 0x3000, "namco52", 0 )   /* ROMs for digitised speech */
1975   ROM_REGION( 0x3000, "52xx", 0 )   /* ROMs for digitised speech */
19591976   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
19601977   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
19611978   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
r4878r4879
19751992   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
19761993   ROM_LOAD( "2900.3e",      0x0000, 0x1000, CRC(d45a4911) SHA1(547236adca9174f5cc0ec05b9649618bb92ba630) )
19771994
1978   BOSCO_CUSTOMS
1979
19801995   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
19811996   ROM_LOAD( "5300.5d",      0x0000, 0x1000, CRC(a956d3c5) SHA1(c5a9d7b1f9b4acda8fb9762414e085cb5fb80c9e) )
19821997
r4878r4879
19962011   ROM_LOAD( "prom.1d",      0x0000, 0x0100, CRC(de2316c6) SHA1(0e55c56046331888d1d3f0d9823d2ceb203e7d3f) )
19972012   ROM_LOAD( "prom.5c",      0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
19982013
1999   ROM_REGION( 0x3000, "namco52", 0 )   /* ROMs for digitised speech */
2014   ROM_REGION( 0x3000, "52xx", 0 )   /* ROMs for digitised speech */
20002015   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
20012016   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
20022017   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
r4878r4879
20162031   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
20172032   ROM_LOAD( "2900.3e",      0x0000, 0x1000, CRC(d45a4911) SHA1(547236adca9174f5cc0ec05b9649618bb92ba630) )
20182033
2019   BOSCO_CUSTOMS
2020
20212034   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
20222035   ROM_LOAD( "5300.5d",      0x0000, 0x1000, CRC(a956d3c5) SHA1(c5a9d7b1f9b4acda8fb9762414e085cb5fb80c9e) )
20232036
r4878r4879
20372050   ROM_LOAD( "prom.1d",      0x0000, 0x0100, CRC(de2316c6) SHA1(0e55c56046331888d1d3f0d9823d2ceb203e7d3f) )
20382051   ROM_LOAD( "prom.5c",      0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
20392052
2040   ROM_REGION( 0x3000, "namco52", 0 )   /* ROMs for digitised speech */
2053   ROM_REGION( 0x3000, "52xx", 0 )   /* ROMs for digitised speech */
20412054   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
20422055   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
20432056   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
r4878r4879
20642077   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
20652078   ROM_LOAD( "2900.3e",      0x0000, 0x1000, CRC(d45a4911) SHA1(547236adca9174f5cc0ec05b9649618bb92ba630) )
20662079
2067   BOSCO_CUSTOMS
2068
20692080   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
20702081   ROM_LOAD( "5300.5d",      0x0000, 0x1000, CRC(a956d3c5) SHA1(c5a9d7b1f9b4acda8fb9762414e085cb5fb80c9e) )
20712082
r4878r4879
20852096   ROM_LOAD( "prom.1d",      0x0000, 0x0100, CRC(de2316c6) SHA1(0e55c56046331888d1d3f0d9823d2ceb203e7d3f) )
20862097   ROM_LOAD( "prom.5c",      0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
20872098
2088   ROM_REGION( 0x3000, "namco52", 0 )   /* ROMs for digitised speech */
2099   ROM_REGION( 0x3000, "52xx", 0 )   /* ROMs for digitised speech */
20892100   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
20902101   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
20912102   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
r4878r4879
21082119   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
21092120   ROM_LOAD( "2900.3e",      0x0000, 0x1000, CRC(d45a4911) SHA1(547236adca9174f5cc0ec05b9649618bb92ba630) )
21102121
2111   BOSCO_CUSTOMS
2112
21132122   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
21142123   ROM_LOAD( "5300.5d",      0x0000, 0x1000, CRC(a956d3c5) SHA1(c5a9d7b1f9b4acda8fb9762414e085cb5fb80c9e) )
21152124
r4878r4879
21292138   ROM_LOAD( "prom.1d",      0x0000, 0x0100, CRC(de2316c6) SHA1(0e55c56046331888d1d3f0d9823d2ceb203e7d3f) )
21302139   ROM_LOAD( "prom.5c",      0x0100, 0x0100, CRC(77245b66) SHA1(0c4d0bee858b97632411c440bea6948a74759746) )   /* timing - not used */
21312140
2132   ROM_REGION( 0x3000, "namco52", 0 )   /* ROMs for digitised speech */
2141   ROM_REGION( 0x3000, "52xx", 0 )   /* ROMs for digitised speech */
21332142   ROM_LOAD( "4900.5n",      0x0000, 0x1000, CRC(09acc978) SHA1(2b264aaeb6eba70ad91593413dca733990e5467b) )
21342143   ROM_LOAD( "5000.5m",      0x1000, 0x1000, CRC(e571e959) SHA1(9c81d7bec73bc605f7dd9a089171b0f34c4bb09a) )
21352144   ROM_LOAD( "5100.5l",      0x2000, 0x1000, CRC(17ac9511) SHA1(266f3fae90d2fe38d109096d352863a52b379899) )
r4878r4879
23052314
23062315*/
23072316
2308#define GALAGA_CUSTOMS \
2309   ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \
2310   ROM_REGION_NAMCO_51XX( "51xx" ) \
2311
2312
23132317ROM_START( galaga )
23142318   ROM_REGION( 0x10000, "maincpu", 0 )     /* 64k for code for the first CPU  */
23152319   ROM_LOAD( "gg1-1b.3p",    0x0000, 0x1000, CRC(ab036c9f) SHA1(ca7f5da42d4e76fd89bb0b35198a23c01462fbfe) )
r4878r4879
23232327   ROM_REGION( 0x10000, "sub2", 0 )     /* 64k for the third CPU  */
23242328   ROM_LOAD( "gg1-7b.2c",    0x0000, 0x1000, CRC(d016686b) SHA1(44c1a04fba3c7c826ff484185cb881b4b22e6657) )
23252329
2326   GALAGA_CUSTOMS
2327
23282330   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
23292331   ROM_LOAD( "gg1-9.4l",     0x0000, 0x1000, CRC(58b2f47c) SHA1(62f1279a784ab2f8218c4137c7accda00e6a3490) )
23302332
r4878r4879
23552357   ROM_REGION( 0x10000, "sub2", 0 )     /* 64k for the third CPU  */
23562358   ROM_LOAD( "gg1-7",        0x0000, 0x1000, CRC(8995088d) SHA1(d6cb439de0718826d1a0363c9d77de8740b18ecf) )
23572359
2358   GALAGA_CUSTOMS
2359
23602360   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
23612361   ROM_LOAD( "gg1-9.4l",     0x0000, 0x1000, CRC(58b2f47c) SHA1(62f1279a784ab2f8218c4137c7accda00e6a3490) )
23622362
r4878r4879
23872387   ROM_REGION( 0x10000, "sub2", 0 )     /* 64k for the third CPU  */
23882388   ROM_LOAD( "3700g.bin",    0x0000, 0x1000, CRC(b07f0aa4) SHA1(7528644a8480d0be2d0d37069515ed319e94778f) )
23892389
2390   GALAGA_CUSTOMS
2391
23922390   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
23932391   ROM_LOAD( "gg1-9.4l",     0x0000, 0x1000, CRC(58b2f47c) SHA1(62f1279a784ab2f8218c4137c7accda00e6a3490) )
23942392
r4878r4879
24192417   ROM_REGION( 0x10000, "sub2", 0 )     /* 64k for the third CPU  */
24202418   ROM_LOAD( "3700g.bin",    0x0000, 0x1000, CRC(b07f0aa4) SHA1(7528644a8480d0be2d0d37069515ed319e94778f) )
24212419
2422   GALAGA_CUSTOMS
2423
24242420   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
24252421   ROM_LOAD( "gg1-9.4l",     0x0000, 0x1000, CRC(58b2f47c) SHA1(62f1279a784ab2f8218c4137c7accda00e6a3490) )
24262422
r4878r4879
24512447   ROM_REGION( 0x10000, "sub2", 0 )     /* 64k for the third CPU  */
24522448   ROM_LOAD( "gg1-7b.2c",    0x0000, 0x1000, CRC(d016686b) SHA1(44c1a04fba3c7c826ff484185cb881b4b22e6657) )
24532449
2454   GALAGA_CUSTOMS
2455
24562450   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
24572451   ROM_LOAD( "gg1-9.4l",     0x0000, 0x1000, CRC(58b2f47c) SHA1(62f1279a784ab2f8218c4137c7accda00e6a3490) )
24582452
r4878r4879
25402534  Xevious & clones
25412535**********************************************************************************************/
25422536
2543#define XEVIOUS_CUSTOMS \
2544   ROM_REGION_NAMCO_50XX( CPUTAG_50XX ) \
2545   ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \
2546   ROM_REGION_NAMCO_51XX( "51xx" ) \
2547
25482537/*
25492538    Xevious - Namco Version
25502539
r4878r4879
25652554   ROM_REGION( 0x10000, "sub2", 0 )
25662555   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
25672556
2568   XEVIOUS_CUSTOMS
2569
25702557   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
25712558   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
25722559
r4878r4879
26192606   ROM_REGION( 0x10000, "sub2", 0 )
26202607   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
26212608
2622   XEVIOUS_CUSTOMS
2623
26242609   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
26252610   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
26262611
r4878r4879
26692654   ROM_REGION( 0x10000, "sub2", 0 )
26702655   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
26712656
2672   XEVIOUS_CUSTOMS
2673
26742657   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
26752658   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
26762659
r4878r4879
27222705   ROM_REGION( 0x10000, "sub2", 0 )
27232706   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
27242707
2725   XEVIOUS_CUSTOMS
2726
27272708   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
27282709   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
27292710
r4878r4879
27812762   ROM_REGION( 0x10000, "sub2", 0 )
27822763   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
27832764
2784   /* This is a bootleg, it probably shouldn't be loading these, see 'unknown roms' below */
2785   XEVIOUS_CUSTOMS
2786
27872765   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
27882766   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
27892767
r4878r4879
28862864   ROM_REGION( 0x10000, "sub2", 0 )
28872865   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
28882866
2889   XEVIOUS_CUSTOMS
2890
28912867   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
28922868   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
28932869
r4878r4879
29362912   ROM_REGION( 0x10000, "sub2", 0 )
29372913   ROM_LOAD( "xvi_7.2c",     0x0000, 0x1000, CRC(dd35cf1c) SHA1(f8d1f8e019d8198308443c2e7e815d0d04b23d14) )
29382914
2939   XEVIOUS_CUSTOMS
2940
29412915   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
29422916   ROM_LOAD( "xvi_12.3b",    0x0000, 0x1000, CRC(088c8b26) SHA1(9c3b61dfca2f84673a78f7f66e363777a8f47a59) )   /* foreground characters */
29432917
r4878r4879
29762950  Dig Dug & clones
29772951**********************************************************************************************/
29782952
2979#define DIGDUG_CUSTOMS \
2980   ROM_REGION_NAMCO_51XX( "51xx" ) \
2981   ROM_REGION_NAMCO_53XX( "53xx" ) \
2982
29832953ROM_START( digdug )
29842954   ROM_REGION( 0x10000, "maincpu", 0 ) /* 64k for code for the first CPU  */
29852955   ROM_LOAD( "dd1a.1",       0x0000, 0x1000, CRC(a80ec984) SHA1(86689980410b9429cd7582c7a76342721c87d030) )
r4878r4879
29942964   ROM_REGION( 0x10000, "sub2", 0 ) /* 64k for the third CPU  */
29952965   ROM_LOAD( "136007.107",   0x0000, 0x1000, CRC(a41bce72) SHA1(2b9b74f56aa7939d9d47cf29497ae11f10d78598) )
29962966
2997   DIGDUG_CUSTOMS
2998
29992967   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
30002968   ROM_LOAD( "dd1.9",        0x0000, 0x0800, CRC(f14a6fe1) SHA1(0aa63300c2cb887196de590aceb98f3cf06fead4) )
30012969
r4878r4879
30353003   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
30363004   ROM_LOAD( "136007.107",   0x0000, 0x1000, CRC(a41bce72) SHA1(2b9b74f56aa7939d9d47cf29497ae11f10d78598) )
30373005
3038   DIGDUG_CUSTOMS
3039
30403006   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
30413007   ROM_LOAD( "dd1.9",        0x0000, 0x0800, CRC(f14a6fe1) SHA1(0aa63300c2cb887196de590aceb98f3cf06fead4) )
30423008
r4878r4879
30953061   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
30963062   ROM_LOAD( "136007.107",   0x0000, 0x1000, CRC(a41bce72) SHA1(2b9b74f56aa7939d9d47cf29497ae11f10d78598) )
30973063
3098   DIGDUG_CUSTOMS
3099
31003064   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
31013065   ROM_LOAD( "136007.108",   0x0000, 0x0800, CRC(3d24a3af) SHA1(857ae93e2a41258a129dcecbaed2df359540b735) )
31023066
r4878r4879
31363100   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
31373101   ROM_LOAD( "136007.107",   0x0000, 0x1000, CRC(a41bce72) SHA1(2b9b74f56aa7939d9d47cf29497ae11f10d78598) )
31383102
3139   DIGDUG_CUSTOMS
3140
31413103   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
31423104   ROM_LOAD( "136007.108",   0x0000, 0x0800, CRC(3d24a3af) SHA1(857ae93e2a41258a129dcecbaed2df359540b735) )
31433105
r4878r4879
32783240   ROM_REGION( 0x10000, "sub2", 0 )   /* 64k for the third CPU  */
32793241   ROM_LOAD( "digdug6.6",   0x0000, 0x1000, CRC(a41bce72) SHA1(2b9b74f56aa7939d9d47cf29497ae11f10d78598) )
32803242
3281   DIGDUG_CUSTOMS
3282
32833243   ROM_REGION( 0x1000, "gfx1", ROMREGION_DISPOSE )
32843244   ROM_LOAD( "digdug8.8",        0x0000, 0x0800, CRC(f14a6fe1) SHA1(0aa63300c2cb887196de590aceb98f3cf06fead4) )
32853245
r4878r4879
33283288   DRIVER_INIT_CALL(galaga);
33293289
33303290   /* Gatsbee has a larger character ROM, we need a handler for banking */
3331   memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1000, 0x1000, 0, 0, gatsbee_bank_w);
3291   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1000, 0x1000, 0, 0, gatsbee_bank_w);
33323292}
33333293
33343294
r4878r4879
33693329static DRIVER_INIT( battles )
33703330{
33713331   /* replace the Namco I/O handlers with interface to the 4th CPU */
3372   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x7000, 0x700f, 0, 0, battles_customio_data0_r, battles_customio_data0_w );
3373   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x7100, 0x7100, 0, 0, battles_customio0_r, battles_customio0_w );
3332   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7000, 0x700f, 0, 0, battles_customio_data0_r, battles_customio_data0_w );
3333   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7100, 0x7100, 0, 0, battles_customio0_r, battles_customio0_w );
33743334
33753335   DRIVER_INIT_CALL(xevious);
33763336}
src/mame/drivers/8080bw.c
r4878r4879
20212021   ROM_LOAD( "la04",         0x1800, 0x0800, CRC(5116b234) SHA1(b165b2574cbcb26a5bb43f91df5f8be5f111f486) )
20222022ROM_END
20232023
2024ROM_START( intruder )
2025   ROM_REGION( 0x10000, "maincpu", 0 )
2026   ROM_LOAD( "la01-1",       0x0000, 0x0800, CRC(bedc0078) SHA1(a5bb0cbbb8e3f27d03beb8101b2be1111d73689d) )
2027   ROM_LOAD( "la02-1",       0x0800, 0x0800, CRC(43bc65c5) SHA1(5f9827c02c2d221e1607359c840374ff7fb92fbf) )
2028   ROM_LOAD( "la03-1",       0x1000, 0x0800, CRC(278ef9cf) SHA1(74a9c1d3500ea28e50d07363a547c381999c84fa) )
2029   ROM_LOAD( "la04-1",       0x1800, 0x0800, CRC(5116b234) SHA1(b165b2574cbcb26a5bb43f91df5f8be5f111f486) )
2030ROM_END
2031
20242032ROM_START( laser )
20252033   ROM_REGION( 0x10000, "maincpu", 0 )
20262034   ROM_LOAD( "1.u36",        0x0000, 0x0800, CRC(b44e2c41) SHA1(00e0b2e088495d6f3bc175e8a53dcb3686ea8484) )
r4878r4879
25842592GAME( 1979, moonbase, invadpt2, invadpt2, invadpt2, 0, ROT270, "Nichibutsu", "Moon Base", GAME_SUPPORTS_SAVE )
25852593GAMEL(19??, invrvnge, 0,        invrvnge, invrvnge, 0, ROT270, "Zenitone-Microsec Ltd.", "Invader's Revenge",  GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND, layout_invrvnge )
25862594GAMEL(19??, invrvnga, invrvnge, invrvnge, invrvnge, 0, ROT270, "Zenitone-Microsec Ltd. (Dutchford license)", "Invader's Revenge (Dutchford)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND, layout_invrvnge )
2587GAME( 1980, spclaser, 0,        invaders, spclaser, 0, ROT270, "GamePlan (Taito)", "Space Laser", GAME_SUPPORTS_SAVE )
2595GAME( 1980, spclaser, 0,        invaders, spclaser, 0, ROT270, "Taito", "Space Laser", GAME_SUPPORTS_SAVE )
2596GAME( 1980, intruder, spclaser, invaders, spclaser, 0, ROT270, "GamePlan (Taito)", "Intruder", GAME_SUPPORTS_SAVE )
25882597GAME( 1980, laser,    spclaser, invaders, spclaser, 0, ROT270, "Leisure Time Electronics Inc.", "Astro Laser", GAME_SUPPORTS_SAVE )
25892598GAME( 1979, spcewarl, spclaser, invaders, spclaser, 0, ROT270, "Leijac Corporation (Konami)","Space War (Leijac Corporation)", GAME_SUPPORTS_SAVE )
25902599GAME( 1979, rollingc, 0,        rollingc, rollingc, 0, ROT270, "Nichibutsu", "Rolling Crash / Moon Base", GAME_SUPPORTS_SAVE )
r4878r4879
25952604GAME( 1979, yosakdon, 0,        yosakdon, yosakdon, 0, ROT270, "Wing", "Yosaku To Donbei (set 1)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) /* bootleg? */
25962605GAME( 1979, yosakdoa, yosakdon, yosakdon, yosakdon, 0, ROT270, "Wing", "Yosaku To Donbei (set 2)", GAME_SUPPORTS_SAVE | GAME_IMPERFECT_SOUND ) /* bootleg? */
25972606GAMEL(1979, shuttlei, 0,        shuttlei, shuttlei, 0, ROT270, "Omori", "Shuttle Invader", GAME_SUPPORTS_SAVE | GAME_NO_COCKTAIL, layout_shuttlei )
2607
src/mame/drivers/quasar.c
r4878r4879
248248   PORT_DIPNAME( 0x18, 0x10, DEF_STR( Difficulty ) )
249249   PORT_DIPSETTING(    0x18, DEF_STR( Easy ) )
250250   PORT_DIPSETTING(    0x10, DEF_STR( Medium ) )
251   PORT_DIPSETTING(    0x08, "Difficult" )
252   PORT_DIPSETTING(    0x00, "Very Difficult" )
251   PORT_DIPSETTING(    0x08, DEF_STR( Difficult ) )
252   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
253253   PORT_DIPNAME( 0x60, 0x20, "Extended Play" )
254254   PORT_DIPSETTING(    0x20, "5500" )                  /* confirmed */
255255   PORT_DIPSETTING(    0x40, "7500" )
src/mame/drivers/ertictac.c
r4878r4879
220220   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) )
221221   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
222222   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
223   PORT_DIPSETTING(    0x40, "Difficult" )
224   PORT_DIPSETTING(    0x00, "Very Difficult" )
223   PORT_DIPSETTING(    0x40, DEF_STR( Difficult ) )
224   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
225225
226226   PORT_START("DSW2")
227227   PORT_DIPNAME( 0x05, 0x00, DEF_STR( Coin_A ) )
src/mame/drivers/mirage.c
r4878r4879
22
33TODO:
44-eeprom emulation? Software settings all changes if you toggle the "flip screen" dip-switch
5-priorities.
6-sound banking is known to be imperfect.
75
86Notes:To enter into Test Mode you need to keep pressed the Mahjong A button at start-up.
97*/
r4878r4879
4341
4442#include "deco16ic.h"
4543
46static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
44static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int pri)
4745{
4846   int offs;
4947
r4878r4879
5654
5755      y = spriteram16[offs];
5856      flash=y&0x1000;
57
5958      if (flash && (video_screen_get_frame_number(machine->primary_screen) & 1)) continue;
6059
60      if (pri != ((y & 0x8000)>>15)) continue;
61
6162      x = spriteram16[offs+2];
6263      colour = (x >>9) & 0x1f;
6364
6465      fx = y & 0x2000;
6566      fy = y & 0x4000;
67
6668      multi = (1 << ((y & 0x0600) >> 9)) - 1;   /* 1x, 2x, 4x, 8x height */
6769
6870      x = x & 0x01ff;
r4878r4879
128130   bitmap_fill(bitmap,cliprect,256); /* not verified */
129131
130132   deco16_tilemap_2_draw(screen,bitmap,cliprect,TILEMAP_DRAW_OPAQUE,0);
133   draw_sprites(screen->machine,bitmap,cliprect,1);
131134   deco16_tilemap_1_draw(screen,bitmap,cliprect,0,0);
135   draw_sprites(screen->machine,bitmap,cliprect,0);
132136
133   draw_sprites(screen->machine,bitmap,cliprect);
134137   return 0;
135138}
136139
r4878r4879
157160
158161static WRITE16_HANDLER( okim1_rombank_w )
159162{
160   if(ACCESSING_BITS_0_7)
161   {
162      UINT8 *oki = memory_region(space->machine, "oki2");
163      memcpy(&oki[0], &oki[(data & 3) * 0x40000] + 0x40000, 0x40000);
164   }
163   okim6295_set_bank_base(devtag_get_device(space->machine, "oki_sfx"), 0x40000 * (data & 0x3));
165164}
166165
167166static WRITE16_HANDLER( okim0_rombank_w )
168167{
169   /*bits 4-6 used?Volume control?*/
168   /*bits 4-6 used on POST? */
170169
171   if(ACCESSING_BITS_0_7)
172   {
173      UINT8 *oki = memory_region(space->machine, "oki1");
174      memcpy(&oki[0], &oki[(data & 7) * 0x40000] + 0x40000, 0x40000);
175   }
170   okim6295_set_bank_base(devtag_get_device(space->machine, "oki_bgm"), 0x40000 * (data & 0x7));
176171}
177172
178173static ADDRESS_MAP_START( mirage_map, ADDRESS_SPACE_PROGRAM, 16 )
r4878r4879
185180   AM_RANGE(0x112000, 0x112bff) AM_RAM AM_BASE(&deco16_pf2_rowscroll)
186181   AM_RANGE(0x120000, 0x1207ff) AM_RAM AM_BASE(&spriteram16)
187182   AM_RANGE(0x130000, 0x1307ff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
188   AM_RANGE(0x140000, 0x14000f) AM_DEVREADWRITE8("oki2", okim6295_r, okim6295_w, 0x00ff)
189   AM_RANGE(0x150000, 0x15000f) AM_DEVREADWRITE8("oki1", okim6295_r, okim6295_w, 0x00ff)
183   AM_RANGE(0x140000, 0x14000f) AM_DEVREADWRITE8("oki_sfx", okim6295_r, okim6295_w, 0x00ff)
184   AM_RANGE(0x150000, 0x15000f) AM_DEVREADWRITE8("oki_bgm", okim6295_r, okim6295_w, 0x00ff)
190185//  AM_RANGE(0x140006, 0x140007) AM_READ(random_readers)
191186//  AM_RANGE(0x150006, 0x150007) AM_READNOP
192187   AM_RANGE(0x160000, 0x160001) AM_WRITENOP
r4878r4879
347342   /* sound hardware */
348343   MDRV_SPEAKER_STANDARD_MONO("mono")
349344
350   MDRV_SOUND_ADD("oki1", OKIM6295, 2500000)
345   MDRV_SOUND_ADD("oki_bgm", OKIM6295, 2000000)
351346   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
352   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
347   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30)
353348
354   MDRV_SOUND_ADD("oki2", OKIM6295, 1000000)
349   MDRV_SOUND_ADD("oki_sfx", OKIM6295, 1000000)
355350   MDRV_SOUND_CONFIG(okim6295_interface_pin7high) // clock frequency & pin 7 not verified
356   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
351   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70)
357352MACHINE_DRIVER_END
358353
359354
r4878r4879
369364     ROM_LOAD16_BYTE( "mbl-01.11a", 0x000001, 0x200000, CRC(895be69a) SHA1(541d8f37fb4cf99312b80a0eb0d729fbbeab5f4f) )
370365   ROM_LOAD16_BYTE( "mbl-02.12a", 0x000000, 0x200000, CRC(474f6104) SHA1(ff81b32b90192c3d5f27c436a9246aa6caaeeeee) )
371366
372   ROM_REGION( 0x240000, "oki1", 0 )   /* M6295 samples */
373   ROM_LOAD( "mbl-03.10a", 0x040000, 0x200000, CRC(4a599703) SHA1(b49e84faa2d6acca952740d30fc8d1a33ac47e79) )
374   ROM_RELOAD(            0x000000, 0x040000 )
367   ROM_REGION( 0x200000, "oki_bgm_data", 0 )
368   ROM_LOAD( "mbl-03.10a", 0x000000, 0x200000, CRC(4a599703) SHA1(b49e84faa2d6acca952740d30fc8d1a33ac47e79) )
375369
376   ROM_REGION( 0x140000, "oki2", 0 )   /* M6295 samples */
377   ROM_LOAD( "mbl-04.12k", 0x040000, 0x100000, CRC(b533123d) SHA1(2cb2f11331d00c2d282113932ed2836805f4fc6e) )
378   ROM_RELOAD(            0x000000, 0x040000 )
370   ROM_REGION( 0x200000, "oki_bgm", 0 )
371   ROM_COPY( "oki_bgm_data", 0x000000, 0x000000, 0x080000 )
372   ROM_COPY( "oki_bgm_data", 0x100000, 0x080000, 0x080000 ) // - banks 2,3 and 4,5 are swapped, PAL address shuffle
373   ROM_COPY( "oki_bgm_data", 0x080000, 0x100000, 0x080000 ) // /
374   ROM_COPY( "oki_bgm_data", 0x180000, 0x180000, 0x080000 )
375
376   ROM_REGION( 0x100000, "oki_sfx", 0 )   /* M6295 samples */
377   ROM_LOAD( "mbl-04.12k", 0x000000, 0x100000, CRC(b533123d) SHA1(2cb2f11331d00c2d282113932ed2836805f4fc6e) )
379378ROM_END
380379
381380static DRIVER_INIT( mirage )
r4878r4879
383382   deco56_decrypt_gfx(machine, "gfx1");
384383}
385384
386GAME( 1994, mirage, 0,        mirage, mirage, mirage, ROT0, "Mitchell", "Mirage Youjuu Mahjongden (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
385GAME( 1994, mirage, 0,        mirage, mirage, mirage, ROT0, "Mitchell", "Mirage Youjuu Mahjongden (Japan)", 0 )
src/mame/drivers/tumblep.c
r4878r4879
7272
7373static WRITE16_HANDLER( tumblep_sound_w )
7474{
75   soundlatch_w(space,0,data & 0xff);
76   cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
75   soundlatch_w(space, 0, data & 0xff);
76   cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
7777}
7878
7979#ifdef UNUSED_FUNCTION
8080static WRITE16_HANDLER( jumppop_sound_w )
8181{
82   soundlatch_w(space,0,data & 0xff);
83   cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE );
82   soundlatch_w(space, 0, data & 0xff);
83   cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE );
8484}
8585#endif
8686
r4878r4879
276276
277277static void sound_irq(const device_config *device, int state)
278278{
279   cpu_set_input_line(device->machine->cpu[1],1,state); /* IRQ 2 */
279   cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
280280}
281281
282282static const ym2151_interface ym2151_config =
src/mame/drivers/dogfgt.c
r4878r4879
121121   PORT_DIPSETTING(    0x00, "5" )
122122   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Difficulty ) )
123123   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
124   PORT_DIPSETTING(    0x00, "Difficult" )
124   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
125125   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
126126   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
127127   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/taitosj.c
r4878r4879
16351635   PORT_DIPNAME(0x18, 0x10, DEF_STR( Difficulty ) )
16361636   PORT_DIPSETTING(   0x18, DEF_STR( Easy ) )      /* 3:00 */
16371637   PORT_DIPSETTING(   0x10, DEF_STR( Normal ) )       /* 2:30 */
1638   PORT_DIPSETTING(   0x08, "Difficult" )      /* 2:00 */
1639   PORT_DIPSETTING(   0x00, "Very Difficult" )    /* 1:30 */
1638   PORT_DIPSETTING(   0x08, DEF_STR( Difficult ) )      /* 2:00 */
1639   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )    /* 1:30 */
16401640   PORT_SERVICE( 0x20, IP_ACTIVE_LOW )
16411641   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) )
16421642   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
src/mame/drivers/bfmsys85.c
r4878r4879
426426
427427   AM_RANGE(0x3600, 0x3600) AM_WRITE(mux_enable_w)      // mux enable
428428
429   AM_RANGE(0x4000, 0xffff) AM_READ(SMH_ROM)         // 48K ROM
429   AM_RANGE(0x4000, 0xffff) AM_ROM                  // 48K ROM
430430   AM_RANGE(0x8000, 0xFFFF) AM_WRITE(watchdog_w)      // kick watchdog
431431
432432ADDRESS_MAP_END
src/mame/drivers/blockout.c
r4878r4879
5858   AM_RANGE(0x180000, 0x1bffff) AM_RAM_WRITE(blockout_videoram_w) AM_BASE(&blockout_videoram)
5959   AM_RANGE(0x1d4000, 0x1dffff) AM_RAM   /* work RAM */
6060   AM_RANGE(0x1f4000, 0x1fffff) AM_RAM   /* work RAM */
61   AM_RANGE(0x200000, 0x207fff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&blockout_frontvideoram)
61   AM_RANGE(0x200000, 0x207fff) AM_WRITEONLY AM_BASE(&blockout_frontvideoram)
6262   AM_RANGE(0x208000, 0x21ffff) AM_RAM   /* ??? */
6363   AM_RANGE(0x280002, 0x280003) AM_WRITE(blockout_frontcolor_w)
6464   AM_RANGE(0x280200, 0x2805ff) AM_RAM_WRITE(blockout_paletteram_w) AM_BASE(&paletteram16)
src/mame/drivers/jalmah.c
r4878r4879
3030-There could be timing issues caused by MCU simulation at $80004;
3131-Fix the sound banking, protection-related for the first version of the MCU
3232 (should be somewhere on the work ram/shared ram)
33-suchipi: I need a side-by-side to understand if the PAL shuffling is correct with the OKI bgm rom.
3334-urashima: might use three/four layers instead of two.It can be checked when you win
3435 a match in particular circumstances because there's a write in the 94000-9bfff region;
3536-Massive clean-ups needed for the MCU snippet programs and the input-ports, also check if
r4878r4879
862863   if(ACCESSING_BITS_0_7)
863864   {
864865      UINT8 *oki = memory_region(space->machine, "oki");
866
865867      oki_rom = data & 1;
866      /*ZA appears to be related to the banking*/
868
869      /* ZA appears to be related to the banking, or maybe kakumei2 uses PAL shuffling and this is for something else? */
867870      oki_za = (data & 2) ? 1 : 0;
871
868872      memcpy(&oki[0x20000], &oki[(oki_rom * 0x80000) + ((oki_bank+oki_za) * 0x20000) + 0x40000], 0x20000);
869873   }
870   //popmessage("PC=%06x %02x %02x %02x",cpu_get_pc(space->cpu),oki_rom,oki_za,oki_bank);
874
875   //popmessage("PC=%06x %02x %02x %02x %08x",cpu_get_pc(space->cpu),oki_rom,oki_za,oki_bank,(oki_rom * 0x80000) + ((oki_bank+oki_za) * 0x20000) + 0x40000);
871876}
872877
873878static WRITE16_HANDLER( jalmah_okibank_w )
r4878r4879
875880   if(ACCESSING_BITS_0_7)
876881   {
877882      UINT8 *oki = memory_region(space->machine, "oki");
883
878884      oki_bank = data & 3;
885
879886      memcpy(&oki[0x20000], &oki[(oki_rom * 0x80000) + ((oki_bank+oki_za) * 0x20000) + 0x40000], 0x20000);
880887   }
881   //popmessage("PC=%06x %02x %02x %02x",cpu_get_pc(space->cpu),oki_rom,oki_za,oki_bank);
888
889   //popmessage("PC=%06x %02x %02x %02x %08x",cpu_get_pc(space->cpu),oki_rom,oki_za,oki_bank,(oki_rom * 0x80000) + ((oki_bank+oki_za) * 0x20000) + 0x40000);
882890}
883891
884892static WRITE16_HANDLER( jalmah_flip_screen_w )
r4878r4879
12951303}
12961304
12971305static MACHINE_DRIVER_START( jalmah )
1298   MDRV_CPU_ADD("maincpu" , M68000, 8000000) /* 68000-8 */
1306   MDRV_CPU_ADD("maincpu" , M68000, 12000000) /* 68000-8 */
12991307   MDRV_CPU_PROGRAM_MAP(jalmah)
13001308   MDRV_CPU_VBLANK_INT("screen", irq2_line_hold)
13011309
r4878r4879
13211329   MDRV_SPEAKER_STANDARD_MONO("mono")
13221330   MDRV_SOUND_ADD("oki", OKIM6295, 4000000)
13231331   MDRV_SOUND_CONFIG(okim6295_interface_pin7low)
1324   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
1332   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5)
13251333MACHINE_DRIVER_END
13261334
13271335static MACHINE_DRIVER_START( urashima )
r4878r4879
15931601   ROM_REGION( 0x1000, "mcu", 0 ) /* M50747 MCU Code */
15941602   ROM_LOAD( "m50747", 0x0000, 0x1000, NO_DUMP )
15951603
1604   ROM_REGION( 0x100000, "oki_data", ROMREGION_ERASEFF ) /* Samples */
1605   ROM_LOAD( "3.bin", 0x00000, 0x80000, CRC(691b5387) SHA1(b8bc9f904eab7653566042b18d89276d537ba586) )
1606   ROM_LOAD( "4.bin", 0x80000, 0x80000, CRC(3fe932a1) SHA1(9e768b901738ee9eba207a67c4fd19efb0035a68) )
1607
15961608   ROM_REGION( 0x140000, "oki", ROMREGION_ERASEFF ) /* Samples */
1597   ROM_LOAD( "3.bin", 0x40000, 0x80000, CRC(691b5387) SHA1(b8bc9f904eab7653566042b18d89276d537ba586) )
1598   ROM_LOAD( "4.bin", 0xc0000, 0x80000, CRC(3fe932a1) SHA1(9e768b901738ee9eba207a67c4fd19efb0035a68) )
1599   ROM_COPY( "oki" ,  0x40000, 0x00000, 0x40000 )
1609   ROM_COPY( "oki_data" , 0x00000, 0x000000+0x00000, 0x40000 )
16001610
1611   /* PAL address shuffling for the BGM data (TODO: check this with a side-by-side test)*/
1612   ROM_COPY( "oki_data" , 0x20000, 0x000000+0x40000, 0x20000 ) // 0
1613   ROM_COPY( "oki_data" , 0x40000, 0x020000+0x40000, 0x20000 ) // 1
1614   ROM_COPY( "oki_data" , 0x60000, 0x040000+0x40000, 0x20000 ) // 2
1615   ROM_COPY( "oki_data" , 0x00000, 0x060000+0x40000, 0x20000 ) // 3
1616
1617   ROM_COPY( "oki_data" , 0x80000, 0x080000+0x40000, 0x40000 )
1618   ROM_COPY( "oki_data" , 0xc0000, 0x0c0000+0x40000, 0x40000 )
1619
16011620   ROM_REGION( 0x20000, "gfx1", 0 ) /* BG0 */
16021621   ROM_LOAD( "14.bin", 0x00000, 0x20000, CRC(e465a540) SHA1(10e19599ab90b0c0b6ef6ee41f16620bd1ba6800) )
16031622
r4878r4879
16131632   ROM_LOAD( "9.bin",  0x100000, 0x80000, CRC(8a348246) SHA1(13516c48bdbe8d78e7517473ef2835a4dea2ce93) )
16141633   ROM_LOAD( "10.bin", 0x180000, 0x80000, CRC(2b0d1afd) SHA1(40009b450901567052aa63c4629a2f7a10343e63) )
16151634
1616   /* the 3 missing proms should be the same as the other games */
16171635   ROM_REGION( 0x220, "user1", 0 ) /* Proms */
16181636   ROM_LOAD( "mj15.bpr", 0x000, 0x100, CRC(ebac41f9) SHA1(9d1629d977849663392cbf03a3ddf76665f88608) )
16191637   ROM_LOAD( "mj16.bpr", 0x100, 0x100, CRC(8d5dc1f6) SHA1(9f723e7cd44f8c09ec30b04725644346484ec753) )
src/mame/drivers/pingpong.c
r4878r4879
195195   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )
196196   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
197197   PORT_DIPSETTING(    0x02, DEF_STR( Normal ) )
198   PORT_DIPSETTING(    0x04, "Difficult" )
199   PORT_DIPSETTING(    0x00, "Very Difficult" )
198   PORT_DIPSETTING(    0x04, DEF_STR( Difficult ) )
199   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
200200   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
201201   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
202202   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
src/mame/drivers/ssrj.c
r4878r4879
9696   PORT_DIPNAME( 0x30, 0x00, DEF_STR( Difficulty ) ) /* ??? code @ $62c */
9797   PORT_DIPSETTING(   0x10, DEF_STR( Easy ) )
9898   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )
99   PORT_DIPSETTING(   0x20, "Difficult" )
100   PORT_DIPSETTING(   0x30, "Very Difficult" )
99   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
100   PORT_DIPSETTING(   0x30, DEF_STR( Very_Difficult ) )
101101   PORT_DIPNAME( 0x40, 0x40, DEF_STR( Free_Play ) )
102102   PORT_DIPSETTING(   0x40, DEF_STR( Off ) )
103103   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/blstroid.c
r4878r4879
8787   AM_RANGE(0xff8200, 0xff8201) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_scanline_int_ack_w)
8888   AM_RANGE(0xff8400, 0xff8401) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_video_int_ack_w)
8989   AM_RANGE(0xff8600, 0xff8601) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_eeprom_enable_w)
90   AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITE(SMH_RAM) AM_BASE(&blstroid_priorityram)
90   AM_RANGE(0xff8800, 0xff89ff) AM_MIRROR(0x7f8000) AM_WRITEONLY AM_BASE(&blstroid_priorityram)
9191   AM_RANGE(0xff8a00, 0xff8a01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_sound_w)
9292   AM_RANGE(0xff8c00, 0xff8c01) AM_MIRROR(0x7f81fe) AM_WRITE(atarigen_sound_reset_w)
9393   AM_RANGE(0xff8e00, 0xff8e01) AM_MIRROR(0x7f81fe) AM_WRITE(blstroid_halt_until_hblank_0_w)
src/mame/drivers/aztarac.c
r4878r4879
7676
7777static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 )
7878   AM_RANGE(0x000000, 0x00bfff) AM_ROM
79   AM_RANGE(0x022000, 0x0220ff) AM_READWRITE(nvram_r, SMH_RAM) AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
79   AM_RANGE(0x022000, 0x0220ff) AM_READ(nvram_r) AM_WRITEONLY AM_BASE(&generic_nvram16) AM_SIZE(&generic_nvram_size)
8080   AM_RANGE(0x027000, 0x027001) AM_READ(joystick_r)
8181   AM_RANGE(0x027004, 0x027005) AM_READ_PORT("INPUTS")
8282   AM_RANGE(0x027008, 0x027009) AM_READWRITE(aztarac_sound_r, aztarac_sound_w)
src/mame/drivers/blmbycar.c
r4878r4879
117117static ADDRESS_MAP_START( blmbycar_map, ADDRESS_SPACE_PROGRAM, 16 )
118118   AM_RANGE(0x000000, 0x0fffff) AM_ROM
119119   AM_RANGE(0xfec000, 0xfeffff) AM_RAM
120   AM_RANGE(0x100000, 0x103fff) AM_WRITE(SMH_RAM                                 )   //
121   AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_BASE(&blmbycar_vram_1   )   // Layer 1
122   AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_BASE(&blmbycar_vram_0   )   // Layer 0
123   AM_RANGE(0x108000, 0x10bfff) AM_WRITE(SMH_RAM                                 )   //
124   AM_RANGE(0x10c000, 0x10c003) AM_WRITE(SMH_RAM) AM_BASE(&blmbycar_scroll_1            )   // Scroll 1
125   AM_RANGE(0x10c004, 0x10c007) AM_WRITE(SMH_RAM) AM_BASE(&blmbycar_scroll_0            )   // Scroll 0
126   AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(blmbycar_palette_w                     )   // Palette
120   AM_RANGE(0x100000, 0x103fff) AM_WRITEONLY                                    // ???
121   AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_BASE(&blmbycar_vram_1)   // Layer 1
122   AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_BASE(&blmbycar_vram_0)   // Layer 0
123   AM_RANGE(0x108000, 0x10bfff) AM_WRITEONLY                                     // ???
124   AM_RANGE(0x10c000, 0x10c003) AM_WRITEONLY AM_BASE(&blmbycar_scroll_1)               // Scroll 1
125   AM_RANGE(0x10c004, 0x10c007) AM_WRITEONLY AM_BASE(&blmbycar_scroll_0)               // Scroll 0
126   AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(blmbycar_palette_w)                     // Palette
127127   AM_RANGE(0x200600, 0x203fff) AM_RAM
128   AM_RANGE(0x204000, 0x2045ff) AM_RAM_WRITE(blmbycar_palette_w) AM_BASE(&paletteram16      )   // Palette
128   AM_RANGE(0x204000, 0x2045ff) AM_RAM_WRITE(blmbycar_palette_w) AM_BASE(&paletteram16)   // Palette
129129   AM_RANGE(0x204600, 0x207fff) AM_RAM
130130   AM_RANGE(0x440000, 0x441fff) AM_RAM
131   AM_RANGE(0x444000, 0x445fff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites (size?)
132   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW"                                 )
133   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2"                              )
134   AM_RANGE(0x700004, 0x700005) AM_READ(blmbycar_opt_wheel_r                        )   // Wheel (optical)
135   AM_RANGE(0x700006, 0x700007) AM_READ_PORT("UNK"                                 )
136   AM_RANGE(0x700008, 0x700009) AM_READ(blmbycar_pot_wheel_r                        )   // Wheel (potentiometer)
137   AM_RANGE(0x70000a, 0x70000b) AM_WRITE(SMH_NOP                                 )   // ? Wheel
138   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w                        )   // Sound
131   AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)// Sprites (size?)
132   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW")
133   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2")
134   AM_RANGE(0x700004, 0x700005) AM_READ(blmbycar_opt_wheel_r)                        // Wheel (optical)
135   AM_RANGE(0x700006, 0x700007) AM_READ_PORT("UNK")
136   AM_RANGE(0x700008, 0x700009) AM_READ(blmbycar_pot_wheel_r)                        // Wheel (potentiometer)
137   AM_RANGE(0x70000a, 0x70000b) AM_WRITENOP                                    // ? Wheel
138   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w)                        // Sound
139139   AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)   // Sound
140   AM_RANGE(0x70006a, 0x70006b) AM_WRITE(blmbycar_pot_wheel_reset_w                  )   // Wheel (potentiometer)
141   AM_RANGE(0x70007a, 0x70007b) AM_WRITE(blmbycar_pot_wheel_shift_w                  )   //
140   AM_RANGE(0x70006a, 0x70006b) AM_WRITE(blmbycar_pot_wheel_reset_w)                  // Wheel (potentiometer)
141   AM_RANGE(0x70007a, 0x70007b) AM_WRITE(blmbycar_pot_wheel_shift_w)                  //
142142ADDRESS_MAP_END
143143
144144static READ16_HANDLER( waterball_unk_r )
r4878r4879
153153static ADDRESS_MAP_START( watrball_map, ADDRESS_SPACE_PROGRAM, 16 )
154154   AM_RANGE(0x000000, 0x0fffff) AM_ROM
155155   AM_RANGE(0xfec000, 0xfeffff) AM_RAM
156   AM_RANGE(0x100000, 0x103fff) AM_WRITE(SMH_RAM                                 )   //
157   AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_BASE(&blmbycar_vram_1   )   // Layer 1
158   AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_BASE(&blmbycar_vram_0   )   // Layer 0
159   AM_RANGE(0x108000, 0x10bfff) AM_WRITE(SMH_RAM                                 )   //
160   AM_RANGE(0x10c000, 0x10c003) AM_WRITE(SMH_RAM) AM_BASE(&blmbycar_scroll_1            )   // Scroll 1
161   AM_RANGE(0x10c004, 0x10c007) AM_WRITE(SMH_RAM) AM_BASE(&blmbycar_scroll_0            )   // Scroll 0
162   AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(blmbycar_palette_w                     )   // Palette
156   AM_RANGE(0x100000, 0x103fff) AM_WRITEONLY                                     // ???
157   AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_BASE(&blmbycar_vram_1)   // Layer 1
158   AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_BASE(&blmbycar_vram_0)   // Layer 0
159   AM_RANGE(0x108000, 0x10bfff) AM_WRITEONLY                                     // ???
160   AM_RANGE(0x10c000, 0x10c003) AM_WRITEONLY AM_BASE(&blmbycar_scroll_1)               // Scroll 1
161   AM_RANGE(0x10c004, 0x10c007) AM_WRITEONLY AM_BASE(&blmbycar_scroll_0)               // Scroll 0
162   AM_RANGE(0x200000, 0x2005ff) AM_RAM_WRITE(blmbycar_palette_w)                     // Palette
163163   AM_RANGE(0x200600, 0x203fff) AM_RAM
164   AM_RANGE(0x204000, 0x2045ff) AM_RAM_WRITE(blmbycar_palette_w) AM_BASE(&paletteram16      )   // Palette
164   AM_RANGE(0x204000, 0x2045ff) AM_RAM_WRITE(blmbycar_palette_w) AM_BASE(&paletteram16)   // Palette
165165   AM_RANGE(0x204600, 0x207fff) AM_RAM
166166   AM_RANGE(0x440000, 0x441fff) AM_RAM
167   AM_RANGE(0x444000, 0x445fff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram16) AM_SIZE(&spriteram_size   )   // Sprites (size?)
168   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW"                                 )
169   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2"                              )
170   AM_RANGE(0x700006, 0x700007) AM_READ(SMH_NOP                                    )   // read
171   AM_RANGE(0x700008, 0x700009) AM_READ(waterball_unk_r                             )   // 0x0008 must toggle
172   AM_RANGE(0x70000a, 0x70000b) AM_WRITE(SMH_NOP                                 )   // ?? busy
173   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w                        )   // Sound
167   AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)// Sprites (size?)
168   AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW")
169   AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2")
170   AM_RANGE(0x700006, 0x700007) AM_READNOP                                       // read
171   AM_RANGE(0x700008, 0x700009) AM_READ(waterball_unk_r)                           // 0x0008 must toggle
172   AM_RANGE(0x70000a, 0x70000b) AM_WRITEONLY                                     // ?? busy
173   AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w)                        // Sound
174174   AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_r, okim6295_w, 0x00ff)   //
175175ADDRESS_MAP_END
176176
src/mame/drivers/gbusters.c
r4878r4879
180180   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
181181   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
182182   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
183   PORT_DIPSETTING(    0x20, "Difficult" )
184   PORT_DIPSETTING(    0x00, "Very Difficult" )
183   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
184   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
185185   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
186186   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
187187   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/aeroboto.c
r4878r4879
7878   AM_RANGE(0x01a2, 0x01a2) AM_WRITE(aeroboto_1a2_w)         // affects IRQ line (more protection?)
7979   AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE(&aeroboto_mainram)   // main  RAM
8080   AM_RANGE(0x0800, 0x08ff) AM_RAM                        // tile color buffer; copied to 0x2000
81   AM_RANGE(0x0900, 0x09ff) AM_WRITE(SMH_RAM)               // a backup of default tile colors
81   AM_RANGE(0x0900, 0x09ff) AM_WRITEONLY                   // a backup of default tile colors
8282   AM_RANGE(0x1000, 0x17ff) AM_RAM_WRITE(aeroboto_videoram_w) AM_BASE(&aeroboto_videoram)      // tile RAM
8383   AM_RANGE(0x1800, 0x183f) AM_RAM AM_BASE(&aeroboto_hscroll)   // horizontal scroll regs
8484   AM_RANGE(0x2000, 0x20ff) AM_RAM_WRITE(aeroboto_tilecolor_w) AM_BASE(&aeroboto_tilecolor)   // tile color RAM
r4878r4879
9090   AM_RANGE(0x3001, 0x3001) AM_READ_PORT("DSW1") AM_WRITE(soundlatch_w)
9191   AM_RANGE(0x3002, 0x3002) AM_READ_PORT("DSW2") AM_WRITE(soundlatch2_w)
9292   AM_RANGE(0x3003, 0x3003) AM_WRITEONLY AM_BASE(&aeroboto_vscroll)
93   AM_RANGE(0x3004, 0x3004) AM_READWRITE(aeroboto_201_r, SMH_RAM) AM_BASE(&aeroboto_starx)
93   AM_RANGE(0x3004, 0x3004) AM_READ(aeroboto_201_r) AM_WRITEONLY AM_BASE(&aeroboto_starx)
9494   AM_RANGE(0x3005, 0x3005) AM_WRITEONLY AM_BASE(&aeroboto_stary)   // usable but probably wrong
9595   AM_RANGE(0x3006, 0x3006) AM_WRITEONLY AM_BASE(&aeroboto_bgcolor)
9696   AM_RANGE(0x3800, 0x3800) AM_READNOP                     // watchdog or IRQ ack
src/mame/drivers/konamigv.c
r4878r4879
454454static READ32_HANDLER( flash_r )
455455{
456456   int reg = offset*2;
457   int shift = 0;
457   //int shift = 0;
458458
459459   if (mem_mask == 0xffff0000)
460460   {
461461      reg++;
462      shift = 16;
462      //shift = 16;
463463   }
464464
465465   if (reg == 4)   // set odd address
src/mame/drivers/crgolf.c
r4878r4879
237237   AM_RANGE(0x0000, 0x3fff) AM_ROM
238238   AM_RANGE(0x4000, 0x5fff) AM_RAM
239239   AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(1)
240   AM_RANGE(0x8003, 0x8003) AM_WRITE(SMH_RAM) AM_BASE(&crgolf_color_select)
241   AM_RANGE(0x8004, 0x8004) AM_WRITE(SMH_RAM) AM_BASE(&crgolf_screen_flip)
242   AM_RANGE(0x8005, 0x8005) AM_WRITE(SMH_RAM) AM_BASE(&crgolf_screen_select)
243   AM_RANGE(0x8006, 0x8006) AM_WRITE(SMH_RAM) AM_BASE(&crgolf_screenb_enable)
244   AM_RANGE(0x8007, 0x8007) AM_WRITE(SMH_RAM) AM_BASE(&crgolf_screena_enable)
240   AM_RANGE(0x8003, 0x8003) AM_WRITEONLY AM_BASE(&crgolf_color_select)
241   AM_RANGE(0x8004, 0x8004) AM_WRITEONLY AM_BASE(&crgolf_screen_flip)
242   AM_RANGE(0x8005, 0x8005) AM_WRITEONLY AM_BASE(&crgolf_screen_select)
243   AM_RANGE(0x8006, 0x8006) AM_WRITEONLY AM_BASE(&crgolf_screenb_enable)
244   AM_RANGE(0x8007, 0x8007) AM_WRITEONLY AM_BASE(&crgolf_screena_enable)
245245   AM_RANGE(0x8800, 0x8800) AM_READWRITE(sound_to_main_r, main_to_sound_w)
246246   AM_RANGE(0x9000, 0x9000) AM_WRITE(rom_bank_select_w)
247247   AM_RANGE(0xa000, 0xffff) AM_READWRITE(crgolf_videoram_r, crgolf_videoram_w)
src/mame/drivers/ksys573.c
r4878r4879
23402340         static int b = 0;
23412341         static int o = 0;
23422342
2343         /* fpga */
23432344         s = ( s >> 1 ) | ( ( data & 0x8000 ) >> 8 );
23442345         b++;
23452346         if( b == 8 )
r4878r4879
29382939
29392940   PORT_START( "STAGE" )
29402941   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_PLAYER(1)
2941   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(1) /* serial? */
2942   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY PORT_PLAYER(1)    /* serial? */
2942   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(1) /* multiplexor */
2943   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY PORT_PLAYER(1)    /* multiplexor */
29432944   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_16WAY PORT_PLAYER(1)
29442945   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_PLAYER(2)
2945   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(2) /* serial? */
2946   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY PORT_PLAYER(2)    /* serial? */
2946   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(2) /* multiplexor */
2947   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY PORT_PLAYER(2)    /* multiplexor */
29472948   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_16WAY PORT_PLAYER(2)
29482949INPUT_PORTS_END
29492950
r4878r4879
29522953
29532954   PORT_MODIFY("IN2")
29542955   PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Left 1" )
2955   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Right 1" ) /* serial? */
2956   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Up 1" ) /* serial? */
2956   PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Right 1" )
2957   PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Up 1" )
29572958   PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Down 1" )
2958   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME( "P1 Up-Left 2" ) /* P1 BUTTON 1 */ /* skip init? */
2959   PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME( "P1 Up-Left 2" ) /* P1 BUTTON 1 */
29592960   PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Left 2" ) /* P1 BUTTON 2 */
29602961   PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Down 2" ) /* P1 BUTTON 3 */
29612962   PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Up-Left 1" ) /* P2 LEFT */
2962   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Up-Right 1" ) /* P2 RIGHT */ /* serial? */
2963   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED ) /* P2 UP */ /* serial? */
2963   PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Up-Right 1" ) /* P2 RIGHT */
2964   PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNUSED ) /* P2 UP */
29642965   PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNUSED ) /* P2 DOWN */
2965   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME( "P1 Up 2" ) /* P2 BUTTON1 */ /* skip init? */
2966   PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_NAME( "P1 Up 2" ) /* P2 BUTTON1 */
29662967   PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_16WAY PORT_PLAYER(1) PORT_NAME( "P1 Right 2" ) /* P2 BUTTON2 */
29672968   PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME( "P1 Up-Right 2" ) /* P2 BUTTON3 */
29682969   PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* P2 START */
src/mame/drivers/bladestl.c
r4878r4879
113113   AM_RANGE(0x0000, 0x1fff) AM_READWRITE(K007342_r, K007342_w)   /* Color RAM + Video RAM */
114114   AM_RANGE(0x2000, 0x21ff) AM_READWRITE(K007420_r, K007420_w)   /* Sprite RAM */
115115   AM_RANGE(0x2200, 0x23ff) AM_READWRITE(K007342_scroll_r, K007342_scroll_w)   /* Scroll RAM */
116   AM_RANGE(0x2400, 0x245f) AM_RAM AM_BASE(&paletteram)   /* palette */
117   AM_RANGE(0x2600, 0x2607) AM_WRITE(K007342_vreg_w)      /* Video Registers */
118   AM_RANGE(0x2e00, 0x2e00) AM_READ_PORT("COINSW")         /* DIPSW #3, coinsw, startsw */
119   AM_RANGE(0x2e01, 0x2e01) AM_READ_PORT("P1")            /* 1P controls */
120   AM_RANGE(0x2e02, 0x2e02) AM_READ_PORT("P2")            /* 2P controls */
121   AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW2")         /* DISPW #2 */
122   AM_RANGE(0x2e40, 0x2e40) AM_READ_PORT("DSW1")         /* DIPSW #1 */
116   AM_RANGE(0x2400, 0x245f) AM_RAM AM_BASE(&paletteram)      /* palette */
117   AM_RANGE(0x2600, 0x2607) AM_WRITE(K007342_vreg_w)         /* Video Registers */
118   AM_RANGE(0x2e00, 0x2e00) AM_READ_PORT("COINSW")            /* DIPSW #3, coinsw, startsw */
119   AM_RANGE(0x2e01, 0x2e01) AM_READ_PORT("P1")               /* 1P controls */
120   AM_RANGE(0x2e02, 0x2e02) AM_READ_PORT("P2")               /* 2P controls */
121   AM_RANGE(0x2e03, 0x2e03) AM_READ_PORT("DSW2")            /* DISPW #2 */
122   AM_RANGE(0x2e40, 0x2e40) AM_READ_PORT("DSW1")            /* DIPSW #1 */
123123   AM_RANGE(0x2e80, 0x2e80) AM_WRITE(bladestl_sh_irqtrigger_w)   /* cause interrupt on audio CPU */
124   AM_RANGE(0x2ec0, 0x2ec0) AM_WRITE(watchdog_reset_w)      /* watchdog reset */
125   AM_RANGE(0x2f00, 0x2f03) AM_READ(trackball_r)         /* Trackballs */
124   AM_RANGE(0x2ec0, 0x2ec0) AM_WRITE(watchdog_reset_w)         /* watchdog reset */
125   AM_RANGE(0x2f00, 0x2f03) AM_READ(trackball_r)            /* Trackballs */
126126   AM_RANGE(0x2f40, 0x2f40) AM_WRITE(bladestl_bankswitch_w)   /* bankswitch control */
127127   AM_RANGE(0x2f80, 0x2f9f) AM_READWRITE(K051733_r, K051733_w)   /* Protection: 051733 */
128   AM_RANGE(0x2fc0, 0x2fc0) AM_WRITENOP            /* ??? */
129   AM_RANGE(0x4000, 0x5fff) AM_RAM                     /* Work RAM */
130   AM_RANGE(0x6000, 0x7fff) AM_READWRITE(SMH_BANK(1), SMH_RAM)   /* banked ROM */
128   AM_RANGE(0x2fc0, 0x2fc0) AM_WRITENOP                  /* ??? */
129   AM_RANGE(0x4000, 0x5fff) AM_RAM                        /* Work RAM */
130   AM_RANGE(0x6000, 0x7fff) AM_ROMBANK(1)                  /* banked ROM */
131131   AM_RANGE(0x8000, 0xffff) AM_ROM
132132ADDRESS_MAP_END
133133
134134static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
135135   AM_RANGE(0x0000, 0x07ff) AM_RAM
136   AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)      /* YM2203 */
136   AM_RANGE(0x1000, 0x1001) AM_DEVREADWRITE("ym", ym2203_r, ym2203_w)   /* YM2203 */
137137   AM_RANGE(0x3000, 0x3000) AM_DEVWRITE("upd", bladestl_speech_ctrl_w)   /* UPD7759 */
138   AM_RANGE(0x4000, 0x4000) AM_DEVREAD("upd", bladestl_speech_busy_r)         /* UPD7759 */
139   AM_RANGE(0x5000, 0x5000) AM_WRITENOP               /* ??? */
140   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)            /* soundlatch_r */
138   AM_RANGE(0x4000, 0x4000) AM_DEVREAD("upd", bladestl_speech_busy_r)   /* UPD7759 */
139   AM_RANGE(0x5000, 0x5000) AM_WRITENOP                        /* ??? */
140   AM_RANGE(0x6000, 0x6000) AM_READ(soundlatch_r)                  /* soundlatch_r */
141141   AM_RANGE(0x8000, 0xffff) AM_ROM
142142ADDRESS_MAP_END
143143
r4878r4879
165165   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
166166   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
167167   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
168   PORT_DIPSETTING(   0x20, "Difficult" )
169   PORT_DIPSETTING(   0x00, "Very difficult" )
168   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
169   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
170170   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
171171   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
172172   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/mcr68.c
r4878r4879
14111411   mcr68_common_init(machine, MCR_CHIP_SQUEAK_DELUXE, 0, 0);
14121412
14131413   /* Zwackery doesn't care too much about this value; currently taken from Blasted */
1414   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * (256 + 16));
1414   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * (256 + 16));
14151415}
14161416
14171417
r4878r4879
14201420   mcr68_common_init(machine, MCR_SOUNDS_GOOD, 0, -4);
14211421
14221422   /* Xenophobe doesn't care too much about this value; currently taken from Blasted */
1423   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * (256 + 16));
1423   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * (256 + 16));
14241424
14251425   /* install control port handler */
1426   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w);
1426   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, xenophobe_control_w);
14271427}
14281428
14291429
r4878r4879
14321432   mcr68_common_init(machine, MCR_TURBO_CHIP_SQUEAK | MCR_SOUNDS_GOOD, 0, -6);
14331433
14341434   /* Spy Hunter 2 doesn't care too much about this value; currently taken from Blasted */
1435   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * (256 + 16));
1435   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * (256 + 16));
14361436
14371437   /* analog port handling is a bit tricky */
1438   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w);
1439   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0d0000, 0x0dffff, 0, 0, spyhunt2_port_0_r);
1440   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0e0000, 0x0effff, 0, 0, spyhunt2_port_1_r);
1438   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, spyhunt2_control_w);
1439   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0d0000, 0x0dffff, 0, 0, spyhunt2_port_0_r);
1440   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0e0000, 0x0effff, 0, 0, spyhunt2_port_1_r);
14411441}
14421442
14431443
r4878r4879
14481448   /* Blasted checks the timing of VBLANK relative to the 493 interrupt */
14491449   /* VBLANK is required to come within 220-256 E clocks (i.e., 2200-2560 CPU clocks) */
14501450   /* after the 493; we also allow 16 E clocks for latency  */
1451   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * (256 + 16));
1451   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * (256 + 16));
14521452
14531453   /* handle control writes */
1454   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, blasted_control_w);
1454   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, blasted_control_w);
14551455
14561456   /* 6840 is mapped to the lower 8 bits */
1457   memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w);
1457   memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w);
14581458}
14591459
14601460
r4878r4879
14631463   mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 16, 0);
14641464
14651465   /* Arch Rivals doesn't care too much about this value; currently taken from Blasted */
1466   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * (256 + 16));
1466   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * (256 + 16));
14671467
14681468   /* handle control writes */
1469   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w);
1469   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0cffff, 0, 0, archrivl_control_w);
14701470
14711471   /* 49-way joystick handling is a bit tricky */
1472   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0e0000, 0x0effff, 0, 0, archrivl_port_1_r);
1472   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0e0000, 0x0effff, 0, 0, archrivl_port_1_r);
14731473
14741474   /* 6840 is mapped to the lower 8 bits */
1475   memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w);
1475   memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0a0000, 0x0a000f, 0, 0, mcr68_6840_lower_r, mcr68_6840_lower_w);
14761476}
14771477
14781478
r4878r4879
14811481   mcr68_common_init(machine, MCR_WILLIAMS_SOUND, 16, 0);
14821482
14831483   /* Pigskin doesn't care too much about this value; currently taken from Tri-Sports */
1484   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * 115);
1484   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * 115);
14851485
14861486   state_save_register_global_array(machine, protection_data);
14871487}
r4878r4879
14941494   /* Tri-Sports checks the timing of VBLANK relative to the 493 interrupt */
14951495   /* VBLANK is required to come within 87-119 E clocks (i.e., 870-1190 CPU clocks) */
14961496   /* after the 493 */
1497   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cpu_get_clock(machine->cpu[0]) / 10) * 115);
1497   mcr68_timing_factor = attotime_make(0, HZ_TO_ATTOSECONDS(cputag_get_clock(machine, "maincpu") / 10) * 115);
14981498}
14991499
15001500
src/mame/drivers/thunderx.c
r4878r4879
448448   /* "No Coin B" = coins produce sound, but no effect on coin counter */
449449
450450   PORT_START("DSW2")
451   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
451   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:1,2")
452452   PORT_DIPSETTING(   0x03, "2" )
453   PORT_DIPSETTING(   0x02, "3" )
453   PORT_DIPSETTING(   0x02, "3" ) // factory default
454454   PORT_DIPSETTING(   0x01, "5" )
455455   PORT_DIPSETTING(   0x00, "7" )
456   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )   /* test mode calls it cabinet type, */
457   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )      /* but this is a 2 players game */
458   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
459   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
460   PORT_DIPSETTING(   0x18, "30000 200000" )
461   PORT_DIPSETTING(   0x10, "50000 300000" )
456   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x00, "SW2:3" )  // test mode calls it cabinet type, but this is a 2 players game
457                                                  // US manual default = "ON : Upright" / Japanese manual default = "OFF : Table" , but not work?
458   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:4,5")
459   PORT_DIPSETTING(   0x18, "30000 200000" ) // factory default. Japanese manual has typo "30000 300000"
460   PORT_DIPSETTING(   0x10, "50000 300000" ) //                                           "50000 200000"
462461   PORT_DIPSETTING(   0x08, "30000" )
463462   PORT_DIPSETTING(   0x00, "50000" )
464   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
463   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
465464   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
466   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
467   PORT_DIPSETTING(   0x20, "Difficult" )
468   PORT_DIPSETTING(   0x00, "Very Difficult" )
469   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
465   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) ) // factory default
466   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
467   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
468   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
470469   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
471   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
470   PORT_DIPSETTING(   0x00, DEF_STR( On ) ) // factory default
472471
473472   PORT_START("DSW3")
474   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
475   PORT_DIPSETTING(   0x01, DEF_STR( Off ) )
473   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW3:1")
474   PORT_DIPSETTING(   0x01, DEF_STR( Off ) ) // factory default
476475   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
477   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
478   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
479   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
480   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
481   PORT_DIPNAME( 0x08, 0x08, "Continue Limit" )
482   PORT_DIPSETTING(    0x08, "3" )
483   PORT_DIPSETTING(    0x00, "5" )
476   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" )
477   PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW3:3" )  // TYPO on US manual "OFF : Game mode / ON : Game mode"
478   PORT_DIPNAME( 0x08, 0x00, "Continue Limit (1Player/2Players)" )   PORT_DIPLOCATION("SW3:4")
479   PORT_DIPSETTING(    0x08, "3times / Twice altogether" )
480   PORT_DIPSETTING(    0x00, "5times / 4times altogether" ) // factory default
484481   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
485482INPUT_PORTS_END
486483
r4878r4879
502499   /* "No Coin B" = coins produce sound, but no effect on coin counter */
503500
504501    PORT_START("DSW2")
505   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
502   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )      PORT_DIPLOCATION("SW2:1,2")
506503   PORT_DIPSETTING(    0x03, "2" )
507   PORT_DIPSETTING(    0x02, "3" )
504   PORT_DIPSETTING(    0x02, "3" ) // factory default
508505   PORT_DIPSETTING(    0x01, "5" )
509506   PORT_DIPSETTING(    0x00, "7" )
510   PORT_DIPNAME( 0x04, 0x00, "Award Bonus Life" )
511   PORT_DIPSETTING(    0x04, DEF_STR( No ) )
507   PORT_DIPNAME( 0x04, 0x00, "Award Bonus Life" )      PORT_DIPLOCATION("SW2:3")
508   PORT_DIPSETTING(    0x04, DEF_STR( No ) ) // factory default
512509   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
513   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
514   PORT_DIPSETTING(    0x18, "30000 200000" )
515   PORT_DIPSETTING(    0x10, "50000 300000" )
510   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:4,5")
511   PORT_DIPSETTING(    0x18, "30000 200000" ) // Japanese default
512   PORT_DIPSETTING(    0x10, "50000 300000" ) // US default
516513   PORT_DIPSETTING(    0x08, "30000" )
517514   PORT_DIPSETTING(    0x00, "50000" )
518   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
515   PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
519516   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
520   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
521   PORT_DIPSETTING(    0x20, "Difficult" )
522   PORT_DIPSETTING(    0x00, "Very Difficult" )
523   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
517   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) ) // factory default
518   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
519   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
520   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
524521   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
525   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
522   PORT_DIPSETTING(    0x00, DEF_STR( On ) ) // factory default
526523
527524   PORT_START("DSW3")
528   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
529   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
525   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )   PORT_DIPLOCATION("SW3:1")
526   PORT_DIPSETTING(    0x01, DEF_STR( Off ) ) // factory default
530527   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
531   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
532   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
533   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
534   PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
535   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
536   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
537   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
528   PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" )
529   PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW3:3" )
530   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" )
538531   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
539532INPUT_PORTS_END
540533
534static INPUT_PORTS_START( thnderxj )
535   PORT_INCLUDE( thunderx )
541536
537   PORT_MODIFY("DSW2")
538   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW2:3" )  // manual says "OFF=Table On=Upright", but not work?
539   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )   PORT_DIPLOCATION("SW2:4,5")
540   PORT_DIPSETTING(    0x18, "30000 200000" )  // Japanese MS
541   PORT_DIPSETTING(    0x10, "50000 300000" )  // US MS
542   PORT_DIPSETTING(    0x08, "30000" )
543   PORT_DIPSETTING(    0x00, "50000" )
544INPUT_PORTS_END
542545
546/*
547static INPUT_PORTS_START( thndrxja ) // for Japanese later revision (not dumped yet)
548    PORT_INCLUDE( thnderxj )
549
550    PORT_MODIFY("DSW3")
551    PORT_DIPNAME( 0x08, 0x08, "All Stage Clear Loop" )  PORT_DIPLOCATION("SW3:4")
552    PORT_DIPSETTING(    0x08, "Game ends after 3 loops" )  // factory default
553    PORT_DIPSETTING(    0x00, "Endless" )
554INPUT_PORTS_END
555*/
556
557
543558/***************************************************************************
544559
545560    Machine Driver
r4878r4879
929944GAME( 1988, thunderx, 0,        thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (set 1)", 0 )
930945GAME( 1988, thnderxa, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (set 2)", 0 )
931946GAME( 1988, thnderxb, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (set 3)", 0 )
932GAME( 1988, thnderxj, thunderx, thunderx, thunderx, scontra, ROT0,  "Konami", "Thunder Cross (Japan)", 0 )
947GAME( 1988, thnderxj, thunderx, thunderx, thnderxj, scontra, ROT0,  "Konami", "Thunder Cross (Japan)", 0 )
948/*
949GAME( 1988, thndrxja, thunderx, thunderx, thndrxja, scontra, ROT0,  "Konami", "Thunder Cross (Japan, newer revision)", 0 )
950*/
src/mame/drivers/gsword.c
r4878r4879
359359
360360static WRITE8_HANDLER( adpcm_soundcommand_w )
361361{
362   soundlatch_w(space,0,data);
363   cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_NMI, PULSE_LINE);
362   soundlatch_w(space, 0, data);
363   cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
364364}
365365
366static ADDRESS_MAP_START( cpu1_map, 0 , 8 )
366static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM , 8 )
367367   AM_RANGE(0x0000, 0x8fff) AM_ROM
368368   AM_RANGE(0x9000, 0x9fff) AM_RAM
369369   AM_RANGE(0xa000, 0xa37f) AM_RAM
370   AM_RANGE(0xa380, 0xa3ff) AM_WRITE(SMH_RAM) AM_READ(SMH_RAM) AM_BASE(&gsword_spritetile_ram)
370   AM_RANGE(0xa380, 0xa3ff) AM_RAM AM_BASE(&gsword_spritetile_ram)
371371   AM_RANGE(0xa400, 0xa77f) AM_RAM
372   AM_RANGE(0xa780, 0xa7ff) AM_WRITE(SMH_RAM) AM_READ(SMH_RAM) AM_BASE(&gsword_spritexy_ram) AM_SIZE(&gsword_spritexy_size)
372   AM_RANGE(0xa780, 0xa7ff) AM_RAM AM_BASE(&gsword_spritexy_ram) AM_SIZE(&gsword_spritexy_size)
373373   AM_RANGE(0xa980, 0xa980) AM_WRITE(gsword_charbank_w)
374374   AM_RANGE(0xaa80, 0xaa80) AM_WRITE(gsword_videoctrl_w)   /* flip screen, char palette bank */
375375   AM_RANGE(0xab00, 0xab00) AM_WRITE(gsword_scroll_w)
376   AM_RANGE(0xab80, 0xabff) AM_WRITE(SMH_RAM) AM_BASE(&gsword_spriteattrib_ram)
377   AM_RANGE(0xb000, 0xb7ff) AM_WRITE(gsword_videoram_w) AM_READ(SMH_RAM) AM_BASE(&videoram)
376   AM_RANGE(0xab80, 0xabff) AM_WRITEONLY AM_BASE(&gsword_spriteattrib_ram)
377   AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(gsword_videoram_w) AM_BASE(&videoram)
378378ADDRESS_MAP_END
379379
380380static ADDRESS_MAP_START( cpu1_io_map, ADDRESS_SPACE_IO, 8 )
r4878r4879
396396
397397static ADDRESS_MAP_START( cpu2_io_map, ADDRESS_SPACE_IO, 8 )
398398   ADDRESS_MAP_GLOBAL_MASK(0xff)
399   AM_RANGE(0x00, 0x01) AM_WRITE(TAITO8741_2_w) AM_READ(TAITO8741_2_r)
400   AM_RANGE(0x20, 0x21) AM_WRITE(TAITO8741_3_w) AM_READ(TAITO8741_3_r)
401   AM_RANGE(0x40, 0x41) AM_WRITE(TAITO8741_1_w) AM_READ(TAITO8741_1_r)
399   AM_RANGE(0x00, 0x01) AM_READWRITE(TAITO8741_2_r,TAITO8741_2_w)
400   AM_RANGE(0x20, 0x21) AM_READWRITE(TAITO8741_3_r,TAITO8741_3_w)
401   AM_RANGE(0x40, 0x41) AM_READWRITE(TAITO8741_1_r,TAITO8741_1_w)
402402   AM_RANGE(0x60, 0x60) AM_DEVREADWRITE("ay1", gsword_fake_0_r, gsword_AY8910_control_port_0_w)
403403   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("ay1", ay8910_r,        ay8910_data_w)
404404   AM_RANGE(0x80, 0x80) AM_DEVREADWRITE("ay2", gsword_fake_1_r, gsword_AY8910_control_port_1_w)
r4878r4879
599599   PORT_DIPSETTING(    0x20, "78H" )
600600   PORT_DIPSETTING(    0x10, "5AH" )
601601   PORT_DIPSETTING(    0x00, "3CH" )
602   PORT_DIPNAME( 0x40, 0x00, "TEST_MODE" )
602   PORT_DIPNAME( 0x40, 0x40, "TEST_MODE" )
603603   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
604604   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
605605   PORT_DIPNAME( 0x80, 0x80, "DIP1-80(982C)" )
r4878r4879
913913   ROM_REGION( 0x4000, "gfx1", ROMREGION_DISPOSE )
914914   ROM_LOAD( "aa0-10.9n",    0x0000, 0x2000, CRC(207c4f42) SHA1(4cf2922d55cfc9e68cc07c3252ea3b5619b8aca5) )   /* tiles */
915915   ROM_LOAD( "aa1-11.9p",    0x2000, 0x1000, CRC(c130464a) SHA1(9d23577b8aaaffeefff3d8f93668d1b2bd0ba3d9) )
916   ROM_RELOAD(               0x3000, 0x1000 ) // title screen data is actually read from here
916917
917918   ROM_REGION( 0x2000, "gfx2", ROMREGION_DISPOSE )
918919   ROM_LOAD( "aa0-6.9e",     0x0000, 0x2000, CRC(c2c2401a) SHA1(ef987d53d9e502277086f39b455174d3539572e6) )   /* sprites */
r4878r4879
942943#endif
943944#if 1
944945   /* hack for sound protection or time out function */
945   memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r);
946   memory_install_read8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r);
946947#endif
947948}
948949
r4878r4879
957958#endif
958959#if 1
959960   /* hack for sound protection or time out function */
960   memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r);
961   memory_install_read8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r);
961962#endif
962963}
963964
src/mame/drivers/atarifb.c
r4878r4879
157157   AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram)
158158   AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram)
159159   AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
160   AM_RANGE(0x2000, 0x2000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
160   AM_RANGE(0x2000, 0x2000) AM_WRITEONLY AM_BASE(&atarifb_scroll_register) /* OUT 0 */
161161   AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb_out1_w) /* OUT 1 */
162162   AM_RANGE(0x2002, 0x2002) AM_WRITE(atarifb_out2_w) /* OUT 2 */
163163   AM_RANGE(0x2003, 0x2003) AM_WRITE(atarifb_out3_w) /* OUT 3 */
164   AM_RANGE(0x3000, 0x3000) AM_READ(SMH_RAM)
165   AM_RANGE(0x3000, 0x3000) AM_WRITENOP /* Interrupt Acknowledge */
164   AM_RANGE(0x3000, 0x3000) AM_NOP /* Interrupt Acknowledge */
166165   AM_RANGE(0x4000, 0x4000) AM_READ(atarifb_in0_r)
167166   AM_RANGE(0x4002, 0x4002) AM_READ(atarifb_in2_r)
168167   AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
r4878r4879
178177   AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram)
179178   AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram)
180179   AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
181   AM_RANGE(0x2000, 0x2000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
180   AM_RANGE(0x2000, 0x2000) AM_WRITEONLY AM_BASE(&atarifb_scroll_register) /* OUT 0 */
182181   AM_RANGE(0x2001, 0x2001) AM_WRITE(atarifb4_out1_w) /* OUT 1 */
183182   AM_RANGE(0x2002, 0x2002) AM_WRITE(atarifb_out2_w) /* OUT 2 */
184183   AM_RANGE(0x2003, 0x2003) AM_WRITE(atarifb_out3_w) /* OUT 3 */
185   AM_RANGE(0x3000, 0x3000) AM_READ(SMH_RAM)
186   AM_RANGE(0x3000, 0x3000) AM_WRITENOP /* Interrupt Acknowledge */
184   AM_RANGE(0x3000, 0x3000) AM_NOP /* Interrupt Acknowledge */
187185   AM_RANGE(0x4000, 0x4000) AM_READ(atarifb4_in0_r)
188186   AM_RANGE(0x4001, 0x4001) AM_READ_PORT("EXTRA")
189187   AM_RANGE(0x4002, 0x4002) AM_READ(atarifb4_in2_r)
r4878r4879
200198   AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram)
201199   AM_RANGE(0x1000, 0x13bf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram)
202200   AM_RANGE(0x13c0, 0x13ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
203   AM_RANGE(0x2000, 0x2000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
201   AM_RANGE(0x2000, 0x2000) AM_WRITEONLY AM_BASE(&atarifb_scroll_register) /* OUT 0 */
204202   AM_RANGE(0x2001, 0x2001) AM_WRITE(abaseb_out1_w) /* OUT 1 */
205203   AM_RANGE(0x2002, 0x2002) AM_WRITE(atarifb_out2_w) /* OUT 2 */
206204   AM_RANGE(0x2003, 0x2003) AM_WRITE(atarifb_out3_w) /* OUT 3 */
207   AM_RANGE(0x3000, 0x3000) AM_READ(SMH_RAM)
208   AM_RANGE(0x3000, 0x3000) AM_WRITENOP /* Interrupt Acknowledge */
205   AM_RANGE(0x3000, 0x3000) AM_NOP /* Interrupt Acknowledge */
209206   AM_RANGE(0x4000, 0x4000) AM_READ(atarifb_in0_r)
210207   AM_RANGE(0x4002, 0x4002) AM_READ(atarifb_in2_r)
211208   AM_RANGE(0x5000, 0x5000) AM_WRITE(watchdog_reset_w)
r4878r4879
221218   AM_RANGE(0x03a0, 0x03ff) AM_RAM_WRITE(atarifb_alpha2_videoram_w) AM_BASE(&atarifb_alphap2_videoram)
222219   AM_RANGE(0x0800, 0x0bbf) AM_RAM_WRITE(atarifb_field_videoram_w) AM_BASE(&atarifb_field_videoram)
223220   AM_RANGE(0x0bc0, 0x0bff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
224   AM_RANGE(0x1000, 0x1000) AM_WRITE(SMH_RAM) AM_BASE(&atarifb_scroll_register) /* OUT 0 */
221   AM_RANGE(0x1000, 0x1000) AM_WRITEONLY AM_BASE(&atarifb_scroll_register) /* OUT 0 */
225222   AM_RANGE(0x1001, 0x1001) AM_WRITE(soccer_out1_w) /* OUT 1 */
226223   AM_RANGE(0x1002, 0x1002) AM_WRITE(soccer_out2_w) /* OUT 2 */
227224   AM_RANGE(0x1004, 0x1004) AM_WRITENOP /* Interrupt Acknowledge */
src/mame/drivers/runaway.c
r4878r4879
2727extern WRITE8_HANDLER( runaway_video_ram_w );
2828extern WRITE8_HANDLER( runaway_tile_bank_w );
2929
30static emu_timer *interrupt_timer;
3031
3132static TIMER_CALLBACK( interrupt_callback )
3233{
r4878r4879
4041   if (scanline >= 263)
4142      scanline = 16;
4243
43   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), NULL, scanline, interrupt_callback);
44   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, scanline, 0), scanline);
4445}
4546
47static MACHINE_START( runaway )
48{
49   interrupt_timer = timer_alloc(machine, interrupt_callback, NULL);
50}
4651
4752static MACHINE_RESET( runaway )
4853{
49   timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 16, 0), NULL, 16, interrupt_callback);
54   timer_adjust_oneshot(interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 16, 0), 16);
5055}
5156
5257
r4878r4879
357362   MDRV_CPU_ADD("maincpu", M6502, 12096000 / 8) /* ? */
358363   MDRV_CPU_PROGRAM_MAP(runaway_map)
359364
365   MDRV_MACHINE_START(runaway)
360366   MDRV_MACHINE_RESET(runaway)
361367
362368   MDRV_ATARIVGEAROM_ADD("earom")
r4878r4879
433439ROM_END
434440
435441
436GAME( 1982, qwak,    0, qwak,    qwak,    0, ROT270, "Atari", "Qwak (prototype)", 0 )
437GAME( 1982, runaway, 0, runaway, runaway, 0, ROT0,   "Atari", "Runaway (prototype)", 0 )
442GAME( 1982, qwak,    0, qwak,    qwak,    0, ROT270, "Atari", "Qwak (prototype)", GAME_SUPPORTS_SAVE )
443GAME( 1982, runaway, 0, runaway, runaway, 0, ROT0,   "Atari", "Runaway (prototype)", GAME_SUPPORTS_SAVE )
src/mame/drivers/toypop.c
r4878r4879
110110
111111static DRIVER_INIT( 58c_56_56 )
112112{
113   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0_coin);
114   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
115   namcoio_init(machine, 2, NAMCOIO_56XX, &intf2);
113   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0_coin, NULL);
114   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1, NULL);
115   namcoio_init(machine, 2, NAMCOIO_56XX, &intf2, NULL);
116116}
117117
118118static DRIVER_INIT( 58_56_56 )
119119{
120   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
121   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
122   namcoio_init(machine, 2, NAMCOIO_56XX, &intf2);
120   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0, NULL);
121   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1, NULL);
122   namcoio_init(machine, 2, NAMCOIO_56XX, &intf2, NULL);
123123}
124124
125125
src/mame/drivers/tumbleb.c
r4878r4879
352352static WRITE16_HANDLER( tumblepb_sound_w )
353353{
354354   soundlatch_w(space,0,data & 0xff);
355   cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
355   cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
356356}
357357#endif
358358
359359static WRITE16_HANDLER( jumppop_sound_w )
360360{
361361   soundlatch_w(space,0,data & 0xff);
362   cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE );
362   cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE );
363363}
364364
365365/******************************************************************************/
r4878r4879
750750
751751static WRITE16_HANDLER( jumpkids_sound_w )
752752{
753   soundlatch_w(space,0,data & 0xff);
754   cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE);
753   soundlatch_w(space, 0, data & 0xff);
754   cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
755755}
756756
757757
r4878r4879
835835
836836static READ8_HANDLER(jumppop_z80latch_r)
837837{
838   cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE);
838   cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
839839   return soundlatch_r(space, 0);
840840}
841841
r4878r4879
21212121
21222122static void semicom_irqhandler(const device_config *device, int irq)
21232123{
2124   cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE);
2124   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
21252125}
21262126
21272127
r4878r4879
32923292   tumblepb_patch_code(machine, 0x000132);
32933293   #endif
32943294
3295   memory_install_write16_device_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), oki, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w );
3295   memory_install_write16_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), oki, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w );
32963296
32973297}
32983298
r4878r4879
33333333static DRIVER_INIT ( bcstory )
33343334{
33353335   tumblepb_gfx1_rearrange(machine);
3336   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here??
3336   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here??
33373337}
33383338
33393339
r4878r4879
35743574
35753575   HCROM[0x1e228/2] = 0x4e75;
35763576
3577   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x140000, 0x1407ff, 0, 0, (write16_space_func)SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them
3577   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x140000, 0x1407ff, 0, 0, (write16_space_func)SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them
35783578
35793579
35803580   {
r4878r4879
36403640   DRIVER_INIT_CALL(htchctch);
36413641
36423642   /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */
3643   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w);
3643   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w);
36443644
36453645   /* slightly different banking */
3646   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, chokchok_tilebank_w);
3646   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, chokchok_tilebank_w);
36473647}
36483648
36493649static DRIVER_INIT( wlstar )
r4878r4879
36513651   DRIVER_INIT_CALL(htchctch);
36523652
36533653   /* slightly different banking */
3654   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, wlstar_tilebank_w);
3654   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, wlstar_tilebank_w);
36553655}
36563656
36573657static DRIVER_INIT ( dquizgo )
src/mame/drivers/taitogn.c
r4878r4879
10771077   TAITOGNET_BIOS
10781078
10791079   DISK_REGION( "card" )
1080   DISK_IMAGE( "chaoshea", 0, SHA1(2f211ac08675ea8ec33c7659a13951db94eaa627))
1080   DISK_IMAGE( "chaosheat", 0, SHA1(c13b7d7025eee05f1f696d108801c7bafb3f1356))
10811081ROM_END
10821082
1083ROM_START(chaoshej)
1084   TAITOGNET_BIOS
10831085
1086   DISK_REGION( "card" )
1087   DISK_IMAGE( "chaosheatj", 0, SHA1(2f211ac08675ea8ec33c7659a13951db94eaa627))
1088ROM_END
1089
1090
10841091ROM_START(flipmaze)
10851092   TAITOGNET_BIOS
10861093
r4878r4879
12361243/* it in every zip file */
12371244GAME( 1997, taitogn,  0, coh3002t, coh3002t, coh3002t, ROT0, "Sony/Taito", "Taito GNET", GAME_IS_BIOS_ROOT )
12381245
1239GAME( 1998, chaoshea, taitogn,  coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Chaos Heat (V2.08J)", 0 )
1246GAME( 1998, chaoshea, taitogn,  coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Chaos Heat (V2.09O)", 0 )
1247GAME( 1998, chaoshej, chaoshea, coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Chaos Heat (V2.08J)", 0 )
12401248GAME( 1998, raycris,  taitogn,  coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Ray Crisis (V2.03J)", 0 )
12411249GAME( 1999, spuzbobl, taitogn,  coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Super Puzzle Bobble (V2.05O)", 0 )
12421250GAME( 1999, spuzbobj, spuzbobl, coh3002t, coh3002t, coh3002t, ROT0,   "Taito", "Super Puzzle Bobble (V2.04J)", 0 )
src/mame/drivers/taito_z.c
r4878r4879
903903   /* bit 0 enables cpu B */
904904   /* however this fails when recovering from a save state
905905       if cpu B is disabled !! */
906   cpu_set_input_line(machine->cpu[2], INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE);
906   cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, (cpua_ctrl & 0x1) ? CLEAR_LINE : ASSERT_LINE);
907907
908908}
909909
910static void parse_control_noz80(running_machine *machine)
910static WRITE16_HANDLER( cpua_ctrl_w )
911911{
912   /* bit 0 enables cpu B */
913   /* however this fails when recovering from a save state
914       if cpu B is disabled !! */
915   cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, (cpua_ctrl &0x1) ? CLEAR_LINE : ASSERT_LINE);
916
917}
918
919static WRITE16_HANDLER( cpua_ctrl_w )   /* assumes Z80 sandwiched between 68Ks */
920{
921912   if ((data &0xff00) && ((data &0xff) == 0))
922913      data = data >> 8;   /* for Wgp */
923914   cpua_ctrl = data;
r4878r4879
927918   // Chase HQ: handle the lights
928919   if ((!strcmp(space->machine->gamedrv->name, "chasehq")) || (!strcmp(space->machine->gamedrv->name, "chasehqj")))
929920   {
930      output_set_lamp_value(0, (data&0x20) ? 1 : 0);
931      output_set_lamp_value(1, (data&0x40) ? 1 : 0);
921      output_set_lamp_value(0, (data & 0x20) ? 1 : 0);
922      output_set_lamp_value(1, (data & 0x40) ? 1 : 0);
932923   }
933924
934   logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(space->cpu),data);
925   logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(space->cpu), data);
935926}
936927
937static WRITE16_HANDLER( cpua_noz80_ctrl_w )   /* assumes no Z80 */
938{
939   if ((data &0xff00) && ((data &0xff) == 0))
940      data = data >> 8;   /* for Wgp */
941   cpua_ctrl = data;
942928
943   parse_control_noz80(space->machine);
944
945   logerror("CPU #0 PC %06x: write %04x to cpu control\n",cpu_get_pc(space->cpu),data);
946}
947
948
949929/***********************************************************
950930                        INTERRUPTS
951931***********************************************************/
r4878r4879
954934
955935static TIMER_CALLBACK( taitoz_interrupt6 )
956936{
957   cpu_set_input_line(machine->cpu[0],6,HOLD_LINE);
937   cputag_set_input_line(machine, "maincpu", 6, HOLD_LINE);
958938}
959939
960940/* 68000 B */
961941
962#if 0
963942static TIMER_CALLBACK( taitoz_cpub_interrupt5 )
964943{
965   cpu_set_input_line(machine->cpu[2],5,HOLD_LINE);   /* assumes Z80 sandwiched between the 68Ks */
944   cputag_set_input_line(machine, "sub", 5, HOLD_LINE);
966945}
967#endif
968946
969static TIMER_CALLBACK( taitoz_sg_cpub_interrupt5 )
970{
971   cpu_set_input_line(machine->cpu[1],5,HOLD_LINE);   /* assumes no Z80 */
972}
973
974947#if 0
975948static TIMER_CALLBACK( taitoz_cpub_interrupt6 )
976949{
977   cpu_set_input_line(machine->cpu[2],6,HOLD_LINE);   /* assumes Z80 sandwiched between the 68Ks */
950   cputag_set_input_line(machine, "sub", 6, HOLD_LINE);
978951}
979952#endif
980953
r4878r4879
13301303       Four lightgun interrupts happen before the collected coords
13311304       are moved to shared ram where CPUA can use them. */
13321305
1333   timer_set(space->machine, cpu_clocks_to_attotime(space->cpu,10000), NULL, 0, taitoz_sg_cpub_interrupt5);
1306   timer_set(space->machine, cpu_clocks_to_attotime(space->cpu,10000), NULL, 0, taitoz_cpub_interrupt5);
13341307}
13351308
13361309
r4878r4879
14071380
14081381static INT32 banknum;
14091382
1410static void reset_sound_region(running_machine *machine)   /* assumes Z80 sandwiched between 68Ks */
1383static void reset_sound_region(running_machine *machine)
14111384{
14121385   memory_set_bankptr(machine,  10, memory_region(machine, "audiocpu") + (banknum * 0x4000) + 0x10000 );
14131386}
r4878r4879
16011574   AM_RANGE(0x100000, 0x10ffff) AM_RAM
16021575   AM_RANGE(0x110000, 0x113fff) AM_RAM AM_SHARE(1)
16031576   AM_RANGE(0x400000, 0x40000f) AM_READWRITE8(TC0220IOC_r, TC0220IOC_w, 0x00ff)
1604   AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_noz80_ctrl_w)
1577   AM_RANGE(0x600000, 0x600001) AM_WRITE(cpua_ctrl_w)
16051578   AM_RANGE(0x800000, 0x800007) AM_READWRITE(bshark_stick_r, bshark_stick_w)
16061579   AM_RANGE(0xa00000, 0xa01fff) AM_RAM_WRITE(paletteram16_xBBBBBGGGGGRRRRR_word_w) AM_BASE(&paletteram16)
16071580   AM_RANGE(0xc00000, 0xc00fff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
r4878r4879
28062779**************************************************************/
28072780
28082781/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
2809static void irqhandler(const device_config *device, int irq)   // assumes Z80 sandwiched between 68Ks
2782static void irqhandler(const device_config *device, int irq)
28102783{
2811   cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE);
2784   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
28122785}
28132786
28142787/* handler called by the YM2610 emulator when the internal timers cause an IRQ */
r4878r4879
46664639
46674640static STATE_POSTLOAD( bshark_postload )
46684641{
4669   parse_control_noz80(machine);
4642   parse_control(machine);
46704643}
46714644
46724645static DRIVER_INIT( bshark )
r4878r4879
46924665GAMEL(1989, scia,     sci,      sci,      sci,      taitoz,   ROT0,               "Taito Corporation Japan", "Special Criminal Investigation (World set 2)", GAME_IMPERFECT_GRAPHICS, layout_contcirc )
46934666GAMEL(1989, scij,     sci,      sci,      scij,     taitoz,   ROT0,               "Taito Corporation", "Special Criminal Investigation (Japan)", GAME_IMPERFECT_GRAPHICS, layout_contcirc )
46944667GAMEL(1989, sciu,     sci,      sci,      sciu,     taitoz,   ROT0,               "Taito America Corporation", "Special Criminal Investigation (US)", GAME_IMPERFECT_GRAPHICS, layout_contcirc )
4695GAMEL(1991, scin,     sci,      sci,      sci,      taitoz,   ROT0,               "Taito Corporation Japan", "Special Criminal Investigation (Negro Torino hack)", GAME_IMPERFECT_GRAPHICS, layout_contcirc )
4668GAMEL(1991, scin,     sci,      sci,      sci,      taitoz,   ROT0,               "Taito Corporation Japan", "Super Special Criminal Investigation (Negro Torino hack)", GAME_IMPERFECT_GRAPHICS, layout_contcirc )
46964669GAME( 1989, nightstr, 0,        nightstr, nightstr, taitoz,   ROT0,               "Taito Corporation Japan", "Night Striker (World)", GAME_IMPERFECT_GRAPHICS )
46974670GAME( 1989, nghtstrj, nightstr, nightstr, nghtstrj, taitoz,   ROT0,               "Taito Corporation", "Night Striker (Japan)", GAME_IMPERFECT_GRAPHICS )
46984671GAME( 1989, nghtstru, nightstr, nightstr, nghtstru, taitoz,   ROT0,               "Taito America Corporation", "Night Striker (US)", GAME_IMPERFECT_GRAPHICS )
src/mame/drivers/superqix.c
r4878r4879
1212games have one 8910 + a sample player.
1313
1414Notes:
15- The 8751 ROM, sq07.108, was bad: bit 3 was stuck high. I have recovered it
16  by carefully checking the disassembly. There are probably some mistakes.
17  Note that that ROM probably came from a bootleg in the first place.
15- The sq07.108 ROM came from a bootleg where the 8751 MCU was replaced by a
16  model using external ROM. The ROM was bad (bit 3 was stuck high). It was
17  recovered by carefully checking the disassembly but there might still be
18  some mistakes.
19  The bootleg MCU code is different from the original; it was modified by the
20  bootleggers to avoid use of port 2.
1821
1922- The MCU sends some ID to the Z80 on startup, but the Z80 happily ignores it.
2023  This happens in all sets. There appears to be code that would check part of
2124  the MCU init sequence ($5973 onwards), but it doesn't seem to be called.
2225
23- sqixa might be an earlier version because there is a bug with coin lockout:
26- sqixb1 might be an earlier version because there is a bug with coin lockout:
2427  it is activated after inesrting 10 coins instead of 9. sqix doesn't have
2528  that bug and also inverts the coin lockout output.
2629
27- Note that the sqixa ROMs probably came from a bootleg board, where the 8751
28  MCU was replaced by a model using external ROM (which was bad, and manually
29  repaired). Even if it was a bootleg, at this point there is no reason to
30  believe the ROMs had been tampered with.
30- sqixb2 is a bootleg of sqixb1, with the MCU removed.
3131
32- sqixbl is a bootleg of sqixa, with the MCU removed.
33
3432- Prebillian controls: (from the Japanese flyer):
3533  - pullout plunger for shot power (there's no on-screen power indicator in the game)
3634  - dial for aiming
r4878r4879
193191
194192**************************************************************************/
195193
196static UINT8 port1, port3, port3_latch, from_mcu, from_z80, portb;
194static UINT8 port1, port2, port3, port3_latch, from_mcu, from_z80, portb;
197195static int from_mcu_pending, from_z80_pending, invert_coin_lockout;
198196
199197static READ8_DEVICE_HANDLER( in4_mcu_r )
r4878r4879
227225   portb = data;
228226}
229227
230static WRITE8_HANDLER( mcu_p1_w )
228static WRITE8_HANDLER( bootleg_mcu_p1_w )
231229{
232230   switch ((data & 0x0e) >> 1)
233231   {
r4878r4879
268266   }
269267}
270268
271static READ8_HANDLER( mcu_p3_r )
269static WRITE8_HANDLER( mcu_p3_w )
272270{
271   port3 = data;
272}
273
274static READ8_HANDLER( bootleg_mcu_p3_r )
275{
273276   if ((port1 & 0x10) == 0)
274277   {
275278      return input_port_read(space->machine, "DSW1");
r4878r4879
287290   return 0;
288291}
289292
290static WRITE8_HANDLER( mcu_p3_w )
293static READ8_HANDLER( sqixu_mcu_p0_r )
291294{
292   port3 = data;
295   return input_port_read(space->machine, "SYSTEM") | (from_mcu_pending << 6) | (from_z80_pending << 7);
293296}
294297
298static WRITE8_HANDLER( sqixu_mcu_p2_w )
299{
300   // bit 0 = unknown (clocked often)
295301
302   // bit 1 = coin cointer 1
303   coin_counter_w(0,data & 2);
304
305   // bit 2 = coin counter 2
306   coin_counter_w(1,data & 4);
307
308   // bit 3 = coin lockout
309   coin_lockout_global_w(~data & 8);
310
311   // bit 4 = flip screen
312   flip_screen_set(space->machine, data & 0x10);
313
314   // bit 5 = unknown (set on startup)
315
316   // bit 6 = unknown
317   if ((data & 0x40) == 0)
318      from_mcu_pending = 0;   // ????
319
320   // bit 7 = clock latch from port 3 to Z80
321   if ((port2 & 0x80) != 0 && (data & 0x80) == 0)
322   {
323//              logerror("%04x: MCU -> Z80 %02x\n",cpu_get_pc(space->cpu),port3);
324      from_mcu = port3;
325      from_mcu_pending = 1;
326      from_z80_pending = 0;   // ????
327   }
328
329   port2 = data;
330}
331
332static READ8_HANDLER( sqixu_mcu_p3_r )
333{
334//      logerror("%04x: read Z80 command %02x\n",cpu_get_pc(space->cpu),from_z80);
335   from_z80_pending = 0;
336   return from_z80;
337}
338
339
296340static READ8_HANDLER( nmi_ack_r )
297341{
298342   cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
r4878r4879
499543   state_save_register_global(machine, from_mcu_pending);
500544   state_save_register_global(machine, from_z80_pending);
501545   state_save_register_global(machine, port1);
546   state_save_register_global(machine, port2);
502547   state_save_register_global(machine, port3);
503548   state_save_register_global(machine, port3_latch);
504549   state_save_register_global(machine, from_mcu);
r4878r4879
602647
603648/* I8751 memory handlers */
604649
605static ADDRESS_MAP_START( mcu_io_map, ADDRESS_SPACE_IO, 8 )
606   AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_WRITE(mcu_p1_w)
607   AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(mcu_p3_r, mcu_p3_w)
650static ADDRESS_MAP_START( bootleg_mcu_io_map, ADDRESS_SPACE_IO, 8 )
651   AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_WRITE(bootleg_mcu_p1_w)
652   AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(bootleg_mcu_p3_r, mcu_p3_w)
608653ADDRESS_MAP_END
609654
655static ADDRESS_MAP_START( sqixu_mcu_io_map, ADDRESS_SPACE_IO, 8 )
656   AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P0) AM_READ(sqixu_mcu_p0_r)
657   AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READ_PORT("DSW1")
658   AM_RANGE(MCS51_PORT_P2, MCS51_PORT_P2) AM_WRITE(sqixu_mcu_p2_w)
659   AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(sqixu_mcu_p3_r, mcu_p3_w)
660ADDRESS_MAP_END
610661
611662
663
612664static INPUT_PORTS_START( pbillian )
613665   PORT_START("DSW1")
614666   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )
r4878r4879
10541106   MDRV_CPU_VBLANK_INT_HACK(sqix_interrupt,6)   /* ??? */
10551107
10561108   MDRV_CPU_ADD("mcu", I8751, 12000000/3)   /* ??? */
1057   MDRV_CPU_IO_MAP(mcu_io_map)
1109   MDRV_CPU_IO_MAP(bootleg_mcu_io_map)
10581110
10591111   MDRV_QUANTUM_TIME(HZ(30000))
10601112
r4878r4879
10871139MACHINE_DRIVER_END
10881140
10891141
1142static MACHINE_DRIVER_START( sqixu )
1143   MDRV_IMPORT_FROM( sqix )
1144
1145   MDRV_CPU_MODIFY("mcu")
1146   MDRV_CPU_IO_MAP(sqixu_mcu_io_map)
1147MACHINE_DRIVER_END
1148
1149
10901150static MACHINE_DRIVER_START( sqixbl )
10911151
10921152   /* basic machine hardware */
r4878r4879
11661226
11671227ROM_START( sqix )
11681228   ROM_REGION( 0x20000, "maincpu", 0 )
1169   ROM_LOAD( "b03-01-1",     0x00000, 0x08000, CRC(ad614117) SHA1(c461f00a2aecde1bc3860c15a3c31091b14665a2) )
1170   ROM_LOAD( "b03-02",       0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
1229   ROM_LOAD( "b03-01-2.f3",   0x00000, 0x08000, CRC(5ded636b) SHA1(827954001b4617b3bd439be75094d8dca06ea32b) )
1230   ROM_LOAD( "b03-02.h3",     0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
11711231
11721232   ROM_REGION( 0x1000, "mcu", 0 )   /* I8751 code */
1173   ROM_LOAD( "sq07.108",     0x00000, 0x1000, BAD_DUMP CRC(8be4d2a8) SHA1(a0c72cd87b2cddc67070b0a533fca111dbb9a984) )   // from sqixa
1233   ROM_LOAD( "b03-03.l2",    0x00000, 0x1000, NO_DUMP ) /* Original Taito ID code for this set's MCU */
1234   /* sq07.108 is from the sqixb1 set, it will be removed once the actual MCU code from b03-03.l2 is decapped / dumped */
1235   ROM_LOAD( "sq07.108",     0x00000, 0x1000, BAD_DUMP CRC(d11411fb) SHA1(31183f433596c4d2503c01f6dc8d91024f2cf5de) )
11741236
11751237   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
1176   ROM_LOAD( "b03-04",       0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
1238   ROM_LOAD( "b03-04.s8",    0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
11771239
11781240   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
1179   ROM_LOAD( "b03-03",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) )
1180   ROM_LOAD( "b03-06",       0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) )
1241   ROM_LOAD( "sq-iu3.p8",    0x00000, 0x20000, CRC(b8d0c493) SHA1(ef5d62ef3835c7ae088a7aa98945f747130fe0ec) ) /* Sharp LH231041 28 pin 128K x 8bit mask rom */
11811242
11821243   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE )
1183   ROM_LOAD( "b03-05",       0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
1244   ROM_LOAD( "b03-05.t8",    0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
11841245ROM_END
11851246
1247ROM_START( sqixr1 )
1248   ROM_REGION( 0x20000, "maincpu", 0 )
1249   ROM_LOAD( "b03-01-1.f3",   0x00000, 0x08000, CRC(ad614117) SHA1(c461f00a2aecde1bc3860c15a3c31091b14665a2) )
1250   ROM_LOAD( "b03-02.h3",     0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
1251
1252   ROM_REGION( 0x1000, "mcu", 0 )   /* I8751 code */
1253   ROM_LOAD( "b03-03.l2",    0x00000, 0x1000, NO_DUMP ) /* Original Taito ID code for this set's MCU */
1254   /* sq07.108 is from the sqixb1 set, it will be removed once the actual MCU code from b03-03.l2 is decapped / dumped */
1255   ROM_LOAD( "sq07.108",     0x00000, 0x1000, BAD_DUMP CRC(d11411fb) SHA1(31183f433596c4d2503c01f6dc8d91024f2cf5de) )
1256
1257   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
1258   ROM_LOAD( "b03-04.s8",    0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
1259
1260   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
1261   ROM_LOAD( "sq-iu3.p8",    0x00000, 0x20000, CRC(b8d0c493) SHA1(ef5d62ef3835c7ae088a7aa98945f747130fe0ec) ) /* Sharp LH231041 28 pin 128K x 8bit mask rom */
1262
1263   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE )
1264   ROM_LOAD( "b03-05.t8",    0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
1265ROM_END
1266
11861267ROM_START( sqixu )
11871268   ROM_REGION( 0x20000, "maincpu", 0 )
1188   ROM_LOAD( "b03-06.f3",     0x00000, 0x08000, CRC(4f59f7af) SHA1(6ea627ea8505cf8d1a5a1350258180c61fbd1ed9) )
1189   ROM_LOAD( "b03-07.h3",     0x10000, 0x10000, CRC(4c417d4a) SHA1(de46551da1b27312dca40240a210e77595cf9dbd) )
1269   ROM_LOAD( "b03-06.f3",    0x00000, 0x08000, CRC(4f59f7af) SHA1(6ea627ea8505cf8d1a5a1350258180c61fbd1ed9) )
1270   ROM_LOAD( "b03-07.h3",    0x10000, 0x10000, CRC(4c417d4a) SHA1(de46551da1b27312dca40240a210e77595cf9dbd) )
11901271
11911272   ROM_REGION( 0x1000, "mcu", 0 )   /* I8751 code */
1192   ROM_LOAD( "b03-08",    0x00000, 0x1000, BAD_DUMP CRC(8be4d2a8) SHA1(a0c72cd87b2cddc67070b0a533fca111dbb9a984) )   // from sqixa
1273   ROM_LOAD( "b03-08.l2",    0x00000, 0x01000, CRC(7c338c0f) SHA1(b91468c881641f807067835b2dd490cd3e3c577e) )
11931274
11941275   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
1195   ROM_LOAD( "b03-04",       0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
1276   ROM_LOAD( "b03-04.s8",    0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
11961277
11971278   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
1198   ROM_LOAD( "b03-03",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) )
1199   ROM_LOAD( "b03-06",       0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) )
1279   ROM_LOAD( "sq-iu3.p8",    0x00000, 0x20000, CRC(b8d0c493) SHA1(ef5d62ef3835c7ae088a7aa98945f747130fe0ec) ) /* Sharp LH231041 28 pin 128K x 8bit mask rom */
12001280
12011281   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE )
12021282   ROM_LOAD( "b03-09.t8",    0x00000, 0x10000, CRC(69d2a84a) SHA1(b461d8a01f73c6aaa4aac85602c688c111bdca5d) )
12031283ROM_END
12041284
1205/* this was probably a bootleg */
1206ROM_START( sqixa )
1285ROM_START( sqixb1 ) /* this was probably a bootleg */
12071286   ROM_REGION( 0x20000, "maincpu", 0 )
1208   ROM_LOAD( "sq01.97",      0x00000, 0x08000, CRC(0888b7de) SHA1(de3e4637436de185f43d2ad4186d4cfdcd4d33d9) )
1209   ROM_LOAD( "b03-02",       0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
1287   ROM_LOAD( "sq01.97",       0x00000, 0x08000, CRC(0888b7de) SHA1(de3e4637436de185f43d2ad4186d4cfdcd4d33d9) )
1288   ROM_LOAD( "b03-02.h3",     0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
12101289
12111290   ROM_REGION( 0x10000, "mcu", 0 )   /* I8751 code */
1212   ROM_LOAD( "sq07.108",     0x00000, 0x1000, BAD_DUMP CRC(8be4d2a8) SHA1(a0c72cd87b2cddc67070b0a533fca111dbb9a984) )
1291   ROM_LOAD( "sq07.108",     0x00000, 0x1000, BAD_DUMP CRC(d11411fb) SHA1(31183f433596c4d2503c01f6dc8d91024f2cf5de) )
12131292
12141293   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
1215   ROM_LOAD( "b03-04",       0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
1294   ROM_LOAD( "b03-04.s8",    0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
12161295
12171296   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
1218   ROM_LOAD( "b03-03",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) )
1219   ROM_LOAD( "b03-06",       0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) )
1297   ROM_LOAD( "b03-03",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) ) /* 1st half of sq-iu3.p8 */
1298   ROM_LOAD( "b03-06",       0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) ) /* 2nd half of sq-iu3.p8 */
12201299
12211300   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE )
1222   ROM_LOAD( "b03-05",       0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
1301   ROM_LOAD( "b03-05.t8",    0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
12231302ROM_END
12241303
1225ROM_START( sqixbl )
1304ROM_START( sqixb2 )
12261305   ROM_REGION( 0x20000, "maincpu", 0 )
1227   ROM_LOAD( "cpu.2",        0x00000, 0x08000, CRC(682e28e3) SHA1(fe9221d26d7397be5a0fc8fdc51672b5924f3cf2) )
1228   ROM_LOAD( "b03-02",       0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
1306   ROM_LOAD( "cpu.2",         0x00000, 0x08000, CRC(682e28e3) SHA1(fe9221d26d7397be5a0fc8fdc51672b5924f3cf2) )
1307   ROM_LOAD( "b03-02.h3",     0x10000, 0x10000, CRC(9c23cb64) SHA1(7e04cb18cabdc0031621162cbc228cd95875a022) )
12291308
12301309   ROM_REGION( 0x08000, "gfx1", ROMREGION_DISPOSE )
1231   ROM_LOAD( "b03-04",       0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
1310   ROM_LOAD( "b03-04.s8",    0x00000, 0x08000, CRC(f815ef45) SHA1(4189d455b6ccf3ae922d410fb624c4665203febf) )
12321311
12331312   ROM_REGION( 0x20000, "gfx2", ROMREGION_DISPOSE )
1234   ROM_LOAD( "b03-03",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) )
1235   ROM_LOAD( "b03-06",       0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) )
1313   ROM_LOAD( "b03-03",       0x00000, 0x10000, CRC(6e8b6a67) SHA1(c71117cc880a124c46397c446d1edc1cbf681200) ) /* 1st half of sq-iu3.p8 */
1314   ROM_LOAD( "b03-06",       0x10000, 0x10000, CRC(38154517) SHA1(703ad4cfe54a4786c67aedcca5998b57f39fd857) ) /* 2nd half of sq-iu3.p8 */
12361315
12371316   ROM_REGION( 0x10000, "gfx3", ROMREGION_DISPOSE )
1238   ROM_LOAD( "b03-05",       0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
1317   ROM_LOAD( "b03-05.t8",    0x00000, 0x10000, CRC(df326540) SHA1(1fe025edcd38202e24c4e1005f478b6a88533453) )
12391318ROM_END
12401319
12411320ROM_START( perestrf )
r4878r4879
13561435
13571436GAME( 1986, pbillian, 0,        pbillian, pbillian, pbillian, ROT0,  "Taito", "Prebillian", GAME_SUPPORTS_SAVE )
13581437GAME( 1987, hotsmash, 0,        hotsmash, hotsmash, hotsmash, ROT90, "Taito", "Vs. Hot Smash", GAME_SUPPORTS_SAVE )
1359GAME( 1987, sqix,     0,        sqix,     superqix, sqix,     ROT90, "Taito", "Super Qix (set 1)", GAME_SUPPORTS_SAVE )
1360GAME( 1987, sqixa,    sqix,     sqix,     superqix, sqixa,    ROT90, "Taito", "Super Qix (set 2)", GAME_SUPPORTS_SAVE )
1361GAME( 1987, sqixu,    sqix,     sqix,     superqix, sqix,     ROT90, "Taito (Romstar License)", "Super Qix (US)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) // different MCU?
1362GAME( 1987, sqixbl,   sqix,     sqixbl,   superqix, 0,        ROT90, "bootleg", "Super Qix (bootleg)", GAME_SUPPORTS_SAVE )
1438GAME( 1987, sqix,     0,        sqix,     superqix, sqix,     ROT90, "Taito", "Super Qix (World, Rev 2)", GAME_SUPPORTS_SAVE )
1439GAME( 1987, sqixr1,   sqix,     sqix,     superqix, sqixa,    ROT90, "Taito", "Super Qix (World, Rev 1)", GAME_SUPPORTS_SAVE )
1440GAME( 1987, sqixu,    sqix,     sqixu,    superqix, 0,        ROT90, "Taito (Romstar License)", "Super Qix (US)", GAME_SUPPORTS_SAVE )
1441GAME( 1987, sqixb1,   sqix,     sqix,     superqix, sqixa,    ROT90, "bootleg", "Super Qix (bootleg set 1)", GAME_SUPPORTS_SAVE )
1442GAME( 1987, sqixb2,   sqix,     sqixbl,   superqix, 0,        ROT90, "bootleg", "Super Qix (bootleg set 2)", GAME_SUPPORTS_SAVE )
13631443GAME( 1994, perestro, 0,        sqixbl,   superqix, perestro, ROT90, "Promat", "Perestroika Girls", GAME_SUPPORTS_SAVE )
13641444GAME( 1993, perestrf, perestro, sqixbl,   superqix, perestro, ROT90, "Promat (Fuuki license)", "Perestroika Girls (Fuuki license)", GAME_SUPPORTS_SAVE )
src/mame/drivers/mappy.c
r4878r4879
651651
652652static DRIVER_INIT( 56_56 )
653653{
654   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0);
655   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
654   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0, NULL);
655   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1, NULL);
656656}
657657
658658static DRIVER_INIT( 58_56i )
659659{
660   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
661   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1_interleave);
660   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0, NULL);
661   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1_interleave, NULL);
662662}
663663
664664static DRIVER_INIT( 56out_56 )
665665{
666   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps);
667   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
666   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps, NULL);
667   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1, NULL);
668668}
669669
670670static DRIVER_INIT( 56out_59 )
671671{
672   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps);
673   namcoio_init(machine, 1, NAMCOIO_59XX, &intf1);
672   namcoio_init(machine, 0, NAMCOIO_56XX, &intf0_lamps, NULL);
673   namcoio_init(machine, 1, NAMCOIO_59XX, &intf1, NULL);
674674}
675675
676676static DRIVER_INIT( 58_58 )
677677{
678   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
679   namcoio_init(machine, 1, NAMCOIO_58XX, &intf1);
678   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0, NULL);
679   namcoio_init(machine, 1, NAMCOIO_58XX, &intf1, NULL);
680680}
681681
682682static DRIVER_INIT( 58_56 )
683683{
684   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0);
685   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1);
684   namcoio_init(machine, 0, NAMCOIO_58XX, &intf0, NULL);
685   namcoio_init(machine, 1, NAMCOIO_56XX, &intf1, NULL);
686686}
687687
688688/***************************************************************************/
src/mame/drivers/tigeroad.c
r4878r4879
283283   PORT_DIPSETTING(      0x2000, DEF_STR( Very_Easy) )
284284   PORT_DIPSETTING(      0x4000, DEF_STR( Easy ) )
285285   PORT_DIPSETTING(      0x6000, DEF_STR( Normal ) )
286   PORT_DIPSETTING(      0x0000, "Difficult" )
286   PORT_DIPSETTING(      0x0000, DEF_STR( Difficult ) )
287287   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Allow_Continue ) )
288288   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
289289   PORT_DIPSETTING(      0x8000, DEF_STR( Yes ) )
r4878r4879
359359   PORT_DIPNAME( 0x6000, 0x6000, DEF_STR( Difficulty ) )
360360   PORT_DIPSETTING(      0x4000, DEF_STR( Easy ) )
361361   PORT_DIPSETTING(      0x6000, DEF_STR( Normal ) )
362   PORT_DIPSETTING(      0x2000, "Difficult" )
363   PORT_DIPSETTING(      0x0000, "Very Difficult" )
362   PORT_DIPSETTING(      0x2000, DEF_STR( Difficult ) )
363   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Difficult ) )
364364   PORT_DIPNAME( 0x8000, 0x8000, DEF_STR( Allow_Continue ) )
365365   PORT_DIPSETTING(      0x0000, DEF_STR( No ) )
366366   PORT_DIPSETTING(      0x8000, DEF_STR( Yes ) )
r4878r4879
434434   PORT_DIPSETTING(      0x0000, "20" )
435435   PORT_DIPNAME( 0x2000, 0x2000, DEF_STR( Difficulty ) )
436436   PORT_DIPSETTING(      0x2000, DEF_STR( Normal ) )
437   PORT_DIPSETTING(      0x0000, "Difficult" )
437   PORT_DIPSETTING(      0x0000, DEF_STR( Difficult ) )
438438   PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Version ) )
439439   PORT_DIPSETTING(      0x0000, DEF_STR( International ) )
440440   PORT_DIPSETTING(      0x4000, DEF_STR( Japan ) )
src/mame/drivers/aristmk5.c
r4878r4879
9393   ROM_LOAD32_WORD( "indiandr.u12", 0x100002, 0x80000, CRC(4bbe67f6) SHA1(928f88387da66697f1de54f086531f600f80a15e) )
9494ROM_END
9595
96ROM_START( goldprmd )
97   ROM_REGION( 0x800000, "maincpu", 0 ) /* ARM Code */
98   ROM_LOAD32_WORD( "goldprmd.u7",  0x000000, 0x80000, CRC(2fbed80c) SHA1(fb0d97cb2be96da37c487fc3aef06c6120efdb46) )
99   ROM_LOAD32_WORD( "goldprmd.u11", 0x000002, 0x80000, CRC(ec9c183c) SHA1(e405082ee779c4fee103fb7384469c9d6afbc95b) )
100   ROM_LOAD32_WORD( "goldprmd.u8",  0x100000, 0x80000, CRC(3cd7d8e5) SHA1(ae83a7c335564c398330d43295997b8ca547c92d) )
101   ROM_LOAD32_WORD( "goldprmd.u12", 0x100002, 0x80000, CRC(8bbf45d0) SHA1(f58f28e7cc4ac225197959566d81973b5aa0e836) )
102ROM_END
103
104ROM_START( qotn )
105   ROM_REGION( 0x800000, "maincpu", 0 ) /* ARM Code */
106   ROM_LOAD32_WORD( "0200439v.u7",  0x000000, 0x80000, CRC(d476a893) SHA1(186d6fb1830c33976f2d3c96e4f045ece885dc63) )
107   ROM_LOAD32_WORD( "0200439v.u11", 0x000002, 0x80000, CRC(8b0d7205) SHA1(ffa03f1c9332a1a7443eb91b0ded56e7cd9e3cee) )
108   ROM_LOAD32_WORD( "0200439v.u8",  0x100000, 0x80000, CRC(9b996ef1) SHA1(72489e9a0ee5c34f7cad3d121bcd08e09ef72360) )
109   ROM_LOAD32_WORD( "0200439v.u12", 0x100002, 0x80000, CRC(2a0f7feb) SHA1(27c89dadf759e6c892121650758c44ec50990cb6) )
110ROM_END
111
96112ROM_START( swthrt2v )
97113   ROM_REGION( 0x800000, "maincpu", 0 ) /* ARM Code */
98114   ROM_LOAD32_WORD( "swthrt2v.u7",  0x000000, 0x80000, CRC(f51b2faa) SHA1(dbcfdbee92af5f89a8a2611bbc687ee0cc907642) )
99115   ROM_LOAD32_WORD( "swthrt2v.u11", 0x000002, 0x80000, CRC(bd7ead91) SHA1(9f775428a4aa0b0a8ee17aed9be620edc2020c5e) )
100116ROM_END
101117
118ROM_START( enchfrst )
119   ROM_REGION( 0x800000, "maincpu", 0 ) /* ARM Code */
120   ROM_LOAD32_WORD( "0400122v.u7",  0x000000, 0x80000, CRC(b5829b27) SHA1(f6f84c8dc524dcee95e37b93ead9090903bdca4f) )
121   ROM_LOAD32_WORD( "0400122v.u11", 0x000002, 0x80000, CRC(7a97adc8) SHA1(b52f7fdc7edf9ad92351154c01b8003c0576ed94) )
122ROM_END
123
102124ROM_START( margmgc )
103125   ROM_REGION( 0x800000, "maincpu", 0 ) /* ARM Code */
104126   ROM_LOAD32_WORD( "margmgc.u7",  0x000000, 0x80000, CRC(eee7ebaf) SHA1(bad0c08578877f84325c07d51c6ed76c40b70720) )
r4878r4879
127149
128150
129151GAME( 1995, swthrt2v, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Sweet Hearts II (C - 07/09/95, Venezuela version)", GAME_NOT_WORKING|GAME_NO_SOUND )
152GAME( 1995, enchfrst, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Enchanted Forest (E - 23/06/95, Local)", GAME_NOT_WORKING|GAME_NO_SOUND )
153GAME( 1997, goldprmd, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Golden Pyramids (B - 13-05-97, USA)", GAME_NOT_WORKING|GAME_NO_SOUND )
154GAME( 1997, qotn,     0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Queen of the Nile (B - 13-05-97, NSW/ACT)", GAME_NOT_WORKING|GAME_NO_SOUND )
130155GAME( 1997, dmdtouch, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Diamond Touch (E - 30-06-97, Local)", GAME_NOT_WORKING|GAME_NO_SOUND )
131156GAME( 1998, adonis,   0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Adonis (A - 25-05-98, NSW/ACT)", GAME_NOT_WORKING|GAME_NO_SOUND )
132157GAME( 1998, reelrock, 0, aristmk5, aristmk5, aristmk5, ROT0,  "Aristocrat", "Reelin-n-Rockin (A - 13/07/98, Local)", GAME_NOT_WORKING|GAME_NO_SOUND )
src/mame/drivers/boogwing.c
r4878r4879
109109   AM_RANGE(0x24e344, 0x24e345) AM_READ_PORT("INPUTS")
110110   AM_RANGE(0x24e000, 0x24e7ff) AM_WRITE(deco16_104_prot_w) AM_BASE(&deco16_prot_ram)
111111
112   AM_RANGE(0x260000, 0x26000f) AM_WRITE(SMH_RAM) AM_BASE(&deco16_pf12_control)
112   AM_RANGE(0x260000, 0x26000f) AM_WRITEONLY AM_BASE(&deco16_pf12_control)
113113   AM_RANGE(0x264000, 0x265fff) AM_RAM_WRITE(deco16_pf1_data_w) AM_BASE(&deco16_pf1_data)
114114   AM_RANGE(0x266000, 0x267fff) AM_RAM_WRITE(deco16_pf2_data_w) AM_BASE(&deco16_pf2_data)
115115   AM_RANGE(0x268000, 0x268fff) AM_RAM AM_BASE(&deco16_pf1_rowscroll)
116116   AM_RANGE(0x26a000, 0x26afff) AM_RAM AM_BASE(&deco16_pf2_rowscroll)
117117
118   AM_RANGE(0x270000, 0x27000f) AM_WRITE(SMH_RAM) AM_BASE(&deco16_pf34_control)
118   AM_RANGE(0x270000, 0x27000f) AM_WRITEONLY AM_BASE(&deco16_pf34_control)
119119   AM_RANGE(0x274000, 0x275fff) AM_RAM_WRITE(deco16_pf3_data_w) AM_BASE(&deco16_pf3_data)
120120   AM_RANGE(0x276000, 0x277fff) AM_RAM_WRITE(deco16_pf4_data_w) AM_BASE(&deco16_pf4_data)
121121   AM_RANGE(0x278000, 0x278fff) AM_RAM AM_BASE(&deco16_pf3_rowscroll)
r4878r4879
137137   AM_RANGE(0x120000, 0x120001) AM_DEVREADWRITE("oki1", okim6295_r, okim6295_w)
138138   AM_RANGE(0x130000, 0x130001) AM_DEVREADWRITE("oki2", okim6295_r, okim6295_w)
139139   AM_RANGE(0x140000, 0x140001) AM_READ(soundlatch_r)
140   AM_RANGE(0x1f0000, 0x1f1fff) AM_READWRITE(SMH_BANK(8), SMH_BANK(8))
140   AM_RANGE(0x1f0000, 0x1f1fff) AM_RAMBANK(8)
141141   AM_RANGE(0x1fec00, 0x1fec01) AM_WRITE(h6280_timer_w)
142142   AM_RANGE(0x1ff400, 0x1ff403) AM_WRITE(h6280_irq_status_w)
143143ADDRESS_MAP_END
src/mame/drivers/bishjan.c
r4878r4879
394394   AM_RANGE( 0x437000, 0x4371ff ) AM_WRITE( bishjan_scrollram_1_hi_lo_word_w )
395395
396396
397   AM_RANGE( 0x600000, 0x600001 ) AM_READWRITE( SMH_NOP, bishjan_sel_w )
397   AM_RANGE( 0x600000, 0x600001 ) AM_READNOP AM_WRITE( bishjan_sel_w )
398398   AM_RANGE( 0x600060, 0x600063 ) AM_WRITE( colordac_word_w )
399399   AM_RANGE( 0x6000a0, 0x6000a1 ) AM_WRITE( bishjan_byte_lo_msb_w )
400400
src/mame/drivers/mirax.c
r4878r4879
145145   16,16,
146146   RGN_FRAC(1,3),
147147   3,
148   { 0,RGN_FRAC(1,3),RGN_FRAC(2,3)},
148   { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3)},
149149   { 0, 1, 2, 3, 4, 5, 6, 7 ,
150150     0+8*8,1+8*8,2+8*8,3+8*8,4+8*8,5+8*8,6+8*8,7+8*8},
151151   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
r4878r4879
158158   8,8,
159159   RGN_FRAC(1,3),
160160   3,
161   { 0, RGN_FRAC(1,3), RGN_FRAC(2,3)},
161   { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3)},
162162   { 0, 1, 2, 3, 4, 5, 6, 7},
163163   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8},
164164   8*8
165165};
166166
167167static GFXDECODE_START( mirax )
168   GFXDECODE_ENTRY( "gfx1", 0, layout8,     0, 1 )
169   GFXDECODE_ENTRY( "gfx2", 0, layout16,    0, 1 )
170   GFXDECODE_ENTRY( "gfx3", 0, layout16,    0, 1 )
168   GFXDECODE_ENTRY( "gfx1", 0, layout8,     0, 8 )
169   GFXDECODE_ENTRY( "gfx2", 0, layout16,    0, 8 )
170   GFXDECODE_ENTRY( "gfx3", 0, layout16,    0, 8 )
171171GFXDECODE_END
172172
173173static INPUT_PORTS_START( mirax )
174174
175175INPUT_PORTS_END
176176
177
178PALETTE_INIT( mirax )
179{
180   int i;
181
182   for (i = 0;i < machine->config->total_colors;i++)
183   {
184      int bit0,bit1,bit2,r,g,b;
185
186      /* red component */
187      bit0 = (color_prom[i] >> 0) & 0x01;
188      bit1 = (color_prom[i] >> 1) & 0x01;
189      bit2 = (color_prom[i] >> 2) & 0x01;
190      r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
191      /* green component */
192      bit0 = (color_prom[i] >> 3) & 0x01;
193      bit1 = (color_prom[i] >> 4) & 0x01;
194      bit2 = (color_prom[i] >> 5) & 0x01;
195      g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
196      /* blue component */
197      bit0 = 0;
198      bit1 = (color_prom[i] >> 6) & 0x01;
199      bit2 = (color_prom[i] >> 7) & 0x01;
200      b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
201
202      palette_set_color(machine,i,MAKE_RGB(r,g,b));
203   }
204}
205
177206static MACHINE_DRIVER_START( mirax )
178207   MDRV_CPU_ADD("maincpu", Z80, 12000000) // audio cpu ?
179208   MDRV_CPU_PROGRAM_MAP(memory_map)
r4878r4879
188217   MDRV_SCREEN_SIZE(256, 256)
189218   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
190219
191   MDRV_PALETTE_LENGTH(256)
220   MDRV_PALETTE_LENGTH(0x40)
221   MDRV_PALETTE_INIT(mirax)
192222   MDRV_GFXDECODE(mirax)
193223   MDRV_VIDEO_START(mirax)
194224   MDRV_VIDEO_UPDATE(mirax)
src/mame/drivers/skykid.c
r4878r4879
332332   PORT_START("DSWB")   /* DSW B */
333333   PORT_DIPNAME( 0x80, 0x80, "Spurt Time" ) PORT_DIPLOCATION("SWB:1")
334334   PORT_DIPSETTING(    0x80, DEF_STR( Normal ) )
335   PORT_DIPSETTING(    0x00, "Difficult" )
335   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
336336   PORT_DIPNAME( 0x40, 0x40, "Level of Monster" ) PORT_DIPLOCATION("SWB:2")
337337   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
338   PORT_DIPSETTING(    0x00, "Difficult" )
338   PORT_DIPSETTING(    0x00, DEF_STR( Difficult ) )
339339   PORT_DIPNAME( 0x30, 0x30, "Starting Vitality" ) PORT_DIPLOCATION("SWB:4,3")
340340   PORT_DIPSETTING(    0x00, "160" )
341341   PORT_DIPSETTING(    0x30, "128" )
src/mame/drivers/segas16a.c
r4878r4879
165165static UINT16 *workram;
166166
167167static UINT8 video_control;
168static UINT8 mcu_control;
168169static UINT8 mj_input_num;
169170
170171static read16_space_func custom_io_r;
r4878r4879
244245 *
245246 *************************************/
246247
248static MACHINE_START( system16a )
249{
250   state_save_register_global(machine, video_control);
251   state_save_register_global(machine, mcu_control);
252   state_save_register_global(machine, mj_input_num);
253
254   state_save_register_global(machine, n7751_command);
255   state_save_register_global(machine, n7751_rom_address);
256}
257
258
247259static MACHINE_RESET( system16a )
248260{
249261   fd1094_machine_init(cputag_get_cpu(machine, "maincpu"));
r4878r4879
251263   /* if we have a fake i8751 handler, disable the actual 8751 */
252264   if (i8751_vblank_hook != NULL)
253265      timer_call_after_resynch(machine, NULL, 0, suspend_i8751);
266
267   mcu_control = 0x00;
254268}
255269
256270
r4878r4879
344358        D1 : Coin meter #2
345359        D0 : Coin meter #1
346360    */
361   const device_config *mcu = cputag_get_cpu(device->machine, "mcu");
362
347363   if (((video_control ^ data) & 0x0c) && lamp_changed_w)
348364      (*lamp_changed_w)(video_control ^ data, data);
349365   video_control = data;
366
350367   segaic16_tilemap_set_flip(device->machine, 0, data & 0x80);
351368   segaic16_sprites_set_flip(device->machine, 0, data & 0x80);
369
370   if (mcu != NULL)
371      cpu_set_input_line(mcu, MCS51_INT1_LINE, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
372
352373   segaic16_set_display_enable(device->machine, data & 0x10);
353374   set_led_status(1, data & 0x08);
354375   set_led_status(0, data & 0x04);
r4878r4879
504525 *
505526 *************************************/
506527
507static void bodyslam_i8751_sim(running_machine *machine)
528static void dumpmtmt_i8751_sim(running_machine *machine)
508529{
509530   UINT8 flag = workram[0x200/2] >> 8;
510531   UINT8 tick = workram[0x200/2] & 0xff;
r4878r4879
552573static void quartet_i8751_sim(running_machine *machine)
553574{
554575   const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);
576
555577   /* signal a VBLANK to the main CPU */
556578   cputag_set_input_line(machine, "maincpu", 4, HOLD_LINE);
557579
r4878r4879
696718   return standard_io_r(space, offset, mem_mask);
697719}
698720
721
722
699723/*************************************
700724 *
701725 *  Passing Shot custom I/O
r4878r4879
730754   return standard_io_r(space, offset, mem_mask);
731755}
732756
757
758
733759/*************************************
734760 *
735761 *  SDI custom I/O
r4878r4879
791817
792818/*************************************
793819 *
820 *  MCU I/O
821 *
822 *************************************/
823
824INLINE UINT8 maincpu_byte_r(running_machine *machine, offs_t offset)
825{
826   return memory_read_byte(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), offset);
827}
828
829
830INLINE void maincpu_byte_w(running_machine *machine, offs_t offset, UINT8 data)
831{
832   memory_write_byte(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), offset, data);
833}
834
835
836static WRITE8_HANDLER( mcu_control_w )
837{
838   const device_config *maincpu = cputag_get_cpu(space->machine, "maincpu");
839   int irqline;
840
841   cpu_set_input_line(maincpu, INPUT_LINE_RESET, (data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
842   for (irqline = 1; irqline <= 7; irqline++)
843      cpu_set_input_line(maincpu, irqline, ((~data & 7) == irqline) ? ASSERT_LINE : CLEAR_LINE);
844
845   if (data & 0x40)
846      segaic16_set_display_enable(space->machine, 1);
847
848   if ((mcu_control ^ data) & 0x40)
849      cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(10));
850
851   mcu_control = data;
852}
853
854
855static WRITE8_HANDLER( mcu_io_w )
856{
857   /*
858        1.00 0... = work RAM (accessed @ $4000+x) or I/O (accessed @ $8000+x)
859        1.00 1... = text RAM (accessed @ $8000+x)
860        1.01 1... = palette RAM
861        1.10 1... = checksum #0
862        1.11 0... = checksum #1
863        1.11 1... = checksum #2
864    */
865   switch ((mcu_control >> 3) & 7)
866   {
867      case 0:
868         if (offset >= 0x4000 && offset < 0x8000)
869            maincpu_byte_w(space->machine, 0xc70001 ^ (offset & 0x3fff), data);
870         else if (offset >= 0x8000 && offset < 0xc000)
871            maincpu_byte_w(space->machine, 0xc40001 ^ (offset & 0x3fff), data);
872         else
873            logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
874                   cpu_get_pc(space->cpu), mcu_control, offset, data);
875         break;
876
877      case 1:
878         if (offset >= 0x8000 && offset < 0x9000)
879            maincpu_byte_w(space->machine, 0x410001 ^ (offset & 0xfff), data);
880         else
881            logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
882                   cpu_get_pc(space->cpu), mcu_control, offset, data);
883         break;
884
885      case 3:
886         maincpu_byte_w(space->machine, 0x840001 ^ offset, data);
887         break;
888
889      case 5:
890      case 6:
891      case 7:
892         /* ROM */
893
894      default:
895         logerror("%03X: MCU movx write mode %02X offset %04X = %02X\n",
896                cpu_get_pc(space->cpu), mcu_control, offset, data);
897         break;
898   }
899}
900
901
902static READ8_HANDLER( mcu_io_r )
903{
904   switch ((mcu_control >> 3) & 7)
905   {
906      case 0:
907         if (offset >= 0x0000 && offset < 0x3fff)
908            return watchdog_reset_r(space, 0);      /* unsure about this one */
909         else if (offset >= 0x4000 && offset < 0x8000)
910            return maincpu_byte_r(space->machine, 0xc70001 ^ (offset & 0x3fff));
911         else if (offset >= 0x8000 && offset < 0xc000)
912            return maincpu_byte_r(space->machine, 0xc40001 ^ (offset & 0x3fff));
913         logerror("%03X: MCU movx read mode %02X offset %04X\n",
914                cpu_get_pc(space->cpu), mcu_control, offset);
915         return 0xff;
916
917      case 1:
918         if (offset >= 0x8000 && offset < 0x9000)
919            return maincpu_byte_r(space->machine, 0x410001 ^ (offset & 0xfff));
920         logerror("%03X: MCU movx read mode %02X offset %04X\n",
921                cpu_get_pc(space->cpu), mcu_control, offset);
922         return 0xff;
923
924      case 3:
925         return maincpu_byte_r(space->machine, 0x840001 ^ offset);
926
927      case 5:
928         return memory_region(space->machine, "maincpu")[0x00000 + offset];
929      case 6:
930         return memory_region(space->machine, "maincpu")[0x10000 + offset];
931      case 7:
932         return memory_region(space->machine, "maincpu")[0x20000 + offset];
933
934      default:
935         logerror("%03X: MCU movx read mode %02X offset %04X\n",
936                cpu_get_pc(space->cpu), mcu_control, offset);
937         return 0xff;
938   }
939}
940
941
942static INTERRUPT_GEN( mcu_irq_assert )
943{
944   /* toggle the INT0 line on the MCU */
945   cpu_set_input_line(device, MCS51_INT0_LINE, ASSERT_LINE);
946   cpu_set_input_line(device, MCS51_INT0_LINE, CLEAR_LINE);
947
948   /* boost interleave to ensure that the MCU can break the M68000 out of a STOP */
949   cpuexec_boost_interleave(device->machine, attotime_zero, ATTOTIME_IN_USEC(100));
950}
951
952
953
954/*************************************
955 *
794956 *  Capacitor-backed RAM
795957 *
796958 *************************************/
r4878r4879
8701032 *
8711033 *************************************/
8721034
873static ADDRESS_MAP_START( mcu_io_map, ADDRESS_SPACE_DATA, 8 )
1035static ADDRESS_MAP_START( mcu_io_map, ADDRESS_SPACE_IO, 8 )
8741036   ADDRESS_MAP_UNMAP_HIGH
1037   AM_RANGE(0x0000, 0xffff) AM_READWRITE(mcu_io_r, mcu_io_w)
1038   AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READNOP AM_WRITE(mcu_control_w)
1039   AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READNOP   /* read during jb int0 */
8751040ADDRESS_MAP_END
8761041
8771042
r4878r4879
11701335   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
11711336   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
11721337   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
1338   PORT_DIPNAME( 0x0c, 0x0c, "Timer Speed" ) PORT_DIPLOCATION("SW2:3,4")
1339   PORT_DIPSETTING(    0x0c, "Slowest" )
1340   PORT_DIPSETTING(    0x08, "Slow" )
1341   PORT_DIPSETTING(    0x04, "Fast" )
1342   PORT_DIPSETTING(    0x00, "Fastest" )
1343   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,8")
1344   PORT_DIPSETTING(    0x80, DEF_STR( Easy ) )
1345   PORT_DIPSETTING(    0xc0, DEF_STR( Normal ) )
1346   PORT_DIPSETTING(    0x40, DEF_STR( Hard ) )
1347   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
11731348INPUT_PORTS_END
11741349
11751350
r4878r4879
17531928
17541929   MDRV_I8243_ADD("n7751_8243", NULL, n7751_rom_offset_w)
17551930
1931   MDRV_MACHINE_START(system16a)
17561932   MDRV_MACHINE_RESET(system16a)
17571933   MDRV_NVRAM_HANDLER(system16a)
17581934
r4878r4879
18001976
18011977   MDRV_CPU_ADD("mcu", I8751, 8000000)
18021978   MDRV_CPU_IO_MAP(mcu_io_map)
1803   MDRV_CPU_VBLANK_INT("screen", irq0_line_pulse)
1979   MDRV_CPU_VBLANK_INT("screen", mcu_irq_assert)
18041980MACHINE_DRIVER_END
18051981
18061982
r4878r4879
18672043 **************************************************************************************************************************
18682044 **************************************************************************************************************************
18692045    Action Fighter, Sega System 16A
1870    CPU: FD1089A 317-0018
2046    CPU: FD1089A 317-0018?@(dedicated cabinet version uses 317-0014)
18712047 */
18722048ROM_START( afighter )
18732049   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
r4878r4879
21832359   ROM_LOAD( "epr-10031.c3", 0x10000, 0x8000, CRC(ea3c4472) SHA1(ad8eac2d3d14fd6aba713f4d624861c17aabf757) )
21842360   ROM_LOAD( "epr-10032.c4", 0x18000, 0x8000, CRC(0aabebce) SHA1(fab12df8f4eab270be491c6c025d832c338e1e83) )
21852361
2186   ROM_REGION( 0x10000, "mcu", 0 )   /* Intel i8751 protection MCU */
2187   ROM_LOAD( "317-0015.mcu", 0x00000, 0x1000, NO_DUMP )
2362   ROM_REGION( 0x1000, "mcu", 0 )   /* Intel i8751 protection MCU */
2363   ROM_LOAD( "317-0015.bin", 0x0000, 0x1000, CRC(833869e2) SHA1(2675fda669351e958be28ca28de276abb2bbc99a) )
21882364ROM_END
21892365
21902366/**************************************************************************************************************************
21912367    Dump Matsumoto, pre-System 16
21922368    CPU: 68000
2193    i8751 317-00xx (unknown)
2369    i8751 317-0011A
21942370 */
21952371ROM_START( dumpmtmt )
21962372   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
r4878r4879
22282404   ROM_LOAD( "epr-7713.c3", 0x10000, 0x8000, CRC(33f292e7) SHA1(4358cd3922a0dcbf109d2d697c7b8c4e090c3d52) )
22292405   ROM_LOAD( "epr-7714.c4", 0x18000, 0x8000, CRC(8fd48c47) SHA1(1cba63a9e7e0b477683b7758d124f4949558ba7a) )
22302406
2231   ROM_REGION( 0x10000, "mcu", 0 )   /* protection MCU */
2407   ROM_REGION( 0x1000, "mcu", 0 )   /* protection MCU */
22322408   ROM_LOAD( "317-00xx.mcu", 0x00000, 0x1000, NO_DUMP )
22332409ROM_END
22342410
r4878r4879
23002476 **************************************************************************************************************************
23012477 **************************************************************************************************************************
23022478    Major League, pre-System 16
2303    CPU: 68000
2479    CPU: 68000 (version uses i8751(315-5158C) known to be exist)
23042480 */
23052481ROM_START( mjleague )
23062482   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
r4878r4879
24312607   ROM_LOAD( "epr-7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
24322608   ROM_LOAD( "epr-7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
24332609
2434   ROM_REGION( 0x10000, "mcu", 0 )   /* Intel i8751 protection MCU */
2610   ROM_REGION( 0x1000, "mcu", 0 )   /* Intel i8751 protection MCU */
24352611   ROM_LOAD( "315-5194.mcu", 0x00000, 0x1000, NO_DUMP )
24362612
24372613   ROM_REGION( 0x0500, "plds", ROMREGION_DISPOSE )
r4878r4879
24812657   ROM_LOAD( "epr-7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
24822658   ROM_LOAD( "epr-7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
24832659
2484   ROM_REGION( 0x10000, "mcu", 0 )   /* Intel i8751 protection MCU */
2660   ROM_REGION( 0x1000, "mcu", 0 )   /* Intel i8751 protection MCU */
24852661   ROM_LOAD( "315-5194.mcu", 0x00000, 0x1000, NO_DUMP )
24862662
24872663   ROM_REGION( 0x0500, "plds", ROMREGION_DISPOSE )
r4878r4879
25372713   ROM_LOAD( "epr-7474.3c", 0x10000, 0x8000, CRC(dbf853b8) SHA1(e82f497e1144f23f3233b5c45ef182bfc7923715) )
25382714   ROM_LOAD( "epr-7476.4c", 0x18000, 0x8000, CRC(5eba655a) SHA1(6713ef12037cba3139d0f469c82bd90b44bae8ce) )
25392715
2540   ROM_REGION( 0x10000, "mcu", 0 )   /* Intel i8751 protection MCU */
2541   ROM_LOAD( "317-0010.mcu", 0x00000, 0x1000, NO_DUMP )
2716   ROM_REGION( 0x1000, "mcu", 0 )   /* Intel i8751 protection MCU */
2717   ROM_LOAD( "317-0010.bin", 0x00000, 0x1000, CRC(8c2033ea) SHA1(4a60d141517a5d5d065f40f71be4d2ee3be18384) )
25422718ROM_END
25432719
25442720/**************************************************************************************************************************
r4878r4879
27142890   ROM_LOAD( "b9", 0x0000, 0x8000, CRC(6d7966da) SHA1(90f55a99f784c21d7c135e630f4e8b1d4d043d66) )
27152891ROM_END
27162892
2893/* Shinobi bootleg by 'Beta' (7751 replaced by what? Sample rom is different, but no extra sound CPU rom present, missing?) */
2894/* otherwise it seems to run fine on System 16A */
2895ROM_START( shinoblb )
2896   ROM_REGION( 0x040000, "maincpu", 0 ) /* 68000 code */
2897   ROM_LOAD16_BYTE( "4.3k", 0x000000, 0x10000, CRC(c178a39c) SHA1(05ff1679cdfc3618df8b3fabdeab64b1f2299aa3) )
2898   ROM_LOAD16_BYTE( "2.3n", 0x000001, 0x10000, CRC(5ad8ebf2) SHA1(b22e0c8d4b27c553abface17c625e207d19417ab) )
2899   ROM_LOAD16_BYTE( "5.2k", 0x020000, 0x10000, CRC(a2a620bd) SHA1(f8b135ce14d6c5eac5e40ddfd5ad2f1e6f2bc7a6) )
2900   ROM_LOAD16_BYTE( "3.2n", 0x020001, 0x10000, CRC(a3ceda52) SHA1(97a1c52a162fb1d43b3f8f16613b70ce582a8d26) )
2901
2902   ROM_REGION( 0x30000, "gfx1", ROMREGION_DISPOSE ) /* tiles */
2903   ROM_LOAD( "8.3b", 0x00000, 0x10000, CRC(46627e7d) SHA1(66bb5b22a2100e7b9df303007a837bc2d52cf7ba) )
2904   ROM_LOAD( "7.4b", 0x10000, 0x10000, CRC(87d0f321) SHA1(885b38eaff2dcaeab4eeaa20cc8a2885d520abd6) )
2905   ROM_LOAD( "6.5b", 0x20000, 0x10000, CRC(efb4af87) SHA1(0b8a905023e1bc808fd2b1c3cfa3778cde79e659) )
2906
2907   ROM_REGION16_BE( 0x080000, "gfx2", 0 ) /* sprites */
2908   ROM_LOAD16_BYTE( "9.6r",  0x00001, 0x08000, CRC(611f413a) SHA1(180f83216e2dfbfd77b0fb3be83c3042954d12df) )
2909   ROM_CONTINUE(             0x40001, 0x08000 )
2910   ROM_LOAD16_BYTE( "13.8r", 0x00000, 0x08000, CRC(5eb00fc1) SHA1(97e02eee74f61fabcad2a9e24f1868cafaac1d51) )
2911   ROM_CONTINUE(             0x40000, 0x08000 )
2912   ROM_LOAD16_BYTE( "10.6q", 0x10001, 0x08000, CRC(3c0797c0) SHA1(df18c7987281bd9379026c6cf7f96f6ae49fd7f9) )
2913   ROM_CONTINUE(             0x50001, 0x08000 )
2914   ROM_LOAD16_BYTE( "14.8q", 0x10000, 0x08000, CRC(25307ef8) SHA1(91ffbe436f80d583524ee113a8b7c0cf5d8ab286) )
2915   ROM_CONTINUE(             0x50000, 0x08000 )
2916   ROM_LOAD16_BYTE( "11.6p", 0x20001, 0x08000, CRC(c29ac34e) SHA1(b5e9b8c3233a7d6797f91531a0d9123febcf1660) )
2917   ROM_CONTINUE(             0x60001, 0x08000 )
2918   ROM_LOAD16_BYTE( "15.8p", 0x20000, 0x08000, CRC(04a437f8) SHA1(ea5fed64443236e3404fab243761e60e2e48c84c) )
2919   ROM_CONTINUE(             0x60000, 0x08000 )
2920   ROM_LOAD16_BYTE( "12.6n", 0x30001, 0x08000, CRC(41f41063) SHA1(5cc461e9738dddf9eea06831fce3702d94674163) )
2921   ROM_CONTINUE(             0x70001, 0x08000 )
2922   ROM_LOAD16_BYTE( "16.8n", 0x30000, 0x08000, CRC(b6e1fd72) SHA1(eb86e4bf880bd1a1d9bcab3f2f2e917bcaa06172) )
2923   ROM_CONTINUE(             0x70000, 0x08000 )
2924
2925   ROM_REGION( 0x20000, "soundcpu", 0 ) /* sound CPU */
2926   ROM_LOAD( "1.5s", 0x0000, 0x8000, CRC(dd50b745) SHA1(52e1977569d3713ad864d607170c9a61cd059a65) )
2927
2928   /* these 2 n7751 roms weren't present in this set, it's possible it didn't have them */
2929   ROM_REGION( 0x1000, "n7751", 0 )      /* 4k for 7751 onboard ROM */
2930   ROM_LOAD( "7751.bin",     0x0000, 0x0400, CRC(6a9534fc) SHA1(67ad94674db5c2aab75785668f610f6f4eccd158) ) /* 7751 - U34 */
2931
2932   ROM_REGION( 0x08000, "n7751data", 0 ) /* 7751 sound data */
2933   ROM_LOAD( "b9", 0x0000, 0x8000, CRC(6d7966da) SHA1(90f55a99f784c21d7c135e630f4e8b1d4d043d66) )
2934
2935   ROM_REGION( 0x08000, "samples", 0 )
2936   /* sound samples (played by what?, not the same as the original) */
2937   /* marked as 'bad dump' pending investigation, we might actually be missing a cpu rom to play them */
2938   ROM_LOAD( "17.6u", 0x0000, 0x8000, BAD_DUMP CRC(b7a6890c) SHA1(6431df82c7dbe454cabc6084c1a677ebb42ae4b3) )
2939ROM_END
2940
27172941/**************************************************************************************************************************
27182942    Shinobi, Sega System 16A
27192943    CPU: FD1094 (317-0050)
r4878r4879
27662990 **************************************************************************************************************************
27672991 **************************************************************************************************************************
27682992    Sukeban Jansi Ryuko, Sega System 16A
2769    CPU: FD1089B (317-5021)
2993    CPU: FD1089B (317-5021, also 317-5018 known to be exist)
27702994
27712995     (JPN Ver.)
27722996    (c)1988 White Board
r4878r4879
30433267 **************************************************************************************************************************
30443268 **************************************************************************************************************************
30453269    Wonder Boy III, Sega System 16A
3046    CPU: FD1089A (317-unknown)
3270    CPU: FD1089A (317-0086)
30473271 */
30483272ROM_START( wb35 )
30493273   ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 code */
r4878r4879
31153339}
31163340
31173341
3118static DRIVER_INIT( bodyslam )
3342static DRIVER_INIT( dumpmtmt )
31193343{
31203344   system16a_generic_init(machine);
3121   i8751_vblank_hook = bodyslam_i8751_sim;
3345   i8751_vblank_hook = dumpmtmt_i8751_sim;
31223346}
31233347
31243348
r4878r4879
31583382}
31593383
31603384
3385
31613386/*************************************
31623387 *
31633388 *  Game driver(s)
r4878r4879
31653390 *************************************/
31663391
31673392/* "Pre-System 16" */
3168GAME( 1986, bodyslam, 0,        system16a_8751,   bodyslam, bodyslam,    ROT0,   "Sega",           "Body Slam (8751 317-0015)", 0 )
3169GAME( 1986, dumpmtmt, bodyslam, system16a_8751,   bodyslam, bodyslam,    ROT0,   "Sega",           "Dump Matsumoto (Japan, 8751 317-unknown)", 0 )
3393GAME( 1986, bodyslam, 0,        system16a_8751,   bodyslam, generic_16a, ROT0,   "Sega",           "Body Slam (8751 317-0015)", 0 )
3394GAME( 1986, dumpmtmt, bodyslam, system16a_8751,   bodyslam, dumpmtmt,    ROT0,   "Sega",           "Dump Matsumoto (Japan, 8751 317-unknown)", GAME_UNEMULATED_PROTECTION )
31703395GAME( 1985, mjleague, 0,        system16a,        mjleague, mjleague,    ROT270, "Sega",           "Major League", 0 )
3171GAME( 1986, quartet,  0,        system16a_8751,   quartet,  quartet,     ROT0,   "Sega",           "Quartet (Rev A, 8751 315-5194)", 0 )
3172GAME( 1986, quartet1, quartet,  system16a_8751,   quartet,  quartet,     ROT0,   "Sega",           "Quartet (8751 315-5194)", 0 )
3173GAME( 1986, quart21,  quartet,  system16a_8751,   quart2,   quartet,     ROT0,   "Sega",           "Quartet 2 (8751 317-0010)", 0 )
3396GAME( 1986, quartet,  0,        system16a_8751,   quartet,  quartet,     ROT0,   "Sega",           "Quartet (Rev A, 8751 315-5194)", GAME_UNEMULATED_PROTECTION )
3397GAME( 1986, quartet1, quartet,  system16a_8751,   quartet,  quartet,     ROT0,   "Sega",           "Quartet (8751 315-5194)", GAME_UNEMULATED_PROTECTION )
3398GAME( 1986, quart21,  quartet,  system16a_8751,   quart2,   generic_16a, ROT0,   "Sega",           "Quartet 2 (8751 317-0010)", 0 )
31743399GAME( 1986, quart2,   quartet,  system16a,        quart2,   generic_16a, ROT0,   "Sega",           "Quartet 2 (unprotected)", 0 )
31753400
31763401/* System 16A */
r4878r4879
31883413GAME( 1987, shinobi,  0,        system16a,        shinobi,  generic_16a, ROT0,   "Sega",           "Shinobi (set 6, System 16A, unprotected)", 0 )
31893414GAME( 1987, shinobi1, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "Sega",           "Shinobi (set 1, System 16A, FD1094 317-0050)", 0 )
31903415GAME( 1987, shinobls, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "[Sega] (Star bootleg)", "Shinobi (Star bootleg, System 16A)", 0 )
3416GAME( 1987, shinoblb, shinobi,  system16a,        shinobi,  generic_16a, ROT0,   "[Sega] (Beta bootleg)", "Shinobi (Beta bootleg)", 0 ) // should have different sound hw? using original ATM
31913417GAME( 1987, sjryuko1, sjryuko,  system16a,        sjryuko,  sjryukoa,    ROT0,   "White Board",    "Sukeban Jansi Ryuko (set 1, System 16A, FD1089B 317-5021)", 0 )
31923418GAME( 1988, tetris,   0,        system16a_no7751, tetris,   generic_16a, ROT0,   "Sega",           "Tetris (set 4, Japan, System 16A, FD1094 317-0093)", 0 )
31933419GAME( 1988, tetris3,  tetris,   system16a_no7751, tetris,   generic_16a, ROT0,   "Sega",           "Tetris (set 3, Japan, System 16A, FD1094 317-0093a)", 0 )
src/mame/drivers/triforce.c
r4878r4879
77a 'media board' which acts as a CD/DVD emulator
88the Naomi 'DIMM' board, which connects to the GD-ROM drive
99
10Sega Triforce Hardware Overview
11Sega/Namco/Nintendo 2002-2006
12-----------------------------
13
14This is a GameCube-based system containing several PCBs mounted inside a metal box.
15There are two versions. One is for GDROM-based games and the other is customised for
16use with Namco ROM carts.
17
18
19Games on this system include....
20
21Game                                                   Manufacturer              Media                Key Chip
22+----------------------------------------------------+-------------------------+--------------------+--------------|
23|Donkey Kong Jungle Fever                            | Capcom / Nintendo, 2005 | ROM Cart           |              |
24|F-Zero AX                                           | Sega / Nintendo, 2003   | GDROM GDT-0004     |              |
25|F-Zero AX Monster Ride                              | Sega / Nintendo, 2004   | GDROM              |              |
26|*Firmware Update                                    | Sega                    | GDROM GDT-0011     | ?            |
27|*Gekitou Pro Yakyuu                                 | Sega, 2003              | GDROM GDT-0008C    | 317-0371-JPN |
28|*Mario Kart Arcade GP                               | Namco / Nintendo, 2005  | ROM Cart           | 317-5109-COM |
29|Mario Kart Arcade GP 2                              | Namco / Nintendo, 2007  | ROM Cart           |              |
30|Starfox (planned, but not released)                 | Namco / Nintendo, 200?  | ?                  |              |
31|*The Key Of Avalon : The Wizard Master (server)     | Sega, 2003              | GDROM GDT-0005C    | ?            |
32|The Key Of Avalon : The Wizard Master (client)      | Sega, 2003              | GDROM GDT-0006C    |              |
33|*The Key Of Avalon Ver 1.3 (server)                 | Sega, 2004              | GDROM GDT-0009C    | ?            |
34|*The Key Of Avalon Ver 1.3 (client)                 | Sega, 2004              | GDROM GDT-0010C    | ?            |
35|The Key Of Avalon 2 (server)                        | Sega, 2005              | GDROM              |              |
36|*The Key Of Avalon 2 (client)                       | Sega, 2005              | GDROM GDT-0017B    | ?            |
37|*Virtua Striker 2002 (Japan)                        | Sega, 2002              | GDROM GDT-0001     | 317-0337-JPN |
38|*Virtua Striker 2002 (Export)                       | Sega, 2002              | GDROM GDT-0002     | 317-0337-EXP |
39|*Virtua Striker 4 (Japan)                           | Sega, 2005              | GDROM GDT-0013E    | 317-0391-JPN |
40|*Virtua Striker 4 (Export)                          | Sega, 2005              | GDROM GDT-0015     | 317-0393-EXP |
41|*Virtua Striker 4 Ver.2006 (Japan)                  | Sega, 2006              | GDROM GDT-0020D    | ?            |
42|Virtua Striker 4 Ver.2006 (Export)                  | Sega, 2006              | GDROM GDT-0021     |              |
43+----------------------------------------------------+-------------------------+--------------------+--------------+
44* denotes these games are archived.
45If you can help with the undumped games or know of missing Triforce games, please contact...
46http://guru.mameworld.info/
47
48
49PCB Layouts
50===========
51
52
53Network Board (top)
54-------------
55
56This board is not used on the older Triforce version
57
58837-14341
59171-8226C SEGA 2002
60|----------------------------|
61|           LLLL     070XZ1H |
62|           JP1    K4S643232 |
63|           JP2    24LC04    |
64|      25MHz        32.768kHz|
65|CN7   L80227/B        12MHz |
66|      LL          |------|  |
67|                  |AMD   |  |
68|      CN1         |AU1500|  |
69|      CN2         |------|  |
70|                   FLASH.IC2|
71|CN4      ADM3222            |
72|     JP4 ADM3222            |
73|LL   JP3 ADM3222            |
74|----------------------------|
75Notes:
76      AMD AU1500 - AMD AU1500-333MBD MIPS32-compatible CPU (BGA424)
77      K4S643232  - Samsung K4S643232H-UC60 512k x 32bit x 4 banks (64 MBit) Synchronous DRAM LVTTL,
78                   3.3V, 222MHz (TSOPII-86)
79      ADM3222    - Analog Devices ADM3222 High-Speed, +3.3V, 2-Channel RS232/V.28 Interface Device
80                   with 460kBPS Data Rate and Shutdown and Enable Pins (SOIC20)
81      24LC04     - Microchip 24LC04B 2x256x8 (4kbit) Serial EEPROM (SOIC8)
82      FLASH.IC2  - ST Microelectronics M29W160ET 2M x8 (16 MBit) Flash ROM (TSOP48)
83                    - Namco ROM cart version stamped 'FPR24274'
84                    - Sega GDROM version stamped 'FPR24036'
85      L80277/B   - LSI Logic L80227/B 10BASE-T/100BASE-TX Ethernet Network IC (QFP48)
86      070XZ1H    - Sharp 070XZ1H Voltage Regulator
87      CN1/CN2    - Connectors joining to Media Board (2nd Board)
88      CN7        - RJ45 LAN Port A
89      CN4        - DB9 Serial Port
90      JP1        - 1-2
91      JP2        - 1-2
92      JP3        - 2-3
93      JP4        - 2-3
94      L          - LEDs
95
96
97Media Boards
98------------
99
100Sega GDROM-specific older version without DIMM Board (Top Board)
101This version requires a separate standard Sega DIMM Board (same as used on NAOMI)
102This was probably used only for the very early titles like Virtua Striker 2002
103
104837-14291 SEGA 2002
105171-8209B
106            |--------------------------------------|
107            |                             LLLLLLLL |
108            |    DIP42                             |----------|
109            |                      EPC1PC8       JP4  JP2  LL |
110            |                                       JP3  JP1  |
111|-----------|                                                 |
112|                        54MHz                  CN2           |
113|                      |-----------|                          |
114|    FLASH.IC4         |ALTERA     |                          |
115|                      |ACEX       |    CN5S                  |
116|                      |EP1K50QC208|                          |
117|                      |           |                          |
118|      070XZ1H         |-----------|                          |
119|                                                             |
120|                             32.9MHz                         |
121|                                                             |
122|CN6S                                                         |
123|             CN3                               CN1           |
124|-------------------------------------------------------------|
125Notes:
126      ACEX      - Altera ACEX EP1K50QC208 FPGA (QFP208)
127      EPC1PC8   - Altera EPC1PC8 One Time Programmable FPGA Configuration Device (DIP8)
128                   - Sticker '315-6343P'
129      FLASH.IC4 - ST Microelectronics M29W160ET 2M x8 (16 MBit) Flash ROM (TSOP48)
130                   - Stamped 'FPR23910'
131      DIP42     - DIP42 location for M27C160 2M x8 (16 MBit) EPROM (not populated)
132      CN1/2/3   - Connectors for GDROM DIMM Board
133      070XZ1H   - Sharp 070XZ1H Voltage Regulator
134      CN5S      - Connector joining to GameCube PCB (located under the PCB)
135      CN6S      - Connector joining to JVS Filter Board (located under the PCB)
136      JPx       - Jumpers. All positioned to 2-3
137      L         - LEDs
138
139
140Newer Square Metal Box Version (2nd Board down)
141
142837-14355 SEGA 2002 (Sega GDROM version)
143837-14356 SEGA 2002 (Namco ROM cart version)
144171-8232A (Namco ROM cart version)
145171-8231C (Sega GDROM version)
146837-14356R91 (sticker for Namco ROM cart version)
147837-14355-92 (sticker for Sega GDROM version)
148            |----|----------|-----------------------------|
149            |    |PIC16C621 |            50HONDA  SD_CARD |
150            |    |   4MHz   |    CN6     LED              |---|
151            |    |----------|                                 |
152            |  DSW  3771                 50MHz                |
153|-----------|                                                 |
154|LED                                                          |
155|LED                       |-----------|                      |
156|    FLASH.IC2             |   SEGA    |                      |
157|                 DIP42    | 315-6347A |    CN1S         CN3  |
158|LED  71V016               |           |                      |
159|LED                       |           |                      |
160|                          |-----------|                      |
161|                                                             |
162|                                                             |
163|       CN8                                                   |
164|       CN9                               070XZ1H             |
165|CN2S                                                     CN12|
166|-------------------------------------------------------------|
167Notes:
168      315-6347A - Sega custom IC (BGA). Sega GDROM version uses 315-6347
169      71V016    - IDT 71V016SA 64k x 16-bit (1 MBit) 3.3V CMOS Static RAM (TSOP44)
170                  This chip is located under the PCB
171      FLASH.IC2 - ST Microelectronics M29W160ET 2M x8 (16 MBit) Flash ROM (TSOP48)
172                   - Namco ROM cart version stamped 'FPR24331'
173                   - Sega GDROM version stamped 'FPR24035'
174      DIP42     - DIP42 location for M27C160 2M x8 (16 MBit) EPROM (not populated)
175      CN8/CN9   - Connectors joining to network PCB
176      070XZ1H   - Sharp 070XZ1H Voltage Regulator
177      SD_CARD   - Standard SD Card slot (present only on Namco ROM cart version PCB, unused on Mario Kart)
178      50HONDA   - 50-pin mini Honda connector for connection of standard Sega GDROM unit for GDROM-based games only.
179                   - This connector is not present on the Namco ROM cart version of this PCB
180      CN1S      - Connector joining to GameCube PCB (located under the PCB)
181      CN2S      - Connector joining to JVS Filter Board (located under the PCB)
182      CN3       - Connector for ROM cartridge.
183                   - Replaced by 2x 168-pin DIMM Memory Slots on GDROM-based version
184      CN6       - 40 pin IDC flat cable connector (unused)
185      CN12      - 3-pin battery connector, present only on Sega GDROM version PCB
186      DSW       - 2-position DIP Switch, present only on Sega GDROM version PCB
187      PIC16C621 - DIP18 socket and 4MHz OSC on a 90-degrees-mounted small PCB for
188                  Microchip PIC16C621A protection key chip
189
190 ? ? ? ? ? ? ? ? ?Usage:
191 ? ? ? ? ? ? ? ? ?+-----------------------+-----------------+----------------+
192 ? ? ? ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? | Sega Security ?|
193 ? ? ? ? ? ? ? ? ?| Game ? ? ? ? ? ? ? ? ?| Sticker ? ? ? ? | Part Number ? ?|
194 ? ? ? ? ? ? ? ? ?+-----------------------+-----------------+----------------+
195 ? ? ? ? ? ? ? ? ?| Mario Kart Arcade GP ?| 253-5509-5109 ? | 317-5109-COM ? |
196 ? ? ? ? ? ? ? ? ?| Nintendo/Namco, 2005 ?| ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ?|
197 ? ? ? ? ? ? ? ? ?| ? ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ?|
198 ? ? ? ? ? ? ? ? ?| Namco Code: MKA2Ver.B | ? ? ? ? ? ? ? ? | ? ? ? ? ? ? ? ?|
199 ? ? ? ? ? ? ? ? ?+-----------------------+-----------------+----------------+
200
201ROM Board (attached to CN3 of Media Board, ONLY for use with Namco ROM cart version of the Media Board)
202---------
203
204837-14343 SEGA 2002
205171-8228D
206837-14343R4S0 (sticker)
207|---------------|
208| FLASH.IC6     |
209| *FLASH.8S     |
210| FLASH.IC2     |
211| *FLASH.4S     |
212| PFLASH.IC9    |
213| |-------|     |
214| |*Actel |     |
215| |ProASIC|     |
216| |-------|*CN1S|
217|LCX138         |
218|     50MHz     |
219|               |
220|               |
221| FLASH.IC1     |
222| *FLASH.IC3S   |
223| FLASH.IC5     |
224| *FLASH.IC7S   |
225|CN2            |
226|---------------|
227Notes:
228         * - These parts on other side of PCB
229 FLASH.ICx - (except IC9) Samsung K9F1208U0B 512MBit (64Mx8) 3.0V NAND Flash ROM (TSOP48)
230 FLASH.IC9 - Macronix 29LV400CTTC-70G 4MBit (512k x8 / 256k x16) 3V FLASH ROM (TSOP48)
231      CN1S - Connector joining to Media Board (located under the PCB)
232       CN2 - 10-pin JTAG Connector for reprogramming the FPGA (all JTAG connectors and required support parts are not populated)
233   ProASIC - Actel ProASIC Plus APA075 TQG100 75000 Gate FPGA stamped '315-6419B' (TQFP100)
234
235
236Main Board (GameCube)
237----------
238
239This is a standard Nintendo GameCube mainboard.
240Any GameCube mainboard or any version from any of the Triforce units will work.
241Note! The hardware specifications are IDENTICAL to any common GameCube. See
242http://hitmen.c02.at/files/yagcd/yagcd/frames.html for further detailed documentation.
243
244DOL-CPU-10 (Sega Triforce)
245DOL-CPU-20 (Namco Triforce)
246838-14297  (Sticker)
247|----------------------------------------|
248|070XZ1H   MS3M32B    MS3M32B            |
249|D4891281                                |
250|P10                                     |
251|           |-----------|       P9     P5|
252|           | FLIPPER A |                |
253|           |2001 NINTENDO               |
254|P7         |ATI  NEC   |                |
255| AVE_N-DOL |D8926F2011 |RTC_AM-DOL    P3|
256|           |-----------|   32.768kHz    |
257|                                        |
258|   AMP-DOL                              |
259|P2           |-------|          P6    P4|
260|  CLK_B-DOL  |IBM    |                  |
261|  D135       |GEKKO  |                  |
262|  P1         |-------|         P8       |
263|----------------------------------------|
264Notes:
265      070XZ1H    - Sharp 070XZ1H Voltage Regulator
266      D4891281   - NEC D4891281G5 0125XU621 16MB ARAM Auxiliary/DSP DRAM, clocked at 81MHz (SSOP54)
267      FLIPPER A  - Custom NEC/ATI Flipper Chip, clocked at 162MHz (large BGA)
268                   Contains (something like)....
269                             MX92L832 32 Poly Phony Sound Generator
270                             MX96037 16bit DSP Controller
271                             Custom ATI GFX controller
272                             2MB of fast 1T-SRAM memory
273      IBM GEKKO  - Custom IBM PowerPC 750-derivative 'Gekko' CPU with FPU extensions clocked at 486MHz (large BGA)
274                   Full markings..... IBM
275                                      45L8926ESD
276                                      IBM9314PQ
277                                      (C)IBM 2000
278                                      PPCDBK-EFB486X3
279                                      J1900LPB  GE
280      MS3M32B    - MoSys MS3M32B-5 B 12MB 1-T SRAM, clocked at 162MHz (x2, BGA)
281      AVE_N-DOL  - Rohm BU9949FS AV Encoder stamped 'AVE N-DOL' (SSOP32)
282      AMP-DOL    - Amplifier chip stamped 'AMP-DOL' (SOIC14)
283      RTC_AM-DOL - Macronix 1R7459A1 Real Time Clock, also contains the GameCube BIOS in some kind of on-chip serial EEPROM (SOIC14)
284      CLK_B-DOL  - Macronix B021954 CLK B-DOL Clock Generator (SOIC14)
285      D135       - Crystal at 13.5MHz. Most likely clocks generated are....
286                   Gekko:    13.5 x36 = 486MHz
287                   Flipper:  13.5 x12 = 162MHz
288                   1-T SRAM: 13.5 x12 = 162MHz
289                   16M ARAM: 13.5 x6  = 81MHz
290      P1         - Motherboard Power Connector (located under the PCB)
291      P2         - Digital Video Output Connector (not used)
292      P3         - Controller Pad Board Connector (tied to lower PCB to J8 with a small flat cable)
293      P4         - Memory Card Slot Connector A  \ (not used)
294      P5         - Memory Card Slot Connector B  /
295      P6         - Serial Port Connector 1 (located under the PCB, tied to a plug/cable that leads to J10 on lower PCB)
296      P7         - Analog Video Output Connector (tied to a plug/cable that leads to J9 on lower PCB)
297      P8         - Serial Port Connector 2 (located under the PCB, not used)
298      P9         - Media Port Connector (joins to CN1S on the Media Board)
299      P10        - Hi-Speed Parallel Port Connector (located under the PCB, not used)
300
301
302Base Board
303----------
3041st Version (older rectangular metal box without built-in DIMM board and newer square metal box version with built in GDROM controller)
3058909960107 (8909970107) NAMCO LIMITED 2002 GC-AM BASE PCB
306
3072nd Version (newer square metal box, found in a Mario Kart Triforce unit using ROM carts)
3088909961100 (8909971100) NAMCO LIMITED 2002-2003 GC-AM BASE(B) PCB
309
310The differences between the versions seems minor... some component shuffling
311and a switch to a pb-Free manufacturing process. The PCB sizes are the same.
312However the two boards are not compatible when using the other media board. That is, a Base Board for
313GDROM will not work with the top section using ROM carts even though the boards appear identical.
314That is because when a key chip is inserted into a new board, it will marry itself with that board
315(this is stated in the F-Zero AX manual). From then onwards, the Base Board can only be used for _that_ game.
316
317                           |----------------------------------|
318                           |     CR2032            070XZ01    |
319                           |      5.5V        J12             |
320                           |                          TPS54610|
321                           |                                  |
322                           |                               J13|
323                           |                  ADM3222  ADM3222|
324|-----------------|        |                             PC410|
325|CY7C1399         |        |J10                               |
326|LED     J8       |--------|                                  |
327|LED                           |---------------------|        |
328|LED |------|  |----|          |                     |    J9  |
329|LED |ALTERA|  |CY37128        |                     |        |
330|    |EPF10K|  |----|          |                     |        |
331|    |------|        33MHz     |                     |CMPV-DOL|
332|   BU9480F      IS63LV1024    |---------------------|        |
333|                |------|   ADM485        070XZ01    CXA2067AS|
334|                | H8S/ |                        |------------|
335|    3414        |2676  |   ST16C550             |
336|J5              |------|                        |
337|---|  J1       J2          J3         J4        |
338    |--------------------------------------------|
339Notes:
340      070XZ01    - Sharp 070XZ01 Voltage Regulator
341      EPF10K     - Altera FLEX EPF10K30AQC208 FPGA (QFP208)
342      CY37128    - Cypress CY37128VP100 CPLD stamped 'GCABJV1A' (QFP100)
343      CY7C1399   - Cypress CY7C1399 32k x8 3.3V Static RAM (SOJ28)
344      IS63LV1024 - ISSI IS63LV1024-12KL 128k x8 (1M) High-speed CMOS Static RAM 3.3V (SOJ32)
345      H8S/2676   - Hitachi H8S/2676 Microcontroller (QFP144)
346      BU9480F    - ROHM BU9480F 16-bit stereo D/A converter (SOIC8)
347      3414       - JRC NJM3414A Dual High Current Operational Amplifier (SOIC8)
348      ST16C550   - Exar ST16C550 Universal Asynchronous Receiver & Transmitter with 16 byte Transmit & Receive FIFO (TQFP48)
349      ADM485     - Analog Devices ADM485 +5 V Low Power Half Duplex EIA RS-485 Transceiver (SOIC8)
350      CXA2067AS  - Sony CXA2067AS Video Preamplifier (SDIP30)
351      CMPV-DOL   - Macronix B055055G stamped 'CMPV-DOL' (SOP24)
352      ADM3222    - Analog Devices ADM3222 High-Speed, +3.3V, 2-Channel RS232/V.28 Interface Device
353                   with 460kBPS Data Rate and Shutdown and Enable Pins (SOIC20)
354      PC410      - Sharp PC410 Photocoupler (SOIC4)
355      CR20332    - 3.0 Volt Coin Battery
356      5.5V       - 5.5 Volt 1uF Super Cap
357      TPS54610   - Texas Instruments TPS54610 3V-6V Input, 6A Output Synchronous Buck PWM Switcher with Integrated FETs (SSOP28)
358      J1         - USB Connector for attachment of a Sega JVS I/O PCB
359      J2         - RCA Audio Output
360      J3         - 15-pin DSUB Video Output 1
361      J4         - 15-pin DSUB Video Output 2
362      J5         - 6-pin connector (unused)
363      J8         - Flat Cable Connector with Small Flat Cable tied to P3 on Main Board
364      J9         - Flat Cable Connector and Plug tied to P7 Analog Video Output Connector on Main Board
365      J10        - Flat Cable Connector and Plug tied to P6 Serial Port Connector 1 on Main Board
366      J12        - Power Connector tied to P1 Motherboard Power Connector on Main Board
367
368
369Filter Board
370------------
3711st Version
3728909960503 (8909970503) GC-AM CNT-JV PCB
373
3742nd Version
3758909961400 (8909971400) GC-AM CNT-JV(B) PCB
376
377The two versions are identical, the later one is pb-Free
378|------------------------------------------------------|
379|SW2  SW1     DIPSW              J2              J8    |
380|                                                  J9  |
381|J3                       J6          J7               |
382|                                                      |
383|J4    J5                        J1                    |
384|------------------------------------------------------|
385Notes:
386      J1 - 60-pin Connector joins to J13 on Base Board
387      J2 - 30-pin Connector joins to CN2S on Media Board
388      J3 - 8-pin Connector labelled 'RS232'
389      J4 - 7-pin Connector labelled 'MIDI'
390      J5 - 10-pin Connector labelled 'SI'
391      J6 - 6-pin JVS Power Connector
392      J7 - 8-pin JVS Power Connector
393      J8 - 3-pin Fan Connector
394      J9 - 4-pin Namco Audio Connector (unused)
395
396
10397*/
11398
12399#include "driver.h"
r4878r4879
19406ADDRESS_MAP_END
20407
21408
22VIDEO_START(triforce)
409static VIDEO_START(triforce)
23410{
24411
25412}
26413
27VIDEO_UPDATE(triforce)
414static VIDEO_UPDATE(triforce)
28415{
29416   return 0;
30417}
src/mame/drivers/parodius.c
r4878r4879
192192   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
193193   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
194194   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
195   PORT_DIPSETTING(    0x20, "Difficult" )
196   PORT_DIPSETTING(    0x00, "Very Difficult" )
195   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
196   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
197197   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
198198   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
199199   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/combatsc.c
r4878r4879
405405   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
406406   PORT_DIPSETTING( 0x60, DEF_STR( Easy ) )
407407   PORT_DIPSETTING( 0x40, DEF_STR( Normal ) )
408   PORT_DIPSETTING( 0x20, "Difficult" )
409   PORT_DIPSETTING( 0x00, "Very Difficult" )
408   PORT_DIPSETTING( 0x20, DEF_STR( Difficult ) )
409   PORT_DIPSETTING( 0x00, DEF_STR( Very_Difficult ) )
410410   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
411411   PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
412412   PORT_DIPSETTING( 0x00, DEF_STR( On ) )
src/mame/drivers/buggychl.c
r4878r4879
138138   AM_RANGE(0x8000, 0x87ff) AM_RAM /* 6116 SRAM (36) */
139139   AM_RANGE(0x8800, 0x8fff) AM_RAM /* 6116 SRAM (35) */
140140   AM_RANGE(0x9000, 0x9fff) AM_WRITE(buggychl_sprite_lookup_w)
141   AM_RANGE(0xa000, 0xbfff) AM_READWRITE(SMH_BANK(1), buggychl_chargen_w) AM_BASE(&buggychl_character_ram)
141   AM_RANGE(0xa000, 0xbfff) AM_ROMBANK(1) AM_WRITE(buggychl_chargen_w) AM_BASE(&buggychl_character_ram)
142142   AM_RANGE(0xc800, 0xcfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size)
143143   AM_RANGE(0xd100, 0xd100) AM_WRITE(buggychl_ctrl_w)
144144   AM_RANGE(0xd200, 0xd200) AM_WRITE(bankswitch_w)
r4878r4879
146146   AM_RANGE(0xd303, 0xd303) AM_WRITE(buggychl_sprite_lookup_bank_w)
147147   AM_RANGE(0xd400, 0xd400) AM_READWRITE(buggychl_mcu_r, buggychl_mcu_w)
148148   AM_RANGE(0xd401, 0xd401) AM_READ(buggychl_mcu_status_r)
149   AM_RANGE(0xd500, 0xd57f) AM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
149   AM_RANGE(0xd500, 0xd57f) AM_WRITEONLY AM_BASE(&spriteram) AM_SIZE(&spriteram_size)
150150   AM_RANGE(0xd600, 0xd600) AM_READ_PORT("DSW1")
151151   AM_RANGE(0xd601, 0xd601) AM_READ_PORT("DSW2")
152152   AM_RANGE(0xd602, 0xd602) AM_READ_PORT("DSW3")
r4878r4879
158158   AM_RANGE(0xd610, 0xd610) AM_WRITE(sound_command_w)
159159   AM_RANGE(0xd618, 0xd618) AM_WRITENOP   /* accelerator clear */
160160   AM_RANGE(0xd700, 0xd7ff) AM_WRITE(paletteram_xxxxRRRRGGGGBBBB_be_w) AM_BASE(&paletteram)
161   AM_RANGE(0xd840, 0xd85f) AM_WRITE(SMH_RAM) AM_BASE(&buggychl_scrollv)
162   AM_RANGE(0xdb00, 0xdbff) AM_WRITE(SMH_RAM) AM_BASE(&buggychl_scrollh)
163   AM_RANGE(0xdc04, 0xdc04) AM_WRITE(SMH_RAM)   /* should be fg scroll */
161   AM_RANGE(0xd840, 0xd85f) AM_WRITEONLY AM_BASE(&buggychl_scrollv)
162   AM_RANGE(0xdb00, 0xdbff) AM_WRITEONLY AM_BASE(&buggychl_scrollh)
163   AM_RANGE(0xdc04, 0xdc04) AM_WRITEONLY /* should be fg scroll */
164164   AM_RANGE(0xdc06, 0xdc06) AM_WRITE(buggychl_bg_scrollx_w)
165165ADDRESS_MAP_END
166166
r4878r4879
173173   AM_RANGE(0x4820, 0x4820) AM_RAM   /* VOL/BAL   for the 7630 on the MSM5232 output */
174174   AM_RANGE(0x4830, 0x4830) AM_RAM   /* TRBL/BASS for the 7630 on the MSM5232 output  */
175175   AM_RANGE(0x5000, 0x5000) AM_READ(soundlatch_r)
176//  AM_RANGE(0x5001, 0x5001) AM_READ(SMH_RAM)  /* is command pending? */
176//  AM_RANGE(0x5001, 0x5001) AM_READNOP /* is command pending? */
177177   AM_RANGE(0x5001, 0x5001) AM_WRITE(nmi_enable_w)
178178   AM_RANGE(0x5002, 0x5002) AM_WRITE(nmi_disable_w)
179179   AM_RANGE(0x5003, 0x5003) AM_WRITE(sound_enable_w)
src/mame/drivers/pandoras.c
r4878r4879
208208   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
209209   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
210210   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
211   PORT_DIPSETTING(    0x20, "Difficult" )
212   PORT_DIPSETTING(    0x00, "Very Difficult" )
211   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
212   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
213213   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
214214   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
215215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/gberet.c
r4878r4879
242242   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
243243   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
244244   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
245   PORT_DIPSETTING(    0x20, "Difficult" )
246   PORT_DIPSETTING(    0x00, "Very Difficult" )
245   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
246   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
247247   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
248248   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
249249   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
293293   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
294294   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
295295   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
296   PORT_DIPSETTING(    0x20, "Difficult" )
297   PORT_DIPSETTING(    0x00, "Very Difficult" )
296   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
297   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
298298   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
299299   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
300300   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
331331   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
332332   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
333333   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
334   PORT_DIPSETTING(    0x20, "Difficult" )
335   PORT_DIPSETTING(    0x00, "Very Difficult" )
334   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
335   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
336336   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
337337   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
338338   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/psattack.c
r4878r4879
199199   ROM_LOAD("16c711.bin",  0x0000, 0x4010, CRC(b316693f) SHA1(eba1f75043bd415268eedfdb95c475e73c14ff86) ) // converted to binary
200200
201201   DISK_REGION( "cfcard" )
202   DISK_IMAGE_READONLY( "psattack", 0, SHA1(c2ed467c73d46aacff7a740e2e5aada4be204750) )
202   DISK_IMAGE_READONLY( "psattack", 0, SHA1(e99cd0dafc33ec13bf56061f81dc7c0a181594ee) )
203203ROM_END
204204
205205
src/mame/drivers/solomon.c
r4878r4879
146146   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
147147   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
148148   PORT_DIPSETTING(    0x01, DEF_STR( Harder ) )
149   PORT_DIPSETTING(    0x03, "Difficult" )
149   PORT_DIPSETTING(    0x03, DEF_STR( Difficult ) )
150150   PORT_DIPNAME( 0x0c, 0x00, "Timer Speed" )
151151   PORT_DIPSETTING(    0x08, "Slow" )
152152   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
r4878r4879
154154   PORT_DIPSETTING(    0x0c, "Fastest" )
155155   PORT_DIPNAME( 0x10, 0x00, "Extra" )
156156   PORT_DIPSETTING(    0x00, DEF_STR( Normal ) )
157   PORT_DIPSETTING(    0x10, "Difficult" )
157   PORT_DIPSETTING(    0x10, DEF_STR( Difficult ) )
158158   PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Bonus_Life ) )
159159   PORT_DIPSETTING(    0x00, "30k 200k 500k" )
160160   PORT_DIPSETTING(    0x80, "100k 300k 800k" )
src/mame/drivers/gladiatr.c
r4878r4879
1010          Golden Castle Rom Set Support
1111- Phil Stroffolino: palette, sprites, misc video driver fixes
1212- Tatsuyuki Satoh: YM2203 sound improvements, NEC 8741 simulation,ADPCM with MC6809
13- Tomasz Slanina   preliminary Ping POng King driver
13- Tomasz Slanina   preliminary Ping Pong King driver
1414- Nicola Salmoria  clean up
1515
1616special thanks to:
r4878r4879
325325/* !!!!! patch to IRQ timming for 2nd CPU !!!!! */
326326static WRITE8_HANDLER( gladiatr_irq_patch_w )
327327{
328   cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
328   cputag_set_input_line(space->machine, "sub", 0, HOLD_LINE);
329329}
330330#endif
331331
src/mame/drivers/goindol.c
r4878r4879
164164   PORT_DIPSETTING(    0x14, DEF_STR( Very_Easy) )
165165   PORT_DIPSETTING(    0x10, DEF_STR( Easy ) )
166166   PORT_DIPSETTING(    0x0c, DEF_STR( Normal ) )
167   PORT_DIPSETTING(    0x08, "Difficult" )
167   PORT_DIPSETTING(    0x08, DEF_STR( Difficult ) )
168168   PORT_DIPSETTING(    0x04, DEF_STR( Hard ) )
169169   PORT_DIPSETTING(    0x00, DEF_STR( Very_Hard ) )
170170   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )
src/mame/drivers/kangaroo.c
r4878r4879
293293
294294/*************************************
295295 *
296 *  Microcontroller memory handlers
297 *
298 *************************************/
299
300static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 )
301   AM_RANGE(0x0000, 0x07ff) AM_ROM
302ADDRESS_MAP_END
303
304
305
306/*************************************
307 *
308296 *  Port definitions
309297 *
310298 *************************************/
r4878r4879
475463
476464   MDRV_MACHINE_START(kangaroo_mcu)
477465
478   MDRV_CPU_ADD("mcu", MB8841, MASTER_CLOCK/4/12)
466   MDRV_CPU_ADD("mcu", MB8841, MASTER_CLOCK/4/2)
479467   MDRV_CPU_FLAGS(CPU_DISABLE)
480   MDRV_CPU_PROGRAM_MAP(mcu_map)
481468MACHINE_DRIVER_END
482469
483470
src/mame/drivers/cabal.c
r4878r4879
835835
836836
837837
838void seibu_sound_bootleg(running_machine *machine,const char *cpu,int length)
838static void seibu_sound_bootleg(running_machine *machine,const char *cpu,int length)
839839{
840840   const address_space *space = cputag_get_address_space(machine, cpu, ADDRESS_SPACE_PROGRAM);
841841   UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
src/mame/drivers/segas16b.c
r4878r4879
32983298 **************************************************************************************************************************
32993299 **************************************************************************************************************************
33003300    Ace Attacker, Sega System 16B
3301    CPU: FD1094 (317-0059)
3301    CPU: FD1094 (317-0059, also 317-0061 version known to be exist)
33023302    ROM Board: 171-5358
33033303*/
33043304ROM_START( aceattac )
r4878r4879
42684268 **************************************************************************************************************************
42694269 **************************************************************************************************************************
42704270    Dynamite Dux, Sega System 16B
4271    CPU: FD1094 (317-0096)
4271    CPU: FD1094 (317-0096, version uses 317-0094 known to be exist)
42724272    ROM Board: 171-5521
42734273
42744274    Pos.   Silk        Type        Part         Pos.   Silk        Type        Part
r4878r4879
48504850 **************************************************************************************************************************
48514851 **************************************************************************************************************************
48524852    Heavyweight Champ, Sega System 16B
4853    CPU: 68000
4853    CPU: 68000 (version uses custom 317-0046 known to be exist)
48544854    ROM Board: 171-5521
48554855*/
48564856ROM_START( hwchamp )
r4878r4879
54825482 **************************************************************************************************************************
54835483 **************************************************************************************************************************
54845484    Sukeban Jansi Ryuko (JPN Ver.)
5485    CPU: FD1089B 317-5021 (16A/16B)
5485    CPU: FD1089B 317-5021 (16A/16B) (version uses i8751(317-5019) known to be exist)
54865486    ROM Board: 171-???
54875487
54885488    (c)1988 White Board
r4878r4879
57135713 **************************************************************************************************************************
57145714 **************************************************************************************************************************
57155715    Tough Turf, Sega System 16B
5716    CPU: 68000 + i8751 (317-0104)
5716    CPU: 68000 + i8751 (317-0104, 317-0100 also known to be exist)
57175717    ROM Board: 171-5704
57185718 */
57195719ROM_START( tturf )
src/mame/drivers/baraduke.c
r4878r4879
184184   AM_RANGE(0x8800, 0x8800) AM_WRITE(baraduke_irq_ack_w)      /* irq acknowledge */
185185   AM_RANGE(0xb000, 0xb002) AM_WRITE(baraduke_scroll0_w)      /* scroll (layer 0) */
186186   AM_RANGE(0xb004, 0xb006) AM_WRITE(baraduke_scroll1_w)      /* scroll (layer 1) */
187   AM_RANGE(0x6000, 0xffff) AM_READ(SMH_ROM)            /* ROM */
187   AM_RANGE(0x6000, 0xffff) AM_ROM                        /* ROM */
188188ADDRESS_MAP_END
189189
190190static READ8_HANDLER( soundkludge_r )
r4878r4879
199199   AM_RANGE(0x0080, 0x00ff) AM_RAM                        /* built in RAM */
200200   AM_RANGE(0x1105, 0x1105) AM_READ(soundkludge_r)            /* cures speech */
201201   AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r,namcos1_cus30_w) AM_BASE(&namco_wavedata)/* PSG device, shared RAM */
202   AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_ROM)               /* MCU external ROM */
203   AM_RANGE(0x8000, 0x8000) AM_WRITENOP               /* watchdog reset? */
204   AM_RANGE(0x8800, 0x8800) AM_WRITENOP               /* irq acknoledge? */
202   AM_RANGE(0x8000, 0xbfff) AM_ROM                        /* MCU external ROM */
203   AM_RANGE(0x8000, 0x8000) AM_WRITENOP                  /* watchdog reset? */
204   AM_RANGE(0x8800, 0x8800) AM_WRITENOP                  /* irq acknoledge? */
205205   AM_RANGE(0xc000, 0xc7ff) AM_RAM                        /* RAM */
206   AM_RANGE(0xf000, 0xffff) AM_READ(SMH_ROM)               /* MCU internal ROM */
206   AM_RANGE(0xf000, 0xffff) AM_ROM                        /* MCU internal ROM */
207207ADDRESS_MAP_END
208208
209209
src/mame/drivers/mcr.c
r4878r4879
24892489   mcr_init(machine, 90010, 91399, 90913);
24902490   mcr_sound_init(machine, MCR_SSIO);
24912491
2492   memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_r, twotiger_videoram_w);
2492   memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xe800, 0xefff, 0, 0x1000, twotiger_videoram_r, twotiger_videoram_w);
24932493}
24942494
24952495
r4878r4879
25582558   ssio_set_custom_output(4, 0xff, demoderb_op4_w);
25592559
25602560   /* the SSIO Z80 doesn't have any program to execute */
2561   cpu_suspend(machine->cpu[1], SUSPEND_REASON_DISABLE, 1);
2561   cputag_suspend(machine, "tcscpu", SUSPEND_REASON_DISABLE, 1);
25622562}
25632563
25642564
src/mame/drivers/ninjaw.c
r4878r4879
5858result of the way the hardware works: the colors in each are the same.
5959
6060
61Ninja Warriors
62Taito, 1987
63
64PCB Layout
65----------
66
67J1100136A
68K1100313A
69SOUND BOARD
70|------------------------------|
71|  Z80     16MHz        YM2610 |
72|M      B31-37.11              |
73|  TMM2063           TC0140SYT |
74|  TC0060DCA                   |
75|  TC0060DCA  YM3016-F         |
76|  TL074 TL074 TL074           |
77|                     B31-08.19|
78|                     B31-09.18|
79|  MB3735   MB3735    B31-10.17|
80|                     B31-11.16|
81|  VOL1     VOL2               |
82|                        S     |
83|------------------------------|
84Notes:
85      Z80        - clock 4.000MHz [16/4]
86      YM2610     - clock 8.000MHz [16/2]
87      MB3735     - Audio power AMP
88      TC006DCA   - Taito custom ceramic DAC/filter module (SIL20)
89      TC0140SYT  - Taito custom sound control IC (QFP120)
90      YM3016F    - Yamaha stereo audio DAC (DOIC16)
91      TL074      - Texas Instruments low noise quad J-Fet op-amp (DIP14)
92      M          - 25 pin connector
93      S          - 30 pin flat cable joining to CPU BOARD
94      TMM2063    - 8kx8 SRAM (DIP28)
95      B31-37     - TC541000 mask ROM (DIP32)
96      Other B31* - 234000 mask ROM (DIP40)
97
98
99K1100311B
100J1100134B
101CPU BOARD
102|--------------------------------------------------------------|
103|                     2018                              2063   |
104|                    TC0070RGB   TC0110PCR    B31-02.29 43256  |
105|     68000             2018        TC0100SCN B31-01.28 43256  |
106|                           26.686MHz                   2063   |
107|                B31-16.68  16MHZ                              |
108|H                     2018                             2063   |
109|  B31-36.97 B31-33.87  TC0070RGB  TC011PCR   B31-02.27 43256  |
110|  B31-35.96 B31-32.86  2018       TC0100SCN  B31-01.26 43256  |
111|  B31-34.95 B31-31.85  B31-15.62                       2063   |
112|J    DIP28     DIP28                                          |
113|   43256     43256                                            |
114|                                                       2063   |
115|                 2018            TC0100SCN  B31-02.24  43256  |
116|     B31-17.82   TC0070RGB   TC0110PCR      B31-01.24  43256  |
117|                     B31-14-1.54                       2063   |
118|                                                              |
119|                 2018                                  43256  |
120|G                                                      43256  |
121|                                43256     43256     B31-13.20 |
122|                         3771   B31-45.35 B31-47.32    68000  |
123|     PC050CM    TC0040IOC  DSWA B31-29.34 B31-27.31           |
124|                           DSWB    DIP40             B31-12.1 |
125|--------------------------------------------------------------|
126Notes:
127      43256 - 32kx8 SRAM (DIP28)
128      2063  - 8kx8 SRAM (NDIP28)
129      DIP28 - Empty socket(s)
130      DIP40 - Socket for mounting 'ROM 5 BOARD'
131      2018  - 2kx8 SRAM (NDIP24)
132      H     - 12 pin connector for power input
133      J     - 15 pin connector
134      G     - 22-way edge connector
135      B31-12 thru B31-17 - PALs
136
137
138K9100162A
139J9100118A
140ROM 5 BOARD
141|-----------------|
142|B31-38.3 B31-40.6|
143|B31-39.2 B31-41.5|
144|                 |
145| DIP40     74F139|
146|-----------------|
147
148
149K1100312A
150J1100135A
151OBJECT BOARD
152|--------------------------------------------------------------|
153|                                                              |
154|                    B31-18.IC78                               |
155|                                    TMM2064   TMM2064 TMM2064 |
156|                    B31-19.IC80                               |
157|                                    TMM2064                   |
158|                                                              |
159|                                                              |
160|                             B31-20.IC119                     |
161|                             B31-21.IC120                     |
162|                             B31-22.IC121                     |
163|                                                  B31-04.IC173|
164|                                     B31-23.IC143 B31-05.IC174|
165|                                     B31-24.IC144 B31-06.IC175|
166|                                                  B31-07.IC176|
167|                  MB81461 MB81461 MB81461 MB81461             |
168|                  MB81461 MB81461 MB81461 MB81461             |
169|                  MB81461 MB81461 MB81461 MB81461             |
170|H                 MB81461 MB81461 MB81461 MB81461   TC0120SHT |
171|                  MB81461 MB81461 MB81461 MB81461             |
172|                  MB81461 MB81461 MB81461 MB81461             |
173|                  MB81461 MB81461 MB81461 MB81461             |
174|                  MB81461 MB81461 MB81461 MB81461             |
175|--------------------------------------------------------------|
176Notes:
177      B31-04 thru 06 - 234000 mask ROM (DIP40)
178      B31-18 thru 24 - PALs
179      MB81461        - 64kx4 dual-port DRAM (ZIP24)
180      TMM2064        - 8kx8 SRAM (DIP28)
181
61182Dumpers Notes
62183-------------
63184
src/mame/drivers/arkanoid.c
r4878r4879
717717   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) // or up? it rotates the piece.
718718   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
719719   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
720//  PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) // WTF? it does't work
721//  PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 ) // WTF? it does't work
722   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
723   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
720   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
721   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
724722INPUT_PORTS_END
725723
726724
r4878r4879
11781176   {
11791177      ROM[x]=ROM[x]^0x94;
11801178   }
1179
1180   memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, tetrsark_d008_w );
11811181}
11821182
11831183
r4878r4879
11981198GAME( 1986, arkatayt, arkanoid, bootleg,  arkatayt, 0,        ROT90, "bootleg", "Arkanoid (Tayto bootleg)", GAME_SUPPORTS_SAVE )
11991199GAME( 1986, arktayt2, arkanoid, bootleg,  arktayt2, 0,        ROT90, "bootleg", "Arkanoid (Tayto bootleg, harder)", GAME_SUPPORTS_SAVE )
12001200GAME( 1987, arkatour, arkanoid, arkanoid, arkanoid, 0,        ROT90, "Taito America Corporation (Romstar license)", "Tournament Arkanoid (US)", GAME_SUPPORTS_SAVE )
1201GAME( 19??, tetrsark, 0,        bootleg,  tetrsark, tetrsark, ROT0,  "D.R. Korea", "Tetris (D.R. Korea)", GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS )
1201GAME( 19??, tetrsark, 0,        bootleg,  tetrsark, tetrsark, ROT0,  "D.R. Korea", "Tetris (D.R. Korea)", GAME_SUPPORTS_SAVE )
src/mame/drivers/twin16.c
r4878r4879
8484   return (twin16_CPUA_register & 0x40) == 0;
8585}
8686
87enum
88{
89   CPU_A,
90   CPU_B,
91   CPU_SOUND
92};
93
94
9587/******************************************************************************************/
9688
9789#define COMRAM_r               SMH_BANK(1)
r4878r4879
155147    */
156148   UINT16 old = twin16_CPUA_register;
157149   COMBINE_DATA(&twin16_CPUA_register);
158   if( twin16_CPUA_register!=old )
150   if (twin16_CPUA_register != old)
159151   {
160      if( (old&0x08)==0 && (twin16_CPUA_register&0x08) )
161         cpu_set_input_line_and_vector(space->machine->cpu[CPU_SOUND], 0, HOLD_LINE, 0xff );
152      if ((old & 0x08) == 0 && (twin16_CPUA_register & 0x08))
153         cpu_set_input_line_and_vector(cputag_get_cpu(space->machine, "audiocpu"), 0, HOLD_LINE, 0xff);
162154
163      if( (old&0x40) && (twin16_CPUA_register&0x40)==0 )
155      if ((old & 0x40) && (twin16_CPUA_register & 0x40) == 0)
164156         twin16_spriteram_process();
165157
166      if( (old&0x10)==0 && (twin16_CPUA_register&0x10) )
167         cpu_set_input_line(space->machine->cpu[CPU_B], M68K_IRQ_6, HOLD_LINE );
158      if ((old & 0x10) == 0 && (twin16_CPUA_register & 0x10))
159         cputag_set_input_line(space->machine, "sub", M68K_IRQ_6, HOLD_LINE);
168160
169      coin_counter_w( 0, twin16_CPUA_register&0x01 );
170      coin_counter_w( 1, twin16_CPUA_register&0x02 );
171      coin_counter_w( 2, twin16_CPUA_register&0x04 );
161      coin_counter_w(0, twin16_CPUA_register & 0x01);
162      coin_counter_w(1, twin16_CPUA_register & 0x02);
163      coin_counter_w(2, twin16_CPUA_register & 0x04);
172164   }
173165}
174166
r4878r4879
184176   COMBINE_DATA(&twin16_CPUB_register);
185177   if( twin16_CPUB_register!=old )
186178   {
187      if( (old&0x01)==0 && (twin16_CPUB_register&0x1) )
179      if ((old & 0x01) == 0 && (twin16_CPUB_register & 0x01))
188180      {
189         cpu_set_input_line(space->machine->cpu[CPU_A], M68K_IRQ_6, HOLD_LINE );
181         cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_6, HOLD_LINE);
190182      }
191183   }
192184}
r4878r4879
195187{
196188   UINT16 old = twin16_CPUA_register;
197189   COMBINE_DATA(&twin16_CPUA_register);
198   if( twin16_CPUA_register!=old )
190   if (twin16_CPUA_register != old)
199191   {
200      if( (old&0x08)==0 && (twin16_CPUA_register&0x08) )
201         cpu_set_input_line_and_vector(space->machine->cpu[1], 0, HOLD_LINE, 0xff ); // trigger IRQ on sound CPU
192      if ((old & 0x08) == 0 && (twin16_CPUA_register & 0x08))
193         cpu_set_input_line_and_vector(cputag_get_cpu(space->machine, "audiocpu"), 0, HOLD_LINE, 0xff);   // trigger IRQ on sound CPU
202194   }
203195}
204196
r4878r4879
358350   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
359351   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
360352   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
361   PORT_DIPSETTING(    0x20, "Difficult" )
362   PORT_DIPSETTING(    0x00, "Very Difficult" )
353   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
354   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
363355   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
364356   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
365357   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
425417   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
426418   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
427419   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
428   PORT_DIPSETTING(    0x20, "Difficult" )
429   PORT_DIPSETTING(    0x00, "Very Difficult" )
420   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
421   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
430422   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
431423   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
432424   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
482474   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
483475   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
484476   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
485   PORT_DIPSETTING(    0x20, "Difficult" )
486   PORT_DIPSETTING(    0x00, "Very Difficult" )
477   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
478   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
487479   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
488480   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
489481   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
546538   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
547539   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
548540   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
549   PORT_DIPSETTING(    0x20, "Difficult" )
550   PORT_DIPSETTING(    0x00, "Very Difficult" )
541   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
542   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
551543   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
552544   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
553545   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
r4878r4879
601593   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
602594   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
603595   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
604   PORT_DIPSETTING(    0x20, "Difficult" )
605   PORT_DIPSETTING(    0x00, "Very Difficult" )
596   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
597   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
606598   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
607599   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
608600   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/megasys1.c
r4878r4879
102102  bootleg version of rodlandj has one instruction patched out to do exactly
103103  the same thing that we are doing (ignoring the 6295 status).
104104
105- VERY bad sprite lag in iganinju and plusalph and generally others.
106  Is this a sprites buffer issue ?
105- Understand properly how irqs truly works, kazan / iganinju is (again) broken.
107106
107- 64street: player characters in attract mode doesn't move at all, protection
108  or btanb?
109
108110- Understand a handful of unknown bits in video regs
109111
110112
r4878r4879
14801482   MDRV_PALETTE_INIT(megasys1)
14811483   MDRV_VIDEO_START(megasys1)
14821484   MDRV_VIDEO_UPDATE(megasys1)
1485   MDRV_VIDEO_EOF(megasys1)
14831486
14841487   /* sound hardware */
14851488   MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
r4878r4879
15841587   MDRV_PALETTE_INIT(megasys1)
15851588   MDRV_VIDEO_START(megasys1)
15861589   MDRV_VIDEO_UPDATE(megasys1)
1590   MDRV_VIDEO_EOF(megasys1)
15871591
15881592   /* sound hardware */
15891593   MDRV_SPEAKER_STANDARD_MONO("mono")
src/mame/drivers/airbustr.c
r4878r4879
488488   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:1,2")
489489   PORT_DIPSETTING(    0x02, DEF_STR( Easy ) )
490490   PORT_DIPSETTING(    0x03, DEF_STR( Normal ) )
491   PORT_DIPSETTING(    0x01, "Difficult" )
492   PORT_DIPSETTING(    0x00, "Very Difficult" )
491   PORT_DIPSETTING(    0x01, DEF_STR( Difficult ) )
492   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
493493   PORT_DIPUNUSED_DIPLOC( 0x04, IP_ACTIVE_LOW, "SW2:3" )
494494   PORT_DIPNAME( 0x08, 0x08, "Freeze" )            PORT_DIPLOCATION("SW2:4")
495495   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
src/mame/drivers/pacman.c
r4878r4879
20972097   PORT_DIPSETTING(    0x18, DEF_STR( Very_Easy) )
20982098   PORT_DIPSETTING(    0x14, DEF_STR( Easy ) )
20992099   PORT_DIPSETTING(    0x10, DEF_STR( Normal ) )
2100   PORT_DIPSETTING(    0x0c, "Difficult" )
2101   PORT_DIPSETTING(    0x08, "Very Difficult" )
2100   PORT_DIPSETTING(    0x0c, DEF_STR( Difficult ) )
2101   PORT_DIPSETTING(    0x08, DEF_STR( Very_Difficult ) )
21022102   PORT_DIPSETTING(    0x04, DEF_STR( Very_Hard ) )
21032103   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
21042104   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) )
src/mame/drivers/chqflag.c
r4878r4879
249249   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
250250   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
251251   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
252   PORT_DIPSETTING(   0x20, "Difficult" )
253   PORT_DIPSETTING(   0x00, "Very difficult" )
252   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
253   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
254254   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
255255   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
256256   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/sf.c
r4878r4879
346346   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
347347   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
348348   PORT_DIPSETTING(      0x0040, DEF_STR( Easy ) )
349   PORT_DIPSETTING(      0x0020, "Difficult" )
350   PORT_DIPSETTING(      0x0000, "Very difficult" )
349   PORT_DIPSETTING(      0x0020, DEF_STR( Difficult ) )
350   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Difficult ) )
351351   PORT_DIPNAME( 0x0380, 0x0380, "Buy-in max stage" )
352352   PORT_DIPSETTING(      0x0380, "5th" )
353353   PORT_DIPSETTING(      0x0300, "4th" )
r4878r4879
524524   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
525525   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
526526   PORT_DIPSETTING(      0x0040, DEF_STR( Easy ) )
527   PORT_DIPSETTING(      0x0020, "Difficult" )
528   PORT_DIPSETTING(      0x0000, "Very difficult" )
527   PORT_DIPSETTING(      0x0020, DEF_STR( Difficult ) )
528   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Difficult ) )
529529   PORT_DIPNAME( 0x0380, 0x0380, "Buy-in max stage" )
530530   PORT_DIPSETTING(      0x0380, "5th" )
531531   PORT_DIPSETTING(      0x0300, "4th" )
r4878r4879
662662   PORT_DIPNAME( 0x0060, 0x0060, DEF_STR( Difficulty ) )
663663   PORT_DIPSETTING(      0x0060, DEF_STR( Normal ) )
664664   PORT_DIPSETTING(      0x0040, DEF_STR( Easy ) )
665   PORT_DIPSETTING(      0x0020, "Difficult" )
666   PORT_DIPSETTING(      0x0000, "Very difficult" )
665   PORT_DIPSETTING(      0x0020, DEF_STR( Difficult ) )
666   PORT_DIPSETTING(      0x0000, DEF_STR( Very_Difficult ) )
667667   PORT_DIPNAME( 0x0380, 0x0380, "Buy-in max stage" )
668668   PORT_DIPSETTING(      0x0380, "5th" )
669669   PORT_DIPSETTING(      0x0300, "4th" )
src/mame/drivers/konamim2.c
r4878r4879
789789static void cde_dma_transfer(const address_space *space, int channel, int next)
790790{
791791   UINT32 address;
792   int length;
792   //int length;
793793   int i;
794794
795795   if (next)
796796   {
797797      address = cde_dma[channel].next_dst_addr;
798      length = cde_dma[channel].next_length;
798      //length = cde_dma[channel].next_length;
799799   }
800800   else
801801   {
802802      address = cde_dma[channel].dst_addr;
803      length = cde_dma[channel].length;
803      //length = cde_dma[channel].length;
804804   }
805805
806806   for (i=0; i < cde_dma[channel].next_length; i++)
src/mame/drivers/cave.c
r4878r4879
13041304   PORT_DIPSETTING(      0xc000, DEF_STR( Very_Easy ) )
13051305   PORT_DIPSETTING(      0xa000, DEF_STR( Easy ) )
13061306   PORT_DIPSETTING(      0xe000, DEF_STR( Medium ) )
1307   PORT_DIPSETTING(      0x6000, "Medium Hard" )
1307   PORT_DIPSETTING(      0x6000, DEF_STR( Medium_Hard ) )
13081308   PORT_DIPSETTING(      0x8000, "Hard 1" )
13091309   PORT_DIPSETTING(      0x2000, "Hard 2" )
13101310   PORT_DIPSETTING(      0x4000, DEF_STR( Very_Hard ) )
r4878r4879
13281328   PORT_DIPNAME( 0xc000, 0xc000, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:7,8")
13291329   PORT_DIPSETTING(      0x8000, DEF_STR( Very_Easy ) )
13301330   PORT_DIPSETTING(      0xc000, DEF_STR( Medium ) )
1331   PORT_DIPSETTING(      0x4000, "Medium Hard" )
1331   PORT_DIPSETTING(      0x4000, DEF_STR( Medium_Hard ) )
13321332   PORT_DIPSETTING(      0x0000, DEF_STR( Hardest ) )
13331333INPUT_PORTS_END
13341334
src/mame/drivers/bigfghtr.c
r4878r4879
332332   AM_RANGE(0x080000, 0x0805ff) AM_RAM AM_BASE(&spriteram16) AM_SIZE(&spriteram_size)
333333   AM_RANGE(0x080600, 0x080fff) AM_READ(sharedram_r) AM_WRITE(sharedram_w) AM_BASE(&sharedram16)
334334   AM_RANGE(0x081000, 0x085fff) AM_RAM //??
335   AM_RANGE(0x086000, 0x086fff) AM_READ(SMH_RAM) AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram)
336   AM_RANGE(0x087000, 0x087fff) AM_READ(SMH_RAM) AM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram)
337   AM_RANGE(0x088000, 0x089fff) AM_READ(SMH_RAM) AM_WRITE(text_videoram_w) AM_BASE(&text_videoram)
338   AM_RANGE(0x08a000, 0x08afff) AM_READ(SMH_RAM) AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16)
335   AM_RANGE(0x086000, 0x086fff) AM_READONLY AM_WRITE(bg_videoram_w) AM_BASE(&bg_videoram)
336   AM_RANGE(0x087000, 0x087fff) AM_READONLY AM_WRITE(fg_videoram_w) AM_BASE(&fg_videoram)
337   AM_RANGE(0x088000, 0x089fff) AM_READONLY AM_WRITE(text_videoram_w) AM_BASE(&text_videoram)
338   AM_RANGE(0x08a000, 0x08afff) AM_READONLY AM_WRITE(paletteram16_xxxxRRRRGGGGBBBB_word_w) AM_BASE(&paletteram16)
339339   AM_RANGE(0x08b000, 0x08bfff) AM_RAM //??
340340   AM_RANGE(0x08c000, 0x08c001) AM_READ_PORT("P1")
341341   AM_RANGE(0x08c002, 0x08c003) AM_READ_PORT("P2")
src/mame/drivers/albazg.c
r4878r4879
224224
225225static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
226226   AM_RANGE(0x0000, 0x7fff) AM_ROM
227   AM_RANGE(0x8000, 0x9fff) AM_READWRITE(SMH_BANK(1), SMH_ROM)
227   AM_RANGE(0x8000, 0x9fff) AM_ROMBANK(1)
228228   AM_RANGE(0xa7fc, 0xa7fc) AM_WRITE(prot_lock_w)
229229   AM_RANGE(0xa7ff, 0xa7ff) AM_WRITE(eeprom_w)
230230   AM_RANGE(0xaf80, 0xafff) AM_READWRITE(custom_ram_r, custom_ram_w) AM_BASE(&cus_ram)
src/mame/drivers/crimfght.c
r4878r4879
114114   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,7")
115115   PORT_DIPSETTING(    0x60, DEF_STR( Easy ) )
116116   PORT_DIPSETTING(    0x40, DEF_STR( Normal ) )
117   PORT_DIPSETTING(    0x20, "Difficult" )
118   PORT_DIPSETTING(    0x00, "Very difficult" )
117   PORT_DIPSETTING(    0x20, DEF_STR( Difficult ) )
118   PORT_DIPSETTING(    0x00, DEF_STR( Very_Difficult ) )
119119   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
120120   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
121121   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
src/mame/drivers/rabbit.c
r4878r4879
483483static WRITE32_HANDLER ( rabbit_rombank_w )
484484{
485485   UINT8 *dataroms = memory_region(space->machine, "gfx1");
486   int bank;
486//  int bank;
487487//  mame_printf_debug("rabbit rombank %08x\n",data&0x3ff);
488   bank = data & 0x3ff;
488//  bank = data & 0x3ff;
489489
490490//  memory_set_bankptr(space->machine, 1,&dataroms[0x40000*(bank&0x3ff)]);
491491   memory_set_bankptr(space->machine, 1,&dataroms[0]);
src/mame/drivers/asuka.c
r4878r4879
408408   AM_RANGE(0x4000, 0x7fff) AM_ROMBANK(1)
409409   AM_RANGE(0x8000, 0x8fff) AM_RAM
410410   AM_RANGE(0x9000, 0x9001) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
411//  AM_RANGE(0x9002, 0x9100) AM_READ(SMH_RAM)
411//  AM_RANGE(0x9002, 0x9100) AM_READNOP
412412   AM_RANGE(0xa000, 0xa000) AM_WRITE(taitosound_slave_port_w)
413413   AM_RANGE(0xa001, 0xa001) AM_READWRITE(taitosound_slave_comm_r, taitosound_slave_comm_w)
414414   AM_RANGE(0xb000, 0xb000) AM_WRITE(asuka_msm5205_address_w)
src/mame/drivers/hvyunit.c
r4878r4879
331331}
332332
333333
334WRITE8_HANDLER( hu_videoram_w )
334static WRITE8_HANDLER( hu_videoram_w )
335335{
336336   videoram[offset] = data;
337337   tilemap_mark_tile_dirty(bg_tilemap, offset);
338338}
339339
340WRITE8_HANDLER( hu_colorram_w )
340static WRITE8_HANDLER( hu_colorram_w )
341341{
342342   colorram[offset] = data;
343343   tilemap_mark_tile_dirty(bg_tilemap, offset);
src/mame/drivers/segas18.c
r4878r4879
17161716
17171717/**************************************************************************************************************************
17181718    D.D. Crew, Sega System 18
1719    CPU: FD1094 (317-0182)
1719    CPU: FD1094 (317-0182 for 2P version, 317-0185 for 4P version, 317-0188 for 3P version)
17201720    ROM Board: 171-5987A
17211721*/
17221722ROM_START( ddcrewj )
r4878r4879
17601760    game No. 833-8830-02
17611761    pcb  No. 837-8832-02 (171-5873-02b)
17621762    rom  No. 834-8831-02 (171-5987a)
1763    CPU Hiatchi FD1094 317-0196
1763    CPU Hiatchi FD1094 317-0196 (Japanese version uses 317-0194)
17641764*/
17651765ROM_START( desertbr )
17661766   ROM_REGION( 0x300000, "maincpu", 0 ) /* 68000 code - custom CPU 317-0196 */
r4878r4879
19541954
19551955/**************************************************************************************************************************
19561956    Moonwalker, Sega System 18
1957    CPU: FD1094 (317-0157)
1957    CPU: FD1094 (317-0157, version uses i8751(315-5437) known to be exist)
19581958    ROM Board: 171-5873B
19591959*/
19601960ROM_START( mwalkj )
src/mame/drivers/astrocorp.c
r4878r4879
170170static ADDRESS_MAP_START( showhand_map, ADDRESS_SPACE_PROGRAM, 16 )
171171   AM_RANGE( 0x000000, 0x01ffff ) AM_ROM
172172   AM_RANGE( 0x050000, 0x050fff ) AM_RAM AM_BASE( &spriteram16 ) AM_SIZE( &spriteram_size )
173   AM_RANGE( 0x052000, 0x052001 ) AM_WRITE( SMH_NOP )
173   AM_RANGE( 0x052000, 0x052001 ) AM_WRITENOP
174174   AM_RANGE( 0x054000, 0x054001 ) AM_READ_PORT( "INPUTS" )
175175   AM_RANGE( 0x058000, 0x058001 ) AM_WRITE( astrocorp_eeprom_w )
176176   AM_RANGE( 0x05a000, 0x05a001 ) AM_WRITE( astrocorp_outputs_w )
r4878r4879
187187   AM_RANGE( 0x060000, 0x0601ff ) AM_RAM_WRITE( astrocorp_palette_w ) AM_BASE( &paletteram16 )
188188   AM_RANGE( 0x070000, 0x070001 ) AM_DEVWRITE( "oki", astrocorp_sound_bank_w )
189189   AM_RANGE( 0x080000, 0x080fff ) AM_RAM AM_BASE( &spriteram16 ) AM_SIZE( &spriteram_size )
190   AM_RANGE( 0x082000, 0x082001 ) AM_WRITE( SMH_NOP )
190   AM_RANGE( 0x082000, 0x082001 ) AM_WRITENOP
191191   AM_RANGE( 0x084000, 0x084001 ) AM_READ_PORT( "INPUTS" )
192192   AM_RANGE( 0x088000, 0x088001 ) AM_WRITE( astrocorp_eeprom_w )
193193   AM_RANGE( 0x08a000, 0x08a001 ) AM_WRITE( astrocorp_outputs_w )
src/mame/drivers/royalmah.c
r4878r4879
17291729   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) )
17301730   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
17311731   PORT_DIPSETTING(    0x40, DEF_STR( On ) )
1732   PORT_DIPNAME( 0x80, 0x00, "Full Tests" )
1732   PORT_DIPNAME( 0x80, 0x80, "Full Tests" )
17331733   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
17341734   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
17351735
src/mame/drivers/ajax.c
r4878r4879
8282   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )   PORT_DIPLOCATION("SW2:6,7")
8383   PORT_DIPSETTING(   0x60, DEF_STR( Easy ) )
8484   PORT_DIPSETTING(   0x40, DEF_STR( Normal ) )
85   PORT_DIPSETTING(   0x20, "Difficult" )
86   PORT_DIPSETTING(   0x00, "Very Difficult" )
85   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
86   PORT_DIPSETTING(   0x00, DEF_STR( Very_Difficult ) )
8787   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )   PORT_DIPLOCATION("SW2:8")
8888   PORT_DIPSETTING(   0x80, DEF_STR( Off ) )
8989   PORT_DIPSETTING(   0x00, DEF_STR( On ) )
src/mame/drivers/nmk16.c
r4878r4879
215215{
216216   if (ACCESSING_BITS_0_7)
217217   {
218      soundlatch_w(space,0,data & 0xff);
219      cpu_set_input_line(space->machine->cpu[1],0, HOLD_LINE);
218      soundlatch_w(space, 0, data & 0xff);
219      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
220220   }
221221}
222222
r4878r4879
275275{
276276   /* PCB behaviour verified by Corrado Tomaselli at MAME Italia Forum:
277277       every time music changes Z80 is resetted */
278   cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
278   cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
279279}
280280
281281static WRITE16_HANDLER( macross2_sound_command_w )
r4878r4879
313313{
314314   if (ACCESSING_BITS_0_7)
315315   {
316      soundlatch_w(space,0,data&0xff);
317      cpu_set_input_line(space->machine->cpu[1], 0, HOLD_LINE);
316      soundlatch_w(space, 0, data&0xff);
317      cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
318318   }
319319}
320320
r4878r4879
34633463
34643464static void ym2203_irqhandler(const device_config *device, int irq)
34653465{
3466   cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE);
3466   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
34673467}
34683468
34693469static const ym2203_interface ym2203_config =
r4878r4879
45834583static READ16_HANDLER( vandykeb_r ) { return 0x0000; }
45844584static DRIVER_INIT (vandykeb)
45854585{
4586   memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x08000e, 0x08000f, 0, 0, vandykeb_r );
4587   memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x08001e, 0x08001f, 0, 0, (write16_space_func)SMH_NOP );
4586   memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x08000e, 0x08000f, 0, 0, vandykeb_r );
4587   memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x08001e, 0x08001f, 0, 0, (write16_space_func)SMH_NOP );
45884588}
45894589
45904590
r4878r4879
48074807
48084808static void irq_handler(const device_config *device, int irq)
48094809{
4810   cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE);
4810   cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
48114811}
48124812
48134813static const ym2151_interface afega_ym2151_intf =
r4878r4879
52825282   ROM_LOAD( "mustang.17",    0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) )
52835283ROM_END
52845284
5285/* bootleg manufacturered by TAB AUSTRIA */
5286ROM_START( mustangb2 )
5287   ROM_REGION( 0x40000, "maincpu", 0 )
5288   ROM_LOAD16_BYTE( "05.bin",    0x00000, 0x20000, CRC(13c6363b) SHA1(e2c1985d1c8ec9751c47cd7e1b85e007f3aeb6fd) )
5289   ROM_LOAD16_BYTE( "04.bin",    0x00001, 0x20000, CRC(0d06f723) SHA1(28d5899114746d186e1ddd207deb177b31ff614d) )
5290
5291   ROM_REGION(0x20000, "audiocpu", 0 )   /* 64k for sound cpu code */
5292   ROM_LOAD( "01.bin",    0x00000, 0x8000, CRC(90820499) SHA1(ddd43373eb1891a05159085b52bf74760824e5aa) )
5293   ROM_CONTINUE(             0x010000, 0x08000 )
5294   ROM_COPY( "audiocpu", 0, 0x018000, 0x08000 )
5295
5296   ROM_REGION( 0x020000, "gfx1", ROMREGION_DISPOSE )
5297   ROM_LOAD( "06.bin",    0x00000, 0x20000, CRC(81ccfcad) SHA1(70a0f769c0d4588f6f17bd52cc86a745f30e9f00) )
5298
5299   ROM_REGION( 0x080000, "gfx2", ROMREGION_DISPOSE )
5300   ROM_LOAD( "07.bin",    0x00000, 0x20000, CRC(5f8fdfb1) SHA1(529494a317409da978d44610682ef56ebc24e0af) )
5301   ROM_LOAD( "10.bin",    0x20000, 0x20000, CRC(39757d6a) SHA1(71acf748c752df70f437b3ffa759d68d283c22cf) )
5302   ROM_LOAD( "08.bin",    0x40000, 0x20000, CRC(b3dd5243) SHA1(38b71dad7d392319ecef690fb230fa9ca46c7d0a) )
5303   ROM_LOAD( "09.bin",    0x60000, 0x20000, CRC(c6c9752f) SHA1(41a3581af7a10eab9eb15580760a99d27e67f085) )
5304
5305   ROM_REGION( 0x100000, "gfx3", ROMREGION_DISPOSE )
5306   ROM_LOAD16_BYTE( "18.bin",    0x00000, 0x20000, CRC(d13f0722) SHA1(3e9c0a3e124f8b2616bb4a39d2d3fb25623b8c85) )
5307   ROM_LOAD16_BYTE( "13.bin",    0x00001, 0x20000, CRC(54773f95) SHA1(2c57f54efa069907dfb59f15fbc2c580180df3cc) )
5308   ROM_LOAD16_BYTE( "17.bin",    0x40000, 0x20000, CRC(87c1fb43) SHA1(e874ab8aba448b002f64197dacb5d6c47fb83af2) )
5309   ROM_LOAD16_BYTE( "14.bin",    0x40001, 0x20000, CRC(932d3e33) SHA1(a784f288fa99e605a0bf396bc7694319980d1cd1) )
5310   ROM_LOAD16_BYTE( "16.bin",    0x80000, 0x20000, CRC(23d03ad5) SHA1(2cde1accd1d97ce9ea3d0ef24ae4d54e04b8f12f) )
5311   ROM_LOAD16_BYTE( "15.bin",    0x80001, 0x20000, CRC(a62b2f87) SHA1(bcffc6d10bed84c509e5cb57125d08127ab2c89d) )
5312   ROM_LOAD16_BYTE( "12.bin",    0xc0000, 0x20000, CRC(42a6cfc2) SHA1(46fc3b30a50efc94613e3b34aaf0543fa4cdc919) )
5313   ROM_LOAD16_BYTE( "11.bin",    0xc0001, 0x20000, CRC(9d3bee66) SHA1(e8db57b9a5581d3d54e69bb7ba229a49a7cc224f) )
5314
5315   ROM_REGION( 0x010000, "oki", 0 )   /* OKIM6295 samples */
5316   ROM_LOAD( "02.bin",    0x00000, 0x10000, CRC(f6f6c4bf) SHA1(ea4cf74d968e254ae47c16c2f4c2f4bc1a528808) )
5317ROM_END
5318
5319
5320
52855321ROM_START( acrobatm )
52865322   ROM_REGION( 0x40000, "maincpu", 0 )
52875323   ROM_LOAD16_BYTE( "02_ic100.bin",    0x00000, 0x20000, CRC(3fe487f4) SHA1(29aba5debcfddff14e584a1c7c5a403e85fc6ec0) )
r4878r4879
69256961/* Non NMK boards */
69266962
69276963// these use the seibu sound system (sound / music stolen from Raiden) rather than the bootleggers copying the nmk004
6928GAME( 1990, mustangb, mustang,  mustangb, mustang,  0,        ROT0,   "bootleg",                       "US AAF Mustang (bootleg)", GAME_UNEMULATED_PROTECTION ) // Playable but there are Still Protection Problems
6964GAME( 1990, mustangb, mustang,  mustangb, mustang,  0,        ROT0,   "bootleg",                       "US AAF Mustang (bootleg)", 0 )
6965GAME( 1990, mustangb2,mustang,  mustangb, mustang,  0,        ROT0,   "bootleg",                       "US AAF Mustang (TAB Austria bootleg)", 0 ) // PCB and roms have TAB Austria stickers
69296966GAME( 1991, tdragonb, tdragon,  tdragonb, tdragonb, tdragonb, ROT270, "NMK / Tecmo",                  "Thunder Dragon (Bootleg)", 0 )
69306967
69316968// these are from Comad, based on the Thunder Dragon code?
r4878r4879
69506987
69516988// bee-oh board - different display / interrupt timing to others?
69526989GAME( 1991, manybloc, 0,        manybloc, manybloc, 0,        ROT270,             "Bee-Oh",            "Many Block", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND )
6953
src/mame/drivers/nitedrvr.c
r4878r4879
9191   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )   // Spare
9292   PORT_DIPNAME( 0x20, 0x00, "Difficult Bonus" )
9393   PORT_DIPSETTING(   0x00, DEF_STR( Normal ) )
94   PORT_DIPSETTING(   0x20, "Difficult" )
94   PORT_DIPSETTING(   0x20, DEF_STR( Difficult ) )
9595   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNUSED )
9696
9797   PORT_START("IN0")   // fake
src/emu/debug/express.c
r4878r4879
887887               SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_BOR, TIN_PRECEDENCE_10);
888888            else if (strcmp(buffer, "bxor") == 0)
889889               SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_BXOR, TIN_PRECEDENCE_9);
890            else if (strcmp(buffer, "lshift") == 0)
891               SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_LSHIFT, TIN_PRECEDENCE_5);
892            else if (strcmp(buffer, "rshift") == 0)
893               SET_TOKEN_INFO(0, TOK_OPERATOR, TVL_RSHIFT, TIN_PRECEDENCE_5);
890894
891895            /* process anything else as a number or string */
892896            else
src/emu/cpu/h83002/h8disasm.c
r4878r4879
12471247            }
12481248            sprintf(buffer, "%4.4x %s.b #%1.1x, @%s", opcode, bit_instr[(data16>>8)&7], (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
12491249            break;
1250
1251         case 0x77:   // bld #xx:3, @rd
1252            sprintf(buffer, "%4.4x bld #%d, @%s", opcode, (data16>>4)&7, reg_names32[(opcode>>4) & 0x7]);
1253            break;
12501254      }
12511255      break;
12521256      // bxx.b #imm, @aa:8
src/emu/cpu/h83002/h8_16.c
r4878r4879
6565   return h8_disasm(buffer, pc, oprom, opram, 0xffffffff);
6666}
6767
68void h8_3002_InterruptRequest(h83xx_state *h8, UINT8 source)
68void h8_3002_InterruptRequest(h83xx_state *h8, UINT8 source, UINT8 state)
6969{
70   if(source>31)
70   // don't allow clear on external interrupts
71   if ((source <= 17) && (state == 0)) return;
72
73   if (state)
7174   {
72      h8->h8_IRQrequestH |= (1<<(source-32));
75      if (source>31)
76      {
77         h8->h8_IRQrequestH |= (1<<(source-32));
78      }
79      else
80      {
81         h8->h8_IRQrequestL |= (1<<source);
82      }
7383   }
7484   else
7585   {
76      h8->h8_IRQrequestL |= (1<<source);
86      if (source>31)
87      {
88         h8->h8_IRQrequestH &= ~(1<<(source-32));
89      }
90      else
91      {
92         h8->h8_IRQrequestL &= ~(1<<source);
93      }
7794   }
7895}
7996
r4878r4879
292309   case 17: // IRQ5
293310      if (h8->per_regs[0xF8]&0x10) res = 1; break;
294311   case 53: // SCI0 Rx
295      if (h8->per_regs[0xB2]&0x40) res = 1; break;
312      if (!(h8->per_regs[0xB2]&0x40)) res = -2;
313      else if (h8->per_regs[0xF9]&0x08) res = 1; break;
314   case 54: // SCI0 Tx Empty
315      if (!(h8->per_regs[0xB2]&0x80)) res = -2;
316      else if (h8->per_regs[0xF9]&0x08) res = 1; break;
317   case 55: // SCI0 Tx End
318      if (!(h8->per_regs[0xB2]&0x04)) res = -2;
319      else if (h8->per_regs[0xF9]&0x08) res = 1; break;
296320   case 57: // SCI1 Rx
297      if (h8->per_regs[0xBA]&0x40) res = 1; break;
321      if (!(h8->per_regs[0xBA]&0x40)) res = -2;
322      else if (h8->per_regs[0xF9]&0x04) res = 1; break;
323   case 58: // SCI1 Tx Empty
324      if (!(h8->per_regs[0xBA]&0x80)) res = -2;
325      else if (h8->per_regs[0xF9]&0x04) res = 1; break;
326   case 59: // SCI1 Tx End
327      if (!(h8->per_regs[0xBA]&0x04)) res = -2;
328      else if (h8->per_regs[0xF9]&0x04) res = 1; break;
298329   }
299330   return res;
300331}
r4878r4879
381412   case CPUINFO_INT_REGISTER + H8_E6:         h8->regs[6] = info->i;                     break;
382413   case CPUINFO_INT_REGISTER + H8_E7:         h8->regs[7] = info->i;                     break;
383414
384   case CPUINFO_INT_INPUT_STATE + H8_IRQ0:      if (info->i) h8_3002_InterruptRequest(h8, 12);      break;
385   case CPUINFO_INT_INPUT_STATE + H8_IRQ1:      if (info->i) h8_3002_InterruptRequest(h8, 13);      break;
386   case CPUINFO_INT_INPUT_STATE + H8_IRQ2:      if (info->i) h8_3002_InterruptRequest(h8, 14);      break;
387   case CPUINFO_INT_INPUT_STATE + H8_IRQ3:      if (info->i) h8_3002_InterruptRequest(h8, 15);      break;
388   case CPUINFO_INT_INPUT_STATE + H8_IRQ4:      if (info->i) h8_3002_InterruptRequest(h8, 16);      break;
389   case CPUINFO_INT_INPUT_STATE + H8_IRQ5:      if (info->i) h8_3002_InterruptRequest(h8, 17);      break;
415   case CPUINFO_INT_INPUT_STATE + H8_IRQ0:      h8_3002_InterruptRequest(h8, 12, info->i);      break;
416   case CPUINFO_INT_INPUT_STATE + H8_IRQ1:      h8_3002_InterruptRequest(h8, 13, info->i);      break;
417   case CPUINFO_INT_INPUT_STATE + H8_IRQ2:      h8_3002_InterruptRequest(h8, 14, info->i);      break;
418   case CPUINFO_INT_INPUT_STATE + H8_IRQ3:      h8_3002_InterruptRequest(h8, 15, info->i);      break;
419   case CPUINFO_INT_INPUT_STATE + H8_IRQ4:      h8_3002_InterruptRequest(h8, 16, info->i);      break;
420   case CPUINFO_INT_INPUT_STATE + H8_IRQ5:      h8_3002_InterruptRequest(h8, 17, info->i);      break;
390421
391   case CPUINFO_INT_INPUT_STATE + H8_METRO_TIMER_HACK:   if (info->i) h8_3002_InterruptRequest(h8, 24);      break;
422   case CPUINFO_INT_INPUT_STATE + H8_METRO_TIMER_HACK:   h8_3002_InterruptRequest(h8, 24, info->i);      break;
392423
393   case CPUINFO_INT_INPUT_STATE + H8_SCI_0_RX:   if (info->i) h8_3002_InterruptRequest(h8, 53);      break;
394   case CPUINFO_INT_INPUT_STATE + H8_SCI_1_RX:   if (info->i) h8_3002_InterruptRequest(h8, 57);      break;
424   case CPUINFO_INT_INPUT_STATE + H8_SCI_0_RX:   h8_3002_InterruptRequest(h8, 53, info->i);      break;
425   case CPUINFO_INT_INPUT_STATE + H8_SCI_1_RX:   h8_3002_InterruptRequest(h8, 57, info->i);      break;
395426
396427   default:
397428      fatalerror("h8_set_info unknown request %x", state);
src/emu/cpu/h83002/h8priv.h
r4878r4879
3030   const address_space *program;
3131   const address_space *io;
3232
33   // H8/3002 onboard peripherals stuff
34
33   // onboard peripherals stuff
3534   UINT8 per_regs[256];
3635
3736   UINT16 h8TCNT[5];
3837   UINT8 h8TSTR;
3938
39   UINT8 STCR, TCR[2], TCSR[2], TCORA[2], TCORB[2], TCNT[2];
40   UINT16 FRC;
41
4042   emu_timer *timer[5];
43   emu_timer *frctimer;
4144
4245   int mode_8bit;
4346};
src/emu/cpu/h83002/h8_8.c
r4878r4879
2626#define H8_WORD_TIMING(x, adr)   if (address24 >= 0xff90) h8->cyccnt -= (x) * 3; else h8->cyccnt -= (x) * 4;
2727#define H8_IOP_TIMING(x)   h8->cyccnt -= (x);
2828
29static TIMER_CALLBACK( h8_timer_0_cb );
30static TIMER_CALLBACK( h8_timer_1_cb );
31static TIMER_CALLBACK( h8_timer_2_cb );
32static TIMER_CALLBACK( h8_timer_3_cb );
33
2934INLINE UINT16 h8_mem_read16(h83xx_state *h8, offs_t address)
3035{
3136   UINT16 result =  memory_read_byte(h8->program, address)<<8;
r4878r4879
239244   h8->program = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
240245   h8->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
241246
247   h8->timer[0] = timer_alloc(h8->device->machine, h8_timer_0_cb, h8);
248   h8->timer[1] = timer_alloc(h8->device->machine, h8_timer_1_cb, h8);
249   h8->timer[2] = timer_alloc(h8->device->machine, h8_timer_2_cb, h8);
250   h8->timer[3] = timer_alloc(h8->device->machine, h8_timer_3_cb, h8);
251
242252   state_save_register_device_item(device, 0, h8->h8err);
243253   state_save_register_device_item_array(device, 0, h8->regs);
244254   state_save_register_device_item(device, 0, h8->pc);
r4878r4879
264274
265275   // disable timers
266276   h8->h8TSTR = 0;
277   h8->FRC = 0;
278   h8->STCR = 0;
279   h8->TCR[0] = h8->TCR[1] = 0;
280   h8->TCORA[0] = h8->TCORB[0] = 0;
281   h8->TCORA[1] = h8->TCORB[1] = 0;
282   h8->TCNT[0] = h8->TCNT[1] = 0;
267283}
268284
269285static void h8_GenException(h83xx_state *h8, UINT8 vectornr)
r4878r4879
309325      if (h8->per_regs[0xc7]&0x40) res = 1; break;
310326   case 11: // IRQ7
311327      if (h8->per_regs[0xc7]&0x80) res = 1; break;
328   case 19: // 8-bit timer 0 match A
329      if (h8->TCR[0] & 0x40) res = 1; break;
330   case 20: // 8-bit timer 0 match B
331      if (h8->TCR[0] & 0x80) res = 1; break;
332   case 22: // 8-bit timer 1 match A
333      if (h8->TCR[1] & 0x40) res = 1; break;
334   case 23: // 8-bit timer 1 match B
335      if (h8->TCR[1] & 0x80) res = 1; break;
312336   case 28: // SCI0 Rx
313337      if (h8->per_regs[0xda]&0x40) res = 1; break;
314338   case 32: // SCI1 Rx
r4878r4879
371395#define H8_ADDR_MASK 0xffff
372396#include "h8ops.h"
373397
398//  peripherals
399static void recalc_8bit_timer(h83xx_state *h8, int t)
400{
401   static INT32 dividers[8] = { 0, 0, 8, 2, 64, 32, 1024, 256 };
402   int div;
403   INT32 time;
404
405   div = (h8->STCR & 1) | ((h8->TCR[t] & 3)<<1);
406
407   // if "no clock source", stop
408   if (div < 2)
409   {
410      timer_adjust_oneshot(h8->timer[(t*2)], attotime_never, 0);
411      timer_adjust_oneshot(h8->timer[(t*2)+1], attotime_never, 0);
412      return;
413   }
414
415   if (h8->TCORA[t])
416   {
417      time = (cpu_get_clock(h8->device) / dividers[div]) / (h8->TCORA[t] - h8->TCNT[t]);
418      timer_adjust_oneshot(h8->timer[(t*2)], ATTOTIME_IN_HZ(time), 0);
419   }
420
421   if (h8->TCORB[t])
422   {
423      time = (cpu_get_clock(h8->device) / dividers[div]) / (h8->TCORB[t] - h8->TCNT[t]);
424      timer_adjust_oneshot(h8->timer[(t*2)+1], ATTOTIME_IN_HZ(time), 0);
425   }
426}
427
428// IRQs: timer 0: 19 A 20 B 21 OV  timer1: 22 A 23 B 24 OV
429static void timer_8bit_expire(h83xx_state *h8, int t, int sel)
430{
431   static int irqbase[2] = { 19, 22 };
432
433   timer_adjust_oneshot(h8->timer[(t*2)+sel], attotime_never, 0);
434
435   h8->TCSR[t] |= ((0x40)<<sel);
436
437   // check for interrupts
438   if (h8->TCR[t] & (0x40<<sel))
439   {
440      h8->h8_IRQrequestL |= (1 << (irqbase[t] + sel));
441   }
442
443   switch ((h8->TCR[t]>>3) & 3)
444   {
445      case 0:   // no clear
446         break;
447
448      case 1: // clear on match A
449         if (!sel)
450         {
451            h8->TCNT[t] = 0;
452            recalc_8bit_timer(h8, t);
453         }
454         break;
455
456      case 2: // clear on match B
457         if (sel)
458         {
459            h8->TCNT[t] = 0;
460            recalc_8bit_timer(h8, t);
461         }
462         break;
463
464      case 3:   // clear on external reset input signal (not implemented)
465         logerror("H8: external reset not implemented for 8-bit timers\n");
466         break;
467   }
468}
469
470
374471// MAME interface stuff
375472
376473static CPU_SET_INFO( h8 )
r4878r4879
414511{
415512   UINT8 val;
416513   UINT8 reg;
514   UINT64 frc;
515   static UINT64 divider[4] = { 2, 8, 32, 1 };
417516   h83xx_state *h8 = (h83xx_state *)space->cpu->token;
418517
419518   reg = (offset + 0x88) & 0xff;
r4878r4879
423522   case 0x8d:      // serial Rx 1
424523      val = memory_read_byte(h8->io, H8_SERIAL_1);
425524      break;
525   case 0x92:          // FRC H
526      frc = cpu_get_total_cycles(h8->device) / divider[h8->per_regs[0x96]];
527      frc %= 65536;
528      return frc>>8;
529      break;
530   case 0x93:      // FRC L
531      frc = cpu_get_total_cycles(h8->device) / divider[h8->per_regs[0x96]];
532      frc %= 65536;
533      return frc&0xff;
534      break;
426535   case 0xb2:          // port 1 data
427536      val = memory_read_byte(h8->io, H8_PORT_1);
428537      break;
r4878r4879
473582
474583   switch (reg)
475584   {
585   case 0x80:
586      printf("%02x to flash control or external\n", data);
587      break;
476588   case 0x8b:      // serial Tx 1
477589      memory_write_byte(h8->io, H8_SERIAL_1, data);
478590      break;
r4878r4879
519631   case 0x89:
520632      break;
521633
634   case 0xc7:
635      break;
636
637   case 0xc8:
638          h8->TCR[0] = data;
639      recalc_8bit_timer(h8, 0);
640      break;
641   case 0xc9:
642      h8->TCSR[0] = data;
643      h8->h8_IRQrequestL &= ~(1 << 19);
644      h8->h8_IRQrequestL &= ~(1 << 20);
645      h8->h8_IRQrequestL &= ~(1 << 21);
646      recalc_8bit_timer(h8, 0);
647      break;
648   case 0xca:
649      h8->TCORA[0] = data;
650      recalc_8bit_timer(h8, 0);
651      break;
652   case 0xcb:
653      h8->TCORB[0] = data;
654      recalc_8bit_timer(h8, 0);
655      break;
656   case 0xcc:
657      h8->TCNT[0] = data;
658      recalc_8bit_timer(h8, 0);
659      break;
660
522661   case 0xc3:
662      h8->STCR = data;
663      recalc_8bit_timer(h8, 0);
664      recalc_8bit_timer(h8, 1);
523665      break;
524666
525   case 0xc7:
667   case 0xd0:
668          h8->TCR[1] = data;
669      recalc_8bit_timer(h8, 1);
526670      break;
671   case 0xd1:
672      h8->TCSR[1] = data;
673      h8->h8_IRQrequestL &= ~(1 << 22);
674      h8->h8_IRQrequestL &= ~(1 << 23);
675      h8->h8_IRQrequestL &= ~(1 << 24);
676      recalc_8bit_timer(h8, 1);
677      break;
678   case 0xd2:
679      h8->TCORA[1] = data;
680      recalc_8bit_timer(h8, 1);
681      break;
682   case 0xd3:
683      h8->TCORB[1] = data;
684      recalc_8bit_timer(h8, 1);
685      break;
686   case 0xd4:
687      h8->TCNT[1] = data;
688      recalc_8bit_timer(h8, 1);
689      break;
527690   }
528691
529692   h8->per_regs[reg] = data;
530693}
531694
695static TIMER_CALLBACK( h8_timer_0_cb )
696{
697   h83xx_state *h8 = (h83xx_state *)ptr;
698   timer_8bit_expire(h8, 0, 0);
699}
700
701static TIMER_CALLBACK( h8_timer_1_cb )
702{
703   h83xx_state *h8 = (h83xx_state *)ptr;
704   timer_8bit_expire(h8, 0, 1);
705}
706
707static TIMER_CALLBACK( h8_timer_2_cb )
708{
709   h83xx_state *h8 = (h83xx_state *)ptr;
710   timer_8bit_expire(h8, 1, 0);
711}
712
713static TIMER_CALLBACK( h8_timer_3_cb )
714{
715   h83xx_state *h8 = (h83xx_state *)ptr;
716   timer_8bit_expire(h8, 1, 1);
717}
718
532719static ADDRESS_MAP_START( h8_3334_internal_map, ADDRESS_SPACE_PROGRAM, 8 )
533720   // 512B RAM
534721   AM_RANGE(0xfb80, 0xff7f) AM_RAM
src/emu/cpu/h83002/h8ops.h
r4878r4879
222222
223223   if (h8->h8err)
224224   {
225      fatalerror("H8/3xx: Unknown opcode (PC=%x)  %x", h8->ppc, opcode);
226
225      fatalerror("H8/3xx: Unknown opcode (PC=%x) %x", h8->ppc, opcode);
227226   }
228227
229228   return cycles - h8->cyccnt;
r4878r4879
12331232         udata32 = h8_mem_read32(h8, h8_getreg32(h8, H8_SP));
12341233         h8_setreg32(h8, H8_SP, h8_getreg32(h8, H8_SP)+4);
12351234         // extended mode
1236         h8->pc = udata32;
1235         h8->pc = udata32 & 0xffffff;
12371236         H8_IFETCH_TIMING(2);
12381237         H8_STACK_TIMING(2);
12391238         H8_IOP_TIMING(2);
r4878r4879
16951694
16961695         if(((opcode>>4)&0x8) == 0)
16971696         {
1698            switch((opcode>>8)&7)
1697            switch((opcode>>8)&0x7)
16991698            {
17001699            case 0:   udata8 = h8_bset8(h8, bitnr, udata8); h8_setreg8(h8, dstreg, udata8); H8_IFETCH_TIMING(1); break;
17011700            case 2:   udata8 = h8_bclr8(h8, bitnr, udata8); h8_setreg8(h8, dstreg, udata8);H8_IFETCH_TIMING(1);break;
r4878r4879
19241923               bitnr = (ext16>>4)&7;
19251924               h8_btst8(h8, bitnr, udata8);
19261925               break;
1926            // bld.b #imm, @Rn
1927            case 0x77:
1928               udata16 = h8_mem_read16(h8, h8->pc);
1929               h8->pc += 2;
1930               dstreg = (opcode>>4) & 7;
1931               h8_bld8(h8, (udata16>>4) & 7, h8_mem_read8(h8_getreg16(h8, dstreg)));
1932               H8_IFETCH_TIMING(1);
1933               H8_WORD_TIMING(1, h8_getreg16(h8, dstreg));
1934               break;
1935
1936
1937
1938
19271939            default:
19281940               h8->h8err=1;
19291941         }
src/emu/cpu/h83002/h8periph.c
r4878r4879
3838static const UINT8 tcr[5] = { TCR0, TCR1, TCR2, TCR3, TCR4 };
3939static const int tscales[4] = { 1, 2, 4, 8 };
4040
41extern void h8_3002_InterruptRequest(h83xx_state *h8, UINT8 source);
41extern void h8_3002_InterruptRequest(h83xx_state *h8, UINT8 source, UINT8 state);
4242extern void *h8_token;
4343
4444static void h8itu_timer_expire(h83xx_state *h8, int which)
r4878r4879
4949   // interrupt on overflow ?
5050   if(h8->per_regs[tier[which]] & 4)
5151   {
52      h8_3002_InterruptRequest(h8, 26 + 4*which);
52      h8_3002_InterruptRequest(h8, 26 + 4*which, 1);
5353   }
5454}
5555
r4878r4879
414414
415415   switch (reg)
416416   {
417      case 0xb3:
417      case 0xb3:   // serial 0 send
418418         memory_write_byte(h8->io, H8_SERIAL_0, val);
419         h8_3002_InterruptRequest(h8, 54, 1);
420         h8_3002_InterruptRequest(h8, 55, 1);
419421         break;
420      case 0xbb:
422      case 0xbb:   // serial 1 send
421423         memory_write_byte(h8->io, H8_SERIAL_1, val);
424         h8_3002_InterruptRequest(h8, 58, 1);
425         h8_3002_InterruptRequest(h8, 59, 1);
422426         break;
423427      case 0xc7:
424428         memory_write_byte(h8->io, H8_PORT_4, val);
r4878r4879
493497      if(h8->per_regs[0x64] & (4<<tnum))   // interrupt enable
494498      {
495499         //logerror("h8/3007 timer %d GRA INTERRUPT\n",tnum);
496         h8_3002_InterruptRequest(h8, 24+tnum*4);
500         h8_3002_InterruptRequest(h8, 24+tnum*4, 1);
497501      }
498502   }
499503   // GRB match
r4878r4879
515519      if(h8->per_regs[0x65] & (4<<tnum))   // interrupt enable
516520      {
517521         //logerror("h8/3007 timer %d GRB INTERRUPT\n",tnum);
518         h8_3002_InterruptRequest(h8, 25+tnum*4);
522         h8_3002_InterruptRequest(h8, 25+tnum*4, 1);
519523      }
520524   }
521525   // Overflow
r4878r4879
526530      if(h8->per_regs[0x66] & (4<<tnum))   // interrupt enable
527531      {
528532         //logerror("h8/3007 timer %d OVF INTERRUPT\n",tnum);
529         h8_3002_InterruptRequest(h8, 26+tnum*4);
533         h8_3002_InterruptRequest(h8, 26+tnum*4, 1);
530534      }
531535   }
532536
r4878r4879
574578
575579void h8_3007_itu_write8(h83xx_state *h8, UINT8 reg, UINT8 val)
576580{
577   //logerror("%06x: h8/3007 reg %02x = %02x\n",h8->pc,reg,val);
581   logerror("%06x: h8/3007 reg %02x = %02x\n",h8->pc,reg,val);
578582   h8->per_regs[reg] = val;
579583   switch(reg)
580584   {
src/emu/cpu/m68000/m68kcpu.h
r4878r4879
4848/* ======================================================================== */
4949
5050/* Exception Vectors handled by emulation */
51#define EXCEPTION_RESET                    0
5152#define EXCEPTION_BUS_ERROR                2 /* This one is not emulated! */
5253#define EXCEPTION_ADDRESS_ERROR            3 /* This one is partially emulated (doesn't stack a proper frame yet) */
5354#define EXCEPTION_ILLEGAL_INSTRUCTION      4
r4878r4879
563564
564565   int  initial_cycles;
565566   int  remaining_cycles;                     /* Number of clocks remaining */
567   int  reset_cycles;
566568   UINT32 tracing;
567569
568570   jmp_buf aerr_trap;
src/emu/cpu/m68000/m68kcpu.c
r4878r4879
8888const UINT8 m68ki_exception_cycle_table[4][256] =
8989{
9090   { /* 000 */
91        4, /*  0: Reset - Initial Stack Pointer                      */
91       40, /*  0: Reset - Initial Stack Pointer                      */
9292        4, /*  1: Reset - Initial Program Counter                    */
9393       50, /*  2: Bus Error                             (unemulated) */
9494       50, /*  3: Address Error                         (unemulated) */
9595       34, /*  4: Illegal Instruction                                */
96       38, /*  5: Divide by Zero -- ASG: changed from 42             */
97       40, /*  6: CHK -- ASG: chanaged from 44                       */
96       38, /*  5: Divide by Zero                                     */
97       40, /*  6: CHK                                                */
9898       34, /*  7: TRAPV                                              */
9999       34, /*  8: Privilege Violation                                */
100100       34, /*  9: Trace                                              */
r4878r4879
120120       44, /* 29: Level 5 Interrupt Autovector                       */
121121       44, /* 30: Level 6 Interrupt Autovector                       */
122122       44, /* 31: Level 7 Interrupt Autovector                       */
123       34, /* 32: TRAP #0 -- ASG: chanaged from 38                   */
123       34, /* 32: TRAP #0                                        */
124124       34, /* 33: TRAP #1                                            */
125125       34, /* 34: TRAP #2                                            */
126126       34, /* 35: TRAP #3                                            */
r4878r4879
161161        4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
162162   },
163163   { /* 010 */
164        4, /*  0: Reset - Initial Stack Pointer                      */
164       40, /*  0: Reset - Initial Stack Pointer                      */
165165        4, /*  1: Reset - Initial Program Counter                    */
166166      126, /*  2: Bus Error                             (unemulated) */
167167      126, /*  3: Address Error                         (unemulated) */
r4878r4879
539539{
540540   m68ki_cpu_core *m68k = get_safe_token(device);
541541
542   /* eat up any reset cycles */
543   cycles -= m68k->reset_cycles;
544   m68k->reset_cycles = 0;
545   if (cycles <= 0)
546      return m68k->reset_cycles;
547
542548   /* Set our pool of clock cycles available */
543549   m68k->remaining_cycles = cycles;
544550   m68k->initial_cycles = cycles;
r4878r4879
660666   m68ki_jump(m68k, REG_PC);
661667
662668   m68k->run_mode = RUN_MODE_NORMAL;
669
670   m68k->reset_cycles = m68k->cyc_exception[EXCEPTION_RESET];
663671}
664672
665673static CPU_DISASSEMBLE( m68k )
src/emu/cpu/tms34010/34010fld.c
r4878r4879
181181}
182182
183183
184void (*const tms34010_wfield_functions[32])(tms34010_state *tms, offs_t offset, UINT32 data) =
184static void (*const tms34010_wfield_functions[32])(tms34010_state *tms, offs_t offset, UINT32 data) =
185185{
186186   wfield_32, wfield_01, wfield_02, wfield_03, wfield_04, wfield_05,
187187   wfield_06, wfield_07, wfield_08, wfield_09, wfield_10, wfield_11,
r4878r4879
662662   return ((INT32)(ret << 1)) >> 1;
663663}
664664
665UINT32 (*const tms34010_rfield_functions[64])(tms34010_state *tms, offs_t offset) =
665static UINT32 (*const tms34010_rfield_functions[64])(tms34010_state *tms, offs_t offset) =
666666{
667667   rfield_32  , rfield_z_01, rfield_z_02, rfield_z_03, rfield_z_04, rfield_z_05,
668668   rfield_z_06, rfield_z_07, rfield_z_08, rfield_z_09, rfield_z_10, rfield_z_11,
src/emu/cpu/powerpc/ppc403.c
r4878r4879
611611         ppc.spu.sprc = d;
612612         if (ppc.spu.sprc & 0x80)   /* enable RX */
613613         {
614            int baud_rate;
615            if (ppc.iocr & 0x2) {
616               baud_rate = (3686400 / (ppc.spu.brd + 1)) / 16;
617            } else {
618               baud_rate = (33333333 / (ppc.spu.brd + 1)) / 16;
619            }
614            /*
615                int baud_rate;
616                if (ppc.iocr & 0x2) {
617                    baud_rate = (3686400 / (ppc.spu.brd + 1)) / 16;
618                } else {
619                    baud_rate = (33333333 / (ppc.spu.brd + 1)) / 16;
620                }
621                */
620622
621623            /* check if serial port is hooked to a DMA channel */
622624            /* if so, do a DMA operation */
src/emu/cpu/mb88xx/mb88xx.c
r4878r4879
1616#include "debugger.h"
1717#include "mb88xx.h"
1818
19
1920/***************************************************************************
21    CONSTANTS
22***************************************************************************/
23
24#define SERIAL_PRESCALE         6      /* guess */
25#define TIMER_PRESCALE         32      /* guess */
26
27#define SERIAL_DISABLE_THRESH   1000   /* at this value, we give up driving the serial port */
28
29#define INT_CAUSE_SERIAL      0x01
30#define INT_CAUSE_TIMER         0x02
31#define INT_CAUSE_EXTERNAL      0x04
32
33
34
35/***************************************************************************
2036    STRUCTURES & TYPEDEFS
2137***************************************************************************/
2238
r4878r4879
4359    /* Timer registers */
4460    UINT8   TH;   /* Timer High: 4 bits */
4561    UINT8   TL;   /* Timer Low: 4 bits */
62    UINT8   TP; /* Timer Prescale: 6 bits? */
63    UINT8   ctr; /* current external counter value */
4664
4765    /* Serial registers */
4866    UINT8   SB;   /* Serial buffer: 4 bits */
67    UINT16   SBcount;   /* number of bits received */
68    emu_timer *serial;
4969
5070    /* PLA configuration */
5171    UINT8 *   PLA;
5272
5373    /* IRQ handling */
54    int   pending_interrupt;
74    UINT8 pending_interrupt;
5575    cpu_irq_callback irqcallback;
5676    const device_config *device;
5777    const address_space *program;
r4878r4879
7393   return (mb88_state *)device->token;
7494}
7595
96static TIMER_CALLBACK( serial_timer );
97
7698/***************************************************************************
7799    MACROS
78100***************************************************************************/
r4878r4879
126148   cpustate->data = memory_find_address_space(device, ADDRESS_SPACE_DATA);
127149   cpustate->io = memory_find_address_space(device, ADDRESS_SPACE_IO);
128150
151   cpustate->serial = timer_alloc(device->machine, serial_timer, (void *)device);
152
129153   state_save_register_device_item(device, 0, cpustate->PC);
130154   state_save_register_device_item(device, 0, cpustate->PA);
131155   state_save_register_device_item(device, 0, cpustate->SP[0]);
r4878r4879
145169   state_save_register_device_item(device, 0, cpustate->pio);
146170   state_save_register_device_item(device, 0, cpustate->TH);
147171   state_save_register_device_item(device, 0, cpustate->TL);
172   state_save_register_device_item(device, 0, cpustate->TP);
173   state_save_register_device_item(device, 0, cpustate->ctr);
148174   state_save_register_device_item(device, 0, cpustate->SB);
175   state_save_register_device_item(device, 0, cpustate->SBcount);
149176   state_save_register_device_item(device, 0, cpustate->pending_interrupt);
150177}
151178
r4878r4879
156183   /* zero registers and flags */
157184   cpustate->PC = 0;
158185   cpustate->PA = 0;
159   cpustate->PA = 0;
160186   cpustate->SP[0] = cpustate->SP[1] = cpustate->SP[2] = cpustate->SP[3] = 0;
161187   cpustate->SI = 0;
162188   cpustate->A = 0;
r4878r4879
171197   cpustate->pio = 0;
172198   cpustate->TH = 0;
173199   cpustate->TL = 0;
200   cpustate->TP = 0;
174201   cpustate->SB = 0;
202   cpustate->SBcount = 0;
175203   cpustate->pending_interrupt = 0;
176204}
177205
r4878r4879
179207    CORE EXECUTION LOOP
180208***************************************************************************/
181209
210static TIMER_CALLBACK( serial_timer )
211{
212   mb88_state *cpustate = get_safe_token((const device_config *)ptr);
213
214   cpustate->SBcount++;
215
216   /* if we get too many interrupts with no servicing, disable the timer
217       until somebody does something */
218   if (cpustate->SBcount >= SERIAL_DISABLE_THRESH)
219      timer_adjust_oneshot(cpustate->serial, attotime_never, 0);
220
221   /* only read if not full; this is needed by the Namco 52xx to ensure that
222       the program can write to S and recover the value even if serial is enabled */
223   if (!cpustate->sf)
224   {
225      cpustate->SB = (cpustate->SB >> 1) | (READPORT(MB88_PORTSI) ? 8 : 0);
226
227      if (cpustate->SBcount >= 4)
228      {
229         cpustate->sf = 1;
230         cpustate->pending_interrupt |= INT_CAUSE_SERIAL;
231      }
232   }
233
234}
235
182236static int pla( mb88_state *cpustate, int inA, int inB )
183237{
184238   int index = ((inB&1) << 4) | (inA&0x0f);
r4878r4879
194248   /* on falling edge trigger interrupt */
195249   if ( (cpustate->pio & 0x04) && cpustate->nf && state == CLEAR_LINE )
196250   {
197      cpustate->pending_interrupt = 1;
251      cpustate->pending_interrupt |= INT_CAUSE_EXTERNAL;
198252   }
199253
200254   cpustate->nf = (state != CLEAR_LINE) ? 1 : 0;
201255}
202256
203static void update_pio( mb88_state *cpustate )
257static void update_pio_enable( mb88_state *cpustate, UINT8 newpio )
204258{
205   /* update interrupts, serial and timer flags */
259   /* if the serial state has changed, configure the timer */
260   if ((cpustate->pio ^ newpio) & 0x30)
261   {
262      if ((newpio & 0x30) == 0)
263         timer_adjust_oneshot(cpustate->serial, attotime_never, 0);
264      else if ((newpio & 0x30) == 0x20)
265         timer_adjust_periodic(cpustate->serial, ATTOTIME_IN_HZ(cpustate->device->clock / SERIAL_PRESCALE), 0, ATTOTIME_IN_HZ(cpustate->device->clock / SERIAL_PRESCALE));
266      else
267         fatalerror("mb88xx: update_pio_enable set serial enable to unsupported value %02X\n", newpio & 0x30);
268   }
206269
207   if ( (cpustate->pio & 0x04) && cpustate->pending_interrupt )
270   cpustate->pio = newpio;
271}
272
273static void increment_timer( mb88_state *cpustate )
274{
275   cpustate->TL = (cpustate->TL + 1) & 0x0f;
276   if (cpustate->TL == 0)
208277   {
209      /* no vectors supported, just do the callback to clear irq_state if needed */
210      if (cpustate->irqcallback)
278      cpustate->TH = (cpustate->TH + 1) & 0x0f;
279      if (cpustate->TH == 0)
280      {
281         cpustate->vf = 1;
282         cpustate->pending_interrupt |= INT_CAUSE_TIMER;
283      }
284   }
285}
286
287static void update_pio( mb88_state *cpustate, int cycles )
288{
289   /* TODO: improve/validate serial and timer support */
290
291   /* internal clock enable */
292   if ( cpustate->pio & 0x80 )
293   {
294      cpustate->TP += cycles;
295      while (cpustate->TP >= TIMER_PRESCALE)
296      {
297         cpustate->TP -= TIMER_PRESCALE;
298         increment_timer(cpustate);
299      }
300   }
301
302   /* process pending interrupts */
303   if (cpustate->pending_interrupt & cpustate->pio)
304   {
305      /* if we have a live external source, call the irqcallback */
306      if (cpustate->pending_interrupt & cpustate->pio & INT_CAUSE_EXTERNAL)
211307         (*cpustate->irqcallback)(cpustate->device, 0);
212308
309      cpustate->pending_interrupt = 0;
310
213311      cpustate->SP[cpustate->SI] = GETPC();
214312      cpustate->SP[cpustate->SI] |= TEST_CF() << 15;
215313      cpustate->SP[cpustate->SI] |= TEST_ZF() << 14;
r4878r4879
219317      cpustate->PA = 0x00;
220318      cpustate->st = 1;
221319
222      cpustate->pending_interrupt = 0;
223
224320      CYCLES(3); /* ? */
225321   }
322}
226323
227   /* TODO: add support for serial and timer */
324void mb88_external_clock_w(const device_config *device, int state)
325{
326   mb88_state *cpustate = get_safe_token(device);
327   if (state != cpustate->ctr)
328   {
329      cpustate->ctr = state;
330
331      /* on a falling clock, increment the timer, but only if enabled */
332      if (cpustate->ctr == 0 && (cpustate->pio & 0x40))
333         increment_timer(cpustate);
334   }
228335}
229336
337
230338static CPU_EXECUTE( mb88 )
231339{
232340   mb88_state *cpustate = get_safe_token(device);
r4878r4879
497605
498606         case 0x26: /* tstv ZCS:..x */
499607            cpustate->st = cpustate->vf ^ 1;
608            cpustate->vf = 0;
500609            break;
501610
502611         case 0x27: /* tsts ZCS:..x */
503612            cpustate->st = cpustate->sf ^ 1;
613            if (cpustate->sf)
614            {
615               /* re-enable the timer if we disabled it previously */
616               if (cpustate->SBcount >= SERIAL_DISABLE_THRESH)
617                  timer_adjust_periodic(cpustate->serial, ATTOTIME_IN_HZ(cpustate->device->clock / SERIAL_PRESCALE), 0, ATTOTIME_IN_HZ(cpustate->device->clock / SERIAL_PRESCALE));
618               cpustate->SBcount = 0;
619            }
620            cpustate->sf = 0;
504621            break;
505622
506623         case 0x28: /* tstc ZCS:..x */
r4878r4879
526643         case 0x2c: /* rts ZCS:... */
527644            cpustate->SI = ( cpustate->SI - 1 ) & 3;
528645            cpustate->PC = cpustate->SP[cpustate->SI] & 0x3f;
529            cpustate->PA = cpustate->SP[cpustate->SI] >> 6;
646            cpustate->PA = (cpustate->SP[cpustate->SI] >> 6) & 0x1f;
530647            cpustate->st = 1;
531648            break;
532649
r4878r4879
572689            /* restore address and saved state flags on the top bits of the stack */
573690            cpustate->SI = ( cpustate->SI - 1 ) & 3;
574691            cpustate->PC = cpustate->SP[cpustate->SI] & 0x3f;
575            cpustate->PA = cpustate->SP[cpustate->SI] >> 6;
692            cpustate->PA = (cpustate->SP[cpustate->SI] >> 6) & 0x1f;
576693            cpustate->st = (cpustate->SP[cpustate->SI] >> 13)&1;
577694            cpustate->zf = (cpustate->SP[cpustate->SI] >> 14)&1;
578695            cpustate->cf = (cpustate->SP[cpustate->SI] >> 15)&1;
r4878r4879
586703            break;
587704
588705         case 0x3e: /* en imm ZCS:... */
589            cpustate->pio |= READOP(GETPC());
706            update_pio_enable(cpustate, cpustate->pio | READOP(GETPC()));
590707            INCPC();
591708            oc = 2;
592709            cpustate->st = 1;
593710            break;
594711
595712         case 0x3f: /* dis imm ZCS:... */
596            cpustate->pio &= ~(READOP(GETPC()));
713            update_pio_enable(cpustate, cpustate->pio & ~(READOP(GETPC())));
597714            INCPC();
598715            oc = 2;
599716            cpustate->st = 1;
r4878r4879
707824         case 0xa4:   case 0xa5:   case 0xa6:   case 0xa7:
708825         case 0xa8:   case 0xa9:   case 0xaa:   case 0xab:
709826         case 0xac:   case 0xad:   case 0xae:   case 0xaf: /* cyi ZCS:xxx */
710            arg = cpustate->Y - (opcode & 0x0f);
827            arg = (opcode & 0x0f) - cpustate->Y;
711828            UPDATE_CF(arg);
712829            arg &= 0x0f;
713830            UPDATE_ST_Z(arg);
r4878r4879
718835         case 0xb4:   case 0xb5:   case 0xb6:   case 0xb7:
719836         case 0xb8:   case 0xb9:   case 0xba:   case 0xbb:
720837         case 0xbc:   case 0xbd:   case 0xbe:   case 0xbf: /* ci ZCS:xxx */
721            arg = cpustate->A - (opcode & 0x0f);
838            arg = (opcode & 0x0f) - cpustate->A;
722839            UPDATE_CF(arg);
723840            arg &= 0x0f;
724841            UPDATE_ST_Z(arg);
r4878r4879
738855      CYCLES( oc );
739856
740857      /* update interrupts, serial and timer flags */
741      update_pio(cpustate);
858      update_pio(cpustate, oc);
742859   }
743860
744861   return cycles - cpustate->icount;
745862}
746863
747864/***************************************************************************
865    ADDRESS MAPS
866***************************************************************************/
867
868static ADDRESS_MAP_START(program_10bit, ADDRESS_SPACE_PROGRAM, 8)
869   AM_RANGE(0x000, 0x3ff) AM_ROM
870ADDRESS_MAP_END
871
872static ADDRESS_MAP_START(program_11bit, ADDRESS_SPACE_PROGRAM, 8)
873   AM_RANGE(0x000, 0x7ff) AM_ROM
874ADDRESS_MAP_END
875
876static ADDRESS_MAP_START(data_6bit, ADDRESS_SPACE_DATA, 8)
877   AM_RANGE(0x00, 0x3f) AM_RAM
878ADDRESS_MAP_END
879
880static ADDRESS_MAP_START(data_7bit, ADDRESS_SPACE_DATA, 8)
881   AM_RANGE(0x00, 0x7f) AM_RAM
882ADDRESS_MAP_END
883
884/***************************************************************************
748885    INFORMATION SETTERS
749886***************************************************************************/
750887
r4878r4879
799936      case CPUINFO_INT_DEFAULT_IRQ_VECTOR:         info->i = 0;                     break;
800937      case CPUINFO_INT_ENDIANNESS:               info->i = ENDIANNESS_BIG;               break;
801938      case CPUINFO_INT_CLOCK_MULTIPLIER:            info->i = 1;                     break;
802      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 1;                     break;
939      case CPUINFO_INT_CLOCK_DIVIDER:               info->i = 6;                     break;
803940      case CPUINFO_INT_MIN_INSTRUCTION_BYTES:         info->i = 1;                     break;
804941      case CPUINFO_INT_MAX_INSTRUCTION_BYTES:         info->i = 2;                     break;
805942      case CPUINFO_INT_MIN_CYCLES:               info->i = 1;                     break;
r4878r4879
849986      case CPUINFO_FCT_BURN:                     info->burn = NULL;                  break;
850987      case CPUINFO_FCT_DISASSEMBLE:               info->disassemble = CPU_DISASSEMBLE_NAME(mb88);         break;
851988      case CPUINFO_PTR_INSTRUCTION_COUNTER:         info->icount = &cpustate->icount;         break;
989      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break;
990      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:      info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break;
852991
853992      /* --- the following bits of info are returned as NULL-terminated strings --- */
854993      case CPUINFO_STR_NAME:                     strcpy(info->s, "MB88xx");            break;
r4878r4879
8981037      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11;               break;
8991038      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    info->i = 7;               break;
9001039
1040      /* --- the following bits of info are returned as pointers --- */
1041      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break;
1042      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:      info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break;
1043
9011044      /* --- the following bits of info are returned as NULL-terminated strings --- */
9021045      case CPUINFO_STR_NAME:                     strcpy(info->s, "MB8841");            break;
9031046
r4878r4879
9131056      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 11;               break;
9141057      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    info->i = 7;               break;
9151058
1059      /* --- the following bits of info are returned as pointers --- */
1060      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_11bit); break;
1061      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:      info->internal_map8 = ADDRESS_MAP_NAME(data_7bit); break;
1062
9161063      /* --- the following bits of info are returned as NULL-terminated strings --- */
9171064      case CPUINFO_STR_NAME:                     strcpy(info->s, "MB8842");            break;
9181065
r4878r4879
9281075      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10;               break;
9291076      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    info->i = 6;               break;
9301077
1078      /* --- the following bits of info are returned as pointers --- */
1079      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break;
1080      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:      info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break;
1081
9311082      /* --- the following bits of info are returned as NULL-terminated strings --- */
9321083      case CPUINFO_STR_NAME:                     strcpy(info->s, "MB8843");            break;
9331084
r4878r4879
9431094      case CPUINFO_INT_ADDRBUS_WIDTH_PROGRAM: info->i = 10;               break;
9441095      case CPUINFO_INT_ADDRBUS_WIDTH_DATA:    info->i = 6;               break;
9451096
1097      /* --- the following bits of info are returned as pointers --- */
1098      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_PROGRAM:   info->internal_map8 = ADDRESS_MAP_NAME(program_10bit); break;
1099      case CPUINFO_PTR_INTERNAL_MEMORY_MAP_DATA:      info->internal_map8 = ADDRESS_MAP_NAME(data_6bit); break;
1100
9461101      /* --- the following bits of info are returned as NULL-terminated strings --- */
9471102      case CPUINFO_STR_NAME:                     strcpy(info->s, "MB8844");            break;
9481103
src/emu/cpu/mb88xx/mb88xx.h
r4878r4879
2626   MB88_PORTR0,   /* R0-R3, 4 bits */
2727   MB88_PORTR1,   /* R4-R7, 4 bits */
2828   MB88_PORTR2,   /* R8-R11, 4 bits */
29   MB88_PORTR3      /* R12-R15, 4 bits */
29   MB88_PORTR3,   /* R12-R15, 4 bits */
30   MB88_PORTSI      /* SI, 1 bit */
3031};
3132
3233/***************************************************************************
r4878r4879
7879
7980CPU_DISASSEMBLE( mb88 );
8081
82void mb88_external_clock_w(const device_config *device, int state);
83
8184#endif /* __MB88XX_H__ */
src/emu/cpu/sh4/sh4.c
r4878r4879
20782078   sh4->spc = sh4->r[m];
20792079}
20802080
2081UINT32 sh4_getsqremap(SH4 *sh4, UINT32 address)
2081static UINT32 sh4_getsqremap(SH4 *sh4, UINT32 address)
20822082{
20832083   if (!sh4->sh4_mmu_enabled)
20842084      return address;
r4878r4879
36663666#endif
36673667
36683668
3669READ64_HANDLER( sh4_tlb_r )
3669static READ64_HANDLER( sh4_tlb_r )
36703670{
36713671   SH4 *sh4 = get_safe_token(space->cpu);
36723672
r4878r4879
36843684   }
36853685}
36863686
3687WRITE64_HANDLER( sh4_tlb_w )
3687static WRITE64_HANDLER( sh4_tlb_w )
36883688{
36893689   SH4 *sh4 = get_safe_token(space->cpu);
36903690
src/emu/cpu/tms32025/tms32025.c
r4878r4879
19151915   return cpustate->tms32025_irq_cycles;
19161916}
19171917
1918void set_fsx_line(tms32025_state *cpustate, int state)
1918static void set_fsx_line(tms32025_state *cpustate, int state)
19191919{
19201920   if (state != CLEAR_LINE && cpustate->waiting_for_serial_frame)
19211921   {
src/emu/cpu/pdp1/pdp1dasm.c
r4878r4879
2222CPU_DISASSEMBLE( pdp1 )
2323{
2424   int md;
25   int etime = 0;
25   //int etime = 0;
2626
2727   md = *((UINT32 *) oprom);
2828
r4878r4879
3434      ea ();
3535      sprintf (buffer, "AND (0%06o)", y);
3636      IN;
37      etime = 10;
37      //etime = 10;
3838      break;
3939   case IOR:
4040      ea ();
4141      sprintf (buffer, "IOR (0%06o)", y);
4242      IN;
43      etime = 10;
43      //etime = 10;
4444      break;
4545   case XOR:
4646      ea ();
4747      sprintf (buffer, "XOR (0%06o)", y);
4848      IN;
49      etime = 10;
49      //etime = 10;
5050      break;
5151   case XCT:
5252      ea ();
5353      sprintf (buffer, "XCT (0%06o)", y);
5454      IN;
55      etime = 5;
55      //etime = 5;
5656      break;
5757   case CALJDA:
5858      {
r4878r4879
6060            sprintf (buffer, "JDA 0%06o  ", y);
6161         if (ib == 0)
6262            sprintf (buffer, "CAL         ");
63         etime = 10;
63         //etime = 10;
6464         break;
6565      }
6666   case LAC:
6767      ea ();
6868      sprintf (buffer, "LAC (0%06o)", y);
6969      IN;
70      etime = 10;
70      //etime = 10;
7171      break;
7272   case LIO:
7373      ea ();
7474      sprintf (buffer, "LIO (0%06o)", y);
7575      IN;
76      etime = 10;
76      //etime = 10;
7777      break;
7878   case DAC:
7979      ea ();
8080      sprintf (buffer, "DAC 0%06o  ", y);
8181      IN;
82      etime = 10;
82      //etime = 10;
8383      break;
8484   case DAP:
8585      ea ();
8686      sprintf (buffer, "DAP 0%06o  ", y);
8787      IN;
88      etime = 10;
88      //etime = 10;
8989      break;
9090   case DIP:
9191      ea ();
9292      sprintf (buffer, "DIP 0%06o  ", y);
9393      IN;
94      etime = 10;
94      //etime = 10;
9595      break;
9696   case DIO:
9797      ea ();
9898      sprintf (buffer, "DIO 0%06o  ", y);
9999      IN;
100      etime = 10;
100      //etime = 10;
101101      break;
102102   case DZM:
103103      ea ();
104104      sprintf (buffer, "DZM 0%06o  ", y);
105105      IN;
106      etime = 10;
106      //etime = 10;
107107      break;
108108   case ADD:
109109      ea ();
110110      sprintf (buffer, "ADD (0%06o)", y);
111111      IN;
112      etime = 10;
112      //etime = 10;
113113      break;
114114   case SUB:
115115      ea ();
116116      sprintf (buffer, "SUB (0%06o)", y);
117117      IN;
118      etime = 10;
118      //etime = 10;
119119      break;
120120   case IDX:
121121      ea ();
122122      sprintf (buffer, "IDX (0%06o)", y);
123123      IN;
124      etime = 10;
124      //etime = 10;
125125      break;
126126   case ISP:
127127      ea ();
128128      sprintf (buffer, "ISP (0%06o)", y);
129129      IN;
130      etime = 10;
130      //etime = 10;
131131      break;
132132   case SAD:
133133      ea ();
134134      sprintf (buffer, "SAD (0%06o)", y);
135135      IN;
136      etime = 10;
136      //etime = 10;
137137      break;
138138   case SAS:
139139      ea ();
140140      sprintf (buffer, "SAS (0%06o)", y);
141141      IN;
142      etime = 10;
142      //etime = 10;
143143      break;
144144   case MUS_MUL:
145145      ea ();
146146      sprintf (buffer, "MUS (0%06o)", y);
147147      IN;
148      etime = 10;
148      //etime = 10;
149149      break;
150150   case DIS_DIV:
151151      ea ();
152152      sprintf (buffer, "DIS (0%06o)", y);
153153      IN;
154      etime = 10;
154      //etime = 10;
155155      break;
156156   case JMP:
157157      ea ();
158158      sprintf (buffer, "JMP 0%06o  ", y);
159159      IN;
160      etime = 5;
160      //etime = 5;
161161      break;
162162   case JSP:
163163      ea ();
164164      sprintf (buffer, "JSP 0%06o  ", y);
165165      IN;
166      etime = 5;
166      //etime = 5;
167167      break;
168168   case SKP:
169169      {
r4878r4879
183183         if (y & 7)
184184            sprintf (buffer + strlen (buffer), "SZF 0%01o ", (y & 7));
185185         IN;
186         etime = 5;
186         //etime = 5;
187187         break;
188188      }
189189   case SFT:
r4878r4879
200200         {
201201         case 1:
202202            sprintf (buffer, "RAL 0%02o", nshift);
203            etime = 5;
203            //etime = 5;
204204            break;
205205         case 2:
206206            sprintf (buffer, "RIL 0%02o", nshift);
207            etime = 5;
207            //etime = 5;
208208            break;
209209         case 3:
210210            sprintf (buffer, "RCL 0%02o", nshift);
211            etime = 5;
211            //etime = 5;
212212            break;
213213         case 5:
214214            sprintf (buffer, "SAL 0%02o", nshift);
215            etime = 5;
215            //etime = 5;
216216            break;
217217         case 6:
218218            sprintf (buffer, "SIL 0%02o", nshift);
219            etime = 5;
219            //etime = 5;
220220            break;
221221         case 7:
222222            sprintf (buffer, "SCL 0%02o", nshift);
223            etime = 5;
223            //etime = 5;
224224            break;
225225         case 9:
226226            sprintf (buffer, "RAR 0%02o", nshift);
227            etime = 5;
227            //etime = 5;
228228            break;
229229         case 10:
230230            sprintf (buffer, "RIR 0%02o", nshift);
231            etime = 5;
231            //etime = 5;
232232            break;
233233         case 11:
234234            sprintf (buffer, "RCR 0%02o", nshift);
235            etime = 5;
235            //etime = 5;
236236            break;
237237         case 13:
238238            sprintf (buffer, "SAR 0%02o", nshift);
239            etime = 5;
239            //etime = 5;
240240            break;
241241         case 14:
242242            sprintf (buffer, "SIR 0%02o", nshift);
243            etime = 5;
243            //etime = 5;
244244            break;
245245         case 15:
246246            sprintf (buffer, "SCR 0%02o", nshift);
247            etime = 5;
247            //etime = 5;
248248            break;
249249         default:
250250            sprintf (buffer, "SKP ???");
251            etime = 5;
251            //etime = 5;
252252            break;
253253         }
254254         break;
r4878r4879
256256   case LAW:
257257      sprintf (buffer, "LAW 0%06o", y);
258258      IN;
259      etime = 5;
259      //etime = 5;
260260      break;
261261   case IOT:
262262      sprintf (buffer, "IOT 0%06o", md);
263      etime = 10;
263      //etime = 10;
264264      break;
265265   case OPR:
266266      {
r4878r4879
281281            sprintf (buffer + strlen (buffer), "CLF 0%01o ", (y & 7));
282282         if (!(y))
283283            sprintf (buffer + strlen (buffer), "NOP ");
284         etime = 5;
284         //etime = 5;
285285         break;
286286      }
287287   default:
288288      sprintf (buffer, "ILLEGAL");
289      etime = 5;
289      //etime = 5;
290290      break;
291291   }
292292   return 4;
src/emu/cpu/arm7/arm7core.c
r4878r4879
14861486    rlo = (insn >> 12) & 0xf;
14871487
14881488#if ARM7_DEBUG_CORE
1489        if (((insn & 0xf) == 15) || (((insn >> 8) & 0xf) == 15) || (((insn >> 16) & 0xf) == 15) || (((insn >> 12) & 0xf) == 15)
1489        if (((insn & 0xf) == 15) || (((insn >> 8) & 0xf) == 15) || (((insn >> 16) & 0xf) == 15) || (((insn >> 12) & 0xf) == 15))
14901490            LOG(("%08x: Illegal use of PC as a register in SMULL opcode\n", R15));
14911491#endif
14921492
src/emu/cpu/m6800/m6800.c
r4878r4879
962962   }
963963   else
964964   {
965      int eddge;
965      //int eddge;
966966
967967      LOG(("M6800 '%s' set_irq_line %d,%d\n", cpustate->device->tag, irqline, state));
968968      cpustate->irq_state[irqline] = state;
969969
970970      if (irqline == M6800_TIN_LINE && state != cpustate->irq_state[irqline])
971971      {
972         eddge = (state == CLEAR_LINE ) ? 2 : 0;
972         //eddge = (state == CLEAR_LINE ) ? 2 : 0;
973973         if( ((cpustate->tcsr&TCSR_IEDG) ^ (state==CLEAR_LINE ? TCSR_IEDG : 0))==0 )
974974            return;
975975         /* active edge in */
src/emu/uigfx.c
r4878r4879
430430   float cellwidth, cellheight;
431431   float chwidth, chheight;
432432   float titlewidth;
433   float cellaspect;
433   //float cellaspect;
434434   float x0, y0;
435435   render_bounds cellboxbounds;
436436   render_bounds boxbounds;
r4878r4879
497497   /* compute the size of a single cell at this pixel scale factor, as well as the aspect ratio */
498498   cellwidth = (cellboxwidth / (float)xcells) / (float)targwidth;
499499   cellheight = (cellboxheight / (float)ycells) / (float)targheight;
500   cellaspect = cellwidth / cellheight;
500   //cellaspect = cellwidth / cellheight;
501501
502502   /* working from the new width/height, recompute the boxbounds */
503503   fullwidth = (float)cellboxwidth / (float)targwidth + 6.5f * chwidth;
src/emu/video/generic.c
r4878r4879
570570***************************************************************************/
571571
572572/*-------------------------------------------------
573    black - completely black pelette
574-------------------------------------------------*/
575
576PALETTE_INIT( all_black )
577{
578   int i;
579
580   for (i = 0; i < machine->config->total_colors; i++)
581   {
582      palette_set_color(machine,i,RGB_BLACK); /* black */
583   }
584}
585
586
587/*-------------------------------------------------
573588    black_and_white - basic 2-color black & white
574589-------------------------------------------------*/
575590
src/emu/video/generic.h
r4878r4879
131131
132132/* ----- generic palette init routines ----- */
133133
134PALETTE_INIT( all_black );
134135PALETTE_INIT( black_and_white );
135136PALETTE_INIT( RRRR_GGGG_BBBB );
136137PALETTE_INIT( RRRRR_GGGGG_BBBBB );
src/emu/video/tlc34076.c
r4878r4879
101101
102102/*************************************
103103 *
104 *  Save State
105 *
106 *************************************/
107
108void tlc34076_state_save(running_machine *machine)
109{
110   state_save_register_global_array(machine, local_paletteram);
111   state_save_register_global_array(machine, regs);
112   state_save_register_global_array(machine, pens);
113
114   state_save_register_global(machine, writeindex);
115   state_save_register_global(machine, readindex);
116   state_save_register_global(machine, dacbits);
117}
118
119
120/*************************************
121 *
104122 *  Read access
105123 *
106124 *************************************/
src/emu/video/tlc34076.h
r4878r4879
88***************************************************************************/
99
1010void tlc34076_reset(int dacwidth);
11void tlc34076_state_save(running_machine *machine);
1112
1213const pen_t *tlc34076_get_pens(void);
1314
src/emu/info.c
r4878r4879
7979   int nplayer = 0;
8080   int nbutton = 0;
8181   int ncoin = 0;
82   int controlsyes = 0;
82   //int controlsyes = 0;
8383   int analogcontrol = 0;
8484   int i;
8585   const char* service = 0;
r4878r4879
135135                  else
136136                     control[cjoy].Xway = "joy8way";
137137               }
138               controlsyes = 1;
138               //controlsyes = 1;
139139               break;
140140
141141            case IPT_JOYSTICK_UP:
r4878r4879
154154                  else
155155                     control[cjoy].Xway = "joy8way";
156156               }
157               controlsyes = 1;
157               //controlsyes = 1;
158158               break;
159159
160160            case IPT_JOYSTICKRIGHT_UP:
r4878r4879
175175                  else
176176                     control[cdoublejoy].Xway = "doublejoy8way";
177177               }
178               controlsyes = 1;
178               //controlsyes = 1;
179179               break;
180180
181181            case IPT_JOYSTICKRIGHT_LEFT:
r4878r4879
196196                  else
197197                     control[cdoublejoy].Xway = "doublejoy8way";
198198               }
199               controlsyes = 1;
199               //controlsyes = 1;
200200               break;
201201
202202            /* mark as an analog input, and get analog stats after switch */
r4878r4879
265265         /* get the analog stats */
266266         if (analogcontrol)
267267         {
268            controlsyes = 1;
268            //controlsyes = 1;
269269            control[analogcontrol].analog = 1;
270270
271271            if (field->min)
r4878r4879
361361{
362362   const game_driver *clone_of = driver_get_clone(game);
363363   int rom_type;
364   machine_config *pconfig = (clone_of != NULL) ? machine_config_alloc(clone_of->machine_config) : NULL;
364365
365366   /* iterate over 3 different ROM "types": BIOS, ROMs, DISKs */
366367   for (rom_type = 0; rom_type < 3; rom_type++)
r4878r4879
395396               /* if we have a valid ROM and we are a clone, see if we can find the parent ROM */
396397               if (!ROM_NOGOODDUMP(rom) && clone_of != NULL)
397398               {
399                  const rom_source *psource;
398400                  const rom_entry *pregion, *prom;
399401
400402                  /* scan the clone_of ROM for a matching ROM entry */
401                  for (pregion = rom_first_region(clone_of, NULL); pregion != NULL; pregion = rom_next_region(pregion))
402                     for (prom = rom_first_file(pregion); prom != NULL; prom = rom_next_file(prom))
403                        if (hash_data_is_equal(ROM_GETHASHDATA(rom), ROM_GETHASHDATA(prom), 0))
404                        {
405                           parent_rom = prom;
406                           break;
407                        }
403                  for (psource = rom_first_source(clone_of, pconfig); psource != NULL; psource = rom_next_source(clone_of, pconfig, psource))
404                     for (pregion = rom_first_region(clone_of, psource); pregion != NULL; pregion = rom_next_region(pregion))
405                        for (prom = rom_first_file(pregion); prom != NULL; prom = rom_next_file(prom))
406                           if (hash_data_is_equal(ROM_GETHASHDATA(rom), ROM_GETHASHDATA(prom), 0))
407                           {
408                              parent_rom = prom;
409                              break;
410                           }
408411               }
409412
410413               /* scan for a BIOS name */
r4878r4879
474477            }
475478         }
476479   }
480
481   if (pconfig != NULL)
482      machine_config_free(pconfig);
477483}
478484
479485
src/emu/memory.h
r4878r4879
776776#define AM_RAM                        AM_READWRITE(SMH_RAM, SMH_RAM)
777777#define AM_RAMBANK(_bank)               AM_READWRITE(SMH_BANK(_bank), SMH_BANK(_bank))
778778#define AM_RAM_WRITE(_write)            AM_READWRITE(SMH_RAM, _write)
779#define AM_READONLY                     AM_READ(SMH_RAM)
779780#define AM_WRITEONLY                  AM_WRITE(SMH_RAM)
780781
781782#define AM_UNMAP                     AM_READWRITE(SMH_UNMAP, SMH_UNMAP)
src/emu/mame.c
r4878r4879
13141314      machine_config *config;
13151315      astring *sourcename;
13161316
1317      /* parse "vertical.ini" or "horizont.ini" */
1318      if (driver->flags & ORIENTATION_SWAP_XY)
1319         parse_ini_file(options, "vertical");
1320      else
1321         parse_ini_file(options, "horizont");
1322
13171323      /* parse "vector.ini" for vector games */
13181324      config = machine_config_alloc(driver->machine_config);
13191325      for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
src/emu/inptport.c
r4878r4879
375375   { INPUT_STRING_Easiest, "Easiest" },
376376   { INPUT_STRING_Easier, "Easier" },
377377   { INPUT_STRING_Easy, "Easy" },
378   { INPUT_STRING_Medium_Easy, "Medium Easy" },
378379   { INPUT_STRING_Normal, "Normal" },
379380   { INPUT_STRING_Medium, "Medium" },
381   { INPUT_STRING_Medium_Hard, "Medium Hard" },
380382   { INPUT_STRING_Hard, "Hard" },
381383   { INPUT_STRING_Harder, "Harder" },
382384   { INPUT_STRING_Hardest, "Hardest" },
383385   { INPUT_STRING_Very_Hard, "Very Hard" },
386   { INPUT_STRING_Medium_Difficult, "Medium Difficult" },
387   { INPUT_STRING_Difficult, "Difficult" },
388   { INPUT_STRING_More_Difficult, "More Difficult" },
389   { INPUT_STRING_Most_Difficult, "Most Difficult" },
390   { INPUT_STRING_Very_Difficult, "Very Difficult" },
384391   { INPUT_STRING_Very_Low, "Very Low" },
385392   { INPUT_STRING_Low, "Low" },
386393   { INPUT_STRING_High, "High" },
src/emu/devintrf.c
r4878r4879
126126
127127   /* populate device configuration */
128128   device->clock = clock;
129   if ((device->clock & 0xff000000) == 0xff000000)
130   {
131      assert(device->owner != NULL);
132      device->clock = device->owner->clock * ((device->clock >> 12) & 0xfff) / ((device->clock >> 0) & 0xfff);
133   }
129134   device->static_config = NULL;
130135   device->inline_config = (configlen == 0) ? NULL : (device->tag + strlen(tag) + 1);
131136
src/emu/machine/rtc65271.h
r4878r4879
77extern void rtc65271_init(running_machine *machine, UINT8 *xram, void (*interrupt_callback)(running_machine *machine, int state));
88extern UINT8 rtc65271_r(int xramsel, offs_t offset);
99extern void rtc65271_w(int xramsel, offs_t offset, UINT8 data);
10extern READ8_HANDLER( rtc65271_rtc_r );
11extern READ8_HANDLER( rtc65271_xram_r );
12extern WRITE8_HANDLER( rtc65271_rtc_w );
13extern WRITE8_HANDLER( rtc65271_xram_w );
src/emu/machine/68681.c
r4878r4879
399399         {
400400            case 0x07: /* Timer, CLK/16 */
401401               {
402                  double hz;
402                  //double hz;
403403                  //attotime rate = attotime_mul(ATTOTIME_IN_HZ(duart68681->clock), 16*duart68681->CTR.w.l);
404404                  attotime rate = ATTOTIME_IN_HZ(2*device->clock/(2*16*16*duart68681->CTR.w.l));
405                  hz = ATTOSECONDS_TO_HZ(rate.attoseconds);
405                  //hz = ATTOSECONDS_TO_HZ(rate.attoseconds);
406406                  timer_adjust_periodic(duart68681->duart_timer, rate, 0, rate);
407407               }
408408               break;
src/emu/machine/ldpr8210.c
r4878r4879
305305   LASERDISC_TYPE_PIONEER_PR8210,            /* type of the player */
306306   sizeof(ldplayer_data),                  /* size of the state */
307307   "Pioneer PR-8210",                     /* name of the player */
308   rom_pr8210,                           /* pointer to ROM region information */
309   machine_config_pr8210,                  /* pointer to machine configuration */
308   ROM_NAME(pr8210),                     /* pointer to ROM region information */
309   MACHINE_DRIVER_NAME(pr8210),            /* pointer to machine configuration */
310310   pr8210_init,                        /* initialization callback */
311311   pr8210_vsync,                        /* vsync callback */
312312   pr8210_update,                        /* update callback */
r4878r4879
10251025   LASERDISC_TYPE_SIMUTREK_SPECIAL,         /* type of the player */
10261026   sizeof(ldplayer_data),                  /* size of the state */
10271027   "Simutrek Modified PR-8210",            /* name of the player */
1028   rom_simutrek,                        /* pointer to ROM region information */
1029   machine_config_simutrek,               /* pointer to machine configuration */
1028   ROM_NAME(simutrek),                     /* pointer to ROM region information */
1029   MACHINE_DRIVER_NAME(simutrek),            /* pointer to machine configuration */
10301030   simutrek_init,                        /* initialization callback */
10311031   simutrek_vsync,                        /* vsync callback */
10321032   simutrek_update,                     /* update callback */
src/emu/machine/ldvp931.c
r4878r4879
155155   LASERDISC_TYPE_PHILLIPS_22VP931,         /* type of the player */
156156   sizeof(ldplayer_data),                  /* size of the state */
157157   "Phillips 22VP931",                     /* name of the player */
158   rom_vp931,                           /* pointer to ROM region information */
159   machine_config_vp931,                  /* pointer to machine configuration */
158   ROM_NAME(vp931),                     /* pointer to ROM region information */
159   MACHINE_DRIVER_NAME(vp931),               /* pointer to machine configuration */
160160   vp931_init,                           /* initialization callback */
161161   vp931_vsync,                        /* vsync callback */
162162   vp931_update,                        /* update callback */
src/emu/machine/scsi.c
r4878r4879
105105
106106SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass )
107107{
108   SCSIInstance *scsiInstance = alloc_or_die(SCSIInstance);
108   SCSIInstance *scsiInstance = (SCSIInstance *)alloc_array_or_die(UINT8, SCSISizeof( scsiClass ));
109109   scsiInstance->scsiClass = scsiClass;
110110   scsiInstance->machine = machine;
111111   return scsiInstance;
src/emu/machine/microtch.c
r4878r4879
175175
176176INPUT_PORTS_START(microtouch)
177177   PORT_START("TOUCH")
178   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_IMPULSE(10) PORT_NAME( "Touch screen" )
178   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME( "Touch screen" )
179179   PORT_START("TOUCH_X")
180180   PORT_BIT( 0x3fff, 0x2000, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(45) PORT_KEYDELTA(15)
181181   PORT_START("TOUCH_Y")
src/emu/machine/ldv1000.c
r4878r4879
191191   LASERDISC_TYPE_PIONEER_LDV1000,            /* type of the player */
192192   sizeof(ldplayer_data),                  /* size of the state */
193193   "Pioneer LD-V1000",                     /* name of the player */
194   rom_ldv1000,                        /* pointer to ROM region information */
195   machine_config_ldv1000,                  /* pointer to machine configuration */
194   ROM_NAME(ldv1000),                     /* pointer to ROM region information */
195   MACHINE_DRIVER_NAME(ldv1000),            /* pointer to machine configuration */
196196   ldv1000_init,                        /* initialization callback */
197197   ldv1000_vsync,                        /* vsync callback */
198198   ldv1000_update,                        /* update callback */
src/emu/machine/rtc65271.c
r4878r4879
372372   return reply;
373373}
374374
375READ8_HANDLER( rtc65271_rtc_r )
376{
377   return rtc65271_r( 0, offset );
378}
375379
380READ8_HANDLER( rtc65271_xram_r )
381{
382   return rtc65271_r( 1, offset );
383}
384
376385/*
377    Read a byte from clock
386    Write a byte to clock
378387
379388    xramsel: select RTC register if 0, XRAM if 1
380389    offset: address (A0-A5 pins)
r4878r4879
453462   }
454463}
455464
465WRITE8_HANDLER( rtc65271_rtc_w )
466{
467   rtc65271_w( 0, offset, data );
468}
469
470WRITE8_HANDLER( rtc65271_xram_w )
471{
472   rtc65271_w( 1, offset, data );
473}
474
456475static void field_interrupts(void)
457476{
458477   if (rtc.regs[reg_C] & rtc.regs[reg_B] & (reg_C_PF | reg_C_AF | reg_C_UF))
src/emu/inptport.h
r4878r4879
453453   INPUT_STRING_Easiest,
454454   INPUT_STRING_Easier,
455455   INPUT_STRING_Easy,
456   INPUT_STRING_Medium_Easy,
456457   INPUT_STRING_Normal,
457458   INPUT_STRING_Medium,
459   INPUT_STRING_Medium_Hard,
458460   INPUT_STRING_Hard,
459461   INPUT_STRING_Harder,
460462   INPUT_STRING_Hardest,
461463   INPUT_STRING_Very_Hard,
464   INPUT_STRING_Medium_Difficult,
465   INPUT_STRING_Difficult,
466   INPUT_STRING_More_Difficult,
467   INPUT_STRING_Most_Difficult,
468   INPUT_STRING_Very_Difficult,
462469   INPUT_STRING_Very_Low,
463470   INPUT_STRING_Low,
464471   INPUT_STRING_High,
src/emu/devintrf.h
r4878r4879
133133#define DEVICE_CUSTOM_CONFIG_CALL(name)      DEVICE_CUSTOM_CONFIG(name)(device, entrytype, tokens)
134134
135135
136#define DERIVED_CLOCK(num, den)      (0xff000000 | ((num) << 12) | ((den) << 0))
137
138
136139/* shorthand for accessing devices by machine/type/tag */
137140#define devtag_get_device(mach,tag)                     device_list_find_by_tag((mach)->config->devicelist, tag)
138141
src/emu/sound/ymf271.c
r4878r4879
162162
163163    There appears to be at least 2 errors in the table from the original manual.
164164
165    Both 201 & 202 where listed as 3.74490.  202 has be changed to 3.92000 which is "about right"
166    232 was listed as 13.35547.  We use 14.35547 as it apears to be the correct value
165    Both 201 & 202 where listed as 3.74490.  202 has be changed to 3.91513 which was computed based on formulas by OG & Nicola
166    232 was listed as 13.35547.  We use 14.35547 as this is the correct value based on the formula listed below:
167
168LFO period seems easy to compute:
169
170int lfo_period(int entry)
171{
172  int ma, ex;
173  entry = 256-entry;
174  ma = entry & 15;
175  ex = entry >> 4;
176  if(ex)
177    return (ma | 16) << (ex+6);
178  else
179    return ma << 7;
180}
181
182lfo_freq = 44100 / lfo_period
183
167184*/
168185
169186static const double LFO_frequency_table[256] =
r4878r4879
193210   1.34583,   1.38924,   1.43555,   1.48505,   1.53809,   1.59509,   1.65640,   1.72266,
194211   1.79443,   1.87245,   1.95756,   2.05078,   2.15332,   2.26665,   2.39258,   2.53332,
195212   2.69165,   2.77848,   2.87109,   2.97010,   3.07617,   3.19010,   3.31280,   3.44531,
196   3.58887,   3.74490,   3.92000,   4.10156,   4.30664,   4.53331,   4.78516,   5.06664,
213   3.58887,   3.74490,   3.91513,   4.10156,   4.30664,   4.53331,   4.78516,   5.06664,
197214   5.38330,   5.55696,   5.74219,   5.94019,   6.15234,   6.38021,   6.62560,   6.89062,
198215   7.17773,   7.48981,   7.83026,   8.20312,   8.61328,   9.06661,   9.57031,   10.13327,
199216   10.76660,   11.11391,   11.48438,   11.88039,   12.30469,   12.76042,   13.25120,   13.78125,
src/emu/sound/sound.mak
r4878r4879
303303SOUNDDEFS += -DHAS_NAMCO=$(if $(filter NAMCO,$(SOUNDS)),1,0)
304304SOUNDDEFS += -DHAS_NAMCO_15XX=$(if $(filter NAMCO_15XX,$(SOUNDS)),1,0)
305305SOUNDDEFS += -DHAS_NAMCO_CUS30=$(if $(filter NAMCO_CUS30,$(SOUNDS)),1,0)
306SOUNDDEFS += -DHAS_NAMCO_52XX=$(if $(filter NAMCO_52XX,$(SOUNDS)),1,0)
307306SOUNDDEFS += -DHAS_NAMCO_63701X=$(if $(filter NAMCO_63701X,$(SOUNDS)),1,0)
308307SOUNDDEFS += -DHAS_C140=$(if $(filter C140,$(SOUNDS)),1,0)
309308SOUNDDEFS += -DHAS_C352=$(if $(filter C352,$(SOUNDS)),1,0)
r4878r4879
312311SOUNDOBJS += $(SOUNDOBJ)/namco.o
313312endif
314313
315ifneq ($(filter NAMCO_52XX,$(SOUNDS)),)
316SOUNDOBJS += $(SOUNDOBJ)/namco52.o
317endif
318
319314ifneq ($(filter NAMCO_63701X,$(SOUNDS)),)
320315SOUNDOBJS += $(SOUNDOBJ)/n63701x.o
321316endif
src/emu/cheat.c
r4878r4879
17071707   astring_replacec(string, 0, "< ", " lt ");
17081708   astring_replacec(string, 0, "<", " lt ");
17091709
1710   astring_replacec(string, 0, " << ", " lshift ");
1711   astring_replacec(string, 0, " <<", " lshift ");
1712   astring_replacec(string, 0, "<< ", " lshift ");
1713   astring_replacec(string, 0, "<<", " lshift ");
1714
17101715   return string;
17111716}
17121717
src/emu/validity.c
r4878r4879
13851385      for (field = port->fieldlist; field != NULL; field = field->next)
13861386      {
13871387         const input_setting_config *setting;
1388         int strindex = 0;
1388         //int strindex = 0;
13891389
13901390         /* verify analog inputs */
13911391         if (input_type_is_analog(field->type))
r4878r4879
14371437            }
14381438
14391439            /* look up the string and print an error if default strings are not used */
1440            strindex = get_defstr_index(field->name, driver, &error);
1440            /*strindex = */get_defstr_index(field->name, driver, &error);
14411441         }
14421442
14431443         /* verify conditions on the field */
src/mess/includes/apple3.h
r4878r4879
3939READ8_HANDLER( apple3_indexed_read );
4040WRITE8_HANDLER( apple3_indexed_write );
4141
42
4243/*----------- defined in video/apple3.c -----------*/
4344
4445VIDEO_START( apple3 );
src/mess/includes/c128.h
r4878r4879
6363
6464void c128_bankswitch_64 (running_machine *machine, int reset);
6565
66UINT8 c128_m6510_port_read(const device_config *device, UINT8 direction);
67void c128_m6510_port_write(const device_config *device, UINT8 direction, UINT8 data);
68
6669extern const cia6526_interface c128_ntsc_cia0, c128_pal_cia0;
6770extern const cia6526_interface c128_ntsc_cia1, c128_pal_cia1;
6871
72
6973#endif /* C128_H_ */
src/mess/machine/apple3.c
r4878r4879
717717   memory_region(machine, "maincpu")[0x0685] = 0x00;
718718
719719   apple3_enable_mask = 0;
720   apple3_update_drives((device_config*)devtag_get_device(machine, "fdc"));
720   apple3_update_drives(devtag_get_device(machine, "fdc"));
721721
722722   AY3600_init(machine);
723723
src/mess/drivers/apple3.c
r4878r4879
3232/* the Apple /// does some weird tricks whereby it monitors the SYNC pin
3333 * on the CPU to check for indexed instructions and directs them to
3434 * different memory locations */
35static const m6502_interface apple3_m6502_intf =
35static const m6502_interface apple3_m6502_interface =
3636{
37   apple3_indexed_read,
38   apple3_indexed_write,
39   NULL,
40   NULL
37   apple3_indexed_read,   /* read_indexed_func */
38   apple3_indexed_write,   /* write_indexed_func */
39   NULL,               /* port_read_func */
40   NULL,               /* port_write_func */
4141};
4242
4343
44
4445static MACHINE_DRIVER_START( apple3 )
4546   /* basic machine hardware */
4647   MDRV_CPU_ADD("maincpu", M6502, 2000000)        /* 2 MHz */
4748   MDRV_CPU_PROGRAM_MAP(apple3_map)
48   MDRV_CPU_CONFIG( apple3_m6502_intf )
49   MDRV_CPU_CONFIG( apple3_m6502_interface )
4950   MDRV_CPU_PERIODIC_INT(apple3_interrupt, 192)
5051   MDRV_QUANTUM_TIME(HZ(60))
5152
src/mess/drivers/c128.c
r4878r4879
572572
573573static const m6502_interface c128_m8502_interface =
574574{
575   NULL,
576   NULL,
577   c128_m6510_port_read,
578   c128_m6510_port_write
575   NULL,               /* read_indexed_func */
576   NULL,               /* write_indexed_func */
577   c128_m6510_port_read,   /* port_read_func */
578   c128_m6510_port_write,   /* port_write_func */
579579};
580580
581581
r4878r4879
585585 *
586586 *************************************/
587587
588
589588static MACHINE_DRIVER_START( c128 )
590589   /* basic machine hardware */
591590   MDRV_CPU_ADD("maincpu", Z80, VIC6567_CLOCK)
src/mess/drivers/c16.c
r4878r4879
403403   NULL   
404404};
405405
406
407406static const m6502_interface c16_m7501_interface =
408407{
409   NULL,
410   NULL,
411   c16_m7501_port_read,
412   c16_m7501_port_write
408   NULL,               /* read_indexed_func */
409   NULL,               /* write_indexed_func */
410   c16_m7501_port_read,   /* port_read_func */
411   c16_m7501_port_write   /* port_write_func */
413412};
414413
415
416414static MACHINE_DRIVER_START( c16 )
417415   /* basic machine hardware */
418416   MDRV_CPU_ADD("maincpu", M7501, 1400000)        /* 7.8336 MHz */
docs/messnew.txt
r4878r4879
176176
177177Source Changes:
178178----------------
179- The core is based on MAME 0.131u2.  This incorporates all features of the
179- The core is based on MAME 0.131u3.  This incorporates all features of the
180180  update to this core.  [MAME team]
181181
182182- Converted the WAVE sound device to stereo. [Curt Coder]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team