Previous 15994 Revisions Next

r2370 Saturday 12th April, 2008 at 09:23:05 UTC by Dirk Best
Removed some files deleted in the MAME 0.124u1 update
[src/emu]validity.c
[src/mame/drivers]amidar.c frogger.c
[src/mame/machine]galaxian.c

src/mame/machine/galaxian.c
r2369r2370
1/***************************************************************************
2
3  machine.c
4
5  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
6  I/O ports)
7
8***************************************************************************/
9
10#include "driver.h"
11#include "deprecat.h"
12#include "machine/7474.h"
13#include "includes/galaxian.h"
14
15static int irq_line;
16static emu_timer *int_timer;
17
18static UINT8 kingball_speech_dip;
19static UINT8 kingball_sound;
20
21static UINT8 _4in1_bank;
22static UINT8 gmgalax_selected_game;
23
24
25static void galaxian_7474_9M_2_callback(void)
26{
27   /* Q bar clocks the other flip-flop,
28       Q is VBLANK (not visible to the CPU) */
29   TTL7474_clock_w(1, TTL7474_output_comp_r(0));
30   TTL7474_update(1);
31}
32
33static void galaxian_7474_9M_1_callback(void)
34{
35   /* Q goes to the NMI line */
36   cpunum_set_input_line(Machine, 0, irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE);
37}
38
39static const struct TTL7474_interface galaxian_7474_9M_2_intf =
40{
41   galaxian_7474_9M_2_callback
42};
43
44static const struct TTL7474_interface galaxian_7474_9M_1_intf =
45{
46   galaxian_7474_9M_1_callback
47};
48
49
50WRITE8_HANDLER( galaxian_nmi_enable_w )
51{
52   TTL7474_preset_w(1, data);
53   TTL7474_update(1);
54}
55
56
57static TIMER_CALLBACK( interrupt_timer )
58{
59   /* 128V, 64V and 32V go to D */
60   TTL7474_d_w(0, (param & 0xe0) != 0xe0);
61
62   /* 16V clocks the flip-flop */
63   TTL7474_clock_w(0, param & 0x10);
64
65   param = (param + 0x10) & 0xff;
66
67   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, param, 0), param);
68
69   TTL7474_update(0);
70}
71
72
73static void machine_reset_common(running_machine *machine, int line)
74{
75   irq_line = line;
76
77   /* initalize main CPU interrupt generator flip-flops */
78   TTL7474_config(0, &galaxian_7474_9M_2_intf);
79   TTL7474_preset_w(0, 1);
80   TTL7474_clear_w (0, 1);
81
82   TTL7474_config(1, &galaxian_7474_9M_1_intf);
83   TTL7474_clear_w (1, 1);
84   TTL7474_d_w     (1, 0);
85   TTL7474_preset_w(1, 0);
86
87   /* start a timer to generate interrupts */
88   int_timer = timer_alloc(interrupt_timer, NULL);
89   timer_adjust_oneshot(int_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
90}
91
92MACHINE_RESET( galaxian )
93{
94   machine_reset_common(machine, INPUT_LINE_NMI);
95}
96
97MACHINE_RESET( devilfsg )
98{
99   machine_reset_common(machine, 0);
100}
101
102
103
104WRITE8_HANDLER( galaxian_coin_lockout_w )
105{
106   coin_lockout_global_w(~data & 1);
107}
108
109
110WRITE8_HANDLER( galaxian_coin_counter_w )
111{
112   coin_counter_w(offset, data & 0x01);
113}
114
115WRITE8_HANDLER( galaxian_coin_counter_1_w )
116{
117   coin_counter_w(1, data & 0x01);
118}
119
120WRITE8_HANDLER( galaxian_coin_counter_2_w )
121{
122   coin_counter_w(2, data & 0x01);
123}
124
125
126WRITE8_HANDLER( galaxian_leds_w )
127{
128   set_led_status(offset,data & 1);
129}
130
131
132READ8_HANDLER( jumpbug_protection_r )
133{
134   switch (offset)
135   {
136   case 0x0114:  return 0x4f;
137   case 0x0118:  return 0xd3;
138   case 0x0214:  return 0xcf;
139   case 0x0235:  return 0x02;
140   case 0x0311:  return 0x00;  /* not checked */
141   default:
142      logerror("Unknown protection read. Offset: %04X  PC=%04X\n",0xb000+offset,activecpu_get_pc());
143   }
144
145   return 0;
146}
147
148
149
150static READ8_HANDLER( checkmaj_protection_r )
151{
152   switch (activecpu_get_pc())
153   {
154   case 0x0f15:  return 0xf5;
155   case 0x0f8f:  return 0x7c;
156   case 0x10b3:  return 0x7c;
157   case 0x10e0:  return 0x00;
158   case 0x10f1:  return 0xaa;
159   case 0x1402:  return 0xaa;
160   default:
161      logerror("Unknown protection read. PC=%04X\n",activecpu_get_pc());
162   }
163
164   return 0;
165}
166
167
168/* Zig Zag can swap ROMs 2 and 3 as a form of copy protection */
169WRITE8_HANDLER( zigzag_sillyprotection_w )
170{
171   if (data)
172   {
173      /* swap ROM 2 and 3! */
174      memory_set_bank(1, 1);
175      memory_set_bank(2, 0);
176   }
177   else
178   {
179      memory_set_bank(1, 0);
180      memory_set_bank(2, 1);
181   }
182}
183
184DRIVER_INIT( zigzag )
185{
186   UINT8 *RAM = memory_region(REGION_CPU1);
187   memory_configure_bank(1, 0, 2, &RAM[0x2000], 0x1000);
188   memory_configure_bank(2, 0, 2, &RAM[0x2000], 0x1000);
189   memory_set_bank(1, 0);
190   memory_set_bank(2, 1);
191}
192
193
194
195static READ8_HANDLER( dingo_3000_r )
196{
197   return 0xaa;
198}
199
200static READ8_HANDLER( dingo_3035_r )
201{
202   return 0x8c;
203}
204
205static READ8_HANDLER( dingoe_3001_r )
206{
207   return 0xaa;
208}
209
210
211DRIVER_INIT( dingoe )
212{
213   offs_t i;
214   UINT8 *rom = memory_region(REGION_CPU1);
215
216   for (i = 0; i < 0x3000; i++)
217   {
218      UINT8 data_xor;
219
220      /* XOR bit 2 with 4 and 5 with 0 */
221      data_xor = BIT(rom[i], 2) << 4 | BIT(rom[i], 5) << 0;
222      rom[i] ^= data_xor;
223
224
225      /* Invert bit 1 */
226      if (~rom[i] & 0x02)
227         rom[i] = rom[i] | 0x02;
228      else
229         rom[i] = rom[i] & 0xfd;
230
231
232      /* Swap bit0 with bit4 */
233      if ((i & 0x0f) == 0x02 || (i & 0x0f) == 0x0a || (i & 0x0f) == 0x03 || (i & 0x0f) == 0x0b || (i & 0x0f) == 0x06 || (i & 0x0f) == 0x0e || (i & 0x0f) == 0x07 || (i & 0x0f) == 0x0f)   /* Swap Bit 0 and 4 */
234         rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4);
235   }
236
237   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3001, 0x3001, 0, 0, dingoe_3001_r);   /* Protection check */
238
239}
240
241
242
243/* Hack? If $b003 is high, we'll check our "fake" speech dipswitch (marked as SLAM) */
244static READ8_HANDLER( kingball_IN0_r )
245{
246   if (kingball_speech_dip)
247      return (readinputport(0) & ~0x40) | ((readinputport(3) & 0x01) << 6);
248   else
249      return readinputport(0);
250}
251
252static READ8_HANDLER( kingball_IN1_r )
253{
254   /* bit 5 is the NOISE line from the sound circuit.  The code just verifies
255       that it's working, doesn't actually use return value, so we can just use
256       rand() */
257
258   return (readinputport(1) & ~0x20) | (mame_rand(Machine) & 0x20);
259}
260
261WRITE8_HANDLER( kingball_speech_dip_w )
262{
263   kingball_speech_dip = data;
264}
265
266WRITE8_HANDLER( kingball_sound1_w )
267{
268   kingball_sound = (kingball_sound & ~0x01) | data;
269}
270
271WRITE8_HANDLER( kingball_sound2_w )
272{
273   kingball_sound = (kingball_sound & ~0x02) | (data << 1);
274   soundlatch_w (machine, 0, kingball_sound | 0xf0);
275}
276
277
278READ8_HANDLER( scramblb_protection_1_r )
279{
280   switch (activecpu_get_pc())
281   {
282   case 0x01da: return 0x80;
283   case 0x01e4: return 0x00;
284   default:
285      logerror("%04x: read protection 1\n",activecpu_get_pc());
286      return 0;
287   }
288}
289
290READ8_HANDLER( scramblb_protection_2_r )
291{
292   switch (activecpu_get_pc())
293   {
294   case 0x01ca: return 0x90;
295   default:
296      logerror("%04x: read protection 2\n",activecpu_get_pc());
297      return 0;
298   }
299}
300
301
302static READ8_HANDLER( azurian_IN1_r )
303{
304   return (readinputport(1) & ~0x40) | ((readinputport(3) & 0x01) << 6);
305}
306
307static READ8_HANDLER( azurian_IN2_r )
308{
309   return (readinputport(2) & ~0x04) | ((readinputport(3) & 0x02) << 1);
310}
311
312
313WRITE8_HANDLER( _4in1_bank_w )
314{
315   _4in1_bank = data & 0x03;
316   galaxian_gfxbank_w(machine, 0, _4in1_bank);
317   memory_set_bank(1, _4in1_bank);
318}
319
320READ8_HANDLER( _4in1_input_port_1_r )
321{
322   return (readinputport(1) & ~0xc0) | (readinputport(3+_4in1_bank) & 0xc0);
323}
324
325READ8_HANDLER( _4in1_input_port_2_r )
326{
327   return (readinputport(2) & 0x04) | (readinputport(3+_4in1_bank) & ~0xc4);
328}
329
330
331static void gmgalax_select_game(int game)
332{
333   gmgalax_selected_game = game;
334
335   memory_set_bank(1, game);
336
337   galaxian_gfxbank_w(Machine, 0, gmgalax_selected_game);
338}
339
340READ8_HANDLER( gmgalax_input_port_0_r )
341{
342   return readinputport(gmgalax_selected_game ? 3 : 0);
343}
344
345READ8_HANDLER( gmgalax_input_port_1_r )
346{
347   return readinputport(gmgalax_selected_game ? 4 : 1);
348}
349
350READ8_HANDLER( gmgalax_input_port_2_r )
351{
352   return readinputport(gmgalax_selected_game ? 5 : 2);
353}
354
355
356DRIVER_INIT( pisces )
357{
358   /* the coin lockout was replaced */
359   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxian_gfxbank_w);
360}
361
362DRIVER_INIT( checkmaj )
363{
364   /* for the title screen */
365   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3800, 0x3800, 0, 0, checkmaj_protection_r);
366}
367
368DRIVER_INIT( dingo )
369{
370   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3000, 0x3000, 0, 0, dingo_3000_r);
371   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x3035, 0x3035, 0, 0, dingo_3035_r);
372}
373
374DRIVER_INIT( kingball )
375{
376   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa000, 0, 0, kingball_IN0_r);
377   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa800, 0xa800, 0, 0, kingball_IN1_r);
378
379   state_save_register_global(kingball_speech_dip);
380   state_save_register_global(kingball_sound);
381}
382
383
384static UINT8 decode_mooncrst(UINT8 data,offs_t addr)
385{
386   UINT8 res;
387
388   res = data;
389   if (BIT(data,1)) res ^= 0x40;
390   if (BIT(data,5)) res ^= 0x04;
391   if ((addr & 1) == 0)
392      res = (res & 0xbb) | (BIT(res,6) << 2) | (BIT(res,2) << 6);
393   return res;
394}
395
396DRIVER_INIT( mooncrsu )
397{
398   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa002, 0, 0, galaxian_gfxbank_w);
399}
400
401DRIVER_INIT( mooncrst )
402{
403   offs_t i;
404   UINT8 *rom = memory_region(REGION_CPU1);
405
406
407   for (i = 0;i < memory_region_length(REGION_CPU1);i++)
408      rom[i] = decode_mooncrst(rom[i],i);
409
410   DRIVER_INIT_CALL(mooncrsu);
411}
412
413DRIVER_INIT( mooncrgx )
414{
415   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6000, 0x6002, 0, 0, galaxian_gfxbank_w);
416}
417
418DRIVER_INIT( moonqsr )
419{
420   offs_t i;
421   UINT8 *rom = memory_region(REGION_CPU1);
422   UINT8 *decrypt = auto_malloc(0x8000);
423
424   memory_set_decrypted_region(0, 0x0000, 0x7fff, decrypt);
425
426   for (i = 0;i < 0x8000;i++)
427      decrypt[i] = decode_mooncrst(rom[i],i);
428}
429
430DRIVER_INIT( checkman )
431{
432/*
433                     Encryption Table
434                     ----------------
435+---+---+---+------+------+------+------+------+------+------+------+
436|A2 |A1 |A0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0    |
437+---+---+---+------+------+------+------+------+------+------+------+
438| 0 | 0 | 0 |D7    |D6    |D5    |D4    |D3    |D2    |D1    |D0^^D6|
439| 0 | 0 | 1 |D7    |D6    |D5    |D4    |D3    |D2    |D1^^D5|D0    |
440| 0 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D4|D1^^D6|D0    |
441| 0 | 1 | 1 |D7    |D6    |D5    |D4^^D2|D3    |D2    |D1    |D0^^D5|
442| 1 | 0 | 0 |D7    |D6^^D4|D5^^D1|D4    |D3    |D2    |D1    |D0    |
443| 1 | 0 | 1 |D7    |D6^^D0|D5^^D2|D4    |D3    |D2    |D1    |D0    |
444| 1 | 1 | 0 |D7    |D6    |D5    |D4    |D3    |D2^^D0|D1    |D0    |
445| 1 | 1 | 1 |D7    |D6    |D5    |D4^^D1|D3    |D2    |D1    |D0    |
446+---+---+---+------+------+------+------+------+------+------+------+
447
448For example if A2=1, A1=1 and A0=0 then D2 to the CPU would be an XOR of
449D2 and D0 from the ROM's. Note that D7 and D3 are not encrypted.
450
451Encryption PAL 16L8 on cardridge
452         +--- ---+
453    OE --|   U   |-- VCC
454 ROMD0 --|       |-- D0
455 ROMD1 --|       |-- D1
456 ROMD2 --|VER 5.2|-- D2
457    A0 --|       |-- NOT USED
458    A1 --|       |-- A2
459 ROMD4 --|       |-- D4
460 ROMD5 --|       |-- D5
461 ROMD6 --|       |-- D6
462   GND --|       |-- M1 (NOT USED)
463         +-------+
464Pin layout is such that links can replace the PAL if encryption is not used.
465
466*/
467   static const UINT8 xortable[8][4] =
468   {
469      { 6,0,6,0 },
470      { 5,1,5,1 },
471      { 4,2,6,1 },
472      { 2,4,5,0 },
473      { 4,6,1,5 },
474      { 0,6,2,5 },
475      { 0,2,0,2 },
476      { 1,4,1,4 }
477   };
478
479   offs_t i;
480   UINT8 *rom = memory_region(REGION_CPU1);
481
482
483   for (i = 0; i < memory_region_length(REGION_CPU1); i++)
484   {
485      UINT8 data_xor;
486      int line = i & 0x07;
487
488      data_xor = (BIT(rom[i],xortable[line][0]) << xortable[line][1]) |
489               (BIT(rom[i],xortable[line][2]) << xortable[line][3]);
490
491      rom[i] ^= data_xor;
492   }
493}
494
495DRIVER_INIT( gteikob2 )
496{
497   DRIVER_INIT_CALL(pisces);
498
499   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7006, 0x7006, 0, 0, gteikob2_flip_screen_x_w);
500   memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7007, 0x7007, 0, 0, gteikob2_flip_screen_y_w);
501}
502
503DRIVER_INIT( azurian )
504{
505   DRIVER_INIT_CALL(pisces);
506
507   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6800, 0x6800, 0, 0, azurian_IN1_r);
508   memory_install_read8_handler(0, ADDRESS_SPACE_PROGRAM, 0x7000, 0x7000, 0, 0, azurian_IN2_r);
509}
510
511DRIVER_INIT( 4in1 )
512{
513   offs_t i;
514   UINT8 *RAM = memory_region(REGION_CPU1);
515
516   /* Decrypt Program Roms */
517   for (i = 0; i < memory_region_length(REGION_CPU1); i++)
518      RAM[i] = RAM[i] ^ (i & 0xff);
519
520   /* games are banked at 0x0000 - 0x3fff */
521   memory_configure_bank(1, 0, 4, &RAM[0x10000], 0x4000);
522
523   _4in1_bank_w(machine, 0, 0); /* set the initial CPU bank */
524
525   state_save_register_global(_4in1_bank);
526}
527
528INTERRUPT_GEN( hunchbks_vh_interrupt )
529{
530   cpunum_set_input_line_and_vector(machine, 0,0,PULSE_LINE,0x03);
531}
532
533DRIVER_INIT( ladybugg )
534{
535/* Doesn't actually use the bank, but it mustn't have a coin lock! */
536memory_install_write8_handler(0, ADDRESS_SPACE_PROGRAM, 0x6002, 0x6002, 0, 0, galaxian_gfxbank_w);
537}
538
539DRIVER_INIT( gmgalax )
540{
541   /* games are banked at 0x0000 - 0x3fff */
542   UINT8 *RAM=memory_region(REGION_CPU1);
543   memory_configure_bank(1, 0, 2, &RAM[0x10000], 0x4000);
544
545   state_save_register_global(gmgalax_selected_game);
546
547   gmgalax_select_game(input_port_6_r(machine, 0) & 0x01);
548}
549
550INTERRUPT_GEN( gmgalax_vh_interrupt )
551{
552   // reset the cpu if the selected game changed
553   int new_game = input_port_6_r(machine, 0) & 0x01;
554
555   if (gmgalax_selected_game != new_game)
556   {
557      gmgalax_select_game(new_game);
558
559      /* Ghost Muncher never clears this */
560      galaxian_stars_enable_w(machine, 0, 0);
561
562      cpunum_set_input_line(machine, 0, INPUT_LINE_RESET, ASSERT_LINE);
563   }
564}
src/mame/drivers/frogger.c
r2369r2370
1/***************************************************************************
2
3 Frogger hardware
4
5***************************************************************************/
6
7#include "driver.h"
8#include "galaxian.h"
9#include "machine/8255ppi.h"
10#include "sound/ay8910.h"
11
12
13static const gfx_layout frogger_charlayout =
14{
15   8,8,
16   RGN_FRAC(1,2),
17   2,
18   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
19   { 0, 1, 2, 3, 4, 5, 6, 7 },
20   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
21   8*8
22};
23
24static const gfx_layout frogger_spritelayout =
25{
26   16,16,
27   RGN_FRAC(1,2),
28   2,
29   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
30   { 0, 1, 2, 3, 4, 5, 6, 7,
31         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
32   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
33         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
34   32*8
35};
36
37
38static GFXDECODE_START( frogger )
39   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, frogger_charlayout,   0, 8 )
40   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, frogger_spritelayout, 0, 8 )
41GFXDECODE_END
42
43
44static READ8_HANDLER(frogger_ppi8255_0_r)
45{
46   return ppi8255_0_r(machine, offset >> 1);
47}
48
49static READ8_HANDLER(frogger_ppi8255_1_r)
50{
51   return ppi8255_1_r(machine, offset >> 1);
52}
53
54static WRITE8_HANDLER(frogger_ppi8255_0_w)
55{
56   ppi8255_0_w(machine, offset >> 1, data);
57}
58
59static WRITE8_HANDLER(frogger_ppi8255_1_w)
60{
61   ppi8255_1_w(machine, offset >> 1, data);
62}
63
64
65static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
66   AM_RANGE(0x0000, 0x3fff) AM_READ(SMH_ROM)
67   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
68   AM_RANGE(0x8800, 0x8800) AM_READ(watchdog_reset_r)
69   AM_RANGE(0xa800, 0xabff) AM_READ(SMH_RAM)
70   AM_RANGE(0xb000, 0xb0ff) AM_READ(SMH_RAM)
71   AM_RANGE(0xd000, 0xd007) AM_READ(frogger_ppi8255_1_r)
72   AM_RANGE(0xe000, 0xe007) AM_READ(frogger_ppi8255_0_r)
73ADDRESS_MAP_END
74
75static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
76   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
77   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
78   AM_RANGE(0xa800, 0xabff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
79   AM_RANGE(0xb000, 0xb03f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
80   AM_RANGE(0xb040, 0xb05f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
81   AM_RANGE(0xb060, 0xb0ff) AM_WRITE(SMH_RAM)
82   AM_RANGE(0xb808, 0xb808) AM_WRITE(galaxian_nmi_enable_w)
83   AM_RANGE(0xb80c, 0xb80c) AM_WRITE(galaxian_flip_screen_y_w)
84   AM_RANGE(0xb810, 0xb810) AM_WRITE(galaxian_flip_screen_x_w)
85   AM_RANGE(0xb818, 0xb818) AM_WRITE(galaxian_coin_counter_0_w)
86   AM_RANGE(0xb81c, 0xb81c) AM_WRITE(galaxian_coin_counter_1_w)
87   AM_RANGE(0xd000, 0xd007) AM_WRITE(frogger_ppi8255_1_w)
88   AM_RANGE(0xe000, 0xe007) AM_WRITE(frogger_ppi8255_0_w)
89ADDRESS_MAP_END
90
91
92static ADDRESS_MAP_START( froggrmc_readmem, ADDRESS_SPACE_PROGRAM, 8 )
93   AM_RANGE(0x0000, 0x5fff) AM_READ(SMH_ROM)
94   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
95   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
96   AM_RANGE(0x9400, 0x97ff) AM_READ(galaxian_videoram_r)
97   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
98   AM_RANGE(0xa000, 0xa000) AM_READ(input_port_0_r)
99   AM_RANGE(0xa800, 0xa800) AM_READ(input_port_1_r)
100   AM_RANGE(0xb000, 0xb000) AM_READ(input_port_2_r)
101   AM_RANGE(0xb800, 0xb800) AM_READ(watchdog_reset_r)
102ADDRESS_MAP_END
103
104
105static ADDRESS_MAP_START( froggrmc_writemem, ADDRESS_SPACE_PROGRAM, 8 )
106   AM_RANGE(0x0000, 0x3fff) AM_WRITE(SMH_ROM)
107   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
108   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
109   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
110   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
111   AM_RANGE(0x9860, 0x98ff) AM_WRITE(SMH_RAM)
112   AM_RANGE(0xa800, 0xa800) AM_WRITE(soundlatch_w)
113   AM_RANGE(0xb000, 0xb000) AM_WRITE(galaxian_nmi_enable_w)
114   AM_RANGE(0xb001, 0xb001) AM_WRITE(froggrmc_sh_irqtrigger_w)
115   AM_RANGE(0xb006, 0xb006) AM_WRITE(galaxian_flip_screen_x_w)
116   AM_RANGE(0xb007, 0xb007) AM_WRITE(galaxian_flip_screen_y_w)
117ADDRESS_MAP_END
118
119
120static ADDRESS_MAP_START( frogger_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
121   AM_RANGE(0x0000, 0x1fff) AM_READ(SMH_ROM)
122   AM_RANGE(0x4000, 0x43ff) AM_READ(SMH_RAM)
123ADDRESS_MAP_END
124
125static ADDRESS_MAP_START( frogger_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
126   AM_RANGE(0x0000, 0x1fff) AM_WRITE(SMH_ROM)
127   AM_RANGE(0x4000, 0x43ff) AM_WRITE(SMH_RAM)
128    AM_RANGE(0x6000, 0x6fff) AM_WRITE(frogger_filter_w)
129ADDRESS_MAP_END
130
131
132static ADDRESS_MAP_START( frogger_sound_readport, ADDRESS_SPACE_IO, 8 )
133   ADDRESS_MAP_GLOBAL_MASK(0xff)
134   AM_RANGE(0x40, 0x40) AM_READ(AY8910_read_port_0_r)
135ADDRESS_MAP_END
136
137static ADDRESS_MAP_START( frogger_sound_writeport, ADDRESS_SPACE_IO, 8 )
138   ADDRESS_MAP_GLOBAL_MASK(0xff)
139   AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_write_port_0_w)
140   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_control_port_0_w)
141ADDRESS_MAP_END
142
143
144
145static INPUT_PORTS_START( frogger )
146   PORT_START_TAG("IN0")
147   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
148   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot2 - unused */
149   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
150   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 1P shoot1 - unused */
151   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
152   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
153   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
154   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
155
156   PORT_START_TAG("IN1")
157   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
158   PORT_DIPSETTING(   0x00, "3" )
159   PORT_DIPSETTING(   0x01, "5" )
160   PORT_DIPSETTING(   0x02, "7" )
161   PORT_DIPSETTING(   0x03, "256 (Cheat)")
162   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot2 - unused */
163   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* 2P shoot1 - unused */
164   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
165   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
166   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
167   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
168
169   PORT_START_TAG("IN2")
170   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
171   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
172   PORT_DIPSETTING(   0x02, "A 2/1 B 2/1 C 2/1" )
173   PORT_DIPSETTING(   0x04, "A 2/1 B 1/3 C 2/1" )
174   PORT_DIPSETTING(   0x00, "A 1/1 B 1/1 C 1/1" )
175   PORT_DIPSETTING(   0x06, "A 1/1 B 1/6 C 1/1" )
176   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
177   PORT_DIPSETTING(   0x00, DEF_STR( Upright ) )
178   PORT_DIPSETTING(   0x08, DEF_STR( Cocktail ) )
179   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
180   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
181   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
182   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
183INPUT_PORTS_END
184
185
186static INPUT_PORTS_START( froggrmc )
187   PORT_START_TAG("IN0")
188   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
189   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 )
190   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY
191   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY
192   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY
193   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY
194   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
195   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SERVICE1 )
196
197   PORT_START_TAG("IN1")
198   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 )
199   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 )
200   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
201   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL
202   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL
203   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
204   PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) )
205   PORT_DIPSETTING(   0xc0, "3" )
206   PORT_DIPSETTING(   0x80, "5" )
207   PORT_DIPSETTING(   0x40, "7" )
208   PORT_DIPSETTING(   0x00, "256 (Cheat)")
209
210   PORT_START_TAG("IN2")
211   PORT_DIPNAME( 0x01, 0x01, DEF_STR( Cabinet ) )
212   PORT_DIPSETTING(   0x01, DEF_STR( Upright ) )
213   PORT_DIPSETTING(   0x00, DEF_STR( Cocktail ) )
214   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Coinage ) )
215   PORT_DIPSETTING(   0x02, "A 2/1 B 2/1 C 2/1" )
216   PORT_DIPSETTING(   0x04, "A 2/1 B 1/3 C 2/1" )
217   PORT_DIPSETTING(   0x06, "A 1/1 B 1/1 C 1/1" )
218   PORT_DIPSETTING(   0x00, "A 1/1 B 1/6 C 1/1" )
219   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN )
220   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN )
221   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )
222   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
223   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
224INPUT_PORTS_END
225
226static const struct AY8910interface frogger_ay8910_interface =
227{
228   soundlatch_r,
229   frogger_portB_r
230};
231
232
233static MACHINE_DRIVER_START( frogger )
234
235   /* basic machine hardware */
236   MDRV_CPU_ADD_TAG("main", Z80, 18432000/6)   /* 3.072 MHz */
237   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
238
239   MDRV_CPU_ADD(Z80,14318000/8)
240   /* audio CPU */ /* 1.78975 MHz */
241   MDRV_CPU_PROGRAM_MAP(frogger_sound_readmem,frogger_sound_writemem)
242   MDRV_CPU_IO_MAP(frogger_sound_readport,frogger_sound_writeport)
243
244   MDRV_MACHINE_RESET(scramble)
245
246   /* video hardware */
247   MDRV_SCREEN_ADD("main", RASTER)
248   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
249   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
250   MDRV_SCREEN_SIZE(32*8, 32*8)
251   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
252
253   MDRV_GFXDECODE(frogger)
254   MDRV_PALETTE_LENGTH(32+64+2+1)   /* 32 for characters, 64 for stars, 2 for bullets, 1 for background */
255
256   MDRV_PALETTE_INIT(frogger)
257   MDRV_VIDEO_START(frogger)
258   MDRV_VIDEO_UPDATE(galaxian)
259
260   /* sound hardware */
261   MDRV_SPEAKER_STANDARD_MONO("mono")
262   MDRV_SOUND_ADD(AY8910, 14318000/8)
263   MDRV_SOUND_CONFIG(frogger_ay8910_interface)
264   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.33)
265MACHINE_DRIVER_END
266
267
268static MACHINE_DRIVER_START( froggrmc )
269
270   /* basic machine hardware */
271   MDRV_IMPORT_FROM(frogger)
272   MDRV_CPU_MODIFY("main")
273   MDRV_CPU_PROGRAM_MAP(froggrmc_readmem,froggrmc_writemem)
274
275   MDRV_VIDEO_START(froggers)
276MACHINE_DRIVER_END
277
278
279/***************************************************************************
280
281  Game driver(s)
282
283***************************************************************************/
284
285ROM_START( frogger )
286   ROM_REGION( 0x10000, REGION_CPU1, 0 )
287   ROM_LOAD( "frogger.26",   0x0000, 0x1000, CRC(597696d6) SHA1(e7e021776cad00f095a1ebbef407b7c0a8f5d835) )
288   ROM_LOAD( "frogger.27",   0x1000, 0x1000, CRC(b6e6fcc3) SHA1(5e8692f2b0c7f4b3642b3ee6670e1c3b20029cdc) )
289   ROM_LOAD( "frsm3.7",      0x2000, 0x1000, CRC(aca22ae0) SHA1(5a99060ea2506a3ac7d61ca5876ce5cb3e493565) )
290
291   ROM_REGION( 0x10000, REGION_CPU2, 0 )
292   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
293   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
294   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
295
296   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
297   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
298   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
299
300   ROM_REGION( 0x0020, REGION_PROMS, 0 )
301   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
302ROM_END
303
304ROM_START( frogseg1 )
305   ROM_REGION( 0x10000, REGION_CPU1, 0 )
306   ROM_LOAD( "frogger.26",   0x0000, 0x1000, CRC(597696d6) SHA1(e7e021776cad00f095a1ebbef407b7c0a8f5d835) )
307   ROM_LOAD( "frogger.27",   0x1000, 0x1000, CRC(b6e6fcc3) SHA1(5e8692f2b0c7f4b3642b3ee6670e1c3b20029cdc) )
308   ROM_LOAD( "frogger.34",   0x2000, 0x1000, CRC(ed866bab) SHA1(24e1bbde44eb5480b7a0570fa0dc1de388cb95ba) )
309
310   ROM_REGION( 0x10000, REGION_CPU2, 0 )
311   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
312   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
313   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
314
315   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
316   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
317   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
318
319   ROM_REGION( 0x0020, REGION_PROMS, 0 )
320   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
321ROM_END
322
323ROM_START( frogseg2 )
324   ROM_REGION( 0x10000, REGION_CPU1, 0 )
325   ROM_LOAD( "frogger.ic5",  0x0000, 0x1000, CRC(efab0c79) SHA1(68c99b6cdcb9396bb473739a62ffc009b4bf57d5) )
326   ROM_LOAD( "frogger.ic6",  0x1000, 0x1000, CRC(aeca9c13) SHA1(cdf560adbd7f2813e86e378da7781cccf7928a44) )
327   ROM_LOAD( "frogger.ic7",  0x2000, 0x1000, CRC(dd251066) SHA1(4612e1fe1ab7182a277140b1a1976cc17e0746a5) )
328   ROM_LOAD( "frogger.ic8",  0x3000, 0x1000, CRC(bf293a02) SHA1(be94e9f5caa74c3de6fd95bd20928f4a9c514227) )
329
330   ROM_REGION( 0x10000, REGION_CPU2, 0 )
331   ROM_LOAD( "frogger.608",  0x0000, 0x0800, CRC(e8ab0256) SHA1(f090afcfacf5f13cdfa0dfda8e3feb868c6ce8bc) )
332   ROM_LOAD( "frogger.609",  0x0800, 0x0800, CRC(7380a48f) SHA1(75582a94b696062cbdb66a4c5cf0bc0bb94f81ee) )
333   ROM_LOAD( "frogger.610",  0x1000, 0x0800, CRC(31d7eb27) SHA1(2e1d34ae4da385fd7cac94707d25eeddf4604e1a) )
334
335   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
336   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
337   ROM_LOAD( "frogger.606",  0x0800, 0x0800, CRC(f524ee30) SHA1(dd768967add61467baa08d5929001f157d6cd911) )
338
339   ROM_REGION( 0x0020, REGION_PROMS, 0 )
340   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
341ROM_END
342
343
344ROM_START( froggrmc )
345   ROM_REGION( 0x10000, REGION_CPU1, 0 )
346   ROM_LOAD( "epr-1031.15",  0x0000, 0x1000, CRC(4b7c8d11) SHA1(9200b33cac0ef5a6647c95ebd25237fa62fcdf30) )
347   ROM_LOAD( "epr-1032.16",  0x1000, 0x1000, CRC(ac00b9d9) SHA1(6414d2aa2c0ccb8cb567ffde3acdb693cfd28dbb) )
348   ROM_LOAD( "epr-1033.33",  0x2000, 0x1000, CRC(bc1d6fbc) SHA1(c9c040418f0bf7b7fce599592f806e7aaf448c3d) )
349   ROM_LOAD( "epr-1034.34",  0x3000, 0x1000, CRC(9efe7399) SHA1(77355160169db256f45286e60ebf6a406527d346) )
350
351   ROM_REGION( 0x10000, REGION_CPU2, 0 )
352   ROM_LOAD( "epr-1082.42",  0x0000, 0x1000, CRC(802843c2) SHA1(059b26ddf1cdc8076d160b872f9d50b97af7f316) )
353   ROM_LOAD( "epr-1035.43",  0x1000, 0x0800, CRC(14e74148) SHA1(0023394e971f191c41ff20b47835f1dafb924d15) )
354
355   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
356   ROM_LOAD( "frogger.607",  0x0000, 0x0800, CRC(05f7d883) SHA1(78831fd287da18928651a8adb7e578d291493eff) )
357   ROM_LOAD( "epr-1036.1k",  0x0800, 0x0800, CRC(658745f8) SHA1(e4e5c3e011c8a7233a36d29e10e08905873500aa) )
358
359   ROM_REGION( 0x0020, REGION_PROMS, 0 )
360   ROM_LOAD( "pr-91.6l",     0x0000, 0x0020, CRC(413703bf) SHA1(66648b2b28d3dcbda5bdb2605d1977428939dd3c) )
361ROM_END
362
363
364
365GAME( 1981, frogger,  0,       frogger,  frogger,  frogger,  ROT90, "Konami", "Frogger", GAME_SUPPORTS_SAVE )
366GAME( 1981, frogseg1, frogger, frogger,  frogger,  frogger,  ROT90, "[Konami] (Sega license)", "Frogger (Sega set 1)", GAME_SUPPORTS_SAVE )
367GAME( 1981, frogseg2, frogger, frogger,  frogger,  frogger,  ROT90, "[Konami] (Sega license)", "Frogger (Sega set 2)", GAME_SUPPORTS_SAVE )
368GAME( 1981, froggrmc, frogger, froggrmc, froggrmc, froggers, ROT90,  "bootleg?", "Frogger (Moon Cresta hardware)", GAME_SUPPORTS_SAVE )
src/mame/drivers/amidar.c
r2369r2370
1/***************************************************************************
2
3 Amidar hardware
4
5***************************************************************************/
6
7#include "driver.h"
8#include "galaxian.h"
9#include "sound/ay8910.h"
10#include "machine/8255ppi.h"
11
12
13static const gfx_layout amidar_charlayout =
14{
15   8,8,
16   RGN_FRAC(1,2),
17   2,
18   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
19   { 0, 1, 2, 3, 4, 5, 6, 7 },
20   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
21   8*8
22};
23
24static const gfx_layout amidar_spritelayout =
25{
26   16,16,
27   RGN_FRAC(1,2),
28   2,
29   { RGN_FRAC(0,2), RGN_FRAC(1,2) },
30   { 0, 1, 2, 3, 4, 5, 6, 7,
31         8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 },
32   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,
33         16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8 },
34   32*8
35};
36
37
38static GFXDECODE_START( amidar )
39   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, amidar_charlayout,   0, 8 )
40   GFXDECODE_ENTRY( REGION_GFX1, 0x0000, amidar_spritelayout, 0, 8 )
41GFXDECODE_END
42
43
44static UINT8 *amidar_soundram;
45
46static READ8_HANDLER(amidar_soundram_r)
47{
48   return amidar_soundram[offset & 0x03ff];
49}
50
51static WRITE8_HANDLER(amidar_soundram_w)
52{
53   amidar_soundram[offset & 0x03ff] = data;
54}
55
56static const struct AY8910interface amidar_ay8910_interface_2 =
57{
58   soundlatch_r,
59   scramble_portB_r
60};
61
62static READ8_HANDLER(amidar_ppi8255_0_r)
63{
64   return ppi8255_0_r(machine, offset >> 4);
65}
66
67static READ8_HANDLER(amidar_ppi8255_1_r)
68{
69   return ppi8255_1_r(machine, offset >> 4);
70}
71
72static WRITE8_HANDLER(amidar_ppi8255_0_w)
73{
74   ppi8255_0_w(machine, offset >> 4, data);
75}
76
77static WRITE8_HANDLER(amidar_ppi8255_1_w)
78{
79   ppi8255_1_w(machine, offset >> 4, data);
80}
81
82
83static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
84   AM_RANGE(0x0000, 0x7fff) AM_READ(SMH_ROM)
85   AM_RANGE(0x8000, 0x87ff) AM_READ(SMH_RAM)
86   AM_RANGE(0x9000, 0x93ff) AM_READ(SMH_RAM)
87   AM_RANGE(0x9800, 0x98ff) AM_READ(SMH_RAM)
88   AM_RANGE(0xa800, 0xa800) AM_READ(watchdog_reset_r)
89   AM_RANGE(0xb000, 0xb03f) AM_READ(amidar_ppi8255_0_r)
90   AM_RANGE(0xb800, 0xb83f) AM_READ(amidar_ppi8255_1_r)
91ADDRESS_MAP_END
92
93static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
94   AM_RANGE(0x0000, 0x7fff) AM_WRITE(SMH_ROM)
95   AM_RANGE(0x8000, 0x87ff) AM_WRITE(SMH_RAM)
96   AM_RANGE(0x9000, 0x93ff) AM_WRITE(galaxian_videoram_w) AM_BASE(&galaxian_videoram)
97   AM_RANGE(0x9800, 0x983f) AM_WRITE(galaxian_attributesram_w) AM_BASE(&galaxian_attributesram)
98   AM_RANGE(0x9840, 0x985f) AM_WRITE(SMH_RAM) AM_BASE(&galaxian_spriteram) AM_SIZE(&galaxian_spriteram_size)
99   AM_RANGE(0x9860, 0x98ff) AM_WRITE(SMH_RAM)
100   AM_RANGE(0xa000, 0xa000) AM_WRITE(scramble_background_red_w)
101   AM_RANGE(0xa008, 0xa008) AM_WRITE(galaxian_nmi_enable_w)
102   AM_RANGE(0xa010, 0xa010) AM_WRITE(galaxian_flip_screen_x_w)
103   AM_RANGE(0xa018, 0xa018) AM_WRITE(galaxian_flip_screen_y_w)
104   AM_RANGE(0xa020, 0xa020) AM_WRITE(scramble_background_green_w)
105   AM_RANGE(0xa028, 0xa028) AM_WRITE(scramble_background_blue_w)
106   AM_RANGE(0xa030, 0xa030) AM_WRITE(galaxian_coin_counter_0_w)
107   AM_RANGE(0xa038, 0xa038) AM_WRITE(galaxian_coin_counter_1_w)
108   AM_RANGE(0xb000, 0xb03f) AM_WRITE(amidar_ppi8255_0_w)
109   AM_RANGE(0xb800, 0xb83f) AM_WRITE(amidar_ppi8255_1_w)
110ADDRESS_MAP_END
111
112
113static ADDRESS_MAP_START( amidar_sound_readmem, ADDRESS_SPACE_PROGRAM, 8 )
114   AM_RANGE(0x0000, 0x2fff) AM_READ(SMH_ROM)
115   AM_RANGE(0x8000, 0x8fff) AM_READ(amidar_soundram_r)
116ADDRESS_MAP_END
117
118static ADDRESS_MAP_START( amidar_sound_writemem, ADDRESS_SPACE_PROGRAM, 8 )
119   AM_RANGE(0x0000, 0x2fff) AM_WRITE(SMH_ROM)
120   AM_RANGE(0x8000, 0x8fff) AM_WRITE(amidar_soundram_w)
121   AM_RANGE(0x8000, 0x83ff) AM_WRITE(SMH_NOP) AM_BASE(&amidar_soundram)  /* only here to initialize pointer */
122   AM_RANGE(0x9000, 0x9fff) AM_WRITE(scramble_filter_w)
123ADDRESS_MAP_END
124
125static ADDRESS_MAP_START( amidar_sound_readport, ADDRESS_SPACE_IO, 8 )
126   ADDRESS_MAP_GLOBAL_MASK(0xff)
127   AM_RANGE(0x20, 0x20) AM_READ(AY8910_read_port_0_r)
128   AM_RANGE(0x80, 0x80) AM_READ(AY8910_read_port_1_r)
129ADDRESS_MAP_END
130
131static ADDRESS_MAP_START( amidar_sound_writeport, ADDRESS_SPACE_IO, 8 )
132   ADDRESS_MAP_GLOBAL_MASK(0xff)
133   AM_RANGE(0x10, 0x10) AM_WRITE(AY8910_control_port_0_w)
134   AM_RANGE(0x20, 0x20) AM_WRITE(AY8910_write_port_0_w)
135   AM_RANGE(0x40, 0x40) AM_WRITE(AY8910_control_port_1_w)
136   AM_RANGE(0x80, 0x80) AM_WRITE(AY8910_write_port_1_w)
137ADDRESS_MAP_END
138
139#define AMIDAR_IN0 \
140PORT_START_TAG("IN0") \
141   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL\
142   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably space for button 2 */\
143   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )\
144   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )\
145   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY\
146   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY\
147   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )\
148   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
149
150#define AMIDAR_IN1 \
151   PORT_START_TAG("IN1")\
152   PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) )\
153   PORT_DIPSETTING(    0x03, "3" )\
154   PORT_DIPSETTING(    0x02, "4" )\
155   PORT_DIPSETTING(    0x01, "5" )\
156   PORT_DIPSETTING(    0x00, "255 (Cheat)")\
157   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably space for player 2 button 2 */\
158   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL\
159   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL\
160   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL\
161   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )\
162   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
163
164#define  AMIDAR_DSW \
165   PORT_START_TAG("DSW")\
166   PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )\
167   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )\
168   PORT_DIPSETTING(    0x0a, DEF_STR( 3C_1C ) )\
169   PORT_DIPSETTING(    0x01, DEF_STR( 2C_1C ) )\
170   PORT_DIPSETTING(    0x02, DEF_STR( 3C_2C ) )\
171   PORT_DIPSETTING(    0x08, DEF_STR( 4C_3C ) )\
172   PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )\
173   PORT_DIPSETTING(    0x0c, DEF_STR( 3C_4C ) )\
174   PORT_DIPSETTING(    0x0e, DEF_STR( 2C_3C ) )\
175   PORT_DIPSETTING(    0x07, DEF_STR( 1C_2C ) )\
176   PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )\
177   PORT_DIPSETTING(    0x0b, DEF_STR( 1C_3C ) )\
178   PORT_DIPSETTING(    0x03, DEF_STR( 1C_4C ) )\
179   PORT_DIPSETTING(    0x0d, DEF_STR( 1C_5C ) )\
180   PORT_DIPSETTING(    0x05, DEF_STR( 1C_6C ) )\
181   PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )\
182   PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )\
183   PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )\
184   PORT_DIPSETTING(    0x40, DEF_STR( 4C_1C ) )\
185   PORT_DIPSETTING(    0xa0, DEF_STR( 3C_1C ) )\
186   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )\
187   PORT_DIPSETTING(    0x20, DEF_STR( 3C_2C ) )\
188   PORT_DIPSETTING(    0x80, DEF_STR( 4C_3C ) )\
189   PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )\
190   PORT_DIPSETTING(    0xc0, DEF_STR( 3C_4C ) )\
191   PORT_DIPSETTING(    0xe0, DEF_STR( 2C_3C ) )\
192   PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )\
193   PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )\
194   PORT_DIPSETTING(    0xb0, DEF_STR( 1C_3C ) )\
195   PORT_DIPSETTING(    0x30, DEF_STR( 1C_4C ) )\
196   PORT_DIPSETTING(    0xd0, DEF_STR( 1C_5C ) )\
197   PORT_DIPSETTING(    0x50, DEF_STR( 1C_6C ) )\
198   PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )\
199   PORT_DIPSETTING(    0x00, "Disable All Coins" )
200
201
202static INPUT_PORTS_START( amidar )
203   AMIDAR_IN0
204
205   AMIDAR_IN1
206
207   PORT_START_TAG("IN2")
208   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL
209   PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
210   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
211   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
212   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
213   PORT_DIPSETTING(    0x00, "30000 50000" )
214   PORT_DIPSETTING(    0x04, "Every 50000" )
215   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
216   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
217   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
218   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
219   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
220   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
221   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
222   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
223   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
224   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
225   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
226
227   AMIDAR_DSW
228
229INPUT_PORTS_END
230
231/* absolutely identical to amidar, the only difference is the BONUS dip switch */
232static INPUT_PORTS_START( amidaru )
233   PORT_INCLUDE( amidar )
234
235   PORT_MODIFY("IN2")
236   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
237   PORT_DIPSETTING(    0x00, "30000 70000" )
238   PORT_DIPSETTING(    0x04, "50000 80000" )
239INPUT_PORTS_END
240
241static INPUT_PORTS_START( amidaro )
242   PORT_INCLUDE( amidar )
243
244   PORT_MODIFY("IN1")
245   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
246   PORT_DIPSETTING(    0x03, "1" )
247   PORT_DIPSETTING(    0x02, "2" )
248   PORT_DIPSETTING(    0x01, "3" )
249   PORT_DIPSETTING(    0x00, "4" )
250
251   PORT_MODIFY("IN2")
252   PORT_DIPNAME( 0x02, 0x00, "Level Progression" )
253   PORT_DIPSETTING(    0x00, "Slow" )
254   PORT_DIPSETTING(    0x02, "Fast" )
255   PORT_DIPNAME( 0x04, 0x00, DEF_STR( Bonus_Life ) )
256   PORT_DIPSETTING(    0x00, "30000 70000" )
257   PORT_DIPSETTING(    0x04, "50000 80000" )
258INPUT_PORTS_END
259
260/* similar to Amidar, dip switches are different and port 3, which in Amidar */
261/* selects coins per credit, is not used. */
262static INPUT_PORTS_START( turtles )
263   PORT_START_TAG("IN0")
264   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
265   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably space for button 2 */
266   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 )
267   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
268   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
269   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
270   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 )
271   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
272
273   PORT_START_TAG("IN1")
274   PORT_DIPNAME( 0x03, 0x01, DEF_STR( Lives ) )
275   PORT_DIPSETTING(    0x00, "3" )
276   PORT_DIPSETTING(    0x01, "4" )
277   PORT_DIPSETTING(    0x02, "5" )
278   PORT_DIPSETTING(    0x03, "126 (Cheat)")
279   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )   /* probably space for player 2 button 2 */
280   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
281   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
282   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
283   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START2 )
284   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
285
286   PORT_START_TAG("IN2")
287   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
288   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
289   PORT_DIPSETTING(    0x00, "A 1/1 B 2/1 C 1/1" )
290   PORT_DIPSETTING(    0x02, "A 1/2 B 1/1 C 1/2" )
291   PORT_DIPSETTING(    0x04, "A 1/3 B 3/1 C 1/3" )
292   PORT_DIPSETTING(    0x06, "A 1/4 B 4/1 C 1/4" )
293   PORT_DIPNAME( 0x08, 0x00, DEF_STR( Cabinet ) )
294   PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
295   PORT_DIPSETTING(    0x08, DEF_STR( Cocktail ) )
296   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
297   PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) )
298   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
299   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
300   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
301   PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) )
302   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
303   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
304INPUT_PORTS_END
305
306/* same as Turtles, but dip switches are different. */
307static INPUT_PORTS_START( turpin )
308   PORT_INCLUDE( turtles )
309
310   PORT_MODIFY("IN1")
311   PORT_DIPNAME( 0x03, 0x00, DEF_STR( Lives ) )
312   PORT_DIPSETTING(    0x00, "3" )
313   PORT_DIPSETTING(    0x01, "5" )
314   PORT_DIPSETTING(    0x02, "7" )
315   PORT_DIPSETTING(    0x03, "126 (Cheat)")
316
317   PORT_MODIFY("IN2")
318   PORT_DIPNAME( 0x06, 0x00, DEF_STR( Coinage ) )
319   PORT_DIPSETTING(    0x06, DEF_STR( 4C_1C ) )
320   PORT_DIPSETTING(    0x02, DEF_STR( 2C_1C ) )
321   PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
322   PORT_DIPSETTING(    0x04, DEF_STR( 1C_2C ) )
323INPUT_PORTS_END
324
325
326
327static MACHINE_DRIVER_START( amidar )
328
329   /* basic machine hardware */
330   MDRV_CPU_ADD_TAG("main", Z80, 18432000/6)   /* 3.072 MHz */
331   MDRV_CPU_PROGRAM_MAP(readmem,writemem)
332
333   MDRV_CPU_ADD(Z80,14318000/8)
334   /* audio CPU */   /* 1.78975 MHz */
335   MDRV_CPU_PROGRAM_MAP(amidar_sound_readmem,amidar_sound_writemem)
336   MDRV_CPU_IO_MAP(amidar_sound_readport,amidar_sound_writeport)
337
338   MDRV_MACHINE_RESET(scramble)
339
340   /* video hardware */
341   MDRV_SCREEN_ADD("main", RASTER)
342   MDRV_SCREEN_REFRESH_RATE(16000.0/132/2)
343   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
344   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
345   MDRV_SCREEN_SIZE(32*8, 32*8)
346   MDRV_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1)
347   MDRV_GFXDECODE(amidar)
348   MDRV_PALETTE_LENGTH(32+64+2+8)
349
350   MDRV_PALETTE_INIT(turtles)
351   MDRV_VIDEO_START(turtles)
352   MDRV_VIDEO_UPDATE(galaxian)
353
354   /* sound hardware */
355   MDRV_SPEAKER_STANDARD_MONO("mono")
356   MDRV_SOUND_ADD(AY8910, 14318000/8)
357   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
358
359   MDRV_SOUND_ADD(AY8910, 14318000/8)
360   MDRV_SOUND_CONFIG(amidar_ay8910_interface_2)
361   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.16)
362MACHINE_DRIVER_END
363
364
365
366/***************************************************************************
367
368  Game driver(s)
369
370***************************************************************************/
371
372ROM_START( amidar )
373   ROM_REGION( 0x10000, REGION_CPU1, 0 )
374   ROM_LOAD( "amidar.2c",    0x0000, 0x1000, CRC(c294bf27) SHA1(399325bf1559e8cdbddf7cfbf0dc739f9ed72ef0) )
375   ROM_LOAD( "amidar.2e",    0x1000, 0x1000, CRC(e6e96826) SHA1(e9c4f8c594640424b456505e676352a98b758c03) )
376   ROM_LOAD( "amidar.2f",    0x2000, 0x1000, CRC(3656be6f) SHA1(9d652f66bedcf17a6453c0e0ead30bfd7ea0bd0a) )
377   ROM_LOAD( "amidar.2h",    0x3000, 0x1000, CRC(1be170bd) SHA1(c047bc393b297c0d47668a5f6f4870e3fac937ef) )
378
379   ROM_REGION( 0x10000, REGION_CPU2, 0 )
380   ROM_LOAD( "amidar.5c",    0x0000, 0x1000, CRC(c4b66ae4) SHA1(9d09dbde4019f7be3abe0815b0e06d542c01c255) )
381   ROM_LOAD( "amidar.5d",    0x1000, 0x1000, CRC(806785af) SHA1(c8c85e3a6a204feccd7859b4527bd649e96134b4) )
382
383   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
384   ROM_LOAD( "amidar.5f",    0x0000, 0x0800, CRC(5e51e84d) SHA1(dfe84db7e2b1a45a1d484fcf37291f536bc5324c) )
385   ROM_LOAD( "amidar.5h",    0x0800, 0x0800, CRC(2f7f1c30) SHA1(83c330eca20dfcc6a4099001943b9ed7a7c3db5b) )
386
387   ROM_REGION( 0x0020, REGION_PROMS, 0 )
388   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
389ROM_END
390
391ROM_START( amidaru )
392   ROM_REGION( 0x10000, REGION_CPU1, 0 )
393   ROM_LOAD( "amidarus.2c",  0x0000, 0x1000, CRC(951e0792) SHA1(3a68b829c9ffb465bd6582c9ea566e0e947c6c19) )
394   ROM_LOAD( "amidarus.2e",  0x1000, 0x1000, CRC(a1a3a136) SHA1(330ec857fdf4c1b28e2560a5f63a2432f87f9b2f) )
395   ROM_LOAD( "amidarus.2f",  0x2000, 0x1000, CRC(a5121bf5) SHA1(fe15b91724758ede43dd332327919f164772c592) )
396   ROM_LOAD( "amidarus.2h",  0x3000, 0x1000, CRC(051d1c7f) SHA1(3cfa0f728a5c27da0a3fe2579ad226129ccde232) )
397   ROM_LOAD( "amidarus.2j",  0x4000, 0x1000, CRC(351f00d5) SHA1(6659357f40f888b21be00826246200fd3a8a88ce) )
398
399   ROM_REGION( 0x10000, REGION_CPU2, 0 )
400   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
401   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
402
403   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
404   ROM_LOAD( "amidarus.5f",  0x0000, 0x0800, CRC(2cfe5ede) SHA1(0d86a78008ac8653c17fff5be5ebdf1f0a9d31eb) )
405   ROM_LOAD( "amidarus.5h",  0x0800, 0x0800, CRC(57c4fd0d) SHA1(8764deec9fbff4220d61df621b12fc36c3702601) )
406
407   ROM_REGION( 0x0020, REGION_PROMS, 0 )
408   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
409ROM_END
410
411ROM_START( amidaro )
412   ROM_REGION( 0x10000, REGION_CPU1, 0 )
413   ROM_LOAD( "107.2cd",      0x0000, 0x1000, CRC(c52536be) SHA1(3f64578214d2d9f0e4e7ee87e09b0aac33a73098) )
414   ROM_LOAD( "108.2fg",      0x1000, 0x1000, CRC(38538b98) SHA1(12b2a0c09926d006781bee5d450bc0c391cc1fb5) )
415   ROM_LOAD( "109.2fg",      0x2000, 0x1000, CRC(69907f0f) SHA1(f1d19a76ffc41ee8c5c574f10108cfdfe525b732) )
416   ROM_LOAD( "110.2h",       0x3000, 0x1000, CRC(ba149a93) SHA1(9ef1d27f0780612be0ea2be94c3a2c781a4924c8) )
417   ROM_LOAD( "111.2j",       0x4000, 0x1000, CRC(20d01c2e) SHA1(e09437ff440f04036d5ec74b355e97bbbbfefb95) )
418
419   ROM_REGION( 0x10000, REGION_CPU2, 0 )
420   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
421   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
422
423   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
424   ROM_LOAD( "amidarus.5f",  0x0000, 0x0800, CRC(2cfe5ede) SHA1(0d86a78008ac8653c17fff5be5ebdf1f0a9d31eb) )
425   ROM_LOAD( "113.5h",       0x0800, 0x0800, CRC(bcdce168) SHA1(e593d03c460ef4607e3ba25019d9f01d4a717dd9) )  /* The letter 'S' is slightly different */
426
427   ROM_REGION( 0x0020, REGION_PROMS, 0 )
428   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
429ROM_END
430
431ROM_START( amidarb )
432   ROM_REGION( 0x10000, REGION_CPU1, 0 )
433   ROM_LOAD( "ami2gor.2c", 0x0000, 0x1000, CRC(9ad2dcd2) SHA1(43ceb93d891c1ebf55e7c26de13e3db8e1d26f6d) )
434   ROM_LOAD( "2.2f",       0x1000, 0x1000, CRC(66282ff5) SHA1(986778278eb339768d190460680e7aa698812488) )
435   ROM_LOAD( "3.2j",       0x2000, 0x1000, CRC(b0860e31) SHA1(8fb92b0e71c826a509a8f712553de0f4a636286f) )
436   ROM_LOAD( "4.2m",       0x3000, 0x1000, CRC(4a4086c9) SHA1(6f309b67dc68e06e6eb1d3ee2ae75afe253a4ce3) )
437
438   ROM_REGION( 0x10000, REGION_CPU2, 0 )
439   ROM_LOAD( "8.11d",      0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
440   ROM_LOAD( "9.9d",       0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
441
442   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
443   ROM_LOAD( "5.5f",      0x0000, 0x0800, CRC(2082ad0a) SHA1(c6014d9575e92adf09b0961c2158a779ebe940c4) )
444   ROM_LOAD( "6.5h",      0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) )
445
446   ROM_REGION( 0x0020, REGION_PROMS, 0 )
447   ROM_LOAD( "n82s123n.6e",   0x0000, 0x0020, CRC(01004d3f) SHA1(e53cbc54ea96e846481a67bbcccf6b1726e70f9c) )
448ROM_END
449
450ROM_START( amigo )
451   ROM_REGION( 0x10000, REGION_CPU1, 0 )
452   ROM_LOAD( "2732.a1",      0x0000, 0x1000, CRC(930dc856) SHA1(7022f1f26830baccdc8b8f0b10fb1d1ccb080f22) )
453   ROM_LOAD( "2732.a2",      0x1000, 0x1000, CRC(66282ff5) SHA1(986778278eb339768d190460680e7aa698812488) )
454   ROM_LOAD( "2732.a3",      0x2000, 0x1000, CRC(e9d3dc76) SHA1(627c6068c65985175388aec43ac2a4248b004c97) )
455   ROM_LOAD( "2732.a4",      0x3000, 0x1000, CRC(4a4086c9) SHA1(6f309b67dc68e06e6eb1d3ee2ae75afe253a4ce3) )
456
457   ROM_REGION( 0x10000, REGION_CPU2, 0 )
458   ROM_LOAD( "amidarus.5c",  0x0000, 0x1000, CRC(8ca7b750) SHA1(4f4c2915503b85abe141d717fd254ee10c9da99e) )
459   ROM_LOAD( "amidarus.5d",  0x1000, 0x1000, CRC(9b5bdc0a) SHA1(84d953618c8bf510d23b42232a856ac55f1baff5) )
460
461   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
462   ROM_LOAD( "2716.a6",      0x0000, 0x0800, CRC(2082ad0a) SHA1(c6014d9575e92adf09b0961c2158a779ebe940c4) )
463   ROM_LOAD( "2716.a5",      0x0800, 0x0800, CRC(3029f94f) SHA1(3b432b42e79f8b0a7d65e197f373a04e3c92ff20) )
464
465   ROM_REGION( 0x0020, REGION_PROMS, 0 )
466   ROM_LOAD( "amidar.clr",   0x0000, 0x0020, CRC(f940dcc3) SHA1(1015e56f37c244a850a8f4bf0e36668f047fd46d) )
467ROM_END
468
469ROM_START( turtles )
470   ROM_REGION( 0x10000, REGION_CPU1, 0 )
471   ROM_LOAD( "turt_vid.2c",  0x0000, 0x1000, CRC(ec5e61fb) SHA1(3ca89800fda7a7e61f54d71d5302908be2706def) )
472   ROM_LOAD( "turt_vid.2e",  0x1000, 0x1000, CRC(fd10821e) SHA1(af74602bf2454eb8f3b9bb5c425e2476feeecd69) )
473   ROM_LOAD( "turt_vid.2f",  0x2000, 0x1000, CRC(ddcfc5fa) SHA1(2af9383e5a289c2d7fbe6cf5e5b1519c352afbab) )
474   ROM_LOAD( "turt_vid.2h",  0x3000, 0x1000, CRC(9e71696c) SHA1(3dcdf5dc601c875fc9d8b9a46e3ef588e7478e0d) )
475   ROM_LOAD( "turt_vid.2j",  0x4000, 0x1000, CRC(fcd49fef) SHA1(bb1e91b2e6d4b5a861bf37907ef6b198328d8d83) )
476
477   ROM_REGION( 0x10000, REGION_CPU2, 0 )
478   ROM_LOAD( "turt_snd.5c",  0x0000, 0x1000, CRC(f0c30f9a) SHA1(5621f336e9be8acf986a34bbb8855ed5d45c28ef) )
479   ROM_LOAD( "turt_snd.5d",  0x1000, 0x1000, CRC(af5fc43c) SHA1(8a49c55feba094b07380615cf0b6f0878c25a260) )
480
481   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
482   ROM_LOAD( "turt_vid.5h",  0x0000, 0x0800, CRC(e5999d52) SHA1(bc3f52cf6c6e19dfd2dacd1e8c9128f437e995fc) )
483   ROM_LOAD( "turt_vid.5f",  0x0800, 0x0800, CRC(c3ffd655) SHA1(dee51d77be262a2944488e381541c10a2b6e5d83) )
484
485   ROM_REGION( 0x0020, REGION_PROMS, 0 )
486   ROM_LOAD( "turtles.clr",  0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
487ROM_END
488
489ROM_START( turpin )
490   ROM_REGION( 0x10000, REGION_CPU1, 0 )
491   ROM_LOAD( "m1",           0x0000, 0x1000, CRC(89177473) SHA1(0717b1e7308ffe527edfc578ec4353809e7d9eea) )
492   ROM_LOAD( "m2",           0x1000, 0x1000, CRC(4c6ca5c6) SHA1(dd4ca7adaa523a8e775cdfaa99bb3cc25da32c08) )
493   ROM_LOAD( "m3",           0x2000, 0x1000, CRC(62291652) SHA1(82965d3e9608afde4ff06cba1d7a4b11cd904c11) )
494   ROM_LOAD( "turt_vid.2h",  0x3000, 0x1000, CRC(9e71696c) SHA1(3dcdf5dc601c875fc9d8b9a46e3ef588e7478e0d) )
495   ROM_LOAD( "m5",           0x4000, 0x1000, CRC(7d2600f2) SHA1(1a9bdf63b50419c6e0d9c401c3dcf29d5b459fa6) )
496
497   ROM_REGION( 0x10000, REGION_CPU2, 0 )
498   ROM_LOAD( "turt_snd.5c",  0x0000, 0x1000, CRC(f0c30f9a) SHA1(5621f336e9be8acf986a34bbb8855ed5d45c28ef) )
499   ROM_LOAD( "turt_snd.5d",  0x1000, 0x1000, CRC(af5fc43c) SHA1(8a49c55feba094b07380615cf0b6f0878c25a260) )
500
501   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
502   ROM_LOAD( "turt_vid.5h",  0x0000, 0x0800, CRC(e5999d52) SHA1(bc3f52cf6c6e19dfd2dacd1e8c9128f437e995fc) )
503   ROM_LOAD( "turt_vid.5f",  0x0800, 0x0800, CRC(c3ffd655) SHA1(dee51d77be262a2944488e381541c10a2b6e5d83) )
504
505   ROM_REGION( 0x0020, REGION_PROMS, 0 )
506   ROM_LOAD( "turtles.clr",  0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
507ROM_END
508
509ROM_START( 600 )
510   ROM_REGION( 0x10000, REGION_CPU1, 0 )
511   ROM_LOAD( "600_vid.2c",   0x0000, 0x1000, CRC(8ee090ae) SHA1(3d491313da6cccd6dbc15774569be0555fe2f73a) )
512   ROM_LOAD( "600_vid.2e",   0x1000, 0x1000, CRC(45bfaff2) SHA1(ba4f7aa499f4993ec2191b8832b5604fd41964bc) )
513   ROM_LOAD( "600_vid.2f",   0x2000, 0x1000, CRC(9f4c8ed7) SHA1(2564dae82019097227351a7ddc9c5156ca00297a) )
514   ROM_LOAD( "600_vid.2h",   0x3000, 0x1000, CRC(a92ef056) SHA1(c319d41a3345b84670fe9110f78332c1cfe1e163) )
515   ROM_LOAD( "600_vid.2j",   0x4000, 0x1000, CRC(6dadd72d) SHA1(5602b5ebb2c287f72a5ce873b4e3dfd19b8412a0) )
516
517   ROM_REGION( 0x10000, REGION_CPU2, 0 )
518   ROM_LOAD( "600_snd.5c",   0x0000, 0x1000, CRC(1773c68e) SHA1(cc4aa3a98e85bc6300f8c1ee1a0448071d7c6dfa) )
519   ROM_LOAD( "600_snd.5d",   0x1000, 0x1000, CRC(a311b998) SHA1(39af321b8c3f211ed6d083a2aba4fbc8af11c9e8) )
520
521   ROM_REGION( 0x1000, REGION_GFX1, ROMREGION_DISPOSE )
522   ROM_LOAD( "600_vid.5h",   0x0000, 0x0800, CRC(006c3d56) SHA1(0c773e0e84d0bf45be5a5a7cfff960c1ca2f0320) )
523   ROM_LOAD( "600_vid.5f",   0x0800, 0x0800, CRC(7dbc0426) SHA1(29eeb3cdb5a3bcf7115d8099e4d04cf76216b003) )
524
525   ROM_REGION( 0x0020, REGION_PROMS, 0 )
526   ROM_LOAD( "turtles.clr",  0x0000, 0x0020, CRC(f3ef02dd) SHA1(09fd795170d7d30f101d579f57553da5ff3800ab) )
527ROM_END
528
529
530
531GAME( 1981, amidar,  0,       amidar, amidar,  amidar,       ROT90, "Konami", "Amidar", GAME_SUPPORTS_SAVE )
532GAME( 1982, amidaru, amidar,  amidar, amidaru, amidar,       ROT90, "Konami (Stern license)", "Amidar (Stern)", GAME_SUPPORTS_SAVE )
533GAME( 1982, amidaro, amidar,  amidar, amidaro, amidar,       ROT90, "Konami (Olympia license)", "Amidar (Olympia)", GAME_SUPPORTS_SAVE )
534GAME( 1982, amidarb, amidar,  amidar, amidaru, amidar,       ROT90, "bootleg", "Amidar (Bootleg)", GAME_SUPPORTS_SAVE ) /* Simular to Amigo bootleg */
535GAME( 1982, amigo,   amidar,  amidar, amidaru, amidar,       ROT90, "bootleg", "Amigo", GAME_SUPPORTS_SAVE )
536GAME( 1981, turtles, 0,       amidar, turtles, scramble_ppi, ROT90, "[Konami] (Stern license)", "Turtles", GAME_SUPPORTS_SAVE )
537GAME( 1981, turpin,  turtles, amidar, turpin,  scramble_ppi, ROT90, "[Konami] (Sega license)", "Turpin", GAME_SUPPORTS_SAVE )
538GAME( 1981, 600,     turtles, amidar, turtles, scramble_ppi, ROT90, "Konami", "600", GAME_SUPPORTS_SAVE )
src/emu/validity.c
r2369r2370
230230   INT32 remainder, expremainder;
231231   UINT32 uremainder, expuremainder;
232232   int error = FALSE;
233
233return error;
234234   /* use only non-zero, positive numbers */
235235   if (testu64a == 0) testu64a++;
236236   if (testi64a == 0) testi64a++;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team