-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
homedata.cpp
2193 lines (1728 loc) · 93.2 KB
/
homedata.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 Stroffolino, Nicola Salmoria
/***************************************************************************
Homedata Games
driver by Phil Stroffolino and Nicola Salmoria
*1987 X77 Mahjong Hourouki Part1 -Seisyun Hen-
*1987 X72 Mahjong Hourouki Gaiden
*1988 X73 Mahjong Joshi Pro-wres -Give up 5 byou mae-
*1988 A74 Mahjong Hourouki Okite
*1988 X80 Mahjong Clinic
*1988 M81 Mahjong Rokumeikan
*1988 J82 Reikai Doushi / Chinese Exorcist
*1989 X83 Mahjong Kojin Kyouju (Private Teacher)
1989 Battle Cry (not released in Japan)
*1989 X90 Mahjong Vitamin C
*1989 X91 Mahjong Yougo no Kiso Tairyoku
*1990 X02 Mahjong Lemon Angel
*1991 X07 Mahjong Kinjirareta Asobi -Ike Ike Kyoushi no Yokubou-
Games from other companies:
*1991 M15 Mahjong Ikagadesuka (c) Mitchell
*19?? Mahjong Jogakuen (c) Windom
These games use only tilemaps for graphics. These tilemaps are organized into
two pages (a visible page and a backbuffer) which are automatically swapped by the
hardware at vblank.
Some of the tiles are written directly by the CPU, others are written by a "blitter"
which unpacks RLE data from a ROM.
In games using the uPD7807CW, the coprocessor manages input ports and sound/music.
Notes:
- To access service mode in the older mahjong games, keep F2 pressed during boot.
Service mode doesn't work in hourouki because it needs an additional "check" ROM.
- The "help" button some games ask you to press is the start button.
- The games can change visible area at runtime. The meaning of the control registers
isn't understood, but it supported enough to give the correct visible area to all
games.
mjkinjas sets the registers to values different from all the other games; it also
has a 11MHz xtal instead of the 9MHz of all the others, so the two things are
probably related.
- the ROM for the uPD7807 is divided in 4 0x10000 banks. The first three just
contain a simple sample player, followed by the PCM data. The fourth bank contains
the main program. The program literally changes banks under its own feet. However,
the portions of code executed while the bank switch happens are identical in all
banks, so it still works with MAME's standard MRA8_BANK handling.
TODO:
- Dip switches! They might be right for mjhokite, but I haven't verified the other
games.
- I'm not sure service mode in the newer mahjong games is working as it's supposed to.
dip switch changes are not reported, and keypresses only work after you insert a coin.
- In mjikaga bit 2 of bankswitch_w() and bit 7 of pteacher_blitter_bank_w() might
have some other function, since the ROMs are smaller.
- wrong gfx in mrokumei at the beginning of a game. It is selecting the wrong gfx bank;
the bank handling seems correct in all other games, so I don't know what's wrong here.
- mjikaga shows some imperfections with horizontal placement of the screen.
- in attract mode, hourouki draws a horizontal black bar on the bottom right side of
the display.
----------------------------------------------------------------------------
Mahjong Hourouki
(c)1987 Home Data
Board: A77-PWB-A-(A)
CPU: 68B09E Z80-A
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
----------------------------------------------------------------------------
Mahjong Hourouki Gaiden
(c)1987 Home Data
Board: A77-PWB-A-(A)
CPU: 68B09E Z80-A
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
----------------------------------------------------------------------------
Mahjong Hourouki Okite
(c)1988 Homedata
Almost same board as "Mahjong Clinic"
Board: X77-PWB-A-(A) A74 PWB-B
CPU: Hitachi HD68B09EP (location 14G), Sharp LH0080A (Z80A, location 10K)
Sound: SN76489 DAC?
OSC: 16.000MHz (OSC1) 9.000MHz (OSC2)
Custom: HOMEDATA GX61A01 102 8728KK (100pin PQFP, location 8C)
----------------------------------------------------------------------------
Mahjong Rokumeikan
(c)1988 Home Data
Board: A74-PWB-A-(A) (main) A74 PWB-B (sub)
CPU: 68B09E Z80-A
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Reikai Doushi (Chinese Exorcist)
aka Last Apostle Puppet Show (US)
(c)1988 HOME DATA
CPU : 68B09E
SOUND : YM2203
OSC. : 16.000MHz 9.000MHz
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Mahjong Kojinkyouju (Private Teacher)
(c)1989 HOME DATA
Board: X73-PWB-A(C)
CPU: 6809 uPC324C
Sound: SN76489
OSC: 16.000MHz 9.000MHz
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Mahjong Joshi Pro-wres -Give up 5 byou mae-
(c)1988 HOME DATA
Board: X73-PWB-A(C)
CPU: 6809 uPC324C
Sound: SN76489
OSC: 16.000MHz 9.000MHz
ROM: 28 pin mask rom devices are 1mbit, 32 pin are 2mbit.
----------------------------------------------------------------------------
Mahjong Vitamin C
(c)1989 Home Data
Board: X73-PWB-A(A)
Board: X83-PWB-AC(A)
CPU: 68B09E uPD7807CW(?)
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
Note: Manual dips are completely wrong, this actually matches pteacher
----------------------------------------------------------------------------
Mahjong-yougo no Kisotairyoku
(c)1989 Home Data
Board: X83-PWB-A(A)
CPU: 68B09E uPD7807CW(?)
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
----------------------------------------------------------------------------
Mahjong Kinjirareta Asobi
(c)1990 Home Data
Board: X83-PWB-A(A)
CPU: 68B09E uPD7807CW
Sound: SN76489AN DAC
OSC: 11.000MHz 16.000MHz
Custom: GX61A01
Note: seems likely above 11mhz crystal was a repair
----------------------------------------------------------------------------
Mahjong Jogakuen
(c)19?? Windom
Board: X83-PWB-A(A)
CPU: 68B09E uPD7807CW(?)
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Mahjong Lemon Angel
(c)1990 Homedata
Board: X83-PWB-A(A)
CPU: Fujitsu MBL68B09E (16G)
(surface scratched 64pin DIP device on location 12G) [probably uPD7807CW]
Sound: SN76489
OSC: 16.0000MHz (XTAL1) 9.000MHz (XTAL2)
Custom: HOMEDATA GX61A01 102 8842KK
----------------------------------------------------------------------------
Mahjong Ikagadesuka
(c)1991 Mitchell
Board: X83-PWB-A(A)
CPU: 68B09E uPD7807CW
Sound: SN76489AN DAC
OSC: 9.000MHz 16.000MHz
Custom: GX61A01
***************************************************************************/
#include "emu.h"
#include "includes/homedata.h"
#include "cpu/m6809/m6809.h"
#include "cpu/upd7810/upd7810.h"
#include "cpu/z80/z80.h"
#include "sound/dac.h"
#include "sound/volt_reg.h"
#include "screen.h"
#include "speaker.h"
INTERRUPT_GEN_MEMBER(homedata_state::homedata_irq)
{
m_vblank = 1;
device.execute().set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
}
/********************************************************************************
Older Mahjong games:
single CPU, handling SN76489 + DAC and inputs
********************************************************************************/
READ8_MEMBER(homedata_state::mrokumei_keyboard_r)
{
int res = 0x3f,i;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
/* offset 0 is player 1, offset 1 player 2 (not supported) */
if (offset == 0)
{
for (i = 0; i < 5; i++)
{
if (m_keyb & (1 << i))
{
res = ioport(keynames[i])->read() & 0x3f;
break;
}
}
}
if (offset == 0)
{
/* bit 7: visible page
* bit 6: vblank
* other bits are inputs
*/
res |= m_visible_page << 7;
if (m_vblank)
res |= 0x40;
m_vblank = 0;
}
return res;
}
WRITE8_MEMBER(homedata_state::mrokumei_keyboard_select_w)
{
m_keyb = data;
}
WRITE8_MEMBER(homedata_state::mrokumei_sound_bank_w)
{
/* bit 0 = ROM bank
bit 2 = ROM or soundlatch
*/
m_mrokumei_soundbank->set_bank(data & 7);
}
WRITE8_MEMBER(homedata_state::mrokumei_sound_cmd_w)
{
m_soundlatch->write(data);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
/********************************************************************************
Reikai Doushi:
slave uPD7807, handling YM2203 + DAC and inputs
********************************************************************************/
READ8_MEMBER(homedata_state::reikaids_upd7807_porta_r)
{
return m_upd7807_porta;
}
WRITE8_MEMBER(homedata_state::reikaids_upd7807_porta_w)
{
m_upd7807_porta = data;
}
WRITE8_MEMBER(homedata_state::reikaids_upd7807_portc_w)
{
/* port C layout:
7 coin counter
6 to main CPU (data)
5 YM2203 write clock
4 YM2203 read clock
3 YM2203 address (0 = register select 1 = data)
2 to main CPU (status)
1 \ ROM bank
0 /
*/
// logerror("%s: port C wr %02x (STATUS %d DATA %d)\n", machine().describe_context(), data, BIT(data, 2), BIT(data, 6));
m_audiobank->set_entry(data & 0x03);
machine().bookkeeping().coin_counter_w(0, ~data & 0x80);
if (BIT(m_upd7807_portc, 5) && !BIT(data, 5)) /* write clock 1->0 */
m_ymsnd->write(BIT(data, 3), m_upd7807_porta);
if (BIT(m_upd7807_portc, 4) && !BIT(data, 4)) /* read clock 1->0 */
m_upd7807_porta = m_ymsnd->read(BIT(data, 3));
m_upd7807_portc = data;
}
READ8_MEMBER(homedata_state::reikaids_io_r)
{
int res = ioport("IN2")->read(); // bit 4 = coin, bit 5 = service
res |= BIT(m_upd7807_portc, 2) * 0x01; // bit 0 = upd7807 status
res |= BIT(m_upd7807_portc, 6) * 0x02; // bit 1 = upd7807 data
if (m_vblank)
res |= 0x04; // bit 2 = vblank
res |= m_visible_page * 0x08; // bit 3 = visible page
m_vblank = 0;
//logerror("%s: io_r %02x\n", machine().describe_context(), res);
return res;
}
/********************************************************************************
Newer Mahjong games:
slave uPD7807, handling SN76489 + DAC and inputs
********************************************************************************/
READ8_MEMBER(homedata_state::pteacher_io_r)
{
/* bit 6: !vblank
* bit 7: visible page
* other bits seem unused
*/
int res = (m_visible_page ^ 1) << 7;
if (!m_vblank)
res |= 0x40;
m_vblank = 0;
return res;
}
READ8_MEMBER(homedata_state::pteacher_keyboard_r)
{
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
int dips = ioport("DSW")->read();
// logerror("%s: keyboard_r with port A = %02x\n",machine().describe_context(),upd7807_porta);
if (m_upd7807_porta & 0x80)
{
/* player 1 + dip switches */
int row = (m_upd7807_porta & 0x07);
return ioport(keynames[row])->read() | (((dips >> row) & 1) << 5); // 0-5
}
if (m_upd7807_porta & 0x08) // TODO: this works fine with dips 7-8 of the 1st bank, but then expects dips 1-4 of the 2nd bank in inverted order
{
/* player 2 (not supported) + dip switches */
int row = ((m_upd7807_porta >> 4) & 0x07);
return 0xdf | (((dips >> (row + 6)) & 1) << 5); // 6-11
}
return 0xff;
}
READ8_MEMBER(homedata_state::pteacher_upd7807_porta_r)
{
if (!BIT(m_upd7807_portc, 6))
m_upd7807_porta = m_soundlatch->read();
else
logerror("%s: read PA with PC *not* clear\n", machine().describe_context());
return m_upd7807_porta;
}
WRITE8_MEMBER(homedata_state::pteacher_upd7807_porta_w)
{
m_upd7807_porta = data;
}
WRITE8_MEMBER(homedata_state::pteacher_upd7807_portc_w)
{
/* port C layout:
7 coin counter
6 enable message from main CPU on port A
5 clock latch for 76489 command
4
3 \ ROM bank
2 /
1 input (service)
0 input (coin)
*/
// logerror("%s: port C wr %02x\n", machine().describe_context(), data);
m_audiobank->set_entry((data & 0x0c) >> 2);
machine().bookkeeping().coin_counter_w(0, ~data & 0x80);
if (BIT(m_upd7807_portc, 5) && !BIT(data, 5)) /* clock 1->0 */
m_sn->write(m_upd7807_porta);
m_upd7807_portc = data;
}
/********************************************************************************/
WRITE8_MEMBER(homedata_state::bankswitch_w)
{
int last_bank = (memregion("maincpu")->bytes() - 0x10000) / 0x4000;
/* last bank is fixed and is #0 for us, other banks start from #1 (hence data+1 below)*/
if (data < last_bank)
m_mainbank->set_entry(data + 1);
else
m_mainbank->set_entry(0);
}
/********************************************************************************/
void homedata_state::mrokumei_map(address_map &map)
{
map(0x0000, 0x3fff).ram().w(FUNC(homedata_state::mrokumei_videoram_w)).share("videoram");
map(0x4000, 0x5fff).ram();
map(0x6000, 0x6fff).ram(); /* work ram */
map(0x7000, 0x77ff).ram(); /* hourouki expects this to act as RAM */
map(0x7800, 0x7800).ram(); /* only used to store the result of the ROM check */
map(0x7801, 0x7802).r(FUNC(homedata_state::mrokumei_keyboard_r)); // also vblank and active page
map(0x7803, 0x7803).portr("IN0"); // coin, service
map(0x7804, 0x7804).portr("DSW1"); // DSW1
map(0x7805, 0x7805).portr("DSW2"); // DSW2
map(0x7ff0, 0x7ffd).writeonly().share("vreg");
map(0x7ffe, 0x7ffe).nopr(); // ??? read every vblank, value discarded
map(0x8000, 0x8000).w(FUNC(homedata_state::mrokumei_blitter_start_w)); // in some games also ROM bank switch to access service ROM
map(0x8001, 0x8001).w(FUNC(homedata_state::mrokumei_keyboard_select_w));
map(0x8002, 0x8002).w(FUNC(homedata_state::mrokumei_sound_cmd_w));
map(0x8003, 0x8003).w(m_sn, FUNC(sn76489a_device::write));
map(0x8006, 0x8006).w(FUNC(homedata_state::homedata_blitter_param_w));
map(0x8007, 0x8007).w(FUNC(homedata_state::mrokumei_blitter_bank_w));
map(0x8000, 0xffff).rom();
}
void homedata_state::mrokumei_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
// TODO: might be that the entire area is sound_bank_w
map(0xfffc, 0xfffd).nopw(); /* stack writes happen here, but there's no RAM */
map(0x8080, 0x8080).w(FUNC(homedata_state::mrokumei_sound_bank_w));
map(0xffbf, 0xffbf).w(FUNC(homedata_state::mrokumei_sound_bank_w)); // hourouki mirror
}
void homedata_state::mrokumei_sound_io_map(address_map &map)
{
map(0x0000, 0xffff).r(m_mrokumei_soundbank, FUNC(address_map_bank_device::read8)); /* read address is 16-bit */
map(0x0040, 0x0040).mirror(0xff00).w("dac", FUNC(dac_byte_interface::data_w)); /* write address is only 8-bit */
// hourouki mirror...
map(0x007f, 0x007f).mirror(0xff00).w("dac", FUNC(dac_byte_interface::data_w)); /* write address is only 8-bit */
}
void homedata_state::mrokumei_sound_banked_map(address_map &map)
{
map(0x00000, 0x1ffff).mirror(0x20000).rom().region("audiocpu", 0);
map(0x40000, 0x40000).mirror(0x3ffff).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
/********************************************************************************/
void homedata_state::reikaids_map(address_map &map)
{
map(0x0000, 0x3fff).ram().w(FUNC(homedata_state::reikaids_videoram_w)).share("videoram");
map(0x4000, 0x5fff).ram();
map(0x6000, 0x6fff).ram(); /* work RAM */
map(0x7800, 0x7800).ram(); /* behaves as normal RAM */
map(0x7801, 0x7801).portr("IN0");
map(0x7802, 0x7802).portr("IN1");
map(0x7803, 0x7803).r(FUNC(homedata_state::reikaids_io_r)); // coin, blitter, upd7807
map(0x7ff0, 0x7ffd).writeonly().share("vreg");
map(0x7ffe, 0x7ffe).w(FUNC(homedata_state::reikaids_blitter_bank_w));
map(0x7fff, 0x7fff).w(FUNC(homedata_state::reikaids_blitter_start_w));
map(0x8000, 0x8000).w(FUNC(homedata_state::bankswitch_w));
map(0x8002, 0x8002).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x8005, 0x8005).w(FUNC(homedata_state::reikaids_gfx_bank_w));
map(0x8006, 0x8006).w(FUNC(homedata_state::homedata_blitter_param_w));
map(0x8000, 0xbfff).bankr("mainbank");
map(0xc000, 0xffff).rom();
}
void homedata_state::reikaids_upd7807_map(address_map &map)
{
map(0x0000, 0xfeff).bankr("audiobank"); /* External ROM (Banked) */
}
/**************************************************************************/
void homedata_state::pteacher_base_map(address_map &map)
{
map(0x0000, 0x3fff).ram().w(FUNC(homedata_state::mrokumei_videoram_w)).share("videoram");
map(0x4000, 0x5eff).ram();
map(0x5f00, 0x5fff).ram();
map(0x6000, 0x6fff).ram(); /* work ram */
map(0x7800, 0x7800).ram(); /* behaves as normal RAM */
map(0x7801, 0x7801).r(FUNC(homedata_state::pteacher_io_r)); // vblank, visible page
map(0x7ff0, 0x7ffd).writeonly().share("vreg");
map(0x7fff, 0x7fff).w(FUNC(homedata_state::pteacher_blitter_start_w));
map(0x8000, 0x8000).w(FUNC(homedata_state::bankswitch_w));
map(0x8002, 0x8002).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0x8005, 0x8005).w(FUNC(homedata_state::pteacher_blitter_bank_w));
map(0x8006, 0x8006).w(FUNC(homedata_state::homedata_blitter_param_w));
map(0x8007, 0x8007).w(FUNC(homedata_state::pteacher_gfx_bank_w));
map(0x8000, 0xbfff).bankr("mainbank");
map(0xc000, 0xffff).rom();
}
void homedata_state::pteacher_map(address_map &map)
{
pteacher_base_map(map);
map(0x7ff2, 0x7ff2).r(m_mainlatch, FUNC(generic_latch_8_device::read));
}
void homedata_state::pteacher_upd7807_map(address_map &map)
{
map(0x0000, 0x0000).w(m_mainlatch, FUNC(generic_latch_8_device::write));
map(0x0000, 0xfeff).bankr("audiobank"); /* External ROM (Banked) */
}
/**************************************************************************/
/* it seems that Mahjong Jogakuen runs on the same board as the others,
but with just these two addresses swapped. Instead of creating a new
MachineDriver, I just fix them here. */
void homedata_state::jogakuen_map(address_map &map)
{
pteacher_map(map);
map(0x8005, 0x8005).w(FUNC(homedata_state::pteacher_gfx_bank_w));
map(0x8007, 0x8007).w(FUNC(homedata_state::pteacher_blitter_bank_w));
}
/**************************************************************************/
void homedata_state::mjikaga_map(address_map &map)
{
pteacher_base_map(map);
map(0x7802, 0x7802).r(m_mainlatch, FUNC(generic_latch_8_device::read));
}
void homedata_state::mjikaga_upd7807_map(address_map &map)
{
map(0x0123, 0x0123).w(m_mainlatch, FUNC(generic_latch_8_device::write));
map(0x0000, 0xfeff).bankr("audiobank"); /* External ROM (Banked) */
}
/**************************************************************************/
static INPUT_PORTS_START( mjhokite )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:7" )
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:6,5")
PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x10, 0x10, "Initial Score" ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x10, "1000" )
PORT_DIPSETTING( 0x00, "2000" )
PORT_DIPNAME( 0xe0, 0x80, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:3,2,1")
PORT_DIPSETTING( 0xe0, "1 (easiest)" )
PORT_DIPSETTING( 0xc0, "2" )
PORT_DIPSETTING( 0xa0, "3" )
PORT_DIPSETTING( 0x80, "4" )
PORT_DIPSETTING( 0x60, "5" )
PORT_DIPSETTING( 0x40, "6" )
PORT_DIPSETTING( 0x20, "7" )
PORT_DIPSETTING( 0x00, "8 (hardest)" )
PORT_START("DSW2")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:8")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "Girl Voice" ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x04, 0x04, "SW2:6" )
PORT_DIPUNUSED_DIPLOC( 0x08, 0x08, "SW2:5" )
PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "SW2:4" )
PORT_DIPUNUSED_DIPLOC( 0x20, 0x20, "SW2:3" )
PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "SW2:2" )
PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW2:1" )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_DIPNAME( 0x02, 0x02, "Freeze?" )
PORT_DIPSETTING( 0x02, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) // doesn't work in all games
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
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("KEY0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("KEY1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
PORT_START("KEY2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
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_MAHJONG_FLIP_FLOP )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( reikaids )
PORT_START("IN0") // 0x7801
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Punch")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Kick")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Jump / Defense")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
PORT_START("IN1") // 0x7802
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P2 Punch")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P2 Kick")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P2 Jump / Defense")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
PORT_START("IN2") // 0x7803
PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_CUSTOM ) /* coprocessor status */
PORT_BIT( 0x02, IP_ACTIVE_HIGH,IPT_CUSTOM ) /* coprocessor data */
PORT_BIT( 0x04, IP_ACTIVE_HIGH,IPT_CUSTOM ) /* vblank */
PORT_BIT( 0x08, IP_ACTIVE_HIGH,IPT_CUSTOM ) /* visible page */
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW1")
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x06, 0x06, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:2,3")
PORT_DIPSETTING( 0x06, "20k then every 60k" )
PORT_DIPSETTING( 0x04, "30k then every 80k" )
PORT_DIPSETTING( 0x02, "20k" )
PORT_DIPSETTING( 0x00, "30k" )
PORT_DIPNAME( 0x18, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4,5")
PORT_DIPSETTING( 0x18, "2" )
PORT_DIPSETTING( 0x10, "3" )
PORT_DIPSETTING( 0x08, "4" )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x20, 0x20, "Time" ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x20, "60" )
PORT_DIPSETTING( 0x00, "45" )
PORT_DIPNAME( 0x40, 0x40, "Unknown 2-6" ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Unknown 2-7" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x03, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x02, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x04, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x08, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x10, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:6,7,8")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x60, DEF_STR( 1C_5C ) )
INPUT_PORTS_END
static INPUT_PORTS_START( battlcry )
PORT_INCLUDE( reikaids )
PORT_MODIFY("DSW1") // According to manual these DSW #s should be reversed
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:1,2,3")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, "Up To Stage 1" )
PORT_DIPSETTING( 0x06, "Up To Stage 2" )
PORT_DIPSETTING( 0x01, "Up To Stage 3" )
PORT_DIPSETTING( 0x05, "Up To Stage 4" )
PORT_DIPSETTING( 0x03, "Up To Stage 5" )
PORT_DIPSETTING( 0x07, "Up To Stage 6" )
PORT_DIPNAME( 0x18, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:4,5")
PORT_DIPSETTING( 0x18, "1" )
PORT_DIPSETTING( 0x10, "2" )
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x00, "4" )
PORT_DIPNAME( 0x20, 0x20, "Time" ) PORT_DIPLOCATION("SW1:6")
PORT_DIPSETTING( 0x20, "90" )
PORT_DIPSETTING( 0x00, "120" )
PORT_DIPNAME( 0x40, 0x40, "Test Mode" ) PORT_DIPLOCATION("SW1:7")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x80, "Unused - Leave OFF" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x04, 0x04, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:3")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x08, "Background Music" ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x10, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:6,7,8")
PORT_DIPSETTING( 0x80, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x60, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
INPUT_PORTS_END
static INPUT_PORTS_START( mj_keyboard )
PORT_START("KEY0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_B )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_C )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_D )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* dip switch (handled separately) */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_E )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_G )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_H )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* dip switch (handled separately) */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_I )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_J )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_L )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* dip switch (handled separately) */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_M )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_N )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_CHI )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_MAHJONG_PON )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_FLIP_FLOP )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* dip switch (handled separately) */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_KAN )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_REACH )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_RON )
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) /* dip switch (handled separately) */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("KEY5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_BET )
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_HIGH, IPT_CUSTOM ) /* dip switch (handled separately) */
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED )
INPUT_PORTS_END
static INPUT_PORTS_START( pteacher )
PORT_START("DSW") /* dip switches (handled by pteacher_keyboard_r) */
PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0002, 0x0000, "In-Game BGM") PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x0002, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4")
PORT_DIPSETTING( 0x0000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x000c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0008, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x0010, 0x0010, "Female Voices" ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
PORT_DIPUNKNOWN_DIPLOC( 0x0020, 0x0020, "SW1:6" ) //SW1:6,7,8 are difficulty
PORT_DIPUNKNOWN_DIPLOC( 0x0040, 0x0040, "SW1:7" )
PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "SW1:8" )
PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x0100, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_SERVICE_DIPLOC(0x0200, IP_ACTIVE_LOW, "SW2:3" )
PORT_DIPUNKNOWN_DIPLOC( 0x0400, 0x0400, "SW2:2" )
PORT_DIPUNKNOWN_DIPLOC( 0x0800, 0x0800, "SW2:1" )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_INCLUDE( mj_keyboard )
INPUT_PORTS_END
static INPUT_PORTS_START( mjjoship )
PORT_INCLUDE( pteacher )
// Manual wrong for this game - it's an incomplete version of the
// pteacher set, with no service mode and start score instead of
// girl voices. Coins stated in manual in same place but do nothing
PORT_MODIFY("DSW")
// SW1
PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" )
PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" )
PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" )
PORT_DIPNAME( 0x0010, 0x0010, "Player Start Score" ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x0010, "1000" )
PORT_DIPSETTING( 0x0000, "2000" )
// SW2
PORT_DIPUNUSED_DIPLOC( 0x0100, 0x0100, "SW2:4" )
PORT_DIPUNUSED_DIPLOC( 0x0200, 0x0200, "SW2:3" )
INPUT_PORTS_END
static INPUT_PORTS_START( jogakuen )
PORT_START("DSW") /* dip switches (handled by pteacher_keyboard_r) */
PORT_DIPNAME( 0x0007, 0x0007, DEF_STR( Coinage ) )
PORT_DIPSETTING( 0x0000, DEF_STR( 5C_1C ) )
PORT_DIPSETTING( 0x0001, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0002, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0003, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0007, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0006, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x0005, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 1C_4C ) )
PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Demo_Sounds ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0008, DEF_STR( On ) )
PORT_DIPNAME( 0x0010, 0x0010, "In-Game BGM" )
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPNAME( 0x0020, 0x0020, "Gal Strip Voice" )
PORT_DIPSETTING( 0x0020, DEF_STR( On ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Flip_Screen ) )
PORT_DIPSETTING( 0x0040, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) )
PORT_DIPSETTING( 0x0080, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_SERVICE( 0x0800, IP_ACTIVE_LOW )
PORT_DIPNAME( 0x0700, 0x0700, DEF_STR( Difficulty ) ) // not sure about the sequence here
PORT_DIPSETTING( 0x0300, DEF_STR( Easiest ) ) // 'Easy 4' in test mode
PORT_DIPSETTING( 0x0200, DEF_STR( Very_Easy ) ) // 'Easy 3' in test mode
PORT_DIPSETTING( 0x0100, DEF_STR( Easier ) ) // 'Easy 2' in test mode
PORT_DIPSETTING( 0x0000, DEF_STR( Easy ) ) // 'Easy 1' in test mode
PORT_DIPSETTING( 0x0700, DEF_STR( Normal ) ) // 'Normal 0' in test mode
PORT_DIPSETTING( 0x0600, DEF_STR( Hard ) ) // 'Hard 1' in test mode
PORT_DIPSETTING( 0x0500, DEF_STR( Harder ) ) // 'Hard 2' in test mode
PORT_DIPSETTING( 0x0400, DEF_STR( Hardest ) ) // 'Hard 3' in test mode
PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
PORT_START("COIN")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED )