/
mitchell.cpp
2792 lines (2371 loc) · 132 KB
/
mitchell.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
/*************************************************************************************
"Mitchell hardware". Actually used mostly by Capcom.
All games run on the same hardware except mgakuen, which runs on an
earlier version, without RAM banking, not encrypted (standard Z80)
and without EEPROM.
Notes:
- Super Pang has a protection which involves copying code stored in the
EEPROM to RAM and execute it from there. The first time the game is run,
you have to keep the player 1 start button pressed until the title screen
appears. This forces the game to initialize the EEPROM, otherwise it will
not work.
TODO:
- understand what bits 0 and 3 of input port 0x05 are
- correct sound clocks for the MSM5205 bootlegs
******************************************************************************
Pang
Mitchell, 1989
PCB Layout
----------
89125-A-2
|------------------------------------------------------------------|
|HA13001 PW_01.1D PWJ_02.1E PWJ_04.1G PWJ_09.1K |
| VOL VOL M6295 PW_03.2E PW_05.2G PWJ_10.2K |
| LM324 |
| YM2413 CM^81300 |------| |
| |86S105| |
|J TD62064 | | BUNRAKU |
|A |------| |
|M 4364 16MHz|
|M |
|A 5814 DL-010D-103 |
| 4016 |
| 5814 |
| |
| PAL16L8 PWE_06.11H |
| 'POKER' PWE_07.13H |
| KABUKI |
|TEST_SW 93C46 DL-020F-108U HM6264 BATTERY|
|------------------------------------------------------------------|
Notes:
KABUKI - Custom encrypted Z80 marked 'VC5006-0001 KABUKI DL-030P-110V KOREA' (DIP40)
BUNRAKU - Custom chip marked 'BUNRAKU DL-050-115V' (QFP60)
86S105 - Custom chip marked 'something(scratched) 86S105 RJ5C39 8M2 76' (PLCC84)
DL-020F-108U - Custom chip marked 'DL-020F-108U' (SDIP64)
DL-010D-103 - Custom chip marked 'DL-010D-103' (SDIP64)
CM^81300 - Custom chip marked 'CM^81300' (SDIP28, ^ is a triangle symbol)
POKER - PAL16L8 marked 'POKER' (DIP20)
4364 - 8kx8 SRAM (DIP28)
4016 - 2kx8 SRAM (DIP24)
5814 - 2kx8 SRAM (DIP24)
HM6264 - 8kx8 SRAM, battery-backed (DIP28)
93C46 - AKM-J 93C46 128 bytes EEPROM (DIP8)
LM324 - Texas Instruments LM324 Low Power Quad Operational Amplifier
HA13001 - Hitachi HA13001 5.5W Dual / 17.5W BTL Audio Power Amplifier
TD62064 - Toshiba TD62064 4 Channel High-Current Darlington Sink Driver
Z80 - 8.000MHz [16/2]
YM2413 - 4.000MHz [16/4]
M6295 - 1.000MHz [16/16]
VSync - 57.4450Hz
HSync - 15.16452Hz
******************************************************************************
Monsters World (c)1994 TCH
Monsters World is basically a bootleg of Mitchell's Super Pang
The code is a patched version of the current parent 'spang' set supported by
MAME with many code changes and the majority of strings patched out.
Super Pang is encrypted using the 'Kabuki' encryption system, so to decrypt
the game decrypted code and decrypted data must be split.
Monster World contains banks of decrypted data and decrypted code scrambled
together in a single rom, using a GAL to decode the addresses on the actual
PCB.
There are several other changes from Super Pang too. Monsters World has no
NVRAM / EEPROM, and has its own sound CPU driving only an OKI6925. Video
RAM Banking has also been changed.
The actual Monsters World PCB is very close to the Speed Spin PCB but in terms
of emulation the video etc. is closer to mitchell.c
******************************************************************************
Monters World, from TCH (Spain)
Main CPU = Toshiba TMPZ84C00AP-6
Sound CPU = GS Z8400A PS - Z80A
OSC 12.000 MHz
Sound chip = Oki M6295
Graphics = TI 32005BWBL - TPC1020AFN-084C
OSC 10.000 MHz
ROMS
mw-1.rom = ST M27C4001 = Main CPU program
mw-2.rom = Intel D27256-1 = Sound CPU Program
mw-3.rom = AMD AM27C040 = Oki samples
mw-4.rom = ST M27C1001 \
mw-5.rom = TI TMS27C010A |
mw-6.rom = ST M27C1001 | GFX
mw-7.rom = ST M27C1001 /
mw-8.rom = ST M27C1001 \
mw-9.rom = ST M27C1001 / GFX
*************************************************************************************/
#include "emu.h"
#include "includes/mitchell.h"
#include "cpu/z80/z80.h"
#include "machine/kabuki.h" // needed for decoding functions only
#include "sound/okim6295.h"
#include "sound/msm5205.h"
#include "sound/ymopl.h"
#include "screen.h"
#include "speaker.h"
/*************************************
*
* EEPROM
*
*************************************/
uint8_t mitchell_state::pang_port5_r()
{
/* bits 0 and (sometimes) 3 are checked in the interrupt handler.
bit 3 is checked before updating the palette so it really seems to be vblank.
bit 0 may be vblank (or vblank irq flag) related too, but I'm not sure.
Many games require two interrupts per frame and for these bits to toggle,
otherwise music doesn't work.
*/
return (ioport("SYS0")->read() & 0xfe) | (m_irq_source & 1);
}
void mitchell_state::eeprom_cs_w(uint8_t data)
{
m_eeprom->cs_write(data ? ASSERT_LINE : CLEAR_LINE);
}
void mitchell_state::eeprom_clock_w(uint8_t data)
{
m_eeprom->clk_write(data ? ASSERT_LINE : CLEAR_LINE);
}
void mitchell_state::eeprom_serial_w(uint8_t data)
{
m_eeprom->di_write(data & 1);
}
/*************************************
*
* Bankswitch handling
*
*************************************/
void mitchell_state::pang_bankswitch_w(uint8_t data)
{
m_bank1->set_entry(data & 0x0f);
if(m_bank1d)
m_bank1d->set_entry(data & 0x0f);
}
/*************************************
*
* Input handling
*
*************************************/
uint8_t mitchell_state::block_input_r(offs_t offset)
{
static const char *const dialnames[] = { "DIAL1", "DIAL2" };
static const char *const portnames[] = { "IN1", "IN2" };
if (m_dial_selected)
{
int delta = (ioport(dialnames[offset])->read() - m_dial[offset]) & 0xff;
if (delta & 0x80)
{
delta = (-delta) & 0xff;
if (m_dir[offset])
{
/* don't report movement on a direction change, otherwise it will stutter */
m_dir[offset] = 0;
delta = 0;
}
}
else if (delta > 0)
{
if (!m_dir[offset])
{
/* don't report movement on a direction change, otherwise it will stutter */
m_dir[offset] = 1;
delta = 0;
}
}
if (delta > 0x3f)
delta = 0x3f;
return delta << 2;
}
else
{
int res = ioport(portnames[offset])->read() & 0xf7;
if (m_dir[offset])
res |= 0x08;
return res;
}
}
void mitchell_state::block_dial_control_w(uint8_t data)
{
if (data == 0x08)
{
/* reset the dial counters */
m_dial[0] = ioport("DIAL1")->read();
m_dial[1] = ioport("DIAL2")->read();
}
else if (data == 0x80)
m_dial_selected = 0;
else
m_dial_selected = 1;
}
uint8_t mitchell_state::mahjong_input_r(offs_t offset)
{
int i;
static const char *const keynames[2][5] =
{
{ "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" },
{ "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" }
};
for (i = 0; i < 5; i++)
{
if (m_keymatrix & (0x80 >> i))
return ioport(keynames[offset][i])->read();
}
return 0xff;
}
void mitchell_state::mahjong_input_select_w(uint8_t data)
{
m_keymatrix = data;
}
uint8_t mitchell_state::input_r(offs_t offset)
{
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
switch (m_input_type)
{
case 0:
default:
return ioport(portnames[offset])->read();
case 1: /* Mahjong games */
if (offset)
return mahjong_input_r(offset - 1);
else
return ioport("IN0")->read();
case 2: /* Block Block - dial control */
if (offset)
return block_input_r(offset - 1);
else
return ioport("IN0")->read();
case 3: /* Super Pang - simulate START 1 press to initialize EEPROM */
return ioport(portnames[offset])->read();
}
}
void mitchell_state::input_w(uint8_t data)
{
switch (m_input_type)
{
case 0:
default:
logerror("PC %04x: write %02x to port 01\n", m_maincpu->pc(), data);
break;
case 1:
mahjong_input_select_w(data);
break;
case 2:
block_dial_control_w(data);
break;
}
}
/*************************************
*
* Address maps
*
*************************************/
void mitchell_state::mgakuen_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xc000, 0xc7ff).ram().w(m_palette, FUNC(palette_device::write8)); /* palette RAM */
map(0xc800, 0xcfff).rw(FUNC(mitchell_state::pang_colorram_r), FUNC(mitchell_state::pang_colorram_w)).share("colorram"); /* Attribute RAM */
map(0xd000, 0xdfff).rw(FUNC(mitchell_state::mgakuen_videoram_r), FUNC(mitchell_state::mgakuen_videoram_w)).share("videoram"); /* char RAM */
map(0xe000, 0xefff).ram(); /* Work RAM */
map(0xf000, 0xffff).rw(FUNC(mitchell_state::mgakuen_objram_r), FUNC(mitchell_state::mgakuen_objram_w)); /* OBJ RAM */
}
void mitchell_state::mitchell_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xc000, 0xc7ff).rw(FUNC(mitchell_state::pang_paletteram_r), FUNC(mitchell_state::pang_paletteram_w)); /* Banked palette RAM */
map(0xc800, 0xcfff).rw(FUNC(mitchell_state::pang_colorram_r), FUNC(mitchell_state::pang_colorram_w)).share("colorram"); /* Attribute RAM */
map(0xd000, 0xdfff).rw(FUNC(mitchell_state::pang_videoram_r), FUNC(mitchell_state::pang_videoram_w)).share("videoram");/* Banked char / OBJ RAM */
map(0xe000, 0xffff).ram().share("nvram"); /* Work RAM */
}
void mitchell_state::decrypted_opcodes_map(address_map &map)
{
map(0x0000, 0x7fff).bankr("bank0d");
map(0x8000, 0xbfff).bankr("bank1d");
map(0xe000, 0xffff).ram().share("nvram"); /* Work RAM */
}
void mitchell_state::mitchell_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(mitchell_state::pang_gfxctrl_w)); /* Palette bank, layer enable, coin counters, more */
map(0x00, 0x02).r(FUNC(mitchell_state::input_r)); /* The Mahjong games and Block Block need special input treatment */
map(0x01, 0x01).w(FUNC(mitchell_state::input_w));
map(0x02, 0x02).w(FUNC(mitchell_state::pang_bankswitch_w)); /* Code bank register */
map(0x03, 0x03).w("ymsnd", FUNC(ym2413_device::data_w));
map(0x04, 0x04).w("ymsnd", FUNC(ym2413_device::address_w));
map(0x05, 0x05).r(FUNC(mitchell_state::pang_port5_r)).w(m_oki, FUNC(okim6295_device::write));
map(0x06, 0x06).noprw(); /* watchdog? IRQ ack? video buffering? */
map(0x07, 0x07).w(FUNC(mitchell_state::pang_video_bank_w)); /* Video RAM bank register */
map(0x08, 0x08).w(FUNC(mitchell_state::eeprom_cs_w));
map(0x10, 0x10).w(FUNC(mitchell_state::eeprom_clock_w));
map(0x18, 0x18).w(FUNC(mitchell_state::eeprom_serial_w));
}
/* spangbl */
void mitchell_state::spangbl_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1").nopw();
map(0xc000, 0xc7ff).rw(FUNC(mitchell_state::pang_paletteram_r), FUNC(mitchell_state::pang_paletteram_w)); /* Banked palette RAM */
map(0xc800, 0xcfff).rw(FUNC(mitchell_state::pang_colorram_r), FUNC(mitchell_state::pang_colorram_w)).share("colorram");/* Attribute RAM */
map(0xd000, 0xdfff).rw(FUNC(mitchell_state::pang_videoram_r), FUNC(mitchell_state::pang_videoram_w)).share("videoram"); /* Banked char / OBJ RAM */
map(0xe000, 0xffff).ram().share("nvram"); /* Work RAM */
}
void mitchell_state::spangbl_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x02).r(FUNC(mitchell_state::input_r));
map(0x00, 0x00).w(FUNC(mitchell_state::pangbl_gfxctrl_w)); /* Palette bank, layer enable, coin counters, more */
map(0x02, 0x02).w(FUNC(mitchell_state::pang_bankswitch_w)); /* Code bank register */
map(0x03, 0x03).portr("DSW1").w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x05, 0x05).portr("SYS0");
map(0x06, 0x06).nopw(); /* watchdog? irq ack? */
map(0x07, 0x07).w(FUNC(mitchell_state::pang_video_bank_w)); /* Video RAM bank register */
map(0x08, 0x08).w(FUNC(mitchell_state::eeprom_cs_w));
map(0x10, 0x10).w(FUNC(mitchell_state::eeprom_clock_w));
map(0x18, 0x18).w(FUNC(mitchell_state::eeprom_serial_w));
}
void mitchell_state::sound_bankswitch_w(uint8_t data)
{
m_msm->reset_w(BIT(data, 3));
m_soundbank->set_entry(data & 7);
}
void mitchell_state::spangbl_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("soundbank");
map(0xe000, 0xe000).w(FUNC(mitchell_state::sound_bankswitch_w));
map(0xe400, 0xe400).w(m_adpcm_select, FUNC(ls157_device::ba_w));
map(0xec00, 0xec01).w("ymsnd", FUNC(ym2413_device::write));
map(0xf000, 0xf4ff).ram();
map(0xf800, 0xf800).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
void mitchell_state::pangba_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("soundbank");
map(0xe000, 0xe000).w(FUNC(mitchell_state::sound_bankswitch_w));
map(0xe400, 0xe400).w(m_adpcm_select, FUNC(ls157_device::ba_w));
map(0xec00, 0xec01).w("ymsnd", FUNC(ym3812_device::write));
map(0xf000, 0xf4ff).ram();
map(0xf800, 0xf800).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
/**** Monsters World ****/
void mitchell_state::oki_banking_w(uint8_t data)
{
m_oki->set_rom_bank(data & 3);
}
void mitchell_state::mstworld_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram();
map(0x9000, 0x9000).w(FUNC(mitchell_state::oki_banking_w));
map(0x9800, 0x9800).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
void mitchell_state::mstworld_sound_w(uint8_t data)
{
m_soundlatch->write(data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
void mitchell_state::mstworld_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).portr("IN0").w(FUNC(mitchell_state::mstworld_gfxctrl_w)); /* Palette bank, layer enable, coin counters, more */
map(0x01, 0x01).portr("IN1");
map(0x02, 0x02).portr("IN2").w(FUNC(mitchell_state::pang_bankswitch_w)); /* Code bank register */
map(0x03, 0x03).portr("DSW0").w(FUNC(mitchell_state::mstworld_sound_w)); /* write to sound cpu */
map(0x04, 0x04).portr("DSW1"); /* dips? */
map(0x05, 0x05).portr("SYS0"); /* special? */
map(0x06, 0x06).portr("DSW2"); /* dips? */
map(0x06, 0x06).nopw(); /* watchdog? irq ack? */
map(0x07, 0x07).w(FUNC(mitchell_state::mstworld_video_bank_w)); /* Video RAM bank register */
}
void mitchell_state::pkladiesbl_io_map(address_map &map) // TODO: check everything, where is the MSM5205 hooked up?
{
map.global_mask(0xff);
map(0x00, 0x00).portr("IN0").w(FUNC(mitchell_state::pang_gfxctrl_w)); /* Palette bank, layer enable, coin counters, more */
map(0x01, 0x01).portr("IN1").w("ymsnd", FUNC(ym2413_device::address_w)); // TODO: hold buttons are here, multiplexed but not in the same way as the original
map(0x02, 0x02).portr("IN2").w(FUNC(mitchell_state::pang_bankswitch_w)); /* Code bank register */
map(0x03, 0x03).portr("DSW0");
map(0x04, 0x04).portr("DSW1");
map(0x05, 0x05).r(FUNC(mitchell_state::pang_port5_r));
map(0x06, 0x06).noprw(); /* watchdog? IRQ ack? video buffering? */
map(0x07, 0x07).w(FUNC(mitchell_state::pang_video_bank_w)); /* Video RAM bank register */
map(0x08, 0x08).w(FUNC(mitchell_state::eeprom_cs_w));
map(0x09, 0x09).w("ymsnd", FUNC(ym2413_device::data_w));
map(0x10, 0x10).w(FUNC(mitchell_state::eeprom_clock_w));
map(0x18, 0x18).w(FUNC(mitchell_state::eeprom_serial_w));
}
/*************************************
*
* Input ports
*
*************************************/
static INPUT_PORTS_START( mj_common )
PORT_START("SYS0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("KEY0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_START("KEY1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_START("KEY2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_START("KEY3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_START("KEY4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2)
PORT_START("KEY6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2)
PORT_START("KEY7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2)
PORT_START("KEY8")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2)
PORT_START("KEY9")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( mgakuen )
PORT_INCLUDE( mj_common )
PORT_MODIFY("SYS0")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // not PORT_VBLANK
PORT_START("DSW0")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW0:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x08, 0x08, "Rules" ) PORT_DIPLOCATION("DSW0:4")
PORT_DIPSETTING( 0x08, "Kantou" )
PORT_DIPSETTING( 0x00, "Kansai" )
PORT_DIPNAME( 0x10, 0x00, "Harness Type" ) PORT_DIPLOCATION("DSW0:5")
PORT_DIPSETTING( 0x10, "Generic" )
PORT_DIPSETTING( 0x00, "Royal Mahjong" )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DSW0:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, "Freeze" ) PORT_DIPLOCATION("DSW0:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_SERVICE( 0x80, IP_ACTIVE_LOW ) PORT_DIPLOCATION("DSW0:8")
PORT_START("DSW1")
PORT_DIPNAME( 0x03, 0x03, "Player 1 Skill" ) PORT_DIPLOCATION("DSW1:1,2")
PORT_DIPSETTING( 0x03, "Weak" )
PORT_DIPSETTING( 0x02, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x01, "Strong" )
PORT_DIPSETTING( 0x00, "Very Strong" )
PORT_DIPNAME( 0x0c, 0x0c, "Player 2 Skill" ) PORT_DIPLOCATION("DSW1:3,4")
PORT_DIPSETTING( 0x0c, "Weak" )
PORT_DIPSETTING( 0x08, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x04, "Strong" )
PORT_DIPSETTING( 0x00, "Very Strong" )
PORT_DIPNAME( 0x10, 0x00, "Music" ) PORT_DIPLOCATION("DSW1:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:6")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x00, "Help Mode" ) PORT_DIPLOCATION("DSW1:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW1:8" )
INPUT_PORTS_END
static INPUT_PORTS_START( marukin )
PORT_INCLUDE( mj_common )
PORT_MODIFY("SYS0")
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
INPUT_PORTS_END
static INPUT_PORTS_START( pkladies )
/* same unknown ports as the mahjong games, so we include the following */
PORT_INCLUDE( marukin )
PORT_MODIFY("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the service mode farther down */
PORT_MODIFY("KEY0")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Deal")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_NAME("Hold E / Cancel")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_NAME("Hold A / Cancel")
PORT_MODIFY("KEY1")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Cancel")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME("Hold B / Cancel")
PORT_MODIFY("KEY2")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Flip")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME("Hold C / Cancel")
PORT_MODIFY("KEY3")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_NAME("Hold D / Cancel")
PORT_MODIFY("KEY4")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
// P2 inputs seem to be a leftover from mgakuen
PORT_MODIFY("KEY5")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
// PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("Deal")
// PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_PLAYER(2) PORT_NAME("Hold E")
// PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_PLAYER(2) PORT_NAME("Hold A")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("KEY6")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
// PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("Cancel")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
// PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_PLAYER(2) PORT_NAME("Hold B")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("KEY7")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
// PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("Flip")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
// PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_PLAYER(2) PORT_NAME("Hold C")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("KEY8")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
// PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_PLAYER(2) PORT_NAME("Hold D")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("KEY9")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( pkladiesbl )
PORT_START("SYS0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE ) // ok
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) // ok
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) // ok
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON3 ) // ok
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) // ok
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) // ok
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // this seems flipscreen?
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW0")
PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) // this and the following seem to influence both Winning Percentage Level (although only levels 1, 3, 5 and 7) and Game BGM
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW1")
PORT_DIPNAME( 0x0f, 0x04, "Maximum Hands" )
PORT_DIPSETTING( 0x00, "0" )
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x02, "2" )
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x04, "4" )
PORT_DIPSETTING( 0x05, "5" )
PORT_DIPSETTING( 0x06, "6" )
PORT_DIPSETTING( 0x07, "7" )
PORT_DIPSETTING( 0x08, "8" )
PORT_DIPSETTING( 0x09, "9" )
PORT_DIPSETTING( 0x0a, "10" )
PORT_DIPSETTING( 0x0b, "11" )
PORT_DIPSETTING( 0x0c, "12" )
PORT_DIPSETTING( 0x0d, "13" )
PORT_DIPSETTING( 0x0e, "14" )
PORT_DIPSETTING( 0x0f, "15" )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( pang )
PORT_START("SYS0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* USED - handled in port5_r */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read)
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_OPTIONAL // "Shot B" in service mode
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_OPTIONAL // "Shot B" in service mode
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
INPUT_PORTS_END
static INPUT_PORTS_START( spangbl )
PORT_INCLUDE( pang )
PORT_MODIFY("SYS0")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // this bootleg doesn't seem to allow entering test mode. It has a dip bank for settings, instead.
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_MODIFY("IN1")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // must be high for game to boot..
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW1:6,7,8")
PORT_DIPSETTING( 0x07, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x18, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW1:4,5")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x08, "2" )
PORT_DIPSETTING( 0x10, "3" )
PORT_DIPSETTING( 0x18, "4" )
PORT_DIPNAME( 0x60, 0x20, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("DSW1:2,3")
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x20, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x40, DEF_STR( Difficult ) )
PORT_DIPSETTING( 0x60, DEF_STR( Very_Difficult ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW1:1")
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
INPUT_PORTS_END
static INPUT_PORTS_START( mstworld )
/* this port may not have the same role */
PORT_START("SYS0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_SERVICE_NO_TOGGLE( 0x02, IP_ACTIVE_LOW )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen")
PORT_BIT( 0x70, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* unused? */
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* probably unused */
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) // don't think this one matters..
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_START("IN2")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // if not active high gfx aren't copied for game screen?! .. is this instead of a bit in port 5?
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_START("DSW0") /* coinage seems to be in here.. */
PORT_DIPNAME( 0x07, 0x00, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x03, "A 1Coin 4Credits / B 1Coin 4Credits" )
PORT_DIPSETTING( 0x02, "A 1Coin 3Credits / B 1Coin 3Credits" )
PORT_DIPSETTING( 0x01, "A 1Coin 2Credits / B 1Coin 2Credits" )
PORT_DIPSETTING( 0x00, "A 1Coin 1Credit / B 1Coin 4Credists" )
PORT_DIPSETTING( 0x04, "A 2Coins 1Credit / B 1Coin 2Credits" )
PORT_DIPSETTING( 0x05, "A 2Coins 1Credit / B 1Coin 3Credits" )
PORT_DIPSETTING( 0x06, "A 3Coins 1Credit / B 1Coin 2Credits" )
PORT_DIPSETTING( 0x07, "A 4Coins 1Credit / B 1Coin 1Credit" )
PORT_DIPNAME( 0x18, 0x00, DEF_STR( Lives ) )
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x08, "2" )
PORT_DIPSETTING( 0x10, "3" )
PORT_DIPSETTING( 0x18, "4" )
PORT_DIPNAME( 0x60, 0x20, DEF_STR( Difficulty ) )
PORT_DIPSETTING( 0x00, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x20, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x40, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x60, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, "ds1" )
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x00, "ds2" )