/
ksys573.cpp
6492 lines (5094 loc) · 271 KB
/
ksys573.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:R. Belmont, smf
/***************************************************************************
Konami System 573
===========================================================
Driver by R. Belmont & smf
NOTE: The first time you run each game, it will go through a special initialization
procedure. This can be quite lengthy (in the case of Dark Horse Legend). Let it
complete all the way before exiting MAME and you will not have to do it again!
NOTE 2: The first time you run Konami 80's Gallery, it will dump you on a clock
setting screen. Press DOWN to select "SAVE AND EXIT" then press player 1 START
to continue.
Note 3: Some games require an installation cassette when installing from CD.
Go to the slot devices menu in the tab menu and change the cassette from "game"
to "install" and select reset. After installing you need to change the cassette
back to "game" and select reset.
Note 4: Some games require you to press f2 to skip the rtc cleared note.
-----------------------------------------------------------------------------------------
System 573 Hardware Overview
Konami, 1998-2001
This system uses Konami PSX-based hardware with an ATAPI CDROM drive.
GunMania (and probably GunMania Zone Plus) has no CDROM drive.
There is a slot for a security cart (cart is installed in CN14) and also a PCMCIA card slot.
The main board and CDROM drive are housed in a black metal box. GunMania doesn't have that box.
The games can be swapped by exchanging the CDROM disc and the security cart, whereby the main-board
FlashROMs are re-programmed after a small wait. On subsequent power-ups, there is a check to test if the
contents of the FlashROMs matches the CDROM, then the game boots up immediately.
PCMCIA card slot is used by Dance Dance Revolution (2ndMIX link ver. and later),
GUITARFREAKS (2ndMIX link ver. and later), drummania (7thMIX and later), and GunMania.
DDR and GF: 32M flash card is used to store edit data (players can edit data by PlayStation
console, and send data to arcade machine via PS memory card).
DM and GF: network PCB unit (for e-AMUSEMENT) is connected via PCMCIA slot.
GM: unknown (program data is stored in flash card?)
The games that run on this system include...
Game Year Hardware Code CD Code
--------------------------------------------------------------------------------------------
P Anime Champ 2000.12 GCA07 JA (no CD)
P Bass Angler 1998.03 GE765 JA 765 JA A02
P Bass Angler 2 1998.07 GC865 JA 865 JA A02
K Dance Dance Revolution Karaoke MIX (DAM-DDR) 1999.11 GQ921 JB 921 JB B02
K Dance Dance Revolution Karaoke MIX (DAM-DDR) 2nd 2000.07 GQ947 JA 947 JA A02
A Dance Dance Revolution 1998.09 GC845 JA 845 JA(missing)/UA A01 / 845 JA A02
A Dance Dance Revolution Internet Ranking ver. 1998.11 GC845 JB 845 JB A01 / 845 JA/UA A02
A Dance Dance Revolution 2ndMIX 1999.01 GC895 JA 895 JA A02
A Dance Dance Revolution 2ndMIX LINK version 1999.04 GE885 JA 885 JA A02
A DDR 2ndMIX with bmIIDX CLUB ver. 1999.05 GN896 JA 896 JA A01
A DDR 2ndMIX AND bmIIDX substream CLUB ver. 2 1999.05 GE984 JA 984 JA A01
D Dance Dance Revolution Solo BASS MIX 1999.08 GQ894 JA 894 JA A02
D Dance Dance Revolution 3rdMIX 1999.10 GN887 AA/JA/KA 887 AA/JA/KA A02
D Dance Dance Revolution Solo 2000 1999.12 GC905 AA/JA 905 AA/JA A02
D Dance Dance Revolution 3rdMIX PLUS 2000.06 GCA22 JA A22 JA A02
D Dance Dance Revolution 4thMIX 2000.08 GCA33 JA A33 JA A02
D Dance Dance Revolution 4thMIX PLUS 2000.12 GCA34 JA A34 JA A02
D Dance Dance Revolution 5thMIX 2001.03 GCA27 JA A27 JA A02
D DDRMAX Dance Dance Revolution 6thMIX 2001.10 GCB19 JA B19 JA A02
D DDRMAX2 Dance Dance Revolution 7thMIX 2002.03 GCB20 JA B20 JA A02
D Dance Dance Revolution EXTREME 2002.12 GCC36 JA C36 JA A02
D Dance Maniax 2000.06 GE874 JA 874 JA A(needs redump)
D Dance Maniax 2ndMIX 2000.12 GCA39 JA A39 JA A02
D Dance Maniax 2ndMIX APPEND J PARADISE 2001.04
A Dancing Stage 1999.08 GN845 EA 845 EA(needs redump)
D Dancing Stage Euro Mix 2000 GE936 EA 936 EA A(needs redump)
D Dancing Stage Euro Mix 2 2000 G*C23 EA C23 EA A02
D Dancing Stage featuring Disney's Rave 2000.11 GCA37 JA A37 JA A02
D Dancing Stage featuring DREAMS COME TRUE 1999.12 GC910 JA 910 JA/JC A02
A Dancing Stage featuring TRUE KiSS DESTiNATiON 1999.07 G*884 JA 884 JA A02
P Dark Horse Legend 1998.03 GX706 JA 706 JA A02
A drummania 1999.07 GQ881 JA 881 JA D01 / 881 JA A02
D drummania 2ndMIX 2000.03 GE912 JA 912 JA B02
D drummania 3rdMIX 2000.09 GCA23 JA A23 JA A02
D drummania 4thMIX 2001.03 GEA25 JA A25 JA A02
D drummania 5thMIX 2001.09 GCB05 JA B05 JA A02
D drummania 6thMIX 2002.02 GCB16 JA B16 JA A02
N drummania 7thMIX 2002.08 GCC07 JA C07 JA A02
N drummania 7thMIX power-up ver. 2002.08 GEC07 JB C07 JC A02
N drummania 8thMIX 2003.04 GCC38 JA C38 JA A02
N drummania 9thMIX 2003.10 GCD09 JA D09 JA A02
N drummania 10thMIX 2004.04
? Fighting Mania 2000
P Fisherman's Bait 1998.06 GE765 UA 765 UA B02
P Fisherman's Bait 2 1998 GC865 UA 865 UA B02
P Fisherman's Bait Marlin Challenge 1999 GX889 889 AA/EA/JA/UA(needs redump)
P Gachagachamp 1999.01 GQ877 JA GE877-JA(PCMCIA card)
P Great Bishi Bashi Champ 2002.?? GBA48 JA (no CD)
A GUITARFREAKS 1999.02 GQ886 EA/JA/UA/AA 886 ** A02/C02/D02
A GUITARFREAKS 2ndMIX 1999.07 GQ883 JA 883 ** A02
A GUITARFREAKS 2ndMIX Link Kit 1 1999.09 GE929 JA 929 JA A02
A GUITARFREAKS 2ndMIX Link Kit 2 1999.11 GC929 JB 929 JB B02
D GUITARFREAKS 3rdMIX 2000.04 GE949 JA 949 JA C01 / 949 JA C02
D GUITARFREAKS 4thMIX 2000.08 GEA24 JA A24 JA A02
D GUITARFREAKS 5thMIX 2001.03 GCA26 JA A26 JA A02
D GUITARFREAKS 6thMIX 2001.09 GCB06 JA B06 JA A02
D GUITARFREAKS 7thMIX 2002.02 GCB17 JA B17 JA A02
N GUITARFREAKS 8thMIX 2002.08 GCC08 JA C08 JA A02
N GUITARFREAKS 8thMIX power-up ver. 2002.11 GEC08 JB C08 JB A02
N GUITARFREAKS 9thMIX 2003.04 GCC39 JA C39 JA A02
N GUITARFREAKS 10thMIX 2003.10 GCD10 JA D10 JA A02
N GUITARFREAKS 11thMIX 2004.04
G GunMania 2000.07 G?906 JA (no CD)
? *GunMania Zone Plus 2000.10 GCA15 JA
P Handle Champ 1997.12 GQ710 JA (no CD)
P Hyper Bishi Bashi Champ 1998.07 GC876 EA (no CD)
P Hyper Bishi Bashi Champ - 2 Player 1999.08 GC908 JA 908 A02
P Jikkyou Pawafuru Puro Yakyu EX 1998.04 GX802 JA 802 JA B02
P Jikkyou Pawafuru Puro Yakyu EX 98 1998.08
AA Kick & Kick 2001 GNA36 EA (no CD)
P Konami 80's Arcade Gallery 1998.11 GC826 JA 826 JA A01
P Konami 80's AC Special 1998 GC826 UA 826 UA A01
D Mambo a GoGo 2001.06
D Punchmania Hokuto no Ken 2000.03 918 JA B02
D Punchmania Hokuto no Ken 2 2000.12 A09 JA A02
P *Salary Man Champ
P Salary Man Champ - 2 Player 2001.02 GCA18 JA A18 JA(needs redump)
P Step Champ 1999.12
P: plain System573
A: uses ext. analog I/O board GX700-PWB(F)
AA: uses alt. ext. analog I/O board GX700-PWB(K)
D: uses ext. digital sound and I/O board GX894-PWB(B)
N: uses network PCB unit GUC07 + ext. digital sound and I/O board GX894-PWB(B)
G: gun mania only, drives air soft gun (this game uses real BB bullet)
K: uses karaoke I/O board GX921-PWB(B)
Note:
Not all games listed above are confirmed to run on System 573.
* - denotes undumped.
Main PCB Layout
---------------
External controls port
GX700-PWB(A)B ||
(C)1997 KONAMI CO. LTD. \/
|-----------------------------------------------------==============-------|
| CN15 CNA CN10 |
| CN16 |
| |------------------------|
| PQ30RV21 | |
| |-------| | |
| KM416V256 |SONY | | PCMCIA SLOT |
| |CXD2925| | |
| |-------| | |
| | |
| |------------------------|
| |-----| CN21 |
| |32M | |---------| |---------| |
| |-----| |SONY | |SONY | |
| |CXD8561Q | |CXD8530CQ| 29F016 29F016 |--| |
| |-----| | | | | | | |
| |32M | | | | | | | |
| |-----| |---------| |---------| 29F016 29F016 | | |
| 53.693175MHz 67.7376MHz | | |
| |-----| | |CN14|
| KM48V514 KM48V514 |9536 | 29F016 29F016 | | |
| KM48V514 KM48V514 | | | | |
| KM48V514 KM48V514 |-----| | | |
| KM48V514 KM48V514 29F016 29F016 |--| |
| MC44200FT M48T58Y-70PC1 |
| CN12|
| 700A01.22 |
| 14.7456MHz |
| |-------| |
| |KONAMI | |----| LA4705|
| 058232 |056879 | |3644| SM5877 |
| | | |----| ADC0834 LM358|
| |-------| ADM485 CN4 |
| CN5 CN3 CN17 |
| TEST_SW DIP4 USB CN8 RCA-L/R CN9 |
|--| JAMMA |-------------------------------------------|
|---------------------------|
Notes:
CNA - 40-pin IDE cable connector
CN3 - 10-pin connector labelled 'ANALOG', connected to a 9-pin DSUB connector mounted in the
front face of the housing, labelled 'OPTION1'
CN4 - 12-pin connector labelled 'EXT-OUT'
CN5 - 10-pin connector labelled 'EXT-IN', connected to a 9-pin DSUB connector mounted in the
front face of the housing, labelled 'OPTION2'
CN8 - 15-pin DSUB plug labelled 'VGA-DSUB15' extending from the front face of the housing
labelled 'RGB'. Use of this connector is optional because the video is output via the
standard JAMMA connector
CN9 - 4-pin connector for amplified stereo sound output to 2 speakers
CN10 - Custom 80-pin connector (for mounting an additional plug-in board for extra controls,
possibly with CN21 also)
CN12 - 4-pin CD-DA input connector (for Red-Book audio from CDROM drive to main board)
CN14 - 44-pin security cartridge connector. The cartridge only contains a small PCB labelled
'GX700-PWB(D) (C)1997 KONAMI' and has locations for 2 ICs only
IC1 - Small SOIC8 chip, identified as a XICOR X76F041 security supervisor containing 4X
128 x8 secureFLASH arrays, stamped '0038323 E9750'
IC2 - Solder pads for mounting of a PLCC68 or QFP68 packaged IC (not populated)
CN15 - 4-pin CDROM power connector
CN16 - 2-pin fan connector
CN17 - 6-pin power connector, connected to an 8-pin power plug mounted in the front face
of the housing. This can be left unused because the JAMMA connector supplies all power
requirements to the PCB
CN21 - Custom 30-pin connector (purpose unknown, but probably for mounting an additional
plug-in board with CN10 also)
TEST_SW - Push-button test switch
DIP4 - 4-position DIP switch
USB - USB connector extended from the front face of the housing labelled 'I/O'
RCA-L/R - RCA connectors for left/right audio output
PQ30RV21 - Sharp PQ30RV21 low-power voltage regulator (5 Volt to 3 Volt)
LA4705 - Sanyo LA4705 15W 2-channel power amplifier (SIP18)
LM358 - National Semiconductor LM358 low power dual operational amplifier (SOIC8, @ 33C)
CXD2925Q - Sony CXD2925Q SPU (QFP100, @ 15Q)
CXD8561Q - Sony CXD8561Q GPU (QFP208, @ 10M) Also found CXD8561BQ in some units
CXD8530CQ - Sony CXD8530CQ R3000-based CPU (QFP208, @ 17M)
9536 - Xilinx XC9536 in-system-programmable CPLD (PLCC44, @ 22J)
3644 - Hitachi H8/3644 HD6473644H microcontroller with 32k ROM & 1k RAM (QFP64, @ 18E,
labelled '700 02 38920')
056879 - Konami 056879 custom IC (QFP120, @ 13E)
MC44200FT - Motorola MC44200FT Triple 8-bit Video DAC (QFP44)
058232 - Konami 058232 custom ceramic IC (SIP14, @ 6C)
SM5877 - Nippon Precision Circuits SM5877 2-channel D/A converter (SSOP24, @32D)
ADM485 - Analog Devices ADM485 low power EIA RS-485 transceiver (SOIC8, @ 20C)
ADC0834 - National Semiconductor ADC0834 8-Bit Serial I/O A/D Converter with Multiplexer
Option (SOIC14, @ 24D)
M48T58Y-70- STMicroelectronics M48T58Y-70PC1 8k x8 Timekeeper RAM (DIP32, @ 22H)
Note that this is not used for protection. If you put in a new blank Timekeeper RAM
it will be programmed with some data on power-up. If you swap games, the Timekeeper
is updated with the new game data
29F016 Fujitsu 29F016A-90PFTN 2M x8 FlashROM (TSOP48, @ 27H/J/L/M & 31H/J/L/M)
Also found Sharp LH28F016S (2M x8 TSOP40) in some units
KM416V256 - Samsung Electronics KM416V256BT-7 256k x 16 DRAM (TSOP44/40, @ 11Q labelled 'SPUDR4M')
KM48V514 - Samsung Electronics KM48V514BJ-6 512k x 8 EDO DRAM (SOJ28, @ 16G/H, 14G/H, 12G/H, 9G/H labelled 'HDR4M8SJ')
Also found NEC 424805AL-A60 in some units
32M - NEC D481850GF-A12 128k x 32Bit x 2 Banks SGRAM (QFP100, @ 4P & 4L)
Also found Samsung KM4132G271Q-12 in some units
Software -
- 700A01.22G 4M MaskROM (DIP32, @ 22G). AMD 27C040 is also used
- SONY ATAPI CDROM drive, with CDROM disc containing program + graphics + sound
Some System 573 units contain a CR-583 drive dated October 1997, some contain a
CR-587 drive dated March 1998. Note that the CR-587 will not read CDR discs ;-)
Auxiliary Controls PCB
----------------------
GE765-PWB(B)A (C)1998 KONAMI CO. LTD.
|-----------------------------|
| CN33 C2242 |
| C2242 |
| NRPS11-G1A |
| CN35|
| D4701 |
| 74LS14 PC817 |-----------------|
| |
| PAL PAL |
| (E765B1) (E765B2) LCX245 |
| |
| 74LS174 PAL |
| (E765B1) |
| |
| 74LS174 CN31 |
|-----------------------------------------------|
Notes: (all IC's shown)
This PCB is known to be used for the fishing reel controls on all of the fishing games (at least).
CN31 - Connector joining this PCB to the MAIN PCB
CN33 - Connector used to join the external controls connector mounted on the outside of the
metal case to this PCB.
CN35 - Power connector
NRPS11-G1A - Relay?
D4701 - NEC uPD4701 Encoder (SOP24)
C2242 - 2SC2242 Transistor
PC817 - Sharp PC817 Photo-coupler IC (DIP4)
PAL - AMD PALCE16V8Q, stamped 'E765Bx' (DIP20)
GE877-PWB(C) (C)1998 KONAMI
|----------------------|
|-- JAMMA OUT --|
| |
| CN6 |
| CN5 CN4 CN3 CN2 |
| |
| |
| JAMMA IN |
|--------------------------|
Notes: This PCB is used for Gachagachamp. No ICs.
CN5 - To control lever unit (1P). uses 9 pins out of 15 pins of B15P-SHF-1AA
CN6 - To control lever unit (2P). uses 9 pins out of 14 pins of B14P-SHF-1AA
(CN4, CN3, CN2 is printed pattern only, no actual connector)
GX700-PWB(K)A (C)2000 KONAMI
|-----------------------------|
| CN9 CN4 |
| CN3 CN5 |
| |
| U2 U1 |
| |-----------------|
| CN6 |
| U3 U4 U5 U6 |
| U7 U8 U9-U16 |
| U17 U18 |
| |
| U19 |
| U20 U21 CN1 |
| CN7 CN8 CN2 |
|-----------------------------------------------|
Notes: (all ICs shown)
CN1 - (bottom) Connector joining this PCB to the MAIN PCB
CN2 - (unpopulated custom 80-pin)
CN3 - JST ??12
CN4 - JST ??12
CN5 - JST ??12
CN6 - JST ??10
CN7 - (unpopulated 5-pin)
CN8 - (unpopulated 8-pin)
CN9 - (unpopulated 4-pin)
U1 - Maxim DS2401 (SOIC6)
U2 - (unpopulated SOIC8)
U3 - Motorola 74LS74A (SOIC14)
U4,U5,U6 - Motorola 74LS244 (SOIC20)
U7 - (unpopulated 4-pad)
U8 - AMD PALCE16V8Q-15, stamped 'X700K01' (DIP20)
U9-16 - Sharp PC817XF (DIP4)
U17 - TI 74LV245A (SOIC20)
U18 - Motorola 74LS273 (SOIC20)
U19 - (unpopulated PLCC44 socket)
U20 - (unpopulated SOIC16)
U21 - (unpopulated SOIC16)
PCMCIA Flash Card
-----------------
Front
|----PCMCIA CONNECTOR-----|
| |
| HT04A MB624018 MB624019 |
| AT28C16 |
| |
| 29F017A.1L 29F017A.1U |
| 90PFTR 90PFTN |
| |
| 29F017A.2L 29F017A.2U |
| 90PFTN 90PFTR |
| |
| 29F017A.3L 29F017A.3U |
| 90PFTR 90PFTN |
| |
| 29F017A.4L 29F017A.4U |
| 90PFTN 90PFTR |
| |
|------------------SWITCH-|
Back
|----PCMCIA CONNECTOR-----|
| |
| |
| |
| |
| 29F017A.5U 29F017A.5L |
| 90PFTR 90PFTN |
| |
| 29F017A.6U 29F017A.6L |
| 90PFTN 90PFTR |
| |
| 29F017A.7U 29F017A.7L |
| 90PFTR 90PFTN |
| |
| 29F017A.8U 29F017A.8L |
| 90PFTN 90PFTR |
| |
|-SWITCH------------------|
Texas Instruments HT04A
Fujitsu MB624018 CMOS GATE ARRAY
Fujitsu MB624019 CMOS GATE ARRAY
Atmel AT28C16 16K (2K x 8) Parallel EEPROM
Fujitsu 29F017A-90PFTR 16M (2M x 8) BIT Flash Memory Reverse Pinout (Gachaga Champ card used 29F017-12PFTR instead)
Fujitsu 29F017A-90PFTN 16M (2M x 8) BIT Flash Memory Standard Pinout
*/
#include "emu.h"
#include "k573cass.h"
#include "k573dio.h"
#include "k573kara.h"
#include "k573mcal.h"
#include "k573mcr.h"
#include "k573msu.h"
#include "k573npu.h"
#include "cpu/psx/psx.h"
#include "bus/ata/ataintf.h"
#include "bus/ata/cr589.h"
#include "machine/adc083x.h"
#include "machine/bankdev.h"
#include "machine/ds2401.h"
#include "machine/jvshost.h"
#include "machine/linflash.h"
#include "machine/mb89371.h"
#include "machine/ram.h"
#include "machine/timekpr.h"
#include "machine/upd4701.h"
#include "sound/spu.h"
#include "sound/cdda.h"
#include "video/psx.h"
#include "screen.h"
#include "speaker.h"
#include "cdrom.h"
#include <algorithm>
#include "pnchmn.lh"
#define LOG_CDROM (1U << 1)
#define LOG_CONTROL (1U << 2)
#define LOG_SECURITY (1U << 3)
#define LOG_JVS (1U << 4)
#define LOG_IOBOARD (1U << 5)
// #define VERBOSE (LOG_GENERAL | LOG_CDROM | LOG_CONTROL | LOG_SECURITY | LOG_JVS | LOG_IOBOARD)
// #define LOG_OUTPUT_STREAM std::cout
#include "logmacro.h"
#define LOGCDROM(...) LOGMASKED(LOG_CDROM, __VA_ARGS__)
#define LOGCONTROL(...) LOGMASKED(LOG_CONTROL, __VA_ARGS__)
#define LOGSECURITY(...) LOGMASKED(LOG_SECURITY, __VA_ARGS__)
#define LOGJVS(...) LOGMASKED(LOG_JVS, __VA_ARGS__)
#define LOGIOBOARD(...) LOGMASKED(LOG_IOBOARD, __VA_ARGS__)
#define ATAPI_CYCLES_PER_SECTOR ( 30000 ) // plenty of time to allow DMA setup etc. BIOS requires this be at least 2000, individual games may vary.
/*
* Class declaration for sys573_jvs_host
*/
DECLARE_DEVICE_TYPE(SYS573_JVS_HOST, sys573_jvs_host)
class sys573_jvs_host : public jvs_host
{
public:
// construction/destruction
sys573_jvs_host(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
void send_packet(uint8_t *data, int length);
int received_packet(uint8_t *buffer);
int jvs_sense_r();
private:
int output_buffer_size = 0;
};
DEFINE_DEVICE_TYPE(SYS573_JVS_HOST, sys573_jvs_host, "sys573_jvs_host", "JVS Host (System 573)")
sys573_jvs_host::sys573_jvs_host(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: jvs_host(mconfig, SYS573_JVS_HOST, tag, owner, clock)
{
output_buffer_size = 0;
}
int sys573_jvs_host::jvs_sense_r()
{
return !get_address_set_line();
}
int sys573_jvs_host::received_packet(uint8_t *buffer)
{
if (jvs_sense_r()) {
// The game will send the command twice to reset, but the command
// shouldn't return any data or else a "JVS SUBS RESET ERROR" appears
return 0;
}
uint32_t length;
const uint8_t *data;
get_raw_reply(data, length);
if (length > 0) {
// The games don't unescape the data in memory.
// This causes issues any time 0xe0 or 0xd0 shows up in
// the original response data and were escaped.
// Sending an unescaped "encoded" packet works perfectly
// in-game.
uint8_t checksum = std::accumulate(data, data + length, 0);
buffer[0] = 0xe0;
memcpy(buffer + 1, data, length);
buffer[length+1] = checksum;
buffer[length+2] = 0;
length += 2;
commit_encoded();
}
return (int)length;
}
void sys573_jvs_host::send_packet(uint8_t *data, int length)
{
while (length > 0)
{
push(*data);
data++;
length--;
}
commit_raw();
}
namespace {
class ksys573_state : public driver_device
{
public:
ksys573_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_sys573_jvs_host(*this, "sys573_jvs_host"),
m_k573dio(*this, "k573dio"),
m_lamps(*this, "lamp%u", 0U),
m_analog0(*this, "analog0"),
m_analog1(*this, "analog1"),
m_analog2(*this, "analog2"),
m_analog3(*this, "analog3"),
m_psxirq(*this, "maincpu:irq"),
m_ata(*this, "ata"),
m_image(*this, "ata:0:cr589"),
m_pccard1(*this, "pccard1"),
m_pccard2(*this, "pccard2"),
m_h8_response(*this, "h8_response"),
m_ram(*this, "maincpu:ram"),
m_flashbank(*this, "flashbank"),
m_in2(*this, "IN2"),
m_out1(*this, "OUT1"),
m_out2(*this, "OUT2"),
m_upd4701(*this, "upd4701"),
m_gunx(*this, "GUNX"),
m_sensor(*this, "SENSOR"),
m_encoder(*this, "ENCODER"),
m_kicksensor1(*this, "KICK_SENSOR1"),
m_kicksensor2(*this, "KICK_SENSOR2"),
m_kicksensor3(*this, "KICK_SENSOR3"),
m_ds2401_id(*this, "ds2401_id"),
m_duart(*this, "mb89371")
{ }
void drmn9m(machine_config &config);
void drmn10m(machine_config &config);
void gtfrk10m(machine_config &config);
void gtfrk11m(machine_config &config);
void gtrfrk7m(machine_config &config);
void hyperbbc(machine_config &config);
[[maybe_unused]] void ddrsolo(machine_config &config);
void ddrsbm(machine_config &config);
void mamboagga(machine_config &config);
void gunmania(machine_config &config);
void hypbbc2p(machine_config &config);
void gtrfrk2m(machine_config &config);
void gtrfrk2ml(machine_config &config);
void gtrfrk5m(machine_config &config);
void ddrs2k(machine_config &config);
void stepchmp(machine_config &config);
void animechmp(machine_config &config);
void salarymc(machine_config &config);
void gbbchmp(machine_config &config);
void konami573(machine_config &config, bool no_cdrom = false);
void konami573n(machine_config &config);
void drmn2m(machine_config &config);
void gtrfrk3m(machine_config &config);
void mamboagg(machine_config &config);
void gtrfrks(machine_config &config);
void gchgchmp(machine_config &config);
void drmn4m(machine_config &config);
void fbaitbc(machine_config &config);
void ddr4ms(machine_config &config);
void konami573x(machine_config &config);
void dmx(machine_config &config);
void drmn(machine_config &config);
void kicknkick(machine_config &config);
void k573d(machine_config &config);
void k573k(machine_config &config);
void k573a(machine_config &config);
void k573ak(machine_config &config);
void pccard1_16mb(machine_config &config);
void pccard1_32mb(machine_config &config);
void pccard2_32mb(machine_config &config);
void pccard2_64mb(machine_config &config);
void cassx(machine_config &config);
void cassxi(machine_config &config);
void cassy(machine_config &config);
void cassyi(machine_config &config);
void cassyyi(machine_config &config);
void casszi(machine_config &config);
void cassxzi(machine_config &config);
void init_serlamp();
void init_hyperbbc();
void init_drmn();
int gunmania_tank_shutter_sensor();
int gunmania_cable_holder_sensor();
int h8_d0_r();
int h8_d1_r();
int h8_d2_r();
int h8_d3_r();
template<int N> int pccard_cd_r();
void gtrfrks_lamps_b7(int state);
void gtrfrks_lamps_b6(int state);
void gtrfrks_lamps_b5(int state);
void gtrfrks_lamps_b4(int state);
void dmx_lamps_b0(int state);
void dmx_lamps_b1(int state);
void dmx_lamps_b2(int state);
void dmx_lamps_b3(int state);
void dmx_lamps_b4(int state);
void dmx_lamps_b5(int state);
void mamboagg_lamps_b3(int state);
void mamboagg_lamps_b4(int state);
void mamboagg_lamps_b5(int state);
void serial_lamp_reset(int state);
void serial_lamp_data(int state);
void stepchmp_lamp_clock(int state);
void animechmp_lamp_clock(int state);
void salarymc_lamp_clock(int state);
void hyperbbc_lamp_red(int state);
void hyperbbc_lamp_green(int state);
void hyperbbc_lamp_blue(int state);
void hyperbbc_lamp_start(int state);
void hyperbbc_lamp_strobe1(int state);
void hyperbbc_lamp_strobe2(int state);
void hyperbbc_lamp_strobe3(int state);
void h8_clk_w(int state);
int jvs_rx_r();
protected:
using gx700pwfbf_output_delegate = delegate<void (offs_t, uint8_t)>;
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void driver_start() override;
void gx700pwfbf_init(gx700pwfbf_output_delegate &&output_callback_func);
void konami573a_map(address_map &map);
required_device<psxcpu_device> m_maincpu;
required_device<sys573_jvs_host> m_sys573_jvs_host;
optional_device<k573dio_device> m_k573dio;
output_finder<2> m_lamps;
private:
bool jvs_is_valid_packet();
void jvs_input_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t jvs_input_r(offs_t offset, uint16_t mem_mask = ~0);
uint16_t port_in2_jvs_r(offs_t offset, uint16_t mem_mask = ~0);
uint16_t control_r(offs_t offset, uint16_t mem_mask = ~0);
void control_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void atapi_reset_w(uint16_t data);
void security_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t security_r(offs_t offset, uint16_t mem_mask = ~0);
uint16_t ge765pwbba_r(offs_t offset, uint16_t mem_mask = ~0);
void ge765pwbba_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t gx700pwbf_io_r(offs_t offset, uint16_t mem_mask = ~0);
void gx700pwbf_io_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t gx700pwbk_io_r(offs_t offset, uint16_t mem_mask = ~0);
void gx700pwbk_io_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void gunmania_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t gunmania_r(offs_t offset, uint16_t mem_mask = ~0);
void ata_interrupt(int state);
TIMER_CALLBACK_MEMBER( atapi_xfer_end );
void ddrsolo_output_callback(offs_t offset, uint8_t data);
void drmn_output_callback(offs_t offset, uint8_t data);
void dmx_output_callback(offs_t offset, uint8_t data);
void mamboagg_output_callback(offs_t offset, uint8_t data);
double analogue_inputs_callback(uint8_t input);
void cdrom_dma_read( uint32_t *ram, uint32_t n_address, int32_t n_size );
void cdrom_dma_write( uint32_t *ram, uint32_t n_address, int32_t n_size );
void stepchmp_cassette_install(device_t* device);
void animechmp_cassette_install(device_t *device);
void salarymc_cassette_install(device_t *device);
void hyperbbc_cassette_install(device_t *device);
void hyprbbc2_cassette_install(device_t *device);
void hypbbc2p_cassette_install(device_t *device);
static void cr589_config(device_t *device);
void fbaitbc_map(address_map &map);
void flashbank_map(address_map &map);
void gunmania_map(address_map &map);
void gbbchmp_map(address_map &map);
void konami573_map(address_map &map);
void konami573ak_map(address_map &map);
void konami573d_map(address_map &map);
void konami573k_map(address_map &map);
required_ioport m_analog0;
required_ioport m_analog1;
required_ioport m_analog2;
required_ioport m_analog3;
void gx700pwbf_output( int offset, uint8_t data );
required_device<psxirq_device> m_psxirq;
required_device<ata_interface_device> m_ata;
optional_device<atapi_hle_device> m_image;
required_device<pccard_slot_device> m_pccard1;
required_device<pccard_slot_device> m_pccard2;
emu_timer *m_atapi_timer;
int m_atapi_xferbase;
int m_atapi_xfersize;
int m_pccard_cd[2];
uint32_t m_control;
uint16_t m_n_security_control;
required_region_ptr<uint8_t> m_h8_response;
int m_h8_index;
int m_h8_clk;
uint8_t m_gx700pwbf_output_data[ 4 ];
gx700pwfbf_output_delegate m_gx700pwfbf_output_callback;
int m_serial_lamp_bits;
int m_serial_lamp_shift;
int m_serial_lamp_data;
int m_serial_lamp_clock;
int m_hyperbbc_lamp_red;
int m_hyperbbc_lamp_green;
int m_hyperbbc_lamp_blue;
int m_hyperbbc_lamp_start;
int m_hyperbbc_lamp_strobe1;
int m_hyperbbc_lamp_strobe2;
int m_hyperbbc_lamp_strobe3;
uint32_t *m_p_n_psxram;
int m_tank_shutter_position;
int m_cable_holder_release;
int m_jvs_input_idx_r, m_jvs_input_idx_w;
int m_jvs_output_idx_w, m_jvs_output_len_w;
uint8_t m_jvs_input_buffer[512];
uint8_t m_jvs_output_buffer[512];
required_device<ram_device> m_ram;
required_device<address_map_bank_device> m_flashbank;
required_ioport m_in2;
required_ioport m_out1;
required_ioport m_out2;
optional_device<upd4701_device> m_upd4701;
optional_ioport m_gunx;
optional_ioport m_sensor;
optional_ioport m_encoder;
optional_ioport m_kicksensor1;
optional_ioport m_kicksensor2;
optional_ioport m_kicksensor3;
optional_device<ds2401_device> m_ds2401_id;
optional_device<mb89371_device> m_duart;
};
class ddr_state : public ksys573_state
{
public:
ddr_state(const machine_config &mconfig, device_type type, const char *tag) :
ksys573_state(mconfig, type, tag),
m_stage(*this, "STAGE")
{
}
// DDR analog
void ddr(machine_config &config);
void ddrk(machine_config &config);
void ddr2mc2(machine_config &config);
void ddr2ml(machine_config &config);
void ddrbocd(machine_config &config);
// DDR digital
void ddr3m(machine_config &config);
void ddr3mp(machine_config &config);
void ddrusa(machine_config &config);
void ddr5m(machine_config &config);
// Dancing Stage analog
void dsfdcta(machine_config &config);
void dsftkd(machine_config &config);
// Dancing Stage digital
void dsfdct(machine_config &config);
void dsfdr(machine_config &config);
void dsem(machine_config &config);
void dsem2(machine_config &config);
DECLARE_CUSTOM_INPUT_MEMBER( gn845pwbb_read );
void init_ddr();
protected:
virtual void machine_start() override;
private:
struct stage_state
{
int DO = 0;
int clk = 0;
int shift = 0;
int state = 0;
int bit = 0;
};
void ddr_output_callback(offs_t offset, uint8_t data);
void gn845pwbb_do_w(int offset, int data);
void gn845pwbb_clk_w(int offset, int data);
required_ioport m_stage;
uint32_t m_stage_mask;
stage_state m_stage_state[2];
};
class pnchmn_state : public ksys573_state
{
public:
pnchmn_state(const machine_config &mconfig, device_type type, const char *tag) :
ksys573_state(mconfig, type, tag),
m_pads(*this, "PADS")
{
}
void pnchmn(machine_config &config);
void pnchmn2(machine_config &config);
void init_pnchmn();
// FIXME: leaking because a konami573_cassette_xi_device member uses it
double m_pad_position[6] = { };
int m_pad_motor_direction[6] = { };
attotime m_last_pad_update;
required_ioport m_pads;
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
private:
void punchmania_cassette_install(device_t *device);
void punchmania_output_callback(offs_t offset, uint8_t data);
};
void ksys573_state::konami573_map(address_map &map)
{
map(0x1f000000, 0x1f3fffff).m(m_flashbank, FUNC(address_map_bank_device::amap16));
map(0x1f400000, 0x1f400003).portr("IN0").portw("OUT0");
map(0x1f400004, 0x1f400007).portr("IN1");
map(0x1f400008, 0x1f40000b).r(FUNC(ksys573_state::port_in2_jvs_r));
map(0x1f40000c, 0x1f40000f).portr("IN3");
map(0x1f480000, 0x1f48000f).rw(m_ata, FUNC(ata_interface_device::cs0_r), FUNC(ata_interface_device::cs0_w));
map(0x1f4c0000, 0x1f4c000f).rw(m_ata, FUNC(ata_interface_device::cs1_r), FUNC(ata_interface_device::cs1_w));
map(0x1f500000, 0x1f500001).rw(FUNC(ksys573_state::control_r), FUNC(ksys573_state::control_w)); // Konami can't make a game without a "control" register.
map(0x1f560000, 0x1f560001).w(FUNC(ksys573_state::atapi_reset_w));
map(0x1f5c0000, 0x1f5c0003).nopw(); // watchdog?
map(0x1f600000, 0x1f600003).portw("LAMPS");
map(0x1f620000, 0x1f623fff).rw("m48t58", FUNC(timekeeper_device::read), FUNC(timekeeper_device::write)).umask32(0x00ff00ff);
map(0x1f680000, 0x1f680001).rw(FUNC(ksys573_state::jvs_input_r), FUNC(ksys573_state::jvs_input_w));
map(0x1f6a0000, 0x1f6a0001).rw(FUNC(ksys573_state::security_r), FUNC(ksys573_state::security_w));
}
void ksys573_state::flashbank_map(address_map &map)
{
map(0x0000000, 0x03fffff).rw("29f016a.31m", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0x00ff);
map(0x0000000, 0x03fffff).rw("29f016a.27m", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0xff00);
map(0x0400000, 0x07fffff).rw("29f016a.31l", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0x00ff);
map(0x0400000, 0x07fffff).rw("29f016a.27l", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0xff00);
map(0x0800000, 0x0bfffff).rw("29f016a.31j", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0x00ff);
map(0x0800000, 0x0bfffff).rw("29f016a.27j", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0xff00);
map(0x0c00000, 0x0ffffff).rw("29f016a.31h", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0x00ff);
map(0x0c00000, 0x0ffffff).rw("29f016a.27h", FUNC(intelfsh8_device::read), FUNC(intelfsh8_device::write)).umask16(0xff00);
map(0x4000000, 0x7ffffff).rw("pccard1", FUNC(pccard_slot_device::read_memory), FUNC(pccard_slot_device::write_memory));
map(0x8000000, 0xbffffff).rw("pccard2", FUNC(pccard_slot_device::read_memory), FUNC(pccard_slot_device::write_memory));
}
void ksys573_state::konami573d_map(address_map &map)
{
konami573_map(map);
map(0x1f640000, 0x1f6400ff).m(m_k573dio, FUNC(k573dio_device::amap));
}
void ksys573_state::konami573k_map(address_map &map)
{
konami573_map(map);
map(0x1f640000, 0x1f6400ff).m("k573kara", FUNC(k573kara_device::amap));
}
void ksys573_state::konami573a_map(address_map &map)
{
konami573_map(map);
map(0x1f640000, 0x1f6400ff).rw(FUNC(ksys573_state::gx700pwbf_io_r), FUNC(ksys573_state::gx700pwbf_io_w));
}
void ksys573_state::konami573ak_map(address_map &map)
{
konami573_map(map);
map(0x1f640000, 0x1f6400ff).rw(FUNC(ksys573_state::gx700pwbk_io_r), FUNC(ksys573_state::gx700pwbk_io_w));
}
void ksys573_state::fbaitbc_map(address_map &map)
{
konami573_map(map);
map(0x1f640000, 0x1f6400ff).rw(FUNC(ksys573_state::ge765pwbba_r), FUNC(ksys573_state::ge765pwbba_w));
}
void ksys573_state::gunmania_map(address_map &map)
{
konami573_map(map);
map(0x1f640000, 0x1f6400ff).rw(FUNC(ksys573_state::gunmania_r), FUNC(ksys573_state::gunmania_w));
}
void ksys573_state::gbbchmp_map(address_map &map)
{
konami573_map(map);
// The game waits until transmit is ready, but the chip may not actually be present.
map(0x1f640000, 0x1f640007).rw(m_duart, FUNC(mb89371_device::read), FUNC(mb89371_device::write)).umask32(0x00ff00ff);
}
bool ksys573_state::jvs_is_valid_packet()
{
if (m_jvs_input_idx_w < 5) {
// A valid packet will have at the very least
// - sync (0xe0)
// - node number (non-zero)
// - size
// - at least 1 byte in the request message
// - checksum
return false;
}
if (m_jvs_input_buffer[0] != 0xe0 || m_jvs_input_buffer[1] == 0x00) {
return false;
}
int command_size = m_jvs_input_buffer[2] + 3;
if (m_jvs_input_idx_w < command_size) {
return false;
}
uint8_t checksum = 0;
for (int i = 1; i < command_size - 1; i++) {
checksum += m_jvs_input_buffer[i];
}
return checksum == m_jvs_input_buffer[command_size - 1];
}
void ksys573_state::jvs_input_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
m_jvs_input_buffer[m_jvs_input_idx_w++] = data & 0xff;
m_jvs_input_buffer[m_jvs_input_idx_w++] = data >> 8;
if (m_jvs_input_buffer[0] != 0xe0) {
m_jvs_input_idx_w = 0;
}
if (jvs_is_valid_packet()) {
LOGJVS("jvs_input_w( %08x, %08x, %02x %02x )\n", offset, mem_mask, data & 0xff, data >> 8 );
for (int i = 0; i < m_jvs_input_idx_w; i++)
LOGJVS("%02x ", m_jvs_input_buffer[i]);
LOGJVS("\n");
int command_size = m_jvs_input_buffer[2] + 3;
m_sys573_jvs_host->send_packet(m_jvs_input_buffer + 1, command_size - 2); // jvshost doesn't actually check the checksum, so don't send it