/
kaneko16.cpp
4480 lines (3605 loc) · 225 KB
/
kaneko16.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, David Haywood
/***************************************************************************
-= Kaneko 16 Bit Games =-
driver by Luca Elia (l.elia@tin.it)
CPU : 68000 + MCU [Optional]
SOUND : OKI-M6295 x (1 | 2) + YM2149 x (0 | 2)
OR : Z80 + YM2151
OTHER : 93C46 EEPROM [Optional]
CUSTOM : VU-001 046A (48pin PQFP)
VU-002 052 151021 (160pin PQFP) <- Sprites
VU-003 048 XJ009 (x3) (40pin) <- High Colour Background
VIEW2-CHIP 23160-509 9047EAI (144pin PQFP) <- Tilemaps
MUX2-CHIP (64pin PQFP)
HELP1-CHIP (64pin PQFP)
IU-001 9045KP002 (44pin PQFP)
I/O JAMMA MC-8282 047 (46pin) <- Inputs
----------------------------------------------------------------------------------------
Year + Game PCB Notes
----------------------------------------------------------------------------------------
91 The Berlin Wall BW-002 3 x VU-003 (encrypted high colour background)
Magical Crystals Z00FC-02
92 Bakuretsu Breaker ZOOFC-02
Blaze On Z02AT-002 2 x VU-002 Sprites Chips (Atlus PCB ID: ATL-67140)
Shogun Warriors ZO1DK-002 CALC3 MCU protection (EEPROM handling, 68k code snippet, data - palettes, tilemaps, fighters)
B.Rap Boys ZO1DK-002 CALC3 MCU protection (EEPROM handling, 68k code snippet, data - palettes, tilemaps, fighters)
93 Wing Force (prototype) Z08AT-001 2 x VU-002 Sprites Chips, OKI sound
94 Great 1000 Miles Rally Z09AF-005 TBSOP01 MCU protection (EEPROM handling etc.)
Bonk's Adventure Z09AF-003 TBSOP01 MCU protection (EEPROM handling, 68k code snippet, data)
Blood Warrior Z09AF-005 TBSOP01 MCU protection (EEPROM handling etc.)
Pack'n Bang Bang BW-002 (prototype)
95 Great 1000 Miles Rally 2 M201F00138 TBSOP02 MCU protection (EEPROM handling etc.)
----------------------------------------------------------------------------------------
Note: gtmr manual shows "Compatible with AX Kaneko System Board"
Note: Magic Crystals reports "TOYBOX SYSTEM Version 0.93B+"
Note: Decapping shows the CALC3 MCU to be a NEC uPD78322 series MCU with 16K internal ROM. Both the
TBSOP01 and TBSOP02 are thought to be the NEC uPD78324 series MCU with 32K internal ROM.
To Do:
[gtmr]
- Stage 4: The layers' scrolling is very jerky for a couple of seconds
in the middle of this level (probably interrupt related)
- The layers' colours are not initialised when showing the self test
screen and the very first screen (with the Kaneko logo in the middle).
They're probably supposed to be disabled in those occasions, but the
relevant registers aren't changed throughout the game (?)
[gtmr2]
- Finish the Inputs (different wheels and pedals);
- Implement LAN comms;
- Selecting Italian in the service mode settings causes no voice samples being played
(with lots of OKI invalid samples in logerror), sound bank bug or btanb?
[brapboys / shogwarr]
- Verify collision protection on real hardware (appears to be a function of the system/memory controller, NOT the MCU)
- currently B.Rap Boys has it's own special case, it should work with the same code as Blood Warriors / Shogun Warriors (and probably SuperNova)
- Figure out how MCU resets writeback address (currently hacked)
- Find relationship between Key tables and final datablock
- Clean up debug code file writes etc. (when above are done only!)
- Interrupt timing? (some sprites flicker) - some sprite flicker exists in youtube videos too, so probably not a bug
- Sprite buffering (1-2 frames?, or related to above) - some bg objects with sprite parts break up in shogun
Dip locations verified from manual for:
- berlwall
- mgcrystl
- blazeon
- bakubrkr
- bloodwar
- gtmr
- gtmr2
- shogwarr
[general]
- interrupt timing/behaviour
Non-Bugs (happen on real PCB)
[packbang]
- Game crashes or gives you a corrupt stage if you attempt to continue on a bonus stage (due to buggy prototype code)
- Background fading appears inverted, fading to a black screen during levels, this is correct
- Some screens shown on the flyer (enemy select etc.) are never shown, the flyer probably shows a different version
of the game. The backgrounds used can be viewed in test mode.
***************************************************************************/
#include "emu.h"
#include "kaneko16.h"
#include "speaker.h"
/***************************************************************************
Machine Initialisation
***************************************************************************/
MACHINE_RESET_MEMBER(kaneko16_state,gtmr)
{
m_VIEW2_2_pri = 1;
}
MACHINE_RESET_MEMBER(kaneko16_state,mgcrystl)
{
m_VIEW2_2_pri = 0;
}
/***************************************************************************
Misc Machine Emulation Routines
***************************************************************************/
void kaneko16_state::coin_lockout_w(u8 data)
{
machine().bookkeeping().coin_counter_w(0, BIT( data, 0));
machine().bookkeeping().coin_counter_w(1, BIT( data, 1));
machine().bookkeeping().coin_lockout_w(0, BIT(~data, 2));
machine().bookkeeping().coin_lockout_w(1, BIT(~data, 3));
}
void kaneko16_state::bloodwar_coin_lockout_w(u8 data)
{
machine().bookkeeping().coin_counter_w(0, BIT(data, 0));
machine().bookkeeping().coin_counter_w(1, BIT(data, 1));
machine().bookkeeping().coin_lockout_w(0, BIT(data, 7));
machine().bookkeeping().coin_lockout_w(1, BIT(data, 7));
}
/***************************************************************************
Sound
***************************************************************************/
/* Two identically mapped YM2149 chips */
template<unsigned Chip>
u16 kaneko16_state::ym2149_r(offs_t offset)
{
/* Each 2149 register is mapped to a different address */
m_ym2149[Chip]->address_w(offset);
return m_ym2149[Chip]->data_r();
}
template<unsigned Chip>
void kaneko16_state::ym2149_w(offs_t offset, u16 data, u16 mem_mask)
{
/* Each 2149 register is mapped to a different address */
m_ym2149[Chip]->address_w(offset);
/* The registers are mapped to odd addresses, except one! */
if (ACCESSING_BITS_0_7) m_ym2149[Chip]->data_w( data & 0xff);
else m_ym2149[Chip]->data_w((data >> 8) & 0xff);
}
template<unsigned Mask>
void kaneko16_state::oki_bank0_w(u8 data)
{
m_okibank[0]->set_entry(data & Mask);
// logerror("%s:Selecting OKI1 bank %02X\n",machine().describe_context(),data&0xff);
}
template<unsigned Mask>
void kaneko16_state::oki_bank1_w(u8 data)
{
m_okibank[1]->set_entry(data & Mask);
// logerror("%s:Selecting OKI2 bank %02X\n",machine().describe_context(),data&0xff);
}
/***************************************************************************
EEPROM
***************************************************************************/
void kaneko16_state::eeprom_w(u8 data)
{
m_eepromout_port->write(data, 0xff);
}
u8 kaneko16_state::eeprom_r()
{
return m_eeprom->do_read();
}
void kaneko16_state::eeprom_cs_w(u8 data)
{
m_eeprom->cs_write(data);
}
/***************************************************************************
Memory Maps - Main CPU
***************************************************************************/
/***************************************************************************
The Berlin Wall
***************************************************************************/
void kaneko16_berlwall_state::berlwall_oki_w(offs_t offset, u16 data, u16 mem_mask)
{
if (mem_mask == 0xff00) // reads / writes to the upper byte only appear to act as a mirror to the lower byte, 16-bit reads/writes only access the lower byte.
{
data >>= 8;
mem_mask >>= 8;
}
m_oki[0]->write(data);
}
u16 kaneko16_berlwall_state::berlwall_spriteram_r(offs_t offset)
{
offset = bitswap<16>(offset, 15, 14, 13, 12, 2, 11, 10, 9, 8, 7, 6, 5, 4, 3, 1, 0);
offset ^= 0x800;
return m_spriteram->live()[offset];
}
void kaneko16_berlwall_state::berlwall_spriteram_w(offs_t offset, u16 data, u16 mem_mask)
{
offset = bitswap<16>(offset, 15, 14, 13, 12, 2, 11, 10, 9, 8, 7, 6, 5, 4, 3, 1, 0);
offset ^= 0x800;
COMBINE_DATA(&m_spriteram->live()[offset]);
}
u16 kaneko16_berlwall_state::berlwall_spriteregs_r(offs_t offset)
{
if (offset & 0x4)
return 0;
offset = bitswap<8>(offset, 7, 6, 5, 2, 4, 3, 1, 0);
return m_kaneko_spr->regs_r(offset);
}
void kaneko16_berlwall_state::berlwall_spriteregs_w(offs_t offset, u16 data, u16 mem_mask)
{
if (offset & 0x4)
return;
offset = bitswap<8>(offset, 7, 6, 5, 2, 4, 3, 1, 0);
m_kaneko_spr->regs_w(offset, data, mem_mask);
}
void kaneko16_berlwall_state::berlwall_map(address_map &map)
{
map(0x000000, 0x03ffff).rom(); // ROM
map(0x200000, 0x20ffff).ram(); // Work RAM
map(0x30e000, 0x30ffff).rw(FUNC(kaneko16_berlwall_state::berlwall_spriteram_r), FUNC(kaneko16_berlwall_state::berlwall_spriteram_w)).share("spriteram"); // Sprites (scrambled RAM)
map(0x400000, 0x400fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x480000, 0x480001).ram().share("bg15_scroll"); // High Color Background
map(0x500001, 0x500001).rw(FUNC(kaneko16_berlwall_state::bg15_bright_r), FUNC(kaneko16_berlwall_state::bg15_bright_w)); // ""
map(0x580001, 0x580001).rw(FUNC(kaneko16_berlwall_state::bg15_select_r), FUNC(kaneko16_berlwall_state::bg15_select_w)); // ""
map(0x600000, 0x60003f).rw(FUNC(kaneko16_berlwall_state::berlwall_spriteregs_r), FUNC(kaneko16_berlwall_state::berlwall_spriteregs_w)); // Sprite Regs (scrambled RAM)
map(0x680000, 0x680001).portr("P1");
map(0x680002, 0x680003).portr("P2");
map(0x680004, 0x680005).portr("SYSTEM");
// map(0x680006, 0x680007).portr("UNK");
map(0x700000, 0x700000).w(FUNC(kaneko16_berlwall_state::coin_lockout_w)); // Coin Lockout
map(0x780000, 0x780001).r(m_watchdog, FUNC(watchdog_timer_device::reset16_r));
map(0x800000, 0x80001f).rw(FUNC(kaneko16_berlwall_state::ym2149_r<0>), FUNC(kaneko16_berlwall_state::ym2149_w<0>)); // Sound
map(0x800200, 0x80021f).rw(FUNC(kaneko16_berlwall_state::ym2149_r<1>), FUNC(kaneko16_berlwall_state::ym2149_w<1>));
map(0x8003fe, 0x8003ff).noprw(); // for OKI when accessed as .l
map(0x800400, 0x800401).r(m_oki[0], FUNC(okim6295_device::read)).w(FUNC(kaneko16_berlwall_state::berlwall_oki_w));
map(0xc00000, 0xc03fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0xd00000, 0xd0001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
}
/***************************************************************************
Bakuretsu Breaker
***************************************************************************/
/* Two un-assigned OKI samples get requested during game play. Leftover bug? */
/* The two YM2149 chips are only used when entering high score initials, and */
/* when the game is fully completed. Overkill??? */
void kaneko16_state::bakubrkr_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // Work RAM
map(0x400000, 0x40001f).rw(FUNC(kaneko16_state::ym2149_r<0>), FUNC(kaneko16_state::ym2149_w<0>)); // Sound
map(0x400200, 0x40021f).rw(FUNC(kaneko16_state::ym2149_r<1>), FUNC(kaneko16_state::ym2149_w<1>)); // Sound
map(0x400401, 0x400401).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //
map(0x500000, 0x503fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x600000, 0x601fff).ram().share("spriteram"); // Sprites
map(0x700000, 0x700fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0xa80000, 0xa80001).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0xb00000, 0xb0001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0xd00000, 0xd00000).w(FUNC(kaneko16_state::bloodwar_coin_lockout_w)); // Coin Lockout
map(0xd00001, 0xd00001).w(FUNC(kaneko16_state::eeprom_w)); // EEPROM
map(0xe00000, 0xe00001).portr("P1");
map(0xe00002, 0xe00003).portr("P2");
map(0xe00004, 0xe00005).portr("SYSTEM");
map(0xe00006, 0xe00007).portr("UNK");
}
/***************************************************************************
Blaze On
***************************************************************************/
void kaneko16_state::blazeon_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x300000, 0x30ffff).ram(); // Work RAM
map(0x500000, 0x500fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x600000, 0x603fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x700000, 0x700fff).ram().share("spriteram"); // Sprites
map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0x980000, 0x98001f).ram(); // Sprites Regs #2
map(0xc00000, 0xc00001).portr("DSW2_P1");
map(0xc00002, 0xc00003).portr("DSW1_P2");
map(0xc00004, 0xc00005).portr("UNK");
map(0xc00006, 0xc00007).portr("SYSTEM");
map(0xd00000, 0xd00000).w(FUNC(kaneko16_state::coin_lockout_w)); // Coin Lockout
map(0xe00000, 0xe00001).nopr(); // Read = IRQ Ack ?
map(0xe00000, 0xe00000).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0xe40000, 0xe40001).nopr(); // IRQ Ack ?
// map(0xe80000, 0xe80001).nopr(); // IRQ Ack ?
map(0xec0000, 0xec0001).nopr(); // Lev 4 IRQ Ack ?
}
/***************************************************************************
Blood Warrior
***************************************************************************/
void kaneko16_gtmr_state::bloodwar_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // Work RAM
map(0x200000, 0x20ffff).ram().share("mcuram");
map(0x2a0000, 0x2a0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com0_w)); // To MCU ?
map(0x2b0000, 0x2b0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com1_w));
map(0x2c0000, 0x2c0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com2_w));
map(0x2d0000, 0x2d0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com3_w));
map(0x300000, 0x30ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x400000, 0x401fff).ram().share("spriteram"); // Sprites
map(0x500000, 0x503fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x600000, 0x60001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0x800001, 0x800001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x880001, 0x880001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x900000, 0x900039).rw(m_kaneko_hit, FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w));
map(0xa00000, 0xa00001).rw(m_watchdog, FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w));
map(0xb00000, 0xb00001).portr("P1");
map(0xb00002, 0xb00003).portr("P2");
map(0xb00004, 0xb00005).portr("SYSTEM");
map(0xb00006, 0xb00007).portr("EXTRA");
map(0xb80000, 0xb80000).w(FUNC(kaneko16_gtmr_state::bloodwar_coin_lockout_w)); // Coin Lockout
map(0xc00000, 0xc00001).w(FUNC(kaneko16_gtmr_state::display_enable_w));
map(0xd00000, 0xd00001).r(m_toybox, FUNC(kaneko_toybox_device::mcu_status_r));
map(0xe00001, 0xe00001).w(FUNC(kaneko16_gtmr_state::oki_bank0_w<0xf>));
map(0xe80001, 0xe80001).w(FUNC(kaneko16_gtmr_state::oki_bank1_w<0x3>));
}
/***************************************************************************
Bonk's Adventure
***************************************************************************/
void kaneko16_gtmr_state::bonkadv_map(address_map &map)
{
map(0x000000, 0x0fffff).rom(); // ROM
map(0x100000, 0x10ffff).ram(); // Work RAM
map(0x200000, 0x20ffff).ram().share("mcuram"); // Shared With MCU
map(0x2a0000, 0x2a0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com0_w)); // To MCU ?
map(0x2b0000, 0x2b0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com1_w));
map(0x2c0000, 0x2c0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com2_w));
map(0x2d0000, 0x2d0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com3_w));
map(0x300000, 0x30ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x400000, 0x401fff).ram().share("spriteram"); // Sprites
map(0x500000, 0x503fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x600000, 0x60001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0x800001, 0x800001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x880001, 0x880001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x900000, 0x900015).rw(m_kaneko_hit, FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w));
map(0xa00000, 0xa00001).rw(m_watchdog, FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0xb00000, 0xb00001).portr("P1");
map(0xb00002, 0xb00003).portr("P2");
map(0xb00004, 0xb00005).portr("SYSTEM");
map(0xb00006, 0xb00007).portr("UNK");
map(0xb80000, 0xb80000).w(FUNC(kaneko16_gtmr_state::bloodwar_coin_lockout_w)); // Coin Lockout
map(0xc00000, 0xc00001).w(FUNC(kaneko16_gtmr_state::display_enable_w));
map(0xd00000, 0xd00001).r(m_toybox, FUNC(kaneko_toybox_device::mcu_status_r));
map(0xe00001, 0xe00001).w(FUNC(kaneko16_gtmr_state::oki_bank0_w<0xf>));
map(0xe80001, 0xe80001).w(FUNC(kaneko16_gtmr_state::oki_bank1_w<0xf>));
}
/***************************************************************************
Great 1000 Miles Rally
***************************************************************************/
u16 kaneko16_gtmr_state::gtmr_wheel_r()
{
// check 'Controls' dip switch
switch (m_dsw_port->read() & 0x1000)
{
case 0x0000: // 'Both Sides' = 270deg Wheel
return (m_wheel_port[0]->read());
case 0x1000: // '1P Side' = 360' Wheel
return (m_wheel_port[1]->read());
default:
return (0);
}
}
void kaneko16_gtmr_state::gtmr_map(address_map &map)
{
map(0x000000, 0x0ffffd).rom(); // ROM
map(0x0ffffe, 0x0fffff).r(FUNC(kaneko16_gtmr_state::gtmr_wheel_r)); // Wheel Value
map(0x100000, 0x10ffff).ram(); // Work RAM
map(0x200000, 0x20ffff).ram().share(m_mcuram); // Shared With MCU
map(0x2a0000, 0x2a0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com0_w)); // To MCU ?
map(0x2b0000, 0x2b0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com1_w));
map(0x2c0000, 0x2c0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com2_w));
map(0x2d0000, 0x2d0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com3_w));
map(0x300000, 0x30ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x310000, 0x327fff).ram(); //
map(0x400000, 0x401fff).ram().share("spriteram"); // Sprites
map(0x500000, 0x503fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x600000, 0x60000f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0x800001, 0x800001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Samples
map(0x880001, 0x880001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x900000, 0x900039).rw(m_kaneko_hit, FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); // only used for random number
map(0xa00000, 0xa00001).rw(m_watchdog, FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w));
map(0xb00000, 0xb00001).portr("P1");
map(0xb00002, 0xb00003).portr("P2");
map(0xb00004, 0xb00005).portr("SYSTEM");
map(0xb00006, 0xb00007).portr("UNK");
map(0xb80000, 0xb80000).w(FUNC(kaneko16_gtmr_state::coin_lockout_w)); // Coin Lockout
map(0xc00000, 0xc00001).w(FUNC(kaneko16_gtmr_state::display_enable_w)); // might do more than that
map(0xd00000, 0xd00001).r(m_toybox, FUNC(kaneko_toybox_device::mcu_status_r));
map(0xe00001, 0xe00001).w(FUNC(kaneko16_gtmr_state::oki_bank0_w<0xf>)); // Samples Bankswitching
map(0xe80001, 0xe80001).w(FUNC(kaneko16_gtmr_state::oki_bank1_w<0x1>));
}
/***************************************************************************
Great 1000 Miles Rally 2
***************************************************************************/
u16 kaneko16_gtmr_state::gtmr2_wheel_r()
{
switch (m_dsw_port->read() & 0x1800)
{
case 0x0000: // 270' A. Wheel
return (m_wheel_port[0]->read());
case 0x1000: // 270' D. Wheel
return (m_wheel_port[1]->read() << 8);
case 0x0800: // 360' Wheel
return (m_wheel_port[2]->read() << 8);
default:
logerror("gtmr2_wheel_r : read at %06x with joystick\n", m_maincpu->pc());
return (~0);
}
}
u16 kaneko16_gtmr_state::gtmr2_IN1_r()
{
return (m_p2_port->read() & (m_fake_port->read() | ~0x7100));
}
void kaneko16_gtmr_state::gtmr2_map(address_map &map)
{
map(0x000000, 0x0ffffd).rom(); // ROM
map(0x0ffffe, 0x0fffff).r(FUNC(kaneko16_gtmr_state::gtmr2_wheel_r)); // Wheel Value
map(0x100000, 0x10ffff).ram(); // Work RAM
map(0x200000, 0x20ffff).ram().share(m_mcuram); // Shared With MCU
map(0x2a0000, 0x2a0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com0_w)); // To MCU ?
map(0x2b0000, 0x2b0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com1_w));
map(0x2c0000, 0x2c0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com2_w));
map(0x2d0000, 0x2d0001).w(m_toybox, FUNC(kaneko_toybox_device::mcu_com3_w));
map(0x300000, 0x30ffff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x310000, 0x327fff).ram(); //
map(0x400000, 0x401fff).ram().share("spriteram"); // Sprites
map(0x500000, 0x503fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x580000, 0x583fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x600000, 0x60000f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x680000, 0x68001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x700000, 0x70001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0x800001, 0x800001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Samples
map(0x880001, 0x880001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x900000, 0x900039).rw(m_kaneko_hit, FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w)); // only used for random number
map(0xa00000, 0xa00001).rw(m_watchdog, FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w)); // Watchdog
map(0xb00000, 0xb00001).portr("P1");
// map(0xb00002, 0xb00003).portr("P2");
map(0xb00002, 0xb00003).r(FUNC(kaneko16_gtmr_state::gtmr2_IN1_r));
map(0xb00004, 0xb00005).portr("SYSTEM");
map(0xb00006, 0xb00007).portr("EXTRA");
map(0xb80000, 0xb80000).w(FUNC(kaneko16_gtmr_state::coin_lockout_w)); // Coin Lockout
map(0xc00000, 0xc00001).w(FUNC(kaneko16_gtmr_state::display_enable_w)); // might do more than that
map(0xd00000, 0xd00001).r(m_toybox, FUNC(kaneko_toybox_device::mcu_status_r));
map(0xe00001, 0xe00001).w(FUNC(kaneko16_gtmr_state::oki_bank0_w<0xf>)); // Samples Bankswitching
map(0xe80001, 0xe80001).w(FUNC(kaneko16_gtmr_state::oki_bank1_w<0x1>));
}
/***************************************************************************
Magical Crystal
***************************************************************************/
void kaneko16_state::mgcrystl_map(address_map &map)
{
map(0x000000, 0x07ffff).rom(); // ROM
map(0x300000, 0x30ffff).ram(); // Work RAM
map(0x400000, 0x40001f).rw(FUNC(kaneko16_state::ym2149_r<0>), FUNC(kaneko16_state::ym2149_w<0>)); // Sound
map(0x400200, 0x40021f).rw(FUNC(kaneko16_state::ym2149_r<1>), FUNC(kaneko16_state::ym2149_w<1>));
map(0x400401, 0x400401).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x500000, 0x500fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x600000, 0x603fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x680000, 0x683fff).m(m_view2[1], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x700000, 0x701fff).ram().share("spriteram"); // Sprites
map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0xb00000, 0xb0001f).rw(m_view2[1], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0xa00000, 0xa00001).r(m_watchdog, FUNC(watchdog_timer_device::reset16_r)); // Watchdog
map(0xc00000, 0xc00001).portr("DSW_P1");
map(0xc00002, 0xc00003).portr("P2");
map(0xc00004, 0xc00005).portr("SYSTEM");
map(0xd00000, 0xd00000).w(FUNC(kaneko16_state::bloodwar_coin_lockout_w)); // Coin Lockout
map(0xd00001, 0xd00001).w(FUNC(kaneko16_state::eeprom_w)); // EEPROM
}
/***************************************************************************
Shogun Warriors
***************************************************************************/
void kaneko16_shogwarr_state::shogwarr_oki_bank_w(u8 data)
{
m_okibank[0]->set_entry((data >> 4) & 0xf);
m_okibank[1]->set_entry((data & 0xf));
}
void kaneko16_shogwarr_state::shogwarr_map(address_map &map)
{
map(0x000000, 0x03ffff).rom(); // ROM
map(0x100000, 0x10ffff).ram().share(m_mainram); // Work RAM
map(0x200000, 0x20ffff).ram().share(m_mcuram);
map(0x280000, 0x280001).w(m_calc3_prot, FUNC(kaneko_calc3_device::mcu_com0_w));
map(0x290000, 0x290001).w(m_calc3_prot, FUNC(kaneko_calc3_device::mcu_com1_w));
map(0x2b0000, 0x2b0001).w(m_calc3_prot, FUNC(kaneko_calc3_device::mcu_com2_w));
//map(0x2c0000, 0x2c0001) // run calc 3? or irq ack?
map(0x2d0000, 0x2d0001).w(m_calc3_prot, FUNC(kaneko_calc3_device::mcu_com3_w));
map(0x380000, 0x380fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette
map(0x400001, 0x400001).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Samples
map(0x480001, 0x480001).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x580000, 0x581fff).ram().share("spriteram"); // Sprites
map(0x600000, 0x603fff).m(m_view2[0], FUNC(kaneko_view2_tilemap_device::vram_map));
map(0x800000, 0x80001f).rw(m_view2[0], FUNC(kaneko_view2_tilemap_device::regs_r), FUNC(kaneko_view2_tilemap_device::regs_w));
map(0x900000, 0x90001f).rw(m_kaneko_spr, FUNC(kaneko16_sprite_device::regs_r), FUNC(kaneko16_sprite_device::regs_w));
map(0xa00000, 0xa0007f).rw(m_kaneko_hit, FUNC(kaneko_hit_device::kaneko_hit_r), FUNC(kaneko_hit_device::kaneko_hit_w));
map(0xa80000, 0xa80001).rw(m_watchdog, FUNC(watchdog_timer_device::reset16_r), FUNC(watchdog_timer_device::reset16_w));
map(0xb80000, 0xb80001).portr("P1");
map(0xb80002, 0xb80003).portr("P2");
map(0xb80004, 0xb80005).portr("SYSTEM");
map(0xb80006, 0xb80007).portr("UNK");
map(0xd00000, 0xd00001).noprw(); // ? (bit 0)
map(0xe00001, 0xe00001).w(FUNC(kaneko16_shogwarr_state::shogwarr_oki_bank_w)); // Samples Bankswitching
}
/***************************************************************************
Memory Maps - Sound CPU
***************************************************************************/
/***************************************************************************
Blaze On
***************************************************************************/
void kaneko16_state::blazeon_soundmem(address_map &map)
{
map(0x0000, 0x7fff).rom(); // ROM
map(0x8000, 0xbfff).rom(); // ROM (supposed to be banked?)
map(0xc000, 0xdfff).ram(); // RAM
//map(0xe000, 0xe001).noprw(); // Unknown read / writes in boot
}
void kaneko16_state::blazeon_soundport(address_map &map)
{
map.global_mask(0xff);
map(0x02, 0x03).rw(m_ymsnd, FUNC(ym2151_device::read), FUNC(ym2151_device::write));
map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
/***************************************************************************
Wing Force
***************************************************************************/
void kaneko16_state::wingforc_soundport(address_map &map)
{
map.global_mask(0xff);
// map(0x00, 0x00) // 02 written at boot
map(0x02, 0x03).rw(m_ymsnd, FUNC(ym2151_device::read), FUNC(ym2151_device::write));
map(0x06, 0x06).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0x0a, 0x0a).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0x0c, 0x0c).w(FUNC(kaneko16_state::oki_bank0_w<0x3>));
}
/***************************************************************************
Input Ports
***************************************************************************/
/***************************************************************************
Bakuretsu Breaker
***************************************************************************/
static INPUT_PORTS_START( bakubrkr )
PORT_START("P1") /* e00000.w */
PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x0001, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0000, DEF_STR( On ) )
PORT_SERVICE_DIPLOC( 0x0002, IP_ACTIVE_LOW, "SW1:2" )
/* All other game settings done through the test mode */
PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" ) /* Listed as "Unused" */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P2") /* e00002.b */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SYSTEM") /* e00004.b */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT ) // pause
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("UNK") /* Seems unused ! - e00006.b */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START( "EEPROMOUT" )
PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, clk_write)
PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_WRITE_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, di_write)
INPUT_PORTS_END
/***************************************************************************
The Berlin Wall
***************************************************************************/
static INPUT_PORTS_START( berlwall )
PORT_START("P1") /* 680000.w */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(1)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("P2") /* 680002.w */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("SYSTEM") /* 680000.w */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
PORT_SERVICE_NO_TOGGLE( 0x1000, IP_ACTIVE_LOW )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("UNK") /* ? - 680006.w */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("DSW1") /*$200018.b <- ! $80001d.b */
PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x01, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "SW1:2" ) /* Listed as "Unused" */
PORT_DIPNAME( 0x1c, 0x1c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,4,5")
PORT_DIPSETTING( 0x00, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x1c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x08, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x18, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x14, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x10, DEF_STR( 1C_4C ) )
PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:6,7,8")
PORT_DIPSETTING( 0x60, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0xe0, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x40, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0xc0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0xa0, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x80, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x20, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 1C_6C ) )
PORT_START("DSW2") /* $200019.b <- $80001f.b */
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x02, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x03, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x01, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4") // 1p lives at 202982.b
PORT_DIPSETTING( 0x08, "2" )
PORT_DIPSETTING( 0x0c, "3" )
PORT_DIPSETTING( 0x04, "5" )
PORT_DIPSETTING( 0x00, "7" )
PORT_DIPNAME( 0x30, 0x30, "Country" ) PORT_DIPLOCATION("SW2:5,6")
PORT_DIPSETTING( 0x30, "England" )
PORT_DIPSETTING( 0x20, "Italy" )
PORT_DIPSETTING( 0x10, "Germany" )
PORT_DIPSETTING( 0x00, "Freeze Screen" )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:7")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_SERVICE_DIPLOC(0x80, IP_ACTIVE_LOW, "SW2:8" )
INPUT_PORTS_END
/***************************************************************************
The Berlin Wall (bootleg ?)
***************************************************************************/
// Same as berlwall, but for a different lives setting
static INPUT_PORTS_START( berlwallt )
PORT_INCLUDE(berlwall)
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x00, "1" )
PORT_DIPSETTING( 0x0c, "2" )
PORT_DIPSETTING( 0x08, "3" )
PORT_DIPSETTING( 0x04, "5" )
INPUT_PORTS_END
/***************************************************************************
The Berlin Wall (Korea)
***************************************************************************/
// Same as berlwallt, but no country setting
static INPUT_PORTS_START( berlwallk )
PORT_INCLUDE(berlwallt)
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x30, 0x30, "Pause Mode" ) PORT_DIPLOCATION("SW2:5,6")
PORT_DIPSETTING( 0x30, "Off (1)" )
PORT_DIPSETTING( 0x20, "Off (2)" )
PORT_DIPSETTING( 0x10, "Off (3)" )
PORT_DIPSETTING( 0x00, "Freeze Screen" )
INPUT_PORTS_END
/***************************************************************************
Blaze On
***************************************************************************/
static INPUT_PORTS_START( blazeon )
PORT_START("DSW2_P1") /* c00000.w */
PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2")
PORT_DIPSETTING( 0x0002, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x0003, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x0001, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x000c, 0x000c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:3,4")
PORT_DIPSETTING( 0x0000, "2" )
PORT_DIPSETTING( 0x000c, "3" )
PORT_DIPSETTING( 0x0008, "4" )
PORT_DIPSETTING( 0x0004, "5" )
PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:5")
PORT_DIPSETTING( 0x0000, DEF_STR( Off ) )
PORT_DIPSETTING( 0x0010, DEF_STR( On ) )
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" ) /* Listed as "Unused" */
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" ) /* Listed as "Unused" */
PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW2:8" )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
PORT_START("DSW1_P2") /* c00002.w */
PORT_DIPNAME( 0x000f, 0x000f, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
PORT_DIPSETTING( 0x0007, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0008, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0005, "6 Coins/3 Credits" )
PORT_DIPSETTING( 0x0009, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0004, DEF_STR( 4C_3C ) )
PORT_DIPSETTING( 0x000f, DEF_STR( 1C_1C ) )
// PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0003, "5 Coins/6 Credits" )
PORT_DIPSETTING( 0x0002, DEF_STR( 4C_5C ) )
PORT_DIPSETTING( 0x0006, DEF_STR( 2C_3C ) )
// PORT_DIPSETTING( 0x0001, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x000e, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x000d, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x000c, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x000b, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x000a, DEF_STR( 1C_6C ) )
PORT_DIPNAME( 0x00f0, 0x00f0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:5,6,7,8")
PORT_DIPSETTING( 0x0070, DEF_STR( 4C_1C ) )
PORT_DIPSETTING( 0x0080, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x0050, "6 Coins/3 Credits" )
PORT_DIPSETTING( 0x0090, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0040, DEF_STR( 4C_3C ) )
PORT_DIPSETTING( 0x00f0, DEF_STR( 1C_1C ) )
// PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x0030, "5 Coins/6 Credits" )
PORT_DIPSETTING( 0x0020, DEF_STR( 4C_5C ) )
PORT_DIPSETTING( 0x0060, DEF_STR( 2C_3C ) )
// PORT_DIPSETTING( 0x0010, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x00e0, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x00d0, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00c0, DEF_STR( 1C_4C ) )
PORT_DIPSETTING( 0x00b0, DEF_STR( 1C_5C ) )
PORT_DIPSETTING( 0x00a0, DEF_STR( 1C_6C ) )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2)
PORT_START("UNK") /* ? - c00004.w */
PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) // unused?
PORT_START("SYSTEM") /* c00006.w */
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_SERVICE_NO_TOGGLE( 0x2000, IP_ACTIVE_LOW )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_TILT )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_SERVICE1 )
INPUT_PORTS_END
/***************************************************************************
Wing Force
***************************************************************************/
static INPUT_PORTS_START( wingforc )
PORT_START("DSW2_P1") /* c00000.w */
// The game reads and stores these the same as Blaze On.
// However, none of them actually get used. Lives does work if you patch out the
// code that actively zeroes out the value it reads from here.
PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW1:1" )
PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW1:2" )
PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW1:3" )
PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW1:4" )
PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW1:5" )
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW1:6" )
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW1:7" )
PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW1:8" )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1)
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2)
PORT_START("DSW1_P2") /* c00002.w */
// In a similar story to DSW2, these are read and then forced to zero.
// These are credit selections with the same values as Blaze On.
// These work if you remove the code to force to zero, but they don't
// give any feedback unless the coin increases the credit counter.
PORT_DIPUNUSED_DIPLOC( 0x0001, 0x0001, "SW2:1" )
PORT_DIPUNUSED_DIPLOC( 0x0002, 0x0002, "SW2:2" )
PORT_DIPUNUSED_DIPLOC( 0x0004, 0x0004, "SW2:3" )
PORT_DIPUNUSED_DIPLOC( 0x0008, 0x0008, "SW2:4" )
PORT_DIPUNUSED_DIPLOC( 0x0010, 0x0010, "SW2:5" )
PORT_DIPUNUSED_DIPLOC( 0x0020, 0x0020, "SW2:6" )
PORT_DIPUNUSED_DIPLOC( 0x0040, 0x0040, "SW2:7" )
PORT_DIPUNUSED_DIPLOC( 0x0080, 0x0080, "SW2:8" )
PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)