/
mappy.cpp
2075 lines (1722 loc) · 94.4 KB
/
mappy.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// license:BSD-3-Clause
// copyright-holders:Nicola Salmoria
/***************************************************************************
Several Namco games from 1982-1985
driver by Nicola Salmoria
based on previous work by Aaron Giles, Manuel Abadia
The games supported by this driver all run on similar hardware.
They can be divided in three "families":
1) Super Pacman, the first version of the board. Pac & Pal and Grobda run on
seemingly identical hardware.
The hardware consists of two 6809, and several Namco custom ICs that provide
a static tilemap and 2bpp sprites.
Grobda is the only Namco game of this era that has speech (just a short
sample). It appears to do this by manipulating 15XX channels to deliver
non-waveform outputs (removing the 15XX from the board causes sound to
disappear completely).
2) Phozon. This game runs on an unique board: the large number of sprites on
screen at the same time required a 3rd 6809 to help with the calculations.
The sprite hardware is also different from Super Pacman, featuring 8x8 sprites.
Despite the hardware differences, the memory map is almost identical to
Super Pacman, and that's why it's included in this driver.
There is no information about the custom ICs used by this board. The video
section is probably more similar to Gaplus than to Supr Pacman: the sprite
generator might be a 21XX (though Gaplus doesn't use 8x8 sprites), and the
00XX and 04XX address generators are probably replaced by the single CUS20
(which also handles the flip screen flag).
3) Mappy runs on a revised design of the Super Pacman board, where the 00XX
custom is replaced by a 17XX, which provides a scrolling tilemap. The larger
tilemap requires more RAM, so the memory map is slightly different. Also,
sprites are 4bpp instead of 2bpp, so the final stage of video generation is
a little different as well, though the custom ICs are still the same.
Dig Dig II and Motos are almost the same, apart from larger ROMs.
The Tower of Druaga also has 4x the amount of sprite color combinations so
it's the most different of the four.
Custom ICs (Super Pacman and Mappy):
-----------------------------------
CPU board:
07XX clock divider
15XX sound control
16XX I/O control
5xXX(x2) I/O
99XX DAC with volume control (only Mappy, Super Pacman uses LS273, CD4066
and binary-weighted resistors R34-37 and R22-25)
Video board:
00XX tilemap address generator with scrolling capability (only Super Pacman)
04XX sprite address generator
07XX clock divider
11XX gfx data shifter and mixer (16-bit in, 4-bit out) [1]
12XX sprite generator
17XX tilemap address generator with scrolling capability (only Mappy)
[1] Used differently: in Super Pacman it merges the 2bpp tilemap with the 2bpp
sprites; in Mappy it handles the 4bpp sprites, while the tilemap is handled by
standard LS components.
The I/O interface chips vary from game to game (see machine/namcoio.c)
Super Pac-Man memory map
------------------------
Pac & Pal and Grobda are the same.
Note: Part of the address decoding is done by PALs (SPC-5 and SPC-6) so the
tables are inferred by program behaviour.
MAIN CPU:
Address Dir Data Name Description
---------------- --- -------- --------- -----------------------
00000xxxxxxxxxxx R/W xxxxxxxx RAM 2E tilemap RAM
00001xxxxxxxxxxx R/W xxxxxxxx RAM 2H work RAM
000011111xxxxxxx R/W xxxxxxxx portion holding sprite registers (sprite number & color)
00010xxxxxxxxxxx R/W xxxxxxxx RAM 2K work RAM
000101111xxxxxxx R/W xxxxxxxx portion holding sprite registers (x, y)
00011xxxxxxxxxxx R/W xxxxxxxx RAM 2J work RAM
000111111xxxxxxx R/W xxxxxxxx portion holding sprite registers (x msb, flip, size)
00100----------- R/W -------x FLIP screen flip (reading this address sets the bit, done by pacnpal)
01000-xxxxxxxxxx R/W xxxxxxxx SOUND RAM (shared with sound CPU)
01000-0000xxxxxx R/W xxxxxxxx portion holding the sound registers
01001-----xxxxxx R/W ----xxxx FBIT I/O chips [1]
01010-------000x r/W -------- INT ON 2 sound CPU irq enable (data is in A0)
01010-------001x r/W -------- INT ON main CPU irq enable (data is in A0)
01010-------010x W -------- n.c.
01010-------011x r/W -------- SOUND ON sound enable (data is in A0)
01010-------100x r/W -------- 4 RESET reset I/O chips (data is in A0)
01010-------101x r/W -------- SUB RESET reset sound CPU (data is in A0)
01010-------110x W -------- n.c.
01010-------111x W -------- n.c.
10000----------- R/W -------- WDR Watch Dog Reset
101xxxxxxxxxxxxx R xxxxxxxx ROM 1D program ROM
110xxxxxxxxxxxxx R xxxxxxxx ROM 1C program ROM
111xxxxxxxxxxxxx R xxxxxxxx ROM 1B program ROM
[1] only half of that space is actually used, because only 2 of the possible 4 I/O chips are present
SOUND CPU:
Address Dir Data Name Description
---------------- --- -------- --------- -----------------------
000---xxxxxxxxxx R/W xxxxxxxx RAM 3K/3L work RAM (shared with main CPU)
000---0000xxxxxx R/W xxxxxxxx portion holding the sound registers
001---------000x W -------- INT ON 2 sound CPU irq enable (data is in A0)
001---------001x W -------- INT ON main CPU irq enable (data is in A0)
001---------010x W -------- n.c.
001---------011x W -------- SOUND ON sound enable (data is in A0)
001---------100x W -------- 4 RESET reset 58XX I/O chips (data is in A0)
001---------101x W -------- SUB RESET reset sound CPU (data is in A0)
001---------110x W -------- n.c.
001---------111x W -------- n.c.
110-xxxxxxxxxxxx R xxxxxxxx ROM 1J program ROM (optional, not used by any game)
111xxxxxxxxxxxxx R xxxxxxxx ROM 1K program ROM (space for a 2764, but some games use a 2732)
Mappy memory map
----------------
The Tower of Druaga, Dig Dug 2, Motos are the same, with minor differences.
The main difference with Super Pac-Man is the increased video RAM, needed to
implement a scrolling tilemap.
Note: Part of the address decoding is done by PALs (SPC-5 and SPC-6, the same
as Super Pac-Man) so the tables are inferred by program behaviour.
MAIN CPU:
Address Dir Data Name Description
---------------- --- -------- --------- -----------------------
00000xxxxxxxxxxx R/W xxxxxxxx RAM 2H tilemap RAM (tile number)
00001xxxxxxxxxxx R/W xxxxxxxx RAM 2J tilemap RAM (tile color)
00010xxxxxxxxxxx R/W xxxxxxxx RAM 2N work RAM
000101111xxxxxxx R/W xxxxxxxx portion holding sprite registers (sprite number & color)
00011xxxxxxxxxxx R/W xxxxxxxx RAM 2L work RAM
000111111xxxxxxx R/W xxxxxxxx portion holding sprite registers (x, y)
00100xxxxxxxxxxx R/W xxxxxxxx RAM 2M work RAM
001001111xxxxxxx R/W xxxxxxxx portion holding sprite registers (x msb, flip, size)
00111xxxxxxxx--- W -------- POSIV tilemap scroll (data is in A3-A10)
01000-xxxxxxxxxx R/W xxxxxxxx SOUND RAM (shared with sound CPU)
01000-0000xxxxxx R/W xxxxxxxx portion holding the sound registers
01001-----xxxxxx R/W ----xxxx FBIT I/O chips [1]
01010-------000x W -------- INT ON 2 sound CPU irq enable (data is in A0)
01010-------001x W -------- INT ON main CPU irq enable (data is in A0)
01010-------010x W -------- FLIP screen flip (data is in A0)
01010-------011x W -------- SOUND ON sound enable (to 99XX custom) (data is in A0)
01010-------100x W -------- 4 RESET reset I/O chips (data is in A0)
01010-------101x W -------- SUB RESET reset sound CPU (data is in A0)
01010-------110x W -------- n.c.
01010-------111x W -------- n.c.
10000----------- R/W -------- WDR Watch Dog Reset [3]
101xxxxxxxxxxxxx R xxxxxxxx ROM 1D program ROM [2]
110xxxxxxxxxxxxx R xxxxxxxx ROM 1C program ROM [2]
111xxxxxxxxxxxxx R xxxxxxxx ROM 1B program ROM [2]
[1] only half of that space is actually used, because only 2 of the possible 4 I/O chips are present
[2] The Tower of Druaga, Dig Dug 2, Motos have 2 128k ROMs instead of 3 64k:
10xxxxxxxxxxxxxx R xxxxxxxx ROM 1D program ROM
11xxxxxxxxxxxxxx R xxxxxxxx ROM 1B program ROM
[3] Overlaps the ROM region. Dig Dug 2 reads it.
SOUND CPU:
Address Dir Data Name Description
---------------- --- -------- --------- -----------------------
000---xxxxxxxxxx R/W xxxxxxxx RAM 3K/3L work RAM (shared with main CPU)
000---0000xxxxxx R/W xxxxxxxx portion holding the sound registers
001---------000x W -------- INT ON 2 sound CPU irq enable (data is in A0)
001---------001x W -------- INT ON main CPU irq enable (data is in A0)
001---------010x W -------- FLIP screen flip (data is in A0)
001---------011x W -------- SOUND ON sound enable (to 99XX custom) (data is in A0)
001---------100x W -------- 4 RESET reset 58XX I/O chips (data is in A0)
001---------101x W -------- SUB RESET reset sound CPU (data is in A0)
001---------110x W -------- n.c.
001---------111x W -------- n.c.
110-xxxxxxxxxxxx R xxxxxxxx ROM 1J program ROM (optional, not used by any game)
111xxxxxxxxxxxxx R xxxxxxxx ROM 1K program ROM
----------------------------------------------------------------------------
Grobda
Namco, 1984
PCB Layout
----------
Top Board
PCB Number: 22109611 (22109631)
|---------------------------------|
| 0773 1502 |
| PAL GR1-3.3M |
| 8148 VOL |
| 68A09EP 8148 |
| |
| GR1-4.1K |
| --|
| |
| --|
|--| |
| | 2|
| | 2|
| | |
| | W|
| | 5806 A|
| | Y|
| | DSWB |
|--| |
|RESET_SW |
| GR2-3.1D --|
| |
| GR2-2.1C --|
| 5604 |
| GR2-1.1B |
| PAL 1603 DSWA |
| 68A09EP |
| 18.432MHz |
|---------------------------------|
Notes:
Namco Customs:
0773 - Clock Divider/Sync Generator
1502 - Sound Generator
5806 - I/O interface
5604 - I/O interface
1603 - I/O control
6809 clocks: 1.536MHz (both)
VSync: 60.606060Hz
22 Way Connector pinout same as Galaga, Pacland, Baraduke, Dragon Buster etc.
8148 - SRAM 1k x4
GR1-3.3M - PROM type 82S129
All ROMs - EPROM type 2764
Bottom Board
PCB Number: 22109612 (22109632)
|---------------------------------|
| 8148 |
| |
| 8148 |
| |
| GR1-4.3L |
| |
| 2016 |
| |
| |
|--| 2016 1204 |
| | |
| | |
| | 2016 |
| | |
| | |
| | |
| | 0433 GR1-5.3F |
|--| |
| |
| 2016 GR1-6.3E |
| GR1-5.4E |
| |
| 0042 1108 PAL |
| |
| GR1-6.4C |
| 0763 GR1-7.3C |
| |
|---------------------------------|
Notes:
Namco Customs:
1204 - Motion Object Position
0433 - Motion Object Controller
0042 - Video Ram Addresser
0763 - Clock Divider/Sync Generator
1108 - Datashift Playfield Register
8148 - SRAM 1k x4
2016 - SRAM 2x x8
GR1-4.3L \ PROMs type 82S129
GR1-5.4E /
GR1-6.4C - PROM type 82S123
GR1-5.3F \
GR1-6.3E / EPROM type 2764
GR1-7.3C - EPROM type 2732
----------------------------------------------------------------------------
Pacman & Chomp Chomp
Namco, 1983
This game runs on the same PCB as Grobda. Some custom chips have
different numbers but probably have the same purpose.
PCB Layout
----------
Top Board
PCB Number: 22109611 (22109631)
|---------------------------------|
| 0773 1500 |
| PAL PAP1-3.3M |
| 8148 VOL |
| 6809 8148 |
| |
| PAP1_4.1K |
| --|
| |
| --|
|--| |
| | 2|
| | 2|
| | |
| | W|
| | 5601 A|
| | Y|
| | DSWB |
|--| |
|RESET_SW |
| PAP3_3.1D --|
| |
| PAP3_2.1C --|
| 5902 |
| PAP3-1.1B |
| PAL 1600 DSWA |
| 6809 |
| 18.432MHz |
|---------------------------------|
Notes:
Namco Customs:
0773 - Clock Divider/Sync Generator
1500 - Sound Generator
5902 - ? (protection?)
5601 - ? (protection?)
1600 - ?
6809 clocks: 1.536MHz (both)
VSync: 60.606060Hz
22 Way Connector pinout same as Galaga, Pacland, Baraduke, Dragon Buster etc.
8148 - SRAM 1k x4
PAP1-3.3M - PROM type 82S129
All ROMs - EPROM type 2764
Bottom Board
PCB Number: 22109612 (22109632)
|---------------------------------|
| 8148 |
| |
| 8148 |
| |
| PAP2-4.3L |
| |
| 2016 |
| |
| |
|--| 2016 1200 |
| | |
| | |
| | 2016 |
| | |
| | |
| | |
| | 0433 PAP2_5.3F |
|--| |
| 3E |
| 2016 |
| PAP2-5.4E |
| |
| 0044 1100 PAL |
| |
| PAP2-6.4C |
| 0773 PAP2_6.3C |
| |
|---------------------------------|
Notes:
Namco Customs:
1200 - Motion Object Position
0433 - Motion Object Controller
0044 - Video Ram Addresser
0773 - Clock Divider/Sync Generator
1100 - Datashift Playfield Register
8148 - SRAM 1k x4
2016 - SRAM 2x x8
PAP2-4.3L \ PROMs type 82S129
PAP2-5.4E /
PAP2-6.4C - PROM type 82S123
PAP2_5.3F - EPROM type 2764
PAP2_6.3C - EPROM type 2732
3E - Empty socket
----------------------------------------------------------------------------
Easter eggs:
-----------
Abbreviations:
U, D, L, R: player 1 joystick directions
B1, B2: player 1 buttons
S1, S2: start buttons
S: service switch (the one that adds a credit, not the one to enter service mode)
- Super Pac-Man
- enter service mode
- keep B1 pressed and enter the following sequence:
R D D L L L L U
(c) (p) 1982 NAMCO LTD. will be added at the bottom of the screen.
- Pac & Pal
- enter service mode
- enter the following sequence:
L 9xR 5xD 6xU
(c) (p) 1982 NAMCO LTD. will appear on the screen.
- Phozon
- enter service mode
- enter the following sequence:
U U U U R D L L
(c) (p) 1983 NAMCO LTD. will appear on the screen.
- Mappy
- enter service mode
- keep L pressed to make the screen scroll left until the grid covers the whole screen
- press S 3 times
- keep B1 pressed and enter the following sequence:
4xL 6xS1 3xL S2
(c) 1983 NAMCO will appear on the screen.
- Mappy
- play the game and reach the third bonus round (the one after round 10)
- press B1 3 times, S1 3 times, S2 3 times
- after the score of the bonus round is shown, this text will be added at
the bottom of the screen:
(c) 1983 NAMCO
ALL RIGHTS RESERVED
- The Tower of Druaga
- enter service mode
- select sound 19
- press S to display the grid
- enter the following sequence:
4xU D 2xR 6xL S2
(c) NAMCO LTD. 1984 will appear on the screen.
- Dig Dug II (New Ver. only, Old Ver. doesn't have it)
- enter service mode
- select sound 1B
- press S to display the grid
- enter the following sequence:
D D R L L D D L L L U U
- press S again
Some music will play and
DIGDUGII
(c) 1985
NAMCO LTD.
will be slowly drawn on the screen.
- Grobda
- enter service mode
- set coin A to 1 Coin / 1 Credit
- set coin B to 1 Coin / 4 Credits
- set Freeze to On
- (the above means DSW A = 11101001)
- set Lives to 1
- set Difficulty to Rank C
- set Demo Sounds to Off
- set Level Select to Off
- set Bonus Life to 10k
- (the above means DSW B = 10011100)
- press S to display the grid
- press (all together) R + B1 + S2
(c) NAMCO LTD. 1984 will appear on the screen.
To exit, press S1 or S coin
- Motos
- enter service mode
- set coinage to 3 Coins / 1 Credit
- set Lives to 3
- set Difficulty to Rank A
- set Bonus Life to 10k 30k 50k
- set Demo Sounds to Off
- (the above means DSW A = 11100001)
- press S to display the grid
- press (all together) R + B1 + S2
(c) NAMCO LTD. 1985 will appear on the screen.
To exit, press S1 or S
Notes:
-----
- Phozon: completing level 34 (the second round of world 9) causes the game to
crash. This seems to be the correct behaviour: there is no data for levels
after that one, and using the level select dip switch to jump to level 35
(="22") causes the same crash. I think being able to complete level 34 is a
bug, it should be impossible because there shouldn't be enough molecules so
you would play it forever.
- Phozon: if you enter service mode and press service coin something
like the following is written at the bottom of the screen:
99,99999,9999,9999,9999
99,99999,9999,9999,999999
it seems to be a counter decremented while the game is running.
- Mappy: similarly, if you enter service mode and press
P1 button + service coin the following is shown:
99.99.999.9999.9999.9999
99.99.999.9999.9999.0000
- The Tower of Druaga: keep button 1 pressed while pressing the start button to
continue the previous game; you can choose which level to start from.
- Grobda: when the Level Select dip switch is On, after inserting a coin press
button + start to be asked the level to start from.
- The only difference between "grobda2" and "grobda3" is a tiny patch to some
code related to player shoots handling. Bugfix, I guess.
- Dig Dug II: when the "freeze" dip switch is on, at the beginning of the game
select starting level with joystick up/down, then press button 2. During the
game, press start to pause/resume.
TODO:
----
- Phozon: there appear to be two palette banks (sprites are the same, but
characters change from a blue background to brown background). It is not
known if and when the alternate palette should be used. The palette select
bit might be at address 500E/500F; if that's the case, it is set to 0 on
startup and I don't think it's ever set to 1 - which would mean the second
bank is not used and colors are right as they are.
- Phozon: one unknown PROM, I don't know what it could be.
***************************************************************************/
#include "emu.h"
#include "mappy.h"
#include "cpu/m6809/m6809.h"
#include "machine/74157.h"
#include "machine/74259.h"
#include "machine/watchdog.h"
#include "speaker.h"
/*************************************
*
* Constants
*
*************************************/
#define MASTER_CLOCK (XTAL(18'432'000))
#define PIXEL_CLOCK (MASTER_CLOCK/3)
// H counts from 128->511, HBLANK starts at 144 and ends at 240
#define HTOTAL (384)
#define HBEND (0) // (96+16)
#define HBSTART (288) // (16)
#define VTOTAL (264)
#define VBEND (0) // (16)
#define VBSTART (224) // (224+16)
/***************************************************************************/
void mappy_state::int_on_w(int state)
{
m_main_irq_mask = state;
if (!state)
m_maincpu->set_input_line(0, CLEAR_LINE);
}
void mappy_state::int_on_2_w(int state)
{
m_sub_irq_mask = state;
if (!state)
m_subcpu->set_input_line(0, CLEAR_LINE);
}
void mappy_state::int_on_3_w(int state)
{
m_sub2_irq_mask = state;
if (!state)
m_subcpu2->set_input_line(0, CLEAR_LINE);
}
template<uint8_t Chip>
TIMER_CALLBACK_MEMBER(mappy_state::namcoio_run_timer)
{
m_namcoio[Chip]->customio_run();
}
void mappy_state::vblank_irq(int state)
{
if (!state)
return;
if (m_main_irq_mask)
m_maincpu->set_input_line(0, ASSERT_LINE);
if (!m_namcoio[0]->read_reset_line()) // give the cpu a tiny bit of time to write the command before processing it
m_namcoio_run_timer[0]->adjust(attotime::from_usec(50));
if (!m_namcoio[1]->read_reset_line()) // give the cpu a tiny bit of time to write the command before processing it
m_namcoio_run_timer[1]->adjust(attotime::from_usec(50));
if (m_sub_irq_mask)
m_subcpu->set_input_line(0, ASSERT_LINE);
if (m_subcpu2.found() && m_sub2_irq_mask)
m_subcpu2->set_input_line(0, ASSERT_LINE);
}
void mappy_state::superpac_cpu1_map(address_map &map)
{
map(0x0000, 0x07ff).ram().w(FUNC(mappy_state::superpac_videoram_w)).share("videoram");
map(0x0800, 0x1fff).ram().share("spriteram"); // work RAM with embedded sprite RAM
map(0x2000, 0x2000).rw(FUNC(mappy_state::superpac_flipscreen_r), FUNC(mappy_state::superpac_flipscreen_w));
map(0x4000, 0x43ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with the sound CPU
map(0x4800, 0x480f).rw("namcoio_1", FUNC(namcoio_device::read), FUNC(namcoio_device::write)); // custom I/O chips interface
map(0x4810, 0x481f).rw("namcoio_2", FUNC(namcoio_device::read), FUNC(namcoio_device::write)); // custom I/O chips interface
map(0x5000, 0x500f).w("mainlatch", FUNC(ls259_device::write_a0)); // various control bits
map(0x8000, 0x8000).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0xa000, 0xffff).rom();
}
void mappy_state::phozon_cpu1_map(address_map &map)
{
map(0x0000, 0x07ff).ram().w(FUNC(mappy_state::superpac_videoram_w)).share("videoram"); // video RAM
map(0x0800, 0x1fff).ram().share("spriteram"); // shared RAM with CPU #2/sprite RAM
map(0x4000, 0x43ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with the sound CPU
map(0x4800, 0x480f).rw("namcoio_1", FUNC(namcoio_device::read), FUNC(namcoio_device::write)); // custom I/O chips interface
map(0x4810, 0x481f).rw("namcoio_2", FUNC(namcoio_device::read), FUNC(namcoio_device::write)); // custom I/O chips interface
map(0x5000, 0x500f).w("mainlatch", FUNC(ls259_device::write_a0)); // various control bits
map(0x7000, 0x7000).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x8000, 0xffff).rom();
}
void mappy_state::mappy_cpu1_map(address_map &map)
{
map(0x0000, 0x0fff).ram().w(FUNC(mappy_state::mappy_videoram_w)).share("videoram");
map(0x1000, 0x27ff).ram().share("spriteram"); // work RAM with embedded sprite RAM
map(0x3800, 0x3fff).w(FUNC(mappy_state::mappy_scroll_w)); // scroll
map(0x4000, 0x43ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with the sound CPU
map(0x4800, 0x480f).rw("namcoio_1", FUNC(namcoio_device::read), FUNC(namcoio_device::write)); // custom I/O chips interface
map(0x4810, 0x481f).rw("namcoio_2", FUNC(namcoio_device::read), FUNC(namcoio_device::write)); // custom I/O chips interface
map(0x5000, 0x500f).w("mainlatch", FUNC(ls259_device::write_a0)); // various control bits
map(0x8000, 0x8000).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x8000, 0xffff).rom(); // only a000-ffff in Mappy
}
void mappy_state::superpac_cpu2_map(address_map &map)
{
map(0x0000, 0x03ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with the main CPU (also sound registers)
map(0x2000, 0x200f).w("mainlatch", FUNC(ls259_device::write_a0)); // various control bits
map(0xe000, 0xffff).rom();
}
void mappy_state::phozon_cpu2_map(address_map &map)
{
map(0x0000, 0x03ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with the main CPU + sound registers
map(0xe000, 0xffff).rom();
}
void mappy_state::mappy_cpu2_map(address_map &map)
{
map(0x0000, 0x03ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with the main CPU (also sound registers)
map(0x2000, 0x200f).w("mainlatch", FUNC(ls259_device::write_a0)); // various control bits
map(0xe000, 0xffff).rom();
}
// extra CPU only present in Phozon
void mappy_state::phozon_cpu3_map(address_map &map)
{
map(0x0000, 0x07ff).ram().w(FUNC(mappy_state::superpac_videoram_w)).share("videoram");
map(0x0800, 0x1fff).ram().share("spriteram"); // shared RAM with CPU #2/sprite RAM
map(0x4000, 0x43ff).rw(m_namco_15xx, FUNC(namco_15xx_device::sharedram_r), FUNC(namco_15xx_device::sharedram_w)); // shared RAM with CPU #2
map(0xa000, 0xa7ff).ram();
map(0xe000, 0xffff).rom();
}
#define NAMCO_56IN0\
PORT_START("P1") /* 56XX #0 pins 22-29 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY\
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY\
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY\
PORT_START("P2") /* 56XX #0 pins 22-29 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_COCKTAIL\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL\
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL\
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL
#define NAMCO_5XIN0\
PORT_START("P1") /* 56XX #0 pins 22-29 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY\
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY\
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY\
PORT_START("P2") /* 56XX #0 pins 22-29 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL\
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL\
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
#define NAMCO_56IN1\
PORT_START("BUTTONS") /* 56XX #0 pins 30-33 and 38-41 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL\
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )\
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START2 )\
PORT_START("COINS") /* 56XX #0 pins 30-33 and 38-41 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )\
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )\
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
#define NAMCO_56DSW0\
PORT_START("DSW0") /* 56XX #1 pins 30-33 */\
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED )\
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED )\
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) )\
PORT_DIPSETTING( 0x04, DEF_STR( Upright ) )\
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )\
PORT_SERVICE( 0x08, IP_ACTIVE_LOW )
static INPUT_PORTS_START( superpac )
NAMCO_56IN0
NAMCO_56IN1
NAMCO_56DSW0
PORT_START("DSW1") // 56XX #1 pins 22-29
PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
PORT_DIPSETTING( 0x0f, "Rank 0-Normal" )
PORT_DIPSETTING( 0x0e, "Rank 1-Easiest" )
PORT_DIPSETTING( 0x0d, "Rank 2" )
PORT_DIPSETTING( 0x0c, "Rank 3" )
PORT_DIPSETTING( 0x0b, "Rank 4" )
PORT_DIPSETTING( 0x0a, "Rank 5" )
PORT_DIPSETTING( 0x09, "Rank 6-Medium" )
PORT_DIPSETTING( 0x08, "Rank 7" )
PORT_DIPSETTING( 0x07, "Rank 8-Default" )
PORT_DIPSETTING( 0x06, "Rank 9" )
PORT_DIPSETTING( 0x05, "Rank A" )
PORT_DIPSETTING( 0x04, "Rank B-Hardest" )
PORT_DIPSETTING( 0x03, "Rank C-Easy Auto" )
PORT_DIPSETTING( 0x02, "Rank D-Auto" )
PORT_DIPSETTING( 0x01, "Rank E-Auto" )
PORT_DIPSETTING( 0x00, "Rank F-Hard Auto" )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6")
PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
// When Freeze is on, press P1 button 1 to skip levels
PORT_DIPNAME( 0x80, 0x80, "Freeze / Rack Test (Cheat)" ) PORT_TOGGLE PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW2") // 56XX #1 pins 38-41 multiplexed
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_7C ) )
PORT_DIPNAME( 0x38, 0x38, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,5,6")
PORT_DIPSETTING( 0x08, "30k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x30, "30k & 80k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x20, "30k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x38, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x18, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x28, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x10, "30k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x10, "30k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00) // Manual shows 100k only, Test Mode shows 30k which is what we use
PORT_DIPSETTING( 0x38, "30k & 100k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x20, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x30, "30k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x08, "40k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x28, "40k & 120k Only" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x18, "40k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x80, "1" )
PORT_DIPSETTING( 0x40, "2" )
PORT_DIPSETTING( 0xc0, "3" )
PORT_DIPSETTING( 0x00, "5" )
INPUT_PORTS_END
static INPUT_PORTS_START( pacnpal )
NAMCO_56IN0
NAMCO_56IN1
NAMCO_56DSW0
PORT_START("DSW1") // ???? #1 pins ??-??
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_7C ) )
PORT_DIPNAME( 0x38, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:4,5,6")
PORT_DIPSETTING( 0x20, "20k & 70k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x30, "20k, 70k & Every 70k" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x00, "30k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x18, "30k & 70k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x10, "30k & 80k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x28, "30k, 100k & Every 80k" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x08, "30k & 100k Only" ) PORT_CONDITION("DSW1",0xc0,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x08, "30k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x00, "40k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x20, "30k & 80k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x30, "30k, 80k & Every 80k" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x18, "30k & 100k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x10, "40k & 120k Only" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x28, "40k, 100k & Every 100k" ) PORT_CONDITION("DSW1",0xc0,EQUALS,0x00)
PORT_DIPSETTING( 0x38, DEF_STR( None ) )
PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0xc0, "1" )
PORT_DIPSETTING( 0x80, "2" )
PORT_DIPSETTING( 0x40, "3" )
PORT_DIPSETTING( 0x00, "5" )
PORT_START("DSW2") // ???? #1 pins ??-??
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x0c, "Rank A" )
PORT_DIPSETTING( 0x08, "Rank B" )
PORT_DIPSETTING( 0x04, "Rank C" )
PORT_DIPSETTING( 0x00, "Rank D" )
PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:5" )
PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:6" )
PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:7" )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:8" )
INPUT_PORTS_END
static INPUT_PORTS_START( grobda )
NAMCO_5XIN0
NAMCO_56IN1
PORT_START("DSW0") // 56XX #1 pins 30-33
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x04, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) // service mode again
PORT_START("DSW1") // 56XX #1 pins 22-29
PORT_SERVICE_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW1:1" )
PORT_DIPNAME( 0x0e, 0x08, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x0a, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0e, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_4C ) )
PORT_DIPNAME( 0x70, 0x40, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x30, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x50, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x70, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x60, DEF_STR( 1C_4C ) )
PORT_DIPNAME( 0x80, 0x80, "Freeze" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW2") // 56XX #1 pins 38-41 multiplexed
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x02, "1" )
PORT_DIPSETTING( 0x01, "2" )
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x0c, "Rank A" )
PORT_DIPSETTING( 0x08, "Rank B" )
PORT_DIPSETTING( 0x04, "Rank C" )
PORT_DIPSETTING( 0x00, "Rank D" )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Level_Select ) ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7,8")
PORT_DIPSETTING( 0x00, "10k, 50k & Every 50k" )
PORT_DIPSETTING( 0x40, "10k & 30k Only" )
PORT_DIPSETTING( 0xc0, "10k Only" )
PORT_DIPSETTING( 0x80, DEF_STR( None ) )
INPUT_PORTS_END
static INPUT_PORTS_START( phozon )
NAMCO_5XIN0
NAMCO_56IN1
NAMCO_56DSW0
PORT_START("DSW1") // 56XX #1 pins 22-29
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x0e, 0x0e, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:2,3,4")
PORT_DIPSETTING( 0x0e, "Rank 0" )
PORT_DIPSETTING( 0x0c, "Rank 1" )
PORT_DIPSETTING( 0x0a, "Rank 2" )
PORT_DIPSETTING( 0x08, "Rank 3" )
PORT_DIPSETTING( 0x06, "Rank 4" )
PORT_DIPSETTING( 0x04, "Rank 5" )
PORT_DIPSETTING( 0x02, "Rank 6" )
PORT_DIPSETTING( 0x00, "Rank 7" )
// when level select is on, press P1 start during the game and move joystick to select level to jump to
PORT_DIPNAME( 0x10, 0x10, "Level Select (Cheat)" ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
// when stop mode is on, press P1 start to pause the game
PORT_DIPNAME( 0x20, 0x20, "Stop Mode (Cheat)" ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8")
PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) )
PORT_START("DSW2") // 56XX #1 pins 38-41 multiplexed and interleaved
PORT_DIPNAME( 0x11, 0x11, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:2,1")
PORT_DIPSETTING( 0x01, "1" ) // 1 on, 2 off
PORT_DIPSETTING( 0x11, "3" )
PORT_DIPSETTING( 0x10, "4" ) // 2 on, 1 off
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPNAME( 0x62, 0x62, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,3,5")
PORT_DIPSETTING( 0x02, "20k & 80k Only" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x40, "20k, 80k & Every 80k" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x20, "30k Only" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x42, "30k & 60k Only" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x62, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x60, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00) // repeated
PORT_DIPSETTING( 0x22, "30k, 120k & Every 120k" ) PORT_CONDITION("DSW2",0x01,NOTEQUALS,0x00)
PORT_DIPSETTING( 0x22, "20k & 80k Only" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00)
PORT_DIPSETTING( 0x02, "30k Only" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00)
PORT_DIPSETTING( 0x40, "30k, 100k & Every 100k" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00)
PORT_DIPSETTING( 0x62, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00)
PORT_DIPSETTING( 0x60, "30k & 100k Only" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // repeated
PORT_DIPSETTING( 0x42, "40k & 80k Only" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00)
PORT_DIPSETTING( 0x20, "100k Only" ) PORT_CONDITION("DSW2",0x01,EQUALS,0x00)
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
PORT_DIPNAME( 0x8c, 0x8c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW2:6,8,7")
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x8c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x88, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x84, DEF_STR( 1C_7C ) )
INPUT_PORTS_END