/
psikyo.cpp
1982 lines (1559 loc) · 86.9 KB
/
psikyo.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:Luca Elia,Olivier Galibert,Paul Priest
/***************************************************************************
-= Psikyo Games =-
driver by Luca Elia (l.elia@tin.it)
CPU: 68EC020 + PIC16C57 [Optional MCU]
Sound: Z80A + YM2610
Or: LZ8420M (Z80 core) + YMF286-K (YM2610 compatible)
Chips: PS2001B
PS3103
PS3204
PS3305
---------------------------------------------------------------------------
Name Year Board Notes
---------------------------------------------------------------------------
Sengoku Ace (J) 1993 SH201B
Gun Bird (J) 1994 KA302C
Battle K-Road (J) 1994 ""
Strikers 1945 (J) 1995 SH403/SH404 SH403 is similar to KA302C
Tengai (J) 1996 SH404 SH404 has MCU, ymf278-b for sound and gfx banking
---------------------------------------------------------------------------
To Do:
- tengai / tengaij: "For use in Japan" screen is supposed to output the
typical blue Psikyo backdrop gradient instead of being pure black as it is
now;
- Flip Screen support
NOTE: Despite being mentioned in the manual Strikers 1945 doesn't seem to
have a Free Play mode.
The tengai PIC dump has been tested on PCB with the available s1945 program ROMs:
s1945 (World) - working ok
s1945a (Japan / World) - resets when start pressed
s1945k (Korea) - working ok
s1945j (Japan) - boots but locks up with black screen when start pressed
***************************************************************************/
/***** Gun Bird Japan Crash Notes
The Following Section of Code in Gunbird causes reads from the
0x080000 - 0x0fffff region
002894: E2817000 asr.l #1, D1
002896: 70001030 moveq #$0, D0
002898: 10301804 move.b ($4,A0,D1.l), D0 <-- *
00289C: 60183202 bra 28b6
00289E: 3202C2C7 move.w D2, D1
0028A0: C2C77000 mulu.w D7, D1
0028A2: 70003005 moveq #$0, D0
0028A4: 3005D280 move.w D5, D0
0028A6: D280E281 add.l D0, D1
0028A8: E2812071 asr.l #1, D1
0028AA: 20713515 movea.l ([A1],D3.w*4), A0
0028AE: 70001030 moveq #$0, D0
0028B0: 10301804 move.b ($4,A0,D1.l), D0 <-- *
0028B4: E880720F asr.l #4, D0
0028B6: 720FC041 moveq #$f, D1
This causes Gunbird to crash if the ROM Region Size
allocated during loading is smaller than the ROM
region as it tries to read beyond the allocated rom region
This was pointed out by Bart Puype
*****/
#include "emu.h"
#include "psikyo.h"
#include "cpu/z80/z80.h"
#include "cpu/z80/lz8420m.h"
#include "cpu/m68000/m68020.h"
#include "cpu/pic16c5x/pic16c5x.h"
#include "sound/okim6295.h"
#include "sound/ymopl.h"
#include "sound/ymopn.h"
#include "speaker.h"
/***************************************************************************
Strikers 1945 / Tengai MCU
***************************************************************************/
int psikyo_state::mcu_status_r()
{
int ret = 0x00;
/* Don't know exactly what this bit is, but s1945 and tengai
both spin waiting for it to go low during POST. Also,
the following code in tengai (don't know where or if it is
reached) waits for it to pulse:
01A546: move.b (A2), D0 ; A2 = $c00003
01A548: andi.b #$4, D0
01A54C: beq $1a546
01A54E: move.b (A2), D0
01A550: andi.b #$4, D0
01A554: bne $1a54e
Interestingly, s1945nj has the code that spins on this bit,
but said code is never reached. Prototype? */
if (m_mcu_status)
ret = 0x01;
if (!machine().side_effects_disabled())
m_mcu_status = !m_mcu_status; /* hack */
return ret;
}
static const u8 s1945_table[256] = {
0x00, 0x00, 0x64, 0xae, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc,
0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x1e,
0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x5c, 0x00, 0x00, 0x2b, 0xc0
};
static const u8 s1945a_table[256] = {
0x00, 0x00, 0x64, 0xbe, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc,
0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc7, 0x2a,
0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xad, 0x4c, 0x00, 0x00, 0x2b, 0xc0
};
static const u8 s1945j_table[256] = {
0x00, 0x00, 0x64, 0xb6, 0x00, 0x00, 0x26, 0x2c, 0x00, 0x00, 0x2c, 0xda, 0x00, 0x00, 0x2c, 0xbc,
0x00, 0x00, 0x2c, 0x9e, 0x00, 0x00, 0x2f, 0x0e, 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0xc5, 0x92,
0x00, 0x00, 0x32, 0x90, 0x00, 0x00, 0xac, 0x64, 0x00, 0x00, 0x2b, 0xc0
};
void psikyo_state::s1945_mcu_data_w(uint8_t data)
{
m_s1945_mcu_inlatch = data;
}
void psikyo_state::s1945_mcu_control_w(uint8_t data)
{
m_s1945_mcu_control = data;
}
void psikyo_state::s1945_mcu_direction_w(uint8_t data)
{
m_s1945_mcu_direction = data;
}
void psikyo_state::s1945_mcu_bctrl_w(uint8_t data)
{
switch_bgbanks(1, (data >> 6) & 3);
switch_bgbanks(0, (data >> 4) & 3);
m_s1945_mcu_bctrl = data;
}
void psikyo_state::s1945_mcu_command_w(uint8_t data)
{
switch (data | (m_s1945_mcu_direction ? 0x100 : 0))
{
case 0x11c:
m_s1945_mcu_latching = 5;
m_s1945_mcu_index = m_s1945_mcu_inlatch;
break;
case 0x013:
// logerror("MCU: Table read index %02x\n", m_s1945_mcu_index);
m_s1945_mcu_latching = 1;
if (m_s1945_mcu_table != nullptr)
m_s1945_mcu_latch1 = m_s1945_mcu_table[m_s1945_mcu_index];
break;
case 0x113:
m_s1945_mcu_mode = m_s1945_mcu_inlatch;
if (m_s1945_mcu_mode == 1)
{
m_s1945_mcu_latching &= ~1;
m_s1945_mcu_latch2 = 0x55;
}
else
{
// Go figure.
m_s1945_mcu_latching &= ~1;
m_s1945_mcu_latching |= 2;
}
m_s1945_mcu_latching &= ~4;
m_s1945_mcu_latch1 = m_s1945_mcu_inlatch;
break;
case 0x010:
case 0x110:
m_s1945_mcu_latching |= 4;
break;
default:
// logerror("MCU: function %02x, direction %02x, latch1 %02x, latch2 %02x (%x)\n", data, m_s1945_mcu_direction, m_s1945_mcu_latch1, m_s1945_mcu_latch2, m_maincpu->pc());
break;
}
}
// TODO: make this handler 8-bit
u32 psikyo_state::s1945_mcu_data_r()
{
u32 res;
if (m_s1945_mcu_control & 16)
{
res = m_s1945_mcu_latching & 4 ? 0x0000ff00 : m_s1945_mcu_latch1 << 8;
if (!machine().side_effects_disabled())
m_s1945_mcu_latching |= 4;
}
else
{
res = m_s1945_mcu_latching & 1 ? 0x0000ff00 : m_s1945_mcu_latch2 << 8;
if (!machine().side_effects_disabled())
m_s1945_mcu_latching |= 1;
}
res |= m_s1945_mcu_bctrl & 0xf0;
return res;
}
uint8_t psikyo_state::s1945_mcu_control_r()
{
return m_s1945_mcu_latching | 0x08;
}
template<int Layer>
u16 psikyo_state::vram_r(offs_t offset)
{
return m_vram[Layer][offset];
}
template<int Layer>
void psikyo_state::vram_w(offs_t offset, u16 data, u16 mem_mask)
{
COMBINE_DATA(&m_vram[Layer][offset]);
const u32 tilemap_indexes = m_tilemap[Layer]->rows() * m_tilemap[Layer]->cols();
while (offset < tilemap_indexes)
{
m_tilemap[Layer]->mark_tile_dirty(offset);
offset += 0x1000;
}
}
/***************************************************************************
Memory Map
***************************************************************************/
void psikyo_state::psikyo_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM (not all used)
map(0x400000, 0x401fff).ram().share("spriteram"); // Sprites, buffered by two frames (list buffered + fb buffered)
map(0x600000, 0x601fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette
map(0x800000, 0x801fff).rw(FUNC(psikyo_state::vram_r<0>), FUNC(psikyo_state::vram_w<0>)); // Layer 0
map(0x802000, 0x803fff).rw(FUNC(psikyo_state::vram_r<1>), FUNC(psikyo_state::vram_w<1>)); // Layer 1
map(0x804000, 0x807fff).ram().share("vregs"); // RAM + Vregs
// map(0xc00000, 0xc0000b).r(FUNC(psikyo_state::input_r)); // Depends on board
// map(0xc00004, 0xc0000b).w(FUNC(psikyo_state::s1945_mcu_w)); // MCU on sh404
// map(0xc00010, 0xc00013).w(m_soundlatch, FUNC(generic_latch_8_device::write)); // Depends on board
map(0xfe0000, 0xffffff).ram(); // RAM
}
template<int Shift>
void psikyo_state::sound_bankswitch_w(u8 data)
{
m_audiobank->set_entry((data >> Shift) & 0x03);
}
void psikyo_state::s1945bl_okibank_w(u8 data)
{
// not at all sure about this, it seems to write 0 too often
if (data < 5)
m_okibank->set_entry(data);
}
void psikyo_state::s1945bl_oki_map(address_map &map)
{
map(0x00000, 0x2ffff).rom();
map(0x30000, 0x3ffff).bankr("okibank");
}
void psikyo_state::psikyo_bootleg_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM (not all used)
map(0x200000, 0x200fff).ram().share("boot_spritebuf"); // RAM (it copies the spritelist here, the HW probably doesn't have automatic buffering like the originals?
map(0x400000, 0x401fff).ram().share("spriteram"); // Sprites, buffered by two frames (list buffered + fb buffered)
map(0x600000, 0x601fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette
map(0x800000, 0x801fff).rw(FUNC(psikyo_state::vram_r<0>), FUNC(psikyo_state::vram_w<0>)); // Layer 0
map(0x802000, 0x803fff).rw(FUNC(psikyo_state::vram_r<1>), FUNC(psikyo_state::vram_w<1>)); // Layer 1
map(0x804000, 0x807fff).ram().share("vregs"); // RAM + Vregs
map(0xc00000, 0xc0000b).r(FUNC(psikyo_state::gunbird_input_r)); // input ports
map(0xc00018, 0xc00018).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0xc00019, 0xc00019).w(FUNC(psikyo_state::s1945bl_okibank_w));
map(0xfe0000, 0xffffff).ram(); // RAM
}
/***************************************************************************
Sengoku Ace / Samurai Aces
***************************************************************************/
u32 psikyo_state::sngkace_input_r(offs_t offset)
{
switch (offset)
{
case 0x0: return m_in_p1_p2->read();
case 0x1: return m_in_dsw->read();
case 0x2: return m_in_coin->read();
default: logerror("PC %06X - Read input %02X !\n", m_maincpu->pc(), offset * 2);
return 0;
}
}
void psikyo_state::sngkace_map(address_map &map)
{
psikyo_map(map);
map(0xc00000, 0xc0000b).r(FUNC(psikyo_state::sngkace_input_r));
map(0xc00013, 0xc00013).w(m_soundlatch, FUNC(generic_latch_8_device::write));
}
void psikyo_state::sngkace_sound_map(address_map &map)
{
map(0x0000, 0x77ff).rom(); // ROM
map(0x7800, 0x7fff).ram(); // RAM
map(0x8000, 0xffff).bankr("audiobank"); // Banked ROM
}
void psikyo_state::sngkace_sound_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x03).rw("ymsnd", FUNC(ym2610_device::read), FUNC(ym2610_device::write));
map(0x04, 0x04).w(FUNC(psikyo_state::sound_bankswitch_w<0>));
map(0x08, 0x08).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x0c, 0x0c).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w));
}
/***************************************************************************
Gun Bird
***************************************************************************/
u32 psikyo_state::gunbird_input_r(offs_t offset)
{
switch (offset)
{
case 0x0: return m_in_p1_p2->read();
case 0x1: return m_in_dsw->read();
default: logerror("PC %06X - Read input %02X !\n", m_maincpu->pc(), offset * 2);
return 0;
}
}
void psikyo_state::gunbird_map(address_map &map)
{
psikyo_map(map);
map(0xc00000, 0xc0000b).r(FUNC(psikyo_state::gunbird_input_r));
map(0xc00013, 0xc00013).w(m_soundlatch, FUNC(generic_latch_8_device::write));
}
void psikyo_state::s1945n_map(address_map &map)
{
psikyo_map(map);
map(0xc00000, 0xc0000b).r(FUNC(psikyo_state::gunbird_input_r));
map(0xc00011, 0xc00011).w(m_soundlatch, FUNC(generic_latch_8_device::write));
}
void psikyo_state::gunbird_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom(); // ROM
map(0x8000, 0x81ff).ram(); // RAM
map(0x8200, 0xffff).bankr("audiobank"); // Banked ROM
}
void psikyo_state::gunbird_sound_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(psikyo_state::sound_bankswitch_w<4>));
map(0x04, 0x07).rw("ymsnd", FUNC(ym2610_device::read), FUNC(ym2610_device::write));
map(0x08, 0x08).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x0c, 0x0c).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w));
}
/***************************************************************************
Strikers 1945 / Tengai
***************************************************************************/
u32 psikyo_state::s1945_input_r(offs_t offset)
{
switch (offset)
{
case 0x0: return m_in_p1_p2->read();
case 0x1: return (m_in_dsw->read() & 0xffff000f) | s1945_mcu_data_r();
default: logerror("PC %06X - Read input %02X !\n", m_maincpu->pc(), offset * 2);
return 0;
}
}
void psikyo_state::s1945_map(address_map &map)
{
psikyo_map(map);
map(0xc00000, 0xc00007).r(FUNC(psikyo_state::s1945_input_r)); // input ports
map(0xc00006, 0xc00006).w(FUNC(psikyo_state::s1945_mcu_data_w));
map(0xc00007, 0xc00007).w(FUNC(psikyo_state::s1945_mcu_bctrl_w)); // tile bank switching
map(0xc00008, 0xc00008).rw(FUNC(psikyo_state::s1945_mcu_control_r), FUNC(psikyo_state::s1945_mcu_control_w));
map(0xc00009, 0xc00009).w(FUNC(psikyo_state::s1945_mcu_direction_w));
map(0xc0000b, 0xc0000b).w(FUNC(psikyo_state::s1945_mcu_command_w));
map(0xc00011, 0xc00011).w(m_soundlatch, FUNC(generic_latch_8_device::write));
}
void psikyo_state::s1945_sound_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(FUNC(psikyo_state::sound_bankswitch_w<4>));
map(0x02, 0x03).nopw();
map(0x08, 0x0d).rw("ymf", FUNC(ymf278b_device::read), FUNC(ymf278b_device::write));
map(0x10, 0x10).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x18, 0x18).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w));
}
/***************************************************************************
Input Ports
***************************************************************************/
int psikyo_state::z80_nmi_r()
{
int ret = 0x00;
if (m_soundlatch->pending_r())
{
ret = 0x01;
/* main CPU might be waiting for sound CPU to finish NMI,
so set a timer to give sound CPU a chance to run */
if (!machine().side_effects_disabled())
machine().scheduler().synchronize();
// logerror("%s - Read coin port during Z80 NMI\n", machine().describe_context());
}
return ret;
}
static INPUT_PORTS_START( psikyo_common )
PORT_START("P1_P2") /* c00000&1 */
PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) // these depends by the games
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x00040000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x00200000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x00800000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x02000000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x04000000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x08000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x80000000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_START("DSW") /* c00004 -> c00007 */
PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) // these depends by the games
PORT_DIPNAME( 0x00010000, 0x00010000, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1")
PORT_DIPSETTING( 0x00010000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00020000, 0x00000000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:2")
PORT_DIPSETTING( 0x00020000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x000c0000, 0x000c0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x00080000, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x000c0000, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x00040000, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x00300000, 0x00300000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:5,6")
PORT_DIPSETTING( 0x00200000, "1" )
PORT_DIPSETTING( 0x00100000, "2" )
PORT_DIPSETTING( 0x00300000, "3" )
PORT_DIPSETTING( 0x00000000, "4" )
PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00400000, "400K" )
PORT_DIPSETTING( 0x00000000, "600K" )
PORT_SERVICE_DIPLOC( 0x00800000, IP_ACTIVE_LOW, "SW2:8" )
PORT_DIPNAME( 0x01000000, 0x01000000, "Coin Slot" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x01000000, "Shared" )
PORT_DIPSETTING( 0x00000000, "Individual [Free Play]" )
PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4")
PORT_DIPSETTING( 0x0a000000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0c000000, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0e000000, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08000000, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x06000000, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04000000, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x02000000, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x00000000, "1C 6C [Free Play]" )
PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7")
PORT_DIPSETTING( 0x50000000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x60000000, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x70000000, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40000000, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x30000000, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x20000000, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x10000000, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x00000000, "1C 6C [Free Play]" )
PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, "On [Free Play]" ) // Forces 1C_1C
INPUT_PORTS_END
/***************************************************************************
Samurai Aces / Sengoku Ace (Japan)
***************************************************************************/
static INPUT_PORTS_START( samuraia )
PORT_INCLUDE(psikyo_common)
PORT_START("COIN")
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00010000, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00020000, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00040000, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_BIT( 0x00080000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00100000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00200000, IP_ACTIVE_LOW )
PORT_BIT( 0x00400000, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0xff000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 World
0 1 1 1 USA With FBI logo
1 0 1 1 Korea With FBI logo??
1 1 0 1 Hong Kong With FBI logo??
1 1 1 0 Taiwan With FBI logo??
************************************************/
PORT_CONFNAME( 0x000000ff, 0x000000ff, DEF_STR( Region ) )
PORT_CONFSETTING( 0x000000ff, DEF_STR( World ) )
PORT_CONFSETTING( 0x000000ef, "USA & Canada" )
PORT_CONFSETTING( 0x000000df, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x000000bf, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x0000007f, DEF_STR( Taiwan ) )
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
INPUT_PORTS_END
static INPUT_PORTS_START( sngkace )
PORT_INCLUDE( samuraia )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 Japan
0 1 1 1 USA With FBI logo
1 0 1 1 Korea
1 1 0 1 Hong Kong
1 1 1 0 Taiwan
************************************************/
#if 0 // See Patch in machine_reset, only text not logo
PORT_CONFNAME( 0x000000ff, 0x000000ff, DEF_STR( Region ) )
PORT_CONFSETTING( 0x000000ff, DEF_STR( Japan ) )
PORT_CONFSETTING( 0x000000ef, "USA & Canada" )
PORT_CONFSETTING( 0x000000df, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x000000bf, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x0000007f, DEF_STR( Taiwan ) )
#endif
PORT_BIT( 0x000000ff, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
/***************************************************************************
Battle K-Road
Handicap Mode: When you turn ON the Handicap Mode, if the same player wins
consecutive matches against other players, the challenger will get a
handicap. However, it works only when the player challenges again while
counting down continuous games.
***************************************************************************/
static INPUT_PORTS_START( btlkroad )
PORT_INCLUDE(psikyo_common)
PORT_MODIFY("P1_P2") /* c00000 -> c00003 */
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(2)
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2)
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(1)
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(1)
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1)
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
Bit 0 1 2 3
1 1 1 1 Japan
0 1 1 1 USA & Canada
0 0 1 1 Korea
0 1 0 1 Hong Kong
0 1 1 0 Taiwan
Other World
************************************************/
PORT_CONFNAME( 0x0000000f, 0x00000000, DEF_STR( Region ) )
PORT_CONFSETTING( 0x0000000f, DEF_STR( Japan ) )
PORT_CONFSETTING( 0x0000000e, "USA & Canada (Jaleco license)" )
PORT_CONFSETTING( 0x0000000c, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x0000000a, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x00000006, DEF_STR( Taiwan ) )
PORT_CONFSETTING( 0x00000000, DEF_STR( World ) )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank ACTIVE_HIGH fixes slowdowns, but is it right?
// This DSW is used for debugging the game
PORT_DIPNAME( 0x00000100, 0x00000100, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:1") // tested! - So leave as is until filled in
PORT_DIPSETTING( 0x00000100, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00000200, 0x00000200, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2") // tested! - So leave as is until filled in
PORT_DIPSETTING( 0x00000200, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x00000400, IP_ACTIVE_LOW, "SW3:3" )
PORT_DIPUNUSED_DIPLOC( 0x00000800, IP_ACTIVE_LOW, "SW3:4" )
PORT_DIPNAME( 0x00001000, 0x00001000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:5") // tested! - So leave as is until filled in
PORT_DIPSETTING( 0x00001000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x00002000, IP_ACTIVE_LOW, "SW3:6" )
PORT_DIPUNUSED_DIPLOC( 0x00004000, IP_ACTIVE_LOW, "SW3:7" )
PORT_DIPNAME( 0x00008000, 0x00008000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:8") // tested! - So leave as is until filled in
PORT_DIPSETTING( 0x00008000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00100000, 0x00100000, "Blood Effects" ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00100000, DEF_STR( On ) )
PORT_DIPNAME( 0x00200000, 0x00200000, "Handicap Mode" ) PORT_DIPLOCATION("SW2:6")
PORT_DIPSETTING( 0x00200000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
PORT_DIPNAME( 0x00400000, 0x00400000, "Use DSW 3 (Debug)" ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00400000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) )
INPUT_PORTS_END
static INPUT_PORTS_START( btlkroadk )
PORT_INCLUDE( btlkroad )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
Bit 0 1 2 3
1 1 1 1 Japan
0 1 1 1 USA & Canada
0 0 1 1 Korea
0 1 0 1 Hong Kong
0 1 1 0 Taiwan
Other World
************************************************/
PORT_CONFNAME( 0x0000000f, 0x0000000c, DEF_STR( Region ) ) // Game code supports multi-region, but set default to Korea
PORT_CONFSETTING( 0x0000000f, DEF_STR( Japan ) )
PORT_CONFSETTING( 0x0000000e, "USA & Canada (Jaleco license)" )
PORT_CONFSETTING( 0x0000000c, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x0000000a, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x00000006, DEF_STR( Taiwan ) )
PORT_CONFSETTING( 0x00000000, DEF_STR( World ) )
INPUT_PORTS_END
/***************************************************************************
Gun Bird
***************************************************************************/
static INPUT_PORTS_START( gunbird )
PORT_INCLUDE(psikyo_common)
PORT_MODIFY("P1_P2") /* c00000 -> c00003 */
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM )
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 World (No "For use in ...." screen)
0 x x x USA With FBI logo
1 0 x x Korea
1 1 0 x Hong Kong
1 1 1 0 Taiwan
x = Doesn't Matter, see routine starting at 0108A4:
Japan is listed in the code but how do you activate it?
Has no effects on Japan or Korea versions.
************************************************/
PORT_CONFNAME( 0x0000000f, 0x0000000f, DEF_STR( Region ) )
PORT_CONFSETTING( 0x0000000f, DEF_STR( World ) )
PORT_CONFSETTING( 0x0000000e, DEF_STR( USA ) )
PORT_CONFSETTING( 0x0000000d, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x0000000b, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x00000007, DEF_STR( Taiwan ) )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
INPUT_PORTS_END
static INPUT_PORTS_START( gunbirdj )
PORT_INCLUDE( gunbird )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
PORT_BIT( 0x0000000f, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
/***************************************************************************
Strikers 1945
***************************************************************************/
static INPUT_PORTS_START( s1945 )
PORT_INCLUDE(psikyo_common)
PORT_MODIFY("P1_P2") /* c00000 -> c00003 */
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, mcu_status_r)
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 World (No "For use in ...." screen), see:
0149B8: tst.w $fffe58a0.l
0 1 1 1 USA & Canada
1 0 1 1 Korea
1 1 0 1 Hong Kong
1 1 1 0 Taiwan
Other regions check see:
005594: move.w $fffe58a0.l, D0
Came from a Japan board apparently!!!
Japan is listed in the code but how do you activate it?
No effect on set s1945j or s1945k
************************************************/
PORT_CONFNAME( 0x0000000f, 0x0000000f, DEF_STR( Region ) )
PORT_CONFSETTING( 0x0000000f, DEF_STR( World ) )
PORT_CONFSETTING( 0x0000000e, "USA & Canada" )
PORT_CONFSETTING( 0x0000000d, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x0000000b, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x00000007, DEF_STR( Taiwan ) )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00400000, "600K" )
PORT_DIPSETTING( 0x00000000, "800K" )
PORT_DIPNAME( 0x01000000, 0x01000000, "Coin Slot" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x01000000, "Shared" )
PORT_DIPSETTING( 0x00000000, "Individual" )
PORT_DIPNAME( 0x0e000000, 0x0e000000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:2,3,4")
PORT_DIPSETTING( 0x0a000000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0c000000, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0e000000, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08000000, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x06000000, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x04000000, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x02000000, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x70000000, 0x70000000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7")
PORT_DIPSETTING( 0x50000000, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x60000000, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x70000000, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40000000, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x30000000, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x20000000, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x10000000, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x80000000, 0x80000000, "2C Start, 1C Continue" ) PORT_DIPLOCATION("SW1:8")
PORT_DIPSETTING( 0x80000000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) // Forces 1C_1C
INPUT_PORTS_END
static INPUT_PORTS_START( s1945a )
PORT_INCLUDE( s1945 )
PORT_MODIFY("DSW")
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 Japan, anything but 0x0f = "World"
************************************************/
PORT_CONFNAME( 0x0000000f, 0x0000000f, DEF_STR( Region ) )
PORT_CONFSETTING( 0x0000000f, DEF_STR( Japan ) )
PORT_CONFSETTING( 0x0000000e, DEF_STR( World ) )
INPUT_PORTS_END
static INPUT_PORTS_START( s1945j )
PORT_INCLUDE( s1945 )
PORT_MODIFY("DSW")
PORT_BIT( 0x0000000f, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( s1945bl )
PORT_INCLUDE( s1945 )
PORT_MODIFY("P1_P2")
PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_UNKNOWN )
// I need to invert the Vblank on this to avoid excessive slowdown
PORT_MODIFY("DSW") /* c00004 -> c00007 */
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
INPUT_PORTS_END
/***************************************************************************
Tengai
***************************************************************************/
static INPUT_PORTS_START( tengai )
PORT_INCLUDE(psikyo_common)
PORT_MODIFY("P1_P2") /* c00000 -> c00003 */
PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_BIT( 0x00000004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, mcu_status_r)
PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_SERVICE_NO_TOGGLE( 0x00000020, IP_ACTIVE_LOW )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(psikyo_state, z80_nmi_r) // From Sound CPU
PORT_BIT( 0x0000ff00, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_MODIFY("DSW") /* c00004 -> c00007 */
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 World
0 1 1 1 USA & Canada
1 0 1 1 Korea
1 1 0 1 Hong Kong
1 1 1 0 Taiwan
************************************************/
PORT_CONFNAME( 0x0000000f, 0x0000000f, DEF_STR( Region ) )
PORT_CONFSETTING( 0x0000000f, DEF_STR( World ) )
PORT_CONFSETTING( 0x0000000e, "USA & Canada" )
PORT_CONFSETTING( 0x0000000d, DEF_STR( Korea ) )
PORT_CONFSETTING( 0x0000000b, DEF_STR( Hong_Kong ) )
PORT_CONFSETTING( 0x00000007, DEF_STR( Taiwan ) )
PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // vblank
PORT_BIT( 0x00000100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00000400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
PORT_BIT( 0x00000800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00001000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00002000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00004000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x00008000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // tested!
PORT_DIPNAME( 0x00400000, 0x00400000, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00400000, "600K" )
PORT_DIPSETTING( 0x00000000, "800K" )
INPUT_PORTS_END
static INPUT_PORTS_START( tengaij )
PORT_INCLUDE( tengai )
PORT_MODIFY("DSW")
/***********************************************
This Dip port is bit based:
Bit 0 1 2 3
1 1 1 1 Japan, anything but 0x0f = "World"
Text for other regions is present though.
************************************************/
PORT_CONFNAME( 0x0000000f, 0x0000000f, DEF_STR( Region ) )
PORT_CONFSETTING( 0x0000000f, DEF_STR( Japan ) )
PORT_CONFSETTING( 0x0000000e, DEF_STR( World ) )
INPUT_PORTS_END
/***************************************************************************
Gfx Layouts
***************************************************************************/
static GFXDECODE_START( gfx_psikyo )
GFXDECODE_ENTRY( "gfx1", 0, gfx_16x16x4_packed_msb, 0x000, 0x20 ) // [0] Sprites
GFXDECODE_ENTRY( "gfx2", 0, gfx_16x16x4_packed_msb, 0x800, 0x48 ) // [1] Layer 0 + 1
GFXDECODE_END