/
konamim2.cpp
1623 lines (1336 loc) · 57.1 KB
/
konamim2.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:Phil Bennett
/***************************************************************************
Konami M2 hardware
driver by Phil Bennett
TODO:
* Fix Heat of Eleven '98 soft-lock when selecting Japan as a team
* Fix incorrect speed in Tobe! Polystars
* Fix texture compression
* Sort out CD images
* Fix PowerPC 602 Protection Only mode handling.
DONE
* Fix Polystars blending
* Fix missing music in Polystars
* Fix music playing too early
* Fix missing music and sound in Hell Night/Evil Night
* Fix incorrect speed in Heat of 11 and Total Vice (partially)
// Polystars/Total Vice
if (pc == 0x40035958)
gpr[11] = 1;
// Everything else
if (pc == 0x400385c8)
gpr[11] = 0;
Konami M2 Hardware Overview
Konami, 1997-1998
This hardware is 3DO-based with two IBM Power PC CPUs.
There were only 5 known games on this hardware. They include....
Game Year CD Codes Konami Part#
-------------------------------------------------------------------------------------------------------------------
Battle Tryst 1998 636JAC02
Evil Night 1998 810UBA02
Hell Night (alt. Region title, same as Evil Night) 1998 810EAA02
Heat Of Eleven '98 1998 703EAA02
Tobe! Polystars 1997 623JAA02 003894
Total Vice 1997 639UAC01, 639EAD01, 639JAD01, 639AAB01
PCB Layouts
-----------
Top Board
[M]DFUP0882ZAM1
FZ-20B1AK 7BKSA03500 (sticker)
|---------------------------------------------------|
| |--------------------| |----------| |
| |--------------------| |----------| |
| 2902 |---| |--------| |
| AK4309 CY2292S|---| |*2 | | 3DO | |-------| |
| |*1 | |---| | | |IBM | |
| 18MHz |---| | | |POWERPC| |
| | | |602 | |
| |--------| |-------| |
| D4516161 D4516161 |
| |---| |-------| |
|DSW |-------| |*3 | |IBM | |
| | | |---| |POWERPC| |
| D4516161 D4516161 | *4 | |602 | |
| | | |-------| |
| |-------| |
|---------------------------------------------------|
Notes:
AK4309 - Asahi Kasei Microsystems AK4309-VM Digital to Analog Converter (SOIC24)
2902 - Japan Radio Co. JRC2902 Quad Operational Amplifier (SOIC14)
CY2292S - Cypress CY2292S Three-PLL General-Purpose EPROM Programmable Clock Generator (SOIC16)
XTALIN - 18.000MHz, XTALOUT - 18.000MHz, XBUF - 18.000MHz, CPUCLK - 25.2000MHz
CLKA - , CLKB - , CLKC - 16.9345MHz, CLKD -
3DO - 9701 B861131 VY21118- CDE2 3DO 02473-001-0F (QFP208)
*1 - [M] JAPAN ASUKA 9651HX001 044 (QFP44)
*2 - Motorola MC44200FT
*3 - [M] BIG BODY 2 BU6244KS 704 157 (QFP56)
*4 - Unknown BGA chip (Graphics Engine, with heatsink attached)
DSW - 2 position DIP switch
Bottom Board
PWB403045B (C) 1997 KONAMI CO., LTD.
|----------------------------------------------------------|
| CN16 |--------------------| |----------| |
|LA4705 |--------------------| |----------| |
| NJM5532D 9.83MHz |
| 19.66MHz |
|J |--------| 93C46.7K |-|
|A | 058232 | BOOTROM.8Q | |
|M |--------| |------| | |
|M |------| |003461| | |
|A |056879| | | | |CN15
| | | |------| | |
| TEST |------| | |
| | |
| DSW | |
| |-|
| |
|----------------------------------------------------------|
Notes:
056879 - Konami custom IC, location 10E (QFP120)
058232 - Konami custom ceramic flat pack IC, DAC?
003461 - Konami custom IC, location 11K (QFP100)
CN16 - 4 pin connector for CD-DA in from CDROM
CN15 - Standard (PC-compatible) 40 pin IDE CDROM flat cable connector and 4 pin power plug connector,
connected to Panasonic CR-583 8-speed CDROM drive.
LA4705 - LA4705 Power Amplifier
DSW - 8 position dip switch
BOOTROM.8Q - 16MBit MASKROM. Location 8Q (DIP42)
Battle Tryst - 636A01.8Q
Evil Night - .8Q
Heat Of Eleven '98 - .8Q
Polystars - 623B01.8Q
Total Vice - .8Q
93C46.7K - 128bytes x8bit Serial EEPROM. Location 7K (DIP8)
NOTE! There is very mild protection to stop game-swapping. It is based on the information in the EEPROM
being the same as the Time Keeper NVRAM.
For example, in Evil Night, the first line of the NVRAM in hex is 474E38313000000019984541410002A601FEFE01
Looking at it in ascii: GN810.....EAA.......
Hex 474E383130 = GN810
1998 = the year of the game
Hex 454141 = EAA (the version = europe english)
The numbers after this appear to be unimportant (at least with regards to swapping games anyway).
All the other data after the first line is used for high scores tables etc.
The important part is that the data in the EEPROM should be the same as the NVRAM, but the EEPROM data
is byte-swapped! If the two don't match, the check on 7K or the NVRAM will fail and the PCB will reboot
forever.
Some lower boards have two connectors underneath for a protection sub-board or sound board. These are detailed below....
GX636-PWB(A) (C) 1997 KONAMI CO., LTD.
|-------------------------|
| CN4 CN3 |---------| |
| |---------|CN2 |
| PAL |
| |
| NVRAM |
| |
| |---------| |
| |---------|CN1 |
|-------------------------|
Notes:
NVRAM - With Heat of Eleven '98, uses Dallas DS1643 NonVolatile TimeKeeping RAM
With Battle Tryst, uses ST M48T58Y-70PC1 NonVolatile TimeKeeping RAM
With Poly Stars, a sub board is not used at all
PAL - PALCE16V8Q, stamped 'X636A1'
CN3 - 4-pin sound cable tied to CN16 (CD-DA Input) on main lower board
CN4 - 4-pin sound cable tied to CDROM analog audio output connector
GQ639 PWB 403327(A)
|-----------------------------------------|
| 639JAA02.xx |
| |
| |
| |---------| |
| |---------| |
| |
| |
| PAL |
| |
| |
| |
| |
| |---------| |
| YMZ280B |---------| |
| |
| 16.9344MHz |
| |
| |
|-----------------------------------------|
Notes:
This PCB is used on Total Vice only.
639JAA02.xx - 8MBit Sound data ROM (DIP42)
PAL - PAL16V8H stampd ' '
PWB0000047043 (C) 1998 KONAMI CO., LTD.
|-----------------------------------------|
| CN4 CN3 |
| |
| |
| |---------| |
| |---------| |
| 16.9344MHz M48T58Y |
| PAL |
| YMZ280B |
| |
| |
| |
| |
| |---------| |
| |---------| |
| |
| |
| |
| 810A03.16H |
|-----------------------------------------|
Notes:
This PCB is used on Evil Night/Hell Night only.
810A03.16H - 16MBit Sound data ROM (DIP42, byte mode)
PAL - PAL16V8H stamped 'N810B1'
M48T58Y - ST M48T58Y-70PC1 NonVolatile TimeKeeping RAM
CN3 - 4-pin sound cable tied to CN16 (CD-DA Input) on main lower board
CN4 - 4-pin sound cable tied to CDROM analog audio output connector
***************************************************************************/
#include "emu.h"
#include "3dom2.h"
#include "bus/ata/ataintf.h"
#include "bus/ata/cr589.h"
#include "cpu/powerpc/ppc.h"
#include "machine/eepromser.h"
#include "machine/timekpr.h"
#include "sound/dac.h"
#include "sound/ymz280b.h"
#include "debug/debugcon.h"
#include "debugger.h"
#include "screen.h"
#include "speaker.h"
#include "cdrom.h"
namespace {
#define M2_CLOCK XTAL(66'666'700)
#define ENABLE_SDBG 0
/*************************************
*
* driver state class
*
*************************************/
class konamim2_state : public driver_device
{
public:
konamim2_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_ppc1(*this, "ppc1"),
m_ppc2(*this, "ppc2"),
m_bda(*this, "bda"),
m_cde(*this, "cde"),
m_eeprom(*this, "eeprom"),
m_ldac(*this, "ldac"),
m_rdac(*this, "rdac"),
m_ata(*this, "ata"),
m_screen(*this, "screen"),
m_m48t58(*this, "m48t58"),
m_ymz280b(*this, "ymz")
{
}
void konamim2(machine_config &config);
void set_ntsc(machine_config &config);
void set_ntsc2(machine_config &config);
void set_arcres(machine_config &config);
void add_ymz280b(machine_config &config);
void add_mt48t58(machine_config &config);
void polystar(machine_config &config);
void totlvice(machine_config &config);
void btltryst(machine_config &config);
void heatof11(machine_config &config);
void evilngt(machine_config &config);
void hellngt(machine_config &config);
static void cr589_config(device_t *device);
void m2_map(address_map &map);
protected:
virtual void machine_start() override;
public:
void ppc1_int(int state);
void ppc2_int(int state);
void cde_sdbg_out(uint32_t data);
void ldac_out(uint16_t data);
void rdac_out(uint16_t data);
void ata_int(int state);
uint16_t konami_io0_r(offs_t offset);
void konami_io0_w(offs_t offset, uint16_t data);
uint16_t konami_sio_r(offs_t offset, uint16_t mem_mask = ~0);
void konami_sio_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t konami_io1_r(offs_t offset);
void konami_io1_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
void konami_eeprom_w(uint16_t data);
void init_totlvice();
void init_btltryst();
void init_hellngt();
void konami_atapi_unk_w(uint16_t data)
{
// 8000 = /Reset
// 4000 = C000 ... DOIO DMA ... 4000
// m_ata->write_dmack(data & 0x4000 ? ASSERT_LINE : CLEAR_LINE);
if (!(data & 0x8000))
{
logerror("ATAPI RESET!\n");
}
}
private:
void install_ymz280b();
void install_m48t58();
required_device<ppc602_device> m_ppc1;
optional_device<ppc602_device> m_ppc2;
required_device<m2_bda_device> m_bda;
required_device<m2_cde_device> m_cde;
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<dac_word_interface> m_ldac;
required_device<dac_word_interface> m_rdac;
required_device<ata_interface_device> m_ata;
required_device<screen_device> m_screen;
optional_device<m48t58_device> m_m48t58;
optional_device<ymz280b_device> m_ymz280b;
// Konami SIO
uint16_t m_sio_data = 0;
uint32_t m_ata_int = 0; // TEST
emu_timer *m_atapi_timer = nullptr;
TIMER_CALLBACK_MEMBER( atapi_delay )
{
m_atapi_timer->adjust( attotime::never );
m_ata_int = param;
}
void debug_help_command(const std::vector<std::string_view> ¶ms);
void debug_commands(const std::vector<std::string_view> ¶ms);
void dump_task_command(const std::vector<std::string_view> ¶ms);
};
/*************************************
*
* Trampolines - Remove ME
*
*************************************/
void konamim2_state::ppc1_int(int state)
{
m_ppc1->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
}
void konamim2_state::ppc2_int(int state)
{
m_ppc2->set_input_line(INPUT_LINE_IRQ0, state ? ASSERT_LINE : CLEAR_LINE);
}
void konamim2_state::cde_sdbg_out(uint32_t data)
{
if (data == 0xd)
putc('\n', stdout);
else if (data != 0)
putc(data, stdout);
fflush(stdout);
#if ENABLE_SDBG
// Dummy write to enable serial out
if (data == 0x3c)
m_cde->sdbg_in(space, 0, 0xffffffff);
#endif
}
void konamim2_state::ldac_out(uint16_t data)
{
m_ldac->write(data);
}
void konamim2_state::rdac_out(uint16_t data)
{
m_rdac->write(data);
}
/*************************************
*
* ATAPI (Temporary - remove)
*
*************************************/
void konamim2_state::ata_int(int state)
{
// m_atapi_timer->adjust( attotime::from_msec(10), state );
m_ata_int = state;
}
/*************************************
*
* Konami I/O
*
*************************************/
uint16_t konamim2_state::konami_io0_r(offs_t offset)
{
// printf("IO R: %08X\n", offset);
switch (offset)
{
/*
0 = 160
1 = 32
2 = -96
10 = -1888
FF = -32480
100 = 160
1FF = -32480
200 = 159
2FF = -32481
300 = 159
3FF = -32481
400 = 158
800 = 156
C00 = 154
E00
F00 = 153
1000 = 152
2000 = 144
4000 = 128
8000 = 96
E000 = 48
F000 = 40
FF00 = 33
7FFF = -32543
FFFF = -32607
*/
case 0:
{
return swapendian_int16((int16_t)ioport("GUNX1")->read());
}
case 1: return 0;
case 2: return 0; // P3 X?
case 3: return 0xffff; // ?
case 4:
{
return swapendian_int16((int16_t)ioport("GUNY1")->read());
}
case 5: return 0; // P2 Y
case 6: return 0; // P3 Y?
case 7: return 0; //??
case 8: return ioport("P5")->read();
}
//return machine().rand();
return 0;
}
void konamim2_state::konami_io0_w(offs_t offset, uint16_t data)
{
// 9: 0000, 0xFFF
// printf("IO W: %08x %08x\n", offset, data);
}
/*
FEDCBA98 76543210
0: |........ ........|
1: |........ ........|
2: |........ ........|
3: |........ .......x| Coin 1
|........ ......x.| Coin 2
|........ ....x...| Service coin
|.......x ........| EEPROM D0
|.....x.. ........| ADC
|...xx... ........| SIO related? (set to 3 NOTE: Total Vice doesn't like this!)
|..x..... ........| ATAPI/CD status?
4: |........ ........| Player 1/2 inputs
5: |........ ........| Unknown
6: |........ ........| Unknown
7: |........ ........| Unknown
*/
uint16_t konamim2_state::konami_io1_r(offs_t offset)
{
uint16_t data = 0;
// printf("%s: PORT R: [%x] MASK:%.8x\n", machine().describe_context(), offset, mem_mask);
switch (offset)
{
case 0:
data = 0xffff;
break;
case 1:
data = 0xffff;
break;
case 2: // DIP switches
data = ioport("P2")->read();
break;
case 3:
{
data = ioport("P1")->read();
#if M2_BAD_TIMING
static uint32_t d = 0;
data |= d;
d ^= 0x2000;
#else
data |= m_ata_int ? 0x2000 : 0;
#endif
data |= (1 << 10);
data |= (3 << 11); // TODO: 3 normally
break;
}
case 4: // Buttons
data = ioport("P4")->read();
break;
case 5: // Changing this has a tendency to stop evilngt from booting...
data = 0xffff;
break;
case 6: // Buttons
data = ioport("P6")->read();
break;
case 7:
data = 0xffff;
break;
default:
logerror("%s: Unknown read: %x\n", machine().describe_context(), offset);
break;
}
return data;
}
void konamim2_state::konami_io1_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
// 0x0200 = ADC?
// 0x0800 = Coin counter 1
// 0x1000 = Coin counter 2
// 0x2000 = CD-MUTE
// 0x8000 = ?
logerror("%s: PORT W: [%x] %x, MASK:%.8x\n", machine().describe_context(), offset, data, mem_mask);
// printf("CDDA is: %s\n", data & 0x2000 ? "ENABLED" : "MUTE");
machine().bookkeeping().coin_counter_w(0, (data >> 11) & 1);
machine().bookkeeping().coin_counter_w(1, (data >> 12) & 1);
// m_cdda->set_output_gain(0, data & 0x2000 ? 1.0 : 0.0);
// m_cdda->set_output_gain(1, data & 0x2000 ? 1.0 : 0.0);
}
/**************************************
*
* Konami 003461 SIO
*
*************************************/
/*
FEDCBA98 76543210
0: |xxxxxxxx xxxxxxxx| Data R/W
1: |........ ........|
2: |........ ........|
3: |........ ........|
4: |........ ........|
5: |........ ..x.....| Transmit ready
6: |........ ........|
7: |xxxxxxxx xxxxxxxx| Register R/W
*/
uint16_t konamim2_state::konami_sio_r(offs_t offset, uint16_t mem_mask)
{
uint16_t data = 0;
switch (offset)
{
case 7:
data = m_sio_data;
break;
//default:
//logerror("%s: SIO_R: %x %x\n", machine().describe_context(), offset, mem_mask);
}
return data;
}
void konamim2_state::konami_sio_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
switch (offset)
{
case 7:
m_sio_data = data;
break;
//default:
//printf("%s: SIO_W: %x %x %x\n", machine().describe_context(), offset, data, mem_mask);
}
}
// TODO: Use output port
void konamim2_state::konami_eeprom_w(uint16_t data)
{
// 3 = CS
// 2 = CLK
// 1 = DATA
// 0 = ? (From Port)
m_eeprom->cs_write(data & 0x80 ? ASSERT_LINE : CLEAR_LINE);
m_eeprom->di_write(data & 0x20 ? 1 : 0);
m_eeprom->clk_write(data & 0x40 ? ASSERT_LINE : CLEAR_LINE);
}
/*************************************
*
* Machine initialization
*
*************************************/
void konamim2_state::machine_start()
{
m_ppc1->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
m_ppc2->ppcdrc_set_options(PPCDRC_COMPATIBLE_OPTIONS);
m_ppc1->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr());
m_ppc2->ppcdrc_add_fastram(m_bda->ram_start(), m_bda->ram_end(), false, m_bda->ram_ptr());
// TODO: REMOVE
m_atapi_timer = timer_alloc(FUNC(konamim2_state::atapi_delay), this);
m_atapi_timer->adjust( attotime::never );
if (machine().debug_flags & DEBUG_FLAG_ENABLED)
{
using namespace std::placeholders;
machine().debugger().console().register_command("m2", CMDFLAG_NONE, 1, 4, std::bind(&konamim2_state::debug_commands, this, _1));
}
}
/*************************************
*
* Address map
*
*************************************/
void konamim2_state::m2_map(address_map &map)
{
map(0x20000000, 0x201fffff).rom().region("boot", 0); // BIOBUS Slot 0
map(0xfff00000, 0xffffffff).rom().region("boot", 0);
map(0x37400000, 0x37400007).w(FUNC(konamim2_state::konami_eeprom_w)).umask64(0xffff000000000000ULL);
map(0x37600000, 0x3760000f).w(FUNC(konamim2_state::konami_atapi_unk_w)).umask64(0xffff000000000000ULL);
map(0x37a00020, 0x37a0003f).rw(FUNC(konamim2_state::konami_io0_r), FUNC(konamim2_state::konami_io0_w));
map(0x37c00010, 0x37c0001f).rw(FUNC(konamim2_state::konami_sio_r), FUNC(konamim2_state::konami_sio_w));
map(0x37e00000, 0x37e0000f).rw(FUNC(konamim2_state::konami_io1_r), FUNC(konamim2_state::konami_io1_w));
map(0x3f000000, 0x3fffffff).rw(m_ata, FUNC(ata_interface_device::cs0_swap_r), FUNC(ata_interface_device::cs0_swap_w));
}
/*************************************
*
* Port definitions
*
*************************************/
static INPUT_PORTS_START( konamim2 )
PORT_START("DSW")
PORT_DIPNAME( 0x01, 0x00, "Video Res" )
PORT_DIPSETTING( 0x00, "High Res" )
PORT_DIPSETTING( 0x01, "Low Res" )
PORT_START("P1")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) // ATAPI?
PORT_BIT( 0xDE00, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( btltryst )
PORT_INCLUDE( konamim2 )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x01, 0x01, "Video Res" )
PORT_DIPSETTING( 0x00, "High Res" )
PORT_DIPSETTING( 0x01, "Low Res" )
PORT_START("P2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("P4")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("P5")
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P6")
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( polystar )
PORT_INCLUDE( konamim2 )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x01, 0x01, "Video Res" )
PORT_DIPSETTING( 0x00, "High Res" )
PORT_DIPSETTING( 0x01, "Low Res" )
PORT_START("P2")
PORT_DIPNAME( 0x01, 0x01, "Sound Output" )
PORT_DIPSETTING( 0x01, "Mono" )
PORT_DIPSETTING( 0x00, "Stereo" )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("P4")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("P5")
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P6")
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
INPUT_PORTS_END
static INPUT_PORTS_START( totlvice )
PORT_INCLUDE( konamim2 )
PORT_START("P2") // TODO: VERIFY
PORT_DIPNAME( 0x01, 0x00, "Sound Output" )
PORT_DIPSETTING( 0x01, "Mono" )
PORT_DIPSETTING( 0x00, "Stereo" )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("P4")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE2 )
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE3 )
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_START3 )
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_COIN3 )
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("GUNX1")
PORT_BIT( 0xffff, 0x0000, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_MINMAX(0, 640) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
PORT_START("GUNY1")
PORT_BIT( 0xffff, 0x0000, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_MINMAX(0, 240) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1)
PORT_START("P5") // Gun switches
PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P6")
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
PORT_BIT( 0xfffb, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( heatof11 )
PORT_INCLUDE( konamim2 )
PORT_MODIFY("DSW")
PORT_DIPNAME( 0x01, 0x00, "Video Res" )
PORT_DIPSETTING( 0x00, "High Res" )
PORT_DIPSETTING( 0x01, "Low Res" )
PORT_START("P2")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("P4")
PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("P5")
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("P6")
PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_LOW )
INPUT_PORTS_END
static INPUT_PORTS_START( hellngt )
PORT_INCLUDE( konamim2 )
PORT_START("P2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unused ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )