/
fcrash.cpp
2360 lines (2032 loc) · 104 KB
/
fcrash.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:David Haywood
/* Final Crash & other CPS1 bootlegs */
/*
A note regarding other bootlegs:
In order to keep the cps source in some sort of order, the idea is to group similar bootleg hardware into separate
derived classes and source files.
Rom swaps, hacks etc. (on original Capcom hardware) -> cps1.cpp
Sound: Z80, 2x YM2203, 2x m5205 ("Final Crash" h/w) -> fcrash.cpp
Sound: Z80, 1x YM2151, 2x m5205 -> cps1bl_5205.cpp
Sound: PIC, 1x M6295 *1 -> cps1bl_pic.cpp
Sound: Z80, 1x YM2151, 1x M6295 *2 -> fcrash.cpp (for now...)
*1 these seem to be only CPS1.5/Q sound games?
*2 this is original configuration, but non-Capcom (usually single-board) hardware.
As per the above, this file now only contains games in second and last catergories.
Eventually only Final Crash, other Final Fight bootlegs and Carrier Air Wing bootlegs will remain here.
*/
/*
Final Crash is a bootleg of Final Fight
Final Fight is by Capcom and runs on CPS1 hardware
The bootleg was manufactured by Playmark of Italy
this driver depends heavily on cps1.cpp, but has been
kept apart in an attempt to keep cps1.cpp clutter free
Sound is very different from CPS1.
---
Final Crash (bootleg of final fight)
1x 68k
1x z80
2x ym2203
2x oki5205
1x osc 10mhz
1x osc 24mhz
EPROMs:
1.bin sound EPROM
from 2.bin to 9.bin program EPROMs
10.bin to 25.bin graphics EPROMs
---
kodb has various graphical issues, mainly with old info not being cleared away.
Also, it should be using a vblank irq value of 4. This triggers the following bootleg read/writes;
- IN1 is read at 0x992000
- IN0 is read of 0x992008
- dips continue to be read at 0x80001a
- sound command is wrote at 0x992006
- scroll 1Y is wrote at 0x980000
- scroll 1X is wrote at 0x980002
- scroll 2Y is wrote at 0x980004
- scroll 2X is wrote at 0x980006
- scroll 3Y is wrote at 0x980008
- scroll 3X is wrote at 0x98000a
- the layer enable and layer mask writes continue at 0x98000c and 0x980020-2
These read/writes are identical to those used by a Knights of the Round bootleg which uses the all sf2mdt sound
hardware. This set is currently non-working.
This also prevents the game from toggling the sprite address at m_cps_a_regs[0], similar to other bootlegs.
Currently the game is working somewhat, but only using the code left over from the original. If anyone wants to
do any development work on the set, (eg, find the sprite clearing issue), then this should be changed as the game
likely won't write any sprite clearing values otherwise.
None of this is hooked up currently due to issues with row scroll on the scroll2 layer.
Status of each game:
--------------------
cawingb2, cawingbl: OK.
fcrash, kodb: Old sprites show on next screen. Patch used.
sf2m1: Crowd is missing. Plane's tail comes off a bit. Patch used.
wofabl: Old sprites left behind - doesn't seem to write end-of-table marker when sprite table is empty.
Priority problems - doesn't seem to write the layer mask values anywhere.
Incorrect layer ordering during attract - writes invalid layer order values to layer control reg (bits 6-13).
Glitched level 1 trees - bad data in gfx rom 12 but dump is confirmed correct. https://youtu.be/RWKhBzwH0Gk
sgyxz: Priority problems - doesn't seem to write the layer mask values anywhere. Patch used.
Missing foreground trees on level 1.
wofr1bl: Priority problems - doesn't seem to write the layer mask values anywhere.
brightness circuity present on pcb?
sgyxz no
wofabl no
wofr1bl no
others tbc... assume yes for now
*/
#include "emu.h"
#include "fcrash.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "sound/msm5205.h"
#include "sound/okim6295.h"
#include "sound/ymopm.h"
#include "sound/ymopn.h"
#include "machine/eepromser.h"
#include "speaker.h"
#define CPS1_ROWSCROLL_OFFS (0x20/2) /* base of row scroll offsets in other RAM */
#define CODE_SIZE 0x400000
void fcrash_state::fcrash_soundlatch_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_0_7)
{
m_soundlatch->write(data & 0xff);
m_audiocpu->set_input_line(0, HOLD_LINE);
}
}
void fcrash_state::fcrash_snd_bankswitch_w(uint8_t data)
{
m_msm_1->set_output_gain(0, (data & 0x08) ? 0.0 : 1.0);
m_msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0);
membank("bank1")->set_entry(data & 0x07);
}
void fcrash_state::m5205_int1(int state)
{
m_msm_1->data_w(m_sample_buffer1 & 0x0f);
m_sample_buffer1 >>= 4;
m_sample_select1 ^= 1;
if (m_sample_select1 == 0)
m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
void fcrash_state::m5205_int2(int state)
{
m_msm_2->data_w(m_sample_buffer2 & 0x0f);
m_sample_buffer2 >>= 4;
m_sample_select2 ^= 1;
}
void fcrash_state::fcrash_msm5205_0_data_w(uint8_t data)
{
m_sample_buffer1 = data;
}
void fcrash_state::fcrash_msm5205_1_data_w(uint8_t data)
{
m_sample_buffer2 = data;
}
void fcrash_state::cawingbl_soundlatch_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
if (ACCESSING_BITS_8_15)
{
m_soundlatch->write(data >> 8);
m_audiocpu->set_input_line(0, HOLD_LINE);
machine().scheduler().perfect_quantum(attotime::from_usec(50)); /* boost the interleave or some voices get dropped */
}
}
void fcrash_state::kodb_layer_w(offs_t offset, uint16_t data)
{
/* layer enable and mask 1&2 registers are written here - passing them to m_cps_b_regs for now for drawing routines */
if (offset == 0x06)
m_cps_b_regs[m_layer_enable_reg / 2] = data;
else
if (offset == 0x10)
m_cps_b_regs[m_layer_mask_reg[1] / 2] = data;
else
if (offset == 0x11)
m_cps_b_regs[m_layer_mask_reg[2] / 2] = data;
}
void fcrash_state::mtwinsb_layer_w(offs_t offset, uint16_t data)
{
m_cps_a_regs[0x06 / 2] = 0x9100; // bit of a hack - the game never writes this, but does need it
switch (offset)
{
case 0x00:
m_cps_a_regs[0x0e / 2] = data;
break;
case 0x01:
m_cps_a_regs[0x0c / 2] = data - 0x3e;
break;
case 0x02:
m_cps_a_regs[0x12 / 2] = data;
m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */
break;
case 0x03:
m_cps_a_regs[0x10 / 2] = data - 0x3c;
break;
case 0x04:
m_cps_a_regs[0x16 / 2] = data;
break;
case 0x05:
m_cps_a_regs[0x14 / 2] = data - 0x40;
break;
default:
logerror("%s: Unknown layer cmd %X %X\n",machine().describe_context(),offset<<1,data);
}
}
void fcrash_state::sf2m1_layer_w(offs_t offset, uint16_t data)
{
switch (offset)
{
case 0x00:
m_cps_a_regs[0x0e / 2] = data;
break;
case 0x01:
m_cps_a_regs[0x0c / 2] = data;
break;
case 0x02:
m_cps_a_regs[0x12 / 2] = data;
m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */
break;
case 0x03:
m_cps_a_regs[0x10 / 2] = data;
break;
case 0x04:
m_cps_a_regs[0x16 / 2] = data;
break;
case 0x05:
m_cps_a_regs[0x14 / 2] = data;
break;
case 0x06:
switch (data)
{
case 0:
data = 0x078e;
break;
case 1:
data = 0x12c0;
break;
case 2:
data = 0x06ce;
break;
case 3:
data = 0x09ce;
break;
case 4:
data = 0x12ce;
break;
case 5:
data = 0x0b4e;
break;
}
[[fallthrough]];
case 0xb3:
m_cps_b_regs[m_layer_enable_reg / 2] = data;
break;
case 0x0b:
case 0x1b:
m_cps_a_regs[0x06 / 2] = data;
break;
default:
logerror("%s: Unknown layer cmd %X %X\n",machine().describe_context(),offset<<1,data);
}
}
void fcrash_state::varthb_layer_w(offs_t offset, uint16_t data)
{
switch (offset)
{
case 0x00:
m_cps_a_regs[0x0e / 2] = data;
break;
case 0x01:
m_cps_a_regs[0x0c / 2] = data;
break;
case 0x02:
m_cps_a_regs[0x12 / 2] = data;
m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */
break;
case 0x03:
m_cps_a_regs[0x10 / 2] = data;
break;
case 0x04:
m_cps_a_regs[0x16 / 2] = data;
break;
case 0x05:
m_cps_a_regs[0x14 / 2] = data;
break;
default:
logerror("%s: Unknown layer cmd %X %X\n",machine().describe_context(),offset<<1,data);
}
}
void fcrash_state::varthb_layer2_w(uint16_t data)
{
if (data > 0x9000)
m_cps_a_regs[0x06 / 2] = data;
}
uint16_t fcrash_state::sgyxz_dsw_r(offs_t offset)
{
int in = m_sgyxz_dsw[offset]->read();
return (in << 8) | 0xff;
}
void fcrash_state::wofr1bl_layer_w(offs_t offset, uint16_t data)
{
switch (offset)
{
case 0x00:
m_cps_a_regs[0x0e / 2] = data;
break;
case 0x01:
m_cps_a_regs[0x0c / 2] = data;
break;
case 0x02:
m_cps_a_regs[0x12 / 2] = data;
m_cps_a_regs[CPS1_ROWSCROLL_OFFS] = data; /* row scroll start */
break;
case 0x03:
m_cps_a_regs[0x10 / 2] = data;
break;
case 0x04:
m_cps_a_regs[0x16 / 2] = data;
break;
case 0x05:
m_cps_a_regs[0x14 / 2] = data;
break;
case 0x06:
{
// see bootleggers routines starting at $101000
// writes values 0-f to 98000c
// how does this relate to layer control reg value?
// original game values:
// m_cps_b_regs[m_layer_enable_reg / 2] = m_mainram[0x6398 / 2];
// m_cps_b_regs[m_layer_mask_reg[1] / 2] = m_mainram[0x639a / 2];
// m_cps_b_regs[m_layer_mask_reg[2] / 2] = m_mainram[0x639c / 2];
// m_cps_b_regs[m_layer_mask_reg[3] / 2] = m_mainram[0x639e / 2];
m_cps_b_regs[0x3e / 2] = data;
switch (data)
{
case 0: // 12ce
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce; // attract lvl 1
m_cps_b_regs[m_layer_mask_reg[1] / 2] = 0x1f;
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x1ff;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x7fff;
break;
case 1: // 12c2, 12c6, 270a, 138e, 18ce
m_cps_b_regs[m_layer_enable_reg / 2] = 0x138e; // attract lvl 4
m_cps_b_regs[m_layer_mask_reg[1] / 2] = 0x3f;
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x1ff;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x7fff;
break;
case 2:
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce; // ?
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x780;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0;
break;
case 3: // 1c8e, 1c82, 1c86, 270a
m_cps_b_regs[m_layer_enable_reg / 2] = 0x1c8e; // attract lvl 2
m_cps_b_regs[m_layer_mask_reg[1] / 2] = 0x7ff;
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x780;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0;
break;
case 4:
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce; // ?
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x7fff;
break;
case 5:
break;
case 6:
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce; // ?
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x781;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x1f;
break;
case 7:
break;
case 8:
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce; // ?
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x1f;
break;
case 9:
break;
case 10:
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce; // ?
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x40ff;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x7fff;
break;
case 11:
break;
case 14: // 12ce, 1b0e
m_cps_b_regs[m_layer_enable_reg / 2] = 0x12ce;
break;
case 15: // 270a, 1e0e, 138e, 270e
m_cps_b_regs[m_layer_enable_reg / 2] = 0x138e; // attract lvl 3
m_cps_b_regs[m_layer_mask_reg[1] / 2] = 0x7fff;
m_cps_b_regs[m_layer_mask_reg[2] / 2] = 0x7fff;
m_cps_b_regs[m_layer_mask_reg[3] / 2] = 0x7fff;
break;
}
}
break;
default:
logerror("%s: Unknown layer cmd %X %X\n",machine().describe_context(),offset<<1,data);
}
}
void fcrash_state::wofr1bl_layer2_w(uint16_t data)
{
m_cps_a_regs[0x06 / 2] = data;
}
void fcrash_state::wofr1bl_spr_base_w(uint16_t data)
{
m_sprite_base = data ? 0x3000 : 0x1000;
}
void fcrash_state::fcrash(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 10000000);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::fcrash_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, 24000000/6); /* ? */
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::fcrash_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, fcrash)
MCFG_MACHINE_RESET_OVERRIDE(fcrash_state, fcrash)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(64*8, 32*8);
m_screen->set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1 );
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_fcrash));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(4096);
// sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
ym2203_device &ym1(YM2203(config, "ym1", 24000000/6)); /* ? */
ym1.add_route(0, "mono", 0.10);
ym1.add_route(1, "mono", 0.10);
ym1.add_route(2, "mono", 0.10);
ym1.add_route(3, "mono", 1.0);
ym2203_device &ym2(YM2203(config, "ym2", 24000000/6)); /* ? */
ym2.add_route(0, "mono", 0.10);
ym2.add_route(1, "mono", 0.10);
ym2.add_route(2, "mono", 0.10);
ym2.add_route(3, "mono", 1.0);
MSM5205(config, m_msm_1, 24000000/64); /* ? */
m_msm_1->vck_legacy_callback().set(FUNC(fcrash_state::m5205_int1)); /* interrupt function */
m_msm_1->set_prescaler_selector(msm5205_device::S96_4B); /* 4KHz 4-bit */
m_msm_1->add_route(ALL_OUTPUTS, "mono", 0.25);
MSM5205(config, m_msm_2, 24000000/64); /* ? */
m_msm_2->vck_legacy_callback().set(FUNC(fcrash_state::m5205_int2)); /* interrupt function */
m_msm_2->set_prescaler_selector(msm5205_device::S96_4B); /* 4KHz 4-bit */
m_msm_2->add_route(ALL_OUTPUTS, "mono", 0.25);
}
void fcrash_state::ffightblb(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 10000000);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::fcrash_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, 24000000/6); /* ? */
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::ffightblb_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, ffightblb)
MCFG_MACHINE_RESET_OVERRIDE(fcrash_state, fcrash)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(64*8, 32*8);
m_screen->set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1 );
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_fcrash));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(4096);
// sound hardware
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
OKIM6295(config, m_oki, 1000000 , okim6295_device::PIN7_HIGH);
m_oki->set_addrmap(0, &fcrash_state::ffightblb_oki_map);
m_oki->add_route(ALL_OUTPUTS, "mono", 0.30);
}
void fcrash_state::cawingbl(machine_config &config)
{
fcrash(config);
/* basic machine hardware */
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::irq6_line_hold)); /* needed to write to scroll values */
MCFG_MACHINE_START_OVERRIDE(fcrash_state, cawingbl)
}
void fcrash_state::kodb(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 10000000);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::fcrash_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, 3579545);
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::kodb_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, kodb)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(64*8, 32*8);
m_screen->set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1);
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_fcrash));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(0xc00);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
ym2151_device &ym2151(YM2151(config, "2151", XTAL(3'579'545))); /* verified on pcb */
ym2151.irq_handler().set_inputline(m_audiocpu, 0);
ym2151.add_route(0, "mono", 0.35);
ym2151.add_route(1, "mono", 0.35);
/* CPS PPU is fed by a 16mhz clock,pin 117 outputs a 4mhz clock which is divided by 4 using 2 74ls74 */
OKIM6295(config, m_oki, XTAL(16'000'000)/4/4, okim6295_device::PIN7_HIGH); // pin 7 can be changed by the game code, see f006 on z80
m_oki->add_route(ALL_OUTPUTS, "mono", 0.30);
}
void fcrash_state::mtwinsb(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 10000000);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::mtwinsb_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, 3579545);
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::sgyxz_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, mtwinsb)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(64*8, 32*8);
m_screen->set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1);
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_fcrash));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(0xc00);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, m_soundlatch2);
ym2151_device &ym2151(YM2151(config, "2151", XTAL(3'579'545)));
ym2151.irq_handler().set_inputline(m_audiocpu, 0);
ym2151.add_route(0, "mono", 0.35);
ym2151.add_route(1, "mono", 0.35);
OKIM6295(config, m_oki, XTAL(16'000'000)/4/4, okim6295_device::PIN7_HIGH);
m_oki->add_route(ALL_OUTPUTS, "mono", 0.30);
}
void fcrash_state::sf2m1(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, XTAL(12'000'000));
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::sf2m1_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, XTAL(3'579'545));
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::sgyxz_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, sf2m1)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(CPS_PIXEL_CLOCK, CPS_HTOTAL, CPS_HBEND, CPS_HBSTART, CPS_VTOTAL, CPS_VBEND, CPS_VBSTART);
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_fcrash));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(0xc00);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, m_soundlatch2);
ym2151_device &ym2151(YM2151(config, "2151", XTAL(3'579'545)));
ym2151.irq_handler().set_inputline(m_audiocpu, 0);
ym2151.add_route(0, "mono", 0.35);
ym2151.add_route(1, "mono", 0.35);
OKIM6295(config, m_oki, XTAL(16'000'000)/4/4, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.30);
}
void fcrash_state::sgyxz(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 12000000);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::sgyxz_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, 3579545);
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::sgyxz_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, sgyxz)
MCFG_MACHINE_RESET_OVERRIDE(fcrash_state, sgyxz)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(64*8, 32*8);
m_screen->set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1 );
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_fcrash));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(0xc00);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, m_soundlatch2);
ym2151_device &ym2151(YM2151(config, "2151", XTAL(3'579'545))); /* verified on pcb */
ym2151.irq_handler().set_inputline(m_audiocpu, 0);
ym2151.add_route(0, "mono", 0.35);
ym2151.add_route(1, "mono", 0.35);
/* CPS PPU is fed by a 16mhz clock,pin 117 outputs a 4mhz clock which is divided by 4 using 2 74ls74 */
OKIM6295(config, m_oki, XTAL(16'000'000)/4/4, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.30); // pin 7 can be changed by the game code, see f006 on z80
}
void fcrash_state::wofabl(machine_config &config)
{
sgyxz(config);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::wofabl_map);
}
void fcrash_state::wofr1bl(machine_config &config)
{
sgyxz(config);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::wofr1bl_map);
EEPROM_93C46_8BIT(config, "eeprom");
MCFG_MACHINE_START_OVERRIDE(fcrash_state, wofr1bl)
MCFG_MACHINE_RESET_REMOVE()
}
void fcrash_state::varthb(machine_config &config)
{
/* basic machine hardware */
M68000(config, m_maincpu, 12000000);
m_maincpu->set_addrmap(AS_PROGRAM, &fcrash_state::varthb_map);
m_maincpu->set_vblank_int("screen", FUNC(fcrash_state::cps1_interrupt));
m_maincpu->set_addrmap(m68000_base_device::AS_CPU_SPACE, &fcrash_state::cpu_space_map);
Z80(config, m_audiocpu, 3579545);
m_audiocpu->set_addrmap(AS_PROGRAM, &fcrash_state::sgyxz_sound_map);
MCFG_MACHINE_START_OVERRIDE(fcrash_state, cps1)
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_refresh_hz(60);
m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
m_screen->set_size(64*8, 32*8);
m_screen->set_visarea(8*8, (64-8)*8-1, 2*8, 30*8-1 );
m_screen->set_screen_update(FUNC(fcrash_state::screen_update_cps1));
m_screen->screen_vblank().set(FUNC(fcrash_state::screen_vblank_cps1));
m_screen->set_palette(m_palette);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_cps1);
PALETTE(config, m_palette, palette_device::BLACK).set_entries(0xc00);
/* sound hardware */
SPEAKER(config, "mono").front_center();
GENERIC_LATCH_8(config, m_soundlatch);
GENERIC_LATCH_8(config, m_soundlatch2);
ym2151_device &ym2151(YM2151(config, "2151", XTAL(3'579'545)));
ym2151.irq_handler().set_inputline(m_audiocpu, 0);
ym2151.add_route(0, "mono", 0.35);
ym2151.add_route(1, "mono", 0.35);
OKIM6295(config, m_oki, XTAL(16'000'000)/4/4, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.30);
}
void fcrash_state::fcrash_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
map(0x800030, 0x800031).w(FUNC(fcrash_state::cps1_coinctrl_w));
map(0x800100, 0x80013f).ram().share("cps_a_regs"); /* CPS-A custom */
map(0x800140, 0x80017f).ram().share("cps_b_regs"); /* CPS-B custom */
map(0x880000, 0x880001).portr("IN1"); /* Player input ports */
map(0x880006, 0x880007).w(FUNC(fcrash_state::fcrash_soundlatch_w)); /* Sound command */
map(0x880008, 0x88000f).r(FUNC(fcrash_state::cps1_dsw_r)); /* System input ports / Dip Switches */
map(0x890000, 0x890001).nopw(); // palette related?
map(0x900000, 0x92ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::mtwinsb_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
map(0x800000, 0x800001).portr("IN1");
map(0x800006, 0x800007).w(FUNC(fcrash_state::cps1_soundlatch_w));
map(0x800018, 0x80001f).r(FUNC(fcrash_state::cps1_dsw_r));
map(0x800030, 0x800037).w(FUNC(fcrash_state::cps1_coinctrl_w));
map(0x800100, 0x80013f).w(FUNC(fcrash_state::cps1_cps_a_w)).share("cps_a_regs");
map(0x800140, 0x80017f).rw(FUNC(fcrash_state::cps1_cps_b_r), FUNC(fcrash_state::cps1_cps_b_w)).share("cps_b_regs");
map(0x980000, 0x98000b).w(FUNC(fcrash_state::mtwinsb_layer_w));
map(0x900000, 0x92ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::sf2m1_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
map(0x800000, 0x800007).portr("IN1"); /* Player input ports */
map(0x800006, 0x800007).w(FUNC(fcrash_state::cps1_soundlatch_w)); /* Sound command */
map(0x800012, 0x800013).r(FUNC(fcrash_state::cps1_in2_r)); /* Buttons 4,5,6 for both players */
map(0x800018, 0x80001f).r(FUNC(fcrash_state::cps1_dsw_r)); /* System input ports / Dip Switches */
map(0x800100, 0x80013f).w(FUNC(fcrash_state::cps1_cps_a_w)).share("cps_a_regs"); /* CPS-A custom */
map(0x800140, 0x80017f).rw(FUNC(fcrash_state::cps1_cps_b_r), FUNC(fcrash_state::cps1_cps_b_w)).share("cps_b_regs");
map(0x800180, 0x800181).nopw(); // only once at boot, for 80010c
map(0x800188, 0x80018f).w(FUNC(fcrash_state::cps1_soundlatch2_w)); /* Sound timer fade */
map(0x880000, 0x880001).nopw(); // unknown
map(0x900000, 0x93ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0x980000, 0x9801ff).w(FUNC(fcrash_state::sf2m1_layer_w));
map(0x990000, 0x990001).nopw(); // same as 880000
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::sgyxz_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
map(0x800030, 0x800031).w(FUNC(fcrash_state::cps1_coinctrl_w));
map(0x800100, 0x80013f).ram().share("cps_a_regs"); /* CPS-A custom */
map(0x800140, 0x80017f).ram().share("cps_b_regs"); /* CPS-B custom */
map(0x880000, 0x880001).portr("IN1"); /* Player input ports */
map(0x880006, 0x880007).portr("IN0"); /* System input ports + Player 3 controls */
map(0x880008, 0x88000d).r(FUNC(fcrash_state::sgyxz_dsw_r)); /* Dip Switches */
map(0x88000e, 0x88000f).w(FUNC(fcrash_state::cps1_soundlatch_w));
map(0x880e78, 0x880e79).nopr(); // reads just once at start, bug?
map(0x890000, 0x890001).w(FUNC(fcrash_state::cps1_soundlatch2_w));
map(0x900000, 0x92ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0xf1c004, 0xf1c005).w(FUNC(fcrash_state::cpsq_coinctrl2_w)); /* Coin control2 (later games) */
map(0xf1c006, 0xf1c007).noprw(); // doesn't have an eeprom
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::wofabl_map(address_map &map)
{
map(0x000000, 0x1fffff).rom();
map(0x800030, 0x800031).w(FUNC(fcrash_state::cps1_coinctrl_w));
map(0x800100, 0x80013f).ram().share("cps_a_regs"); /* CPS-A custom */
map(0x800140, 0x80017f).ram().share("cps_b_regs"); /* CPS-B custom */
map(0x880000, 0x880001).portr("IN1"); /* Player input ports */
map(0x880006, 0x880007).w(FUNC(fcrash_state::cps1_soundlatch_w));
map(0x880008, 0x880009).portr("IN0"); /* System input ports + Player 3 controls */
map(0x88000a, 0x88000f).r(FUNC(fcrash_state::sgyxz_dsw_r)); /* Dip Switches */
map(0x890000, 0x890001).w(FUNC(fcrash_state::cps1_soundlatch2_w));
map(0x900000, 0x92ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0xf1c004, 0xf1c005).w(FUNC(fcrash_state::cpsq_coinctrl2_w)); /* Coin control2 (later games) */
map(0xf1c006, 0xf1c007).noprw(); // doesn't have an eeprom
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::wofr1bl_map(address_map &map)
{
map(0x000000, 0x3fffff).rom();
map(0x800000, 0x800007).portr("IN1"); /* Player input ports */
map(0x800006, 0x800007).w(FUNC(fcrash_state::cps1_soundlatch_w)); /* Sound command */
map(0x800008, 0x800009).w(FUNC(fcrash_state::wofr1bl_layer2_w));
map(0x800018, 0x80001f).r(FUNC(fcrash_state::cps1_dsw_r)); /* System input ports / Dip Switches */
map(0x800030, 0x800037).w(FUNC(fcrash_state::cps1_coinctrl_w));
map(0x800100, 0x80013f).w(FUNC(fcrash_state::cps1_cps_a_w)).share("cps_a_regs"); /* CPS-A custom */
map(0x800140, 0x80017f).rw(FUNC(fcrash_state::cps1_cps_b_r), FUNC(fcrash_state::cps1_cps_b_w)).share("cps_b_regs"); /* Only writes here at boot */
map(0x880000, 0x880001).nopw(); // ?
map(0x900000, 0x92ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0x980000, 0x98000d).w(FUNC(fcrash_state::wofr1bl_layer_w));
map(0xf18000, 0xf19fff).nopw(); // few q-sound leftovers
map(0xf1c000, 0xf1c001).portr("IN2"); /* Player 3 controls (later games) */
map(0xf1c004, 0xf1c005).w(FUNC(fcrash_state::cpsq_coinctrl2_w)); /* Coin control2 (later games) */
map(0xf1c006, 0xf1c007).portr("EEPROMIN").portw("EEPROMOUT");
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::varthb_map(address_map &map)
{
map(0x000000, 0x1fffff).rom();
map(0x800000, 0x800001).portr("IN1");
map(0x800006, 0x800007).w(FUNC(fcrash_state::cps1_soundlatch_w));
map(0x800018, 0x80001f).r(FUNC(fcrash_state::cps1_dsw_r));
map(0x800030, 0x800037).w(FUNC(fcrash_state::cps1_coinctrl_w));
map(0x800100, 0x80013f).w(FUNC(fcrash_state::cps1_cps_a_w)).share("cps_a_regs");
map(0x800140, 0x80017f).rw(FUNC(fcrash_state::cps1_cps_b_r), FUNC(fcrash_state::cps1_cps_b_w)).share("cps_b_regs");
map(0x800188, 0x800189).w(FUNC(fcrash_state::varthb_layer2_w));
map(0x980000, 0x98000b).w(FUNC(fcrash_state::varthb_layer_w));
map(0x900000, 0x92ffff).ram().w(FUNC(fcrash_state::cps1_gfxram_w)).share("gfxram");
map(0xff0000, 0xffffff).ram().share("mainram");
}
void fcrash_state::fcrash_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xd000, 0xd7ff).ram();
map(0xd800, 0xd801).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
map(0xdc00, 0xdc01).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
map(0xe000, 0xe000).w(FUNC(fcrash_state::fcrash_snd_bankswitch_w));
map(0xe400, 0xe400).r(m_soundlatch, FUNC(generic_latch_8_device::read));
map(0xe800, 0xe800).w(FUNC(fcrash_state::fcrash_msm5205_0_data_w));
map(0xec00, 0xec00).w(FUNC(fcrash_state::fcrash_msm5205_1_data_w));
}
void fcrash_state::kodb_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xd000, 0xd7ff).ram();
map(0xe000, 0xe001).rw("2151", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
map(0xe400, 0xe400).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0xe800, 0xe800).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
void fcrash_state::sgyxz_sound_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xd000, 0xd7ff).ram();
map(0xf000, 0xf001).rw("2151", FUNC(ym2151_device::read), FUNC(ym2151_device::write));
map(0xf002, 0xf002).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0xf004, 0xf004).w(FUNC(fcrash_state::cps1_snd_bankswitch_w));
map(0xf006, 0xf006).w(FUNC(fcrash_state::cps1_oki_pin7_w)); /* controls pin 7 of OKI chip */
map(0xf008, 0xf008).r(m_soundlatch, FUNC(generic_latch_8_device::read)); /* Sound command */
map(0xf00a, 0xf00a).r(m_soundlatch2, FUNC(generic_latch_8_device::read)); /* Sound timer fade */
}
void fcrash_state::ffightblb_sound_map(address_map &map) // TODO: verify
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram();
map(0x9000, 0x9000).lw8(NAME([this] (u8 data) { m_okibank->set_entry(data & 0x03); }));
map(0x9800, 0x9800).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write));
map(0xa000, 0xa000).r(m_soundlatch, FUNC(generic_latch_8_device::read));
}
void fcrash_state::ffightblb_oki_map(address_map &map)
{
map(0x00000, 0x1ffff).rom();
map(0x20000, 0x3ffff).bankr(m_okibank);
}
MACHINE_START_MEMBER(fcrash_state, fcrash)
{
uint8_t *ROM = memregion("audiocpu")->base();
membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
m_layer_enable_reg = 0x20;
m_layer_mask_reg[0] = 0x26;
m_layer_mask_reg[1] = 0x30;
m_layer_mask_reg[2] = 0x28;
m_layer_mask_reg[3] = 0x32;
m_layer_scroll1x_offset = 62;
m_layer_scroll2x_offset = 60;
m_layer_scroll3x_offset = 64;
m_sprite_base = 0x50c8;
m_sprite_list_end_marker = 0x8000;
m_sprite_x_offset = 0;
save_item(NAME(m_sample_buffer1));
save_item(NAME(m_sample_buffer2));
save_item(NAME(m_sample_select1));
save_item(NAME(m_sample_select2));
}
MACHINE_RESET_MEMBER(fcrash_state, fcrash)
{
m_sample_buffer1 = 0;
m_sample_buffer2 = 0;
m_sample_select1 = 0;
m_sample_select2 = 0;
}
MACHINE_START_MEMBER(fcrash_state, cawingbl)
{
MACHINE_START_CALL_MEMBER(fcrash);
m_layer_enable_reg = 0x0c;
m_layer_mask_reg[0] = 0x0a;
m_layer_mask_reg[1] = 0x08;
m_layer_mask_reg[2] = 0x06;
m_layer_mask_reg[3] = 0x04;
m_layer_scroll1x_offset = 63;
m_layer_scroll2x_offset = 62;
m_layer_scroll3x_offset = 65;
m_sprite_base = 0x1000;
}
MACHINE_START_MEMBER(fcrash_state, kodb)
{
m_layer_enable_reg = 0x20;
m_layer_mask_reg[0] = 0x2e;
m_layer_mask_reg[1] = 0x2c;
m_layer_mask_reg[2] = 0x2a;
m_layer_mask_reg[3] = 0x28;
m_layer_scroll1x_offset = 0;
m_layer_scroll2x_offset = 0;
m_layer_scroll3x_offset = 0;
m_sprite_base = 0x1000;
m_sprite_list_end_marker = 0xffff;
m_sprite_x_offset = 0;
}
MACHINE_START_MEMBER(fcrash_state, mtwinsb)
{
uint8_t *ROM = memregion("audiocpu")->base();
membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
m_layer_enable_reg = 0x12;
m_layer_mask_reg[0] = 0x14;
m_layer_mask_reg[1] = 0x16;
m_layer_mask_reg[2] = 0x18;
m_layer_mask_reg[3] = 0x1a;
m_layer_scroll1x_offset = 0x00;
m_layer_scroll2x_offset = 0x00;
m_layer_scroll3x_offset = 0x00;
m_sprite_base = 0x1000;
m_sprite_list_end_marker = 0x8000;
m_sprite_x_offset = 0;
}
MACHINE_START_MEMBER(fcrash_state, sf2m1)
{
uint8_t *ROM = memregion("audiocpu")->base();
membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x4000);
m_layer_enable_reg = 0x26;
m_layer_mask_reg[0] = 0x28;