/
slapfght.cpp
2119 lines (1715 loc) · 97.7 KB
/
slapfght.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:K.Wilkins,Stephane Humbert
/***************************************************************************
Toaplan Slap Fight hardware
Driver by K.Wilkins Jan 1998
Games supported:
Alcon / Slap Fight
Guardian / Get Star
Performan
Tiger-Heli
TODO:
- proper MCU emulation (see slapfght_m.cpp)
****************************************************************************
Main CPU Memory Map
-------------------
$0000-$3fff ROM (SF_S19)
$4000-$7fff ROM (SF_S20)
$8000-$bfff ROM (SF_SH) - This is a 32K ROM - Paged ????? How ????
$c000-$c7ff 2K RAM
$c800-$cfff READ:Unknown H/W WRITE:Unknown H/W (Upper PCB)
$d000-$d7ff Background RAM1
$d800-$dfff Background RAM2
$e000-$e7ff Sprite RAM
$e800-$efff READ:Unknown H/W WRITE:Unknown H/W
$f000-$f7ff READ:SF_S16 WRITE:Character RAM
$f800-$ffff READ:Unknown H/W WRITE:Attribute RAM
$c800-$cfff Appears to be RAM BUT 1st 0x10 bytes are swapped with
the sound CPU and vice versa for READ OPERATIONS
Write I/O MAP
-------------
Addr Address based write Data based write
$00 Reset sound CPU
$01 Clear sound CPU reset
$02
$03
$04
$05
$06 Clear/Disable Hardware interrupt
$07 Enable Hardware interrupt
$08 LOW Bank select for SF_SH X axis character scroll reg
$09 HIGH Bank select for SF_SH X axis pixel scroll reg
$0a
$0b
$0c Select 1st set of sprites colors
$0d Select 2nd set of sprites colors
$0e
$0f
Read I/O Map
------------
$00 Status register - cycle 0xc7, 0x55, 0x00 (Thanks to Dave Spicer for the info)
Known Info
----------
2K Character RAM at write only address $f000-$f7ff looks to be organised
64x32 chars with the screen rotated through 90 degrees clockwise. There
appears to be some kind of attribute(?) RAM above at $f800-$ffff organised
in the same manner.
From the look of data in the buffer it is arranged thus: 37x32 (HxW) which
would make the overall frame buffer 296x256.
Print function maybe around $09a2 based on info from log file.
$e000 looks like sprite ram, setup routines at $0008.
Partial hand-made schematics don't show a buffer, but the games most
definitely need it. Could be the second half of the ram, which seems
otherwise unused, but it would be weird bandwidth-wise. It's not
double-buffering through page swapping, sprite updates are
incremental.
Sound System CPU Details
------------------------
Memory Map
$0000-$1fff ROM(SF_S5)
$a080 AY-3-8910(PSG1) Register address
$a081 AY-3-8910(PSG1) Read register
$a082 AY-3-8910(PSG1) Write register
$a090 AY-3-8910(PSG2) Register address
$a091 AY-3-8910(PSG2) Read register
$a092 AY-3-8910(PSG2) Write register
$c800-$cfff RAM(2K)
Strangely the RAM hardware registers seem to be overlaid at $c800
$00a6 routine here reads I/O ports and stores in, its not a straight
copy, the data is mangled before storage:
PSG1-E -> $c808
PSG1-F -> $c80b
PSG2-E -> $c809
PSG2-F -> $c80a - DIP Switch Bank 2 (Test mode is here)
-------------------------------GET STAR------------------------------------
following info by Luca Elia (l.elia@tin.it)
Interesting locations
---------------------
c803 credits
c806 used as a watchdog: main cpu reads then writes FF.
If FF was read, jp 0000h. Sound cpu zeroes it.
c807(1p) left 7 c809 DSW1(cpl'd)
c808(2p) down 6 c80a DSW2(cpl'd)
active_H right 5 c80b ip 1(cpl'd)
up 4
0 3
0 2
but2 1
but1 0
c21d(main) 1p lives
Main cpu writes to unmapped ports 0e,0f,05,03 at startup.
Before playing, f1 is written to e802 and 00 to port 03.
If flip screen dsw is on, ff is written to e802 an 00 to port 02, instead.
Interesting routines (main cpu)
-------------------------------
4a3 wait A irq's
432 init the Ath sprite
569 reads a sequence from e803
607 prints the Ath string (FF terminated). String info is stored at
65bc in the form of: attribute, dest. address, string address (5 bytes)
b73 checks lives. If zero, writes 0 to port 04 then jp 0000h.
Before that, sets I to FF as a flag, for the startup ram check
routine, to not alter the credit counter.
1523 put name in hi-scores?
-------------------------------Performan-----------------------------------
Interesting RAM locations (Main CPU).
-------------------------------------
$8056 Hero counter
$8057 Level counter
$8006 - $8035 High score table
$8609 - $860f High score characters to display to screen for highest score
****************************************************************************
Stephh's notes (based on the games Z80 code and some tests) :
0) all games
- All these games have a specific way of handling inputs :
* when cabinet is set to "Upright", any player can use inputs
from player 1 OR from player 2
* when cabinet is set to "Cocktail", each player has its own inputs
See Mantis bug ID 01746 attached files with Z80 explanations
1) 'tigerh' and clones
1a) 'tigerh'
- US version
- MCU dumped and emulated
1b) 'tigerhj'
- Japan version
- MCU dumped and emulated
1c) 'tigerhb1'
- Bootleg based on 'tigerhj'
- I can't tell if a specific MCU is required for this game :
* MCU status doesn't seem to be required
(see nop instructions at 0x10da, 0x10db, 0x10e5 and 0x10e6)
* there is patched code at 0x0f9c which is called instead of
standard call to 0x10cc, and there is no call to 0x0f88
* there are writes to unknown ports 0x0e and 0x0f
* hardware test is still computed at 0x109d but there is
no delay to wait for correct value (0x83) to be returned
(thus the need of specific read/write handlers)
1d) 'tigerhb2'
- Bootleg based on 'tigerhj'
- MCU reads/writes are patched.as well as ROM check
1e) 'tigerhb3'
- Bootleg based on 'tigerhj'
- MCU reads/writes are patched.
- There is extra code at 0x10e2 (where MCU status was checked)
that prevents player to get any extra lives (even by collecting
10 diamonds) when Dip Switch is set to "20k then every 80k"
(see Mantis bug ID 00652 with Z80 explanations).
2) 'grdian' and clones
2a) 'grdian'
- US version, licensed to Kitkorp - name "Guardian".
- MCU dumped and emulated.
- Difficulty determines the number of energy bars you get.
- Each hit removes 1 energy bar.
- According to the manual, default difficulty shall be set to "Hard".
- You can only get ONE extra life.
- I don't know if it's an ingame bug, but you always have to enter
your initials after a game ends, even if you score less than 10th place.
2b) 'getstarj'
- Japan version - name "Get Star".
- MCU dumped and emulated.
- You always get 4 energy bars.
- Difficulty determines how many energy bars you lose when you get hit.
- I don't know what default difficulty shall be, so I set it to "Easy".
- You can get multiple extra lives.
2c) 'getstarb1'
- Bootleg based on 'getstarj'
- MCU reads/writes are patched, but this hasn't been done in the "test mode".
- The game seems to have its own protection on startup (check code at 0x6d1a).
2d) 'getstarb2'
- Bootleg based on 'getstarj'
- MCU reads/writes are patched, but this hasn't been done in the "test mode".
- The game seems to have its own protection (check code at 0x0569 and 0x0ac6).
- Patches are coded differently than in 'getstarb1' and code isn't always perfect
(lazy coding ?) which causes LOTS of ingames bugs or strange behaviours :
* patched command 0x20 : NO continue play
* patched command 0x21 : as soon as a player loses all his lives,
the game is over (even if other player still has lives)
* patched command 0x22 : difficulty is ALWAYS set to "Easy" at start
so "Difficulty" Dip Switches have no effect when you are playing
(it still has an effect in the "test mode" though)
* patched command 0x23 : different lives settings
(thus the need of a specific INPUT_PORTS definition for this game)
* patched command 0x25 : right and down directions are swapped
(thus the need of a specific INPUT_PORTS definition for this game)
* patched command 0x2a : player flag (which determines if player 1 or
player 2 is playing) is NOT updated, causing the following things :
. current player score will ALWAYS be displayed under player 1
. when cabinet is set to "Cocktail", player 2 uses player 1 inputs
* patched command 0x38 : laser position does NOT change according to
player position (it ALWATS starts from the middle of the screen)
***************************************************************************/
#include "emu.h"
#include "slapfght.h"
#include "cpu/z80/z80.h"
#include "cpu/m6805/m6805.h"
#include "machine/74259.h"
#include "sound/ay8910.h"
#include "speaker.h"
/***************************************************************************
Main Z80 I/O and Memory Maps
***************************************************************************/
void slapfght_state::perfrman_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0x87ff).ram();
map(0x8800, 0x8fff).ram().share("share1");
map(0x9000, 0x97ff).ram().w(FUNC(slapfght_state::videoram_w)).share("videoram");
map(0x9800, 0x9fff).ram().w(FUNC(slapfght_state::colorram_w)).share("colorram");
map(0xa000, 0xa7ff).ram().share("spriteram");
}
void slapfght_state::tigerh_map(address_map &map)
{
map(0x0000, 0xbfff).rom();
map(0xc000, 0xc7ff).ram();
map(0xc800, 0xcfff).ram().share("share1");
map(0xd000, 0xd7ff).ram().w(FUNC(slapfght_state::videoram_w)).share("videoram");
map(0xd800, 0xdfff).ram().w(FUNC(slapfght_state::colorram_w)).share("colorram");
map(0xe000, 0xe7ff).ram().share("spriteram");
map(0xe800, 0xe800).w(FUNC(slapfght_state::scrollx_lo_w));
map(0xe801, 0xe801).w(FUNC(slapfght_state::scrollx_hi_w));
map(0xe802, 0xe802).w(FUNC(slapfght_state::scrolly_w));
map(0xf000, 0xf7ff).ram().w(FUNC(slapfght_state::fixram_w)).share("fixvideoram");
map(0xf800, 0xffff).ram().w(FUNC(slapfght_state::fixcol_w)).share("fixcolorram");
}
void slapfght_state::tigerh_map_mcu(address_map &map)
{
tigerh_map(map);
map(0xe803, 0xe803).rw(m_bmcu, FUNC(taito68705_mcu_device::data_r), FUNC(taito68705_mcu_device::data_w));
}
void slapfght_state::tigerhb1_map(address_map &map)
{
tigerh_map(map);
map(0xe803, 0xe803).rw(FUNC(slapfght_state::tigerhb1_prot_r), FUNC(slapfght_state::tigerhb1_prot_w));
}
void slapfght_state::tigerhb2_map(address_map &map)
{
tigerh_map(map);
map(0xe803, 0xe803).noprw(); // no MCU
}
void slapfght_state::slapfigh_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xc000, 0xc7ff).ram();
map(0xc800, 0xcfff).ram().share("share1");
map(0xd000, 0xd7ff).ram().w(FUNC(slapfght_state::videoram_w)).share("videoram");
map(0xd800, 0xdfff).ram().w(FUNC(slapfght_state::colorram_w)).share("colorram");
map(0xe000, 0xe7ff).ram().share("spriteram");
map(0xe800, 0xe800).w(FUNC(slapfght_state::scrollx_lo_w));
map(0xe801, 0xe801).w(FUNC(slapfght_state::scrollx_hi_w));
map(0xe802, 0xe802).w(FUNC(slapfght_state::scrolly_w));
map(0xf000, 0xf7ff).ram().w(FUNC(slapfght_state::fixram_w)).share("fixvideoram");
map(0xf800, 0xffff).ram().w(FUNC(slapfght_state::fixcol_w)).share("fixcolorram");
}
void slapfght_state::slapfigh_map_mcu(address_map &map)
{
slapfigh_map(map);
map(0xe803, 0xe803).rw(m_bmcu, FUNC(taito68705_mcu_device::data_r), FUNC(taito68705_mcu_device::data_w));
}
void slapfght_state::slapfighb1_map(address_map &map)
{
slapfigh_map(map);
map(0xe803, 0xe803).noprw(); // no MCU
}
void slapfght_state::getstar_map(address_map &map)
{
slapfigh_map(map);
map(0xe803, 0xe803).rw(FUNC(slapfght_state::getstar_mcusim_r), FUNC(slapfght_state::getstar_mcusim_w));
}
void slapfght_state::slapfighb2_map(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("bank1");
map(0xc000, 0xc7ff).ram();
map(0xc800, 0xcfff).ram().share("share1");
map(0xd000, 0xd7ff).ram().w(FUNC(slapfght_state::videoram_w)).share("videoram");
map(0xd800, 0xdfff).ram().w(FUNC(slapfght_state::colorram_w)).share("colorram");
map(0xe000, 0xe7ff).ram().share("spriteram");
map(0xe800, 0xe800).w(FUNC(slapfght_state::scrollx_hi_w));
map(0xe802, 0xe802).w(FUNC(slapfght_state::scrolly_w));
map(0xe803, 0xe803).w(FUNC(slapfght_state::scrollx_lo_w));
map(0xec00, 0xefff).rom(); // it reads a copy of the logo from here!
map(0xf000, 0xf7ff).ram().w(FUNC(slapfght_state::fixram_w)).share("fixvideoram");
map(0xf800, 0xffff).ram().w(FUNC(slapfght_state::fixcol_w)).share("fixcolorram");
}
/**************************************************************************/
void slapfght_state::vblank_irq(int state)
{
if (state && m_main_irq_enabled)
m_maincpu->set_input_line(0, ASSERT_LINE);
}
void slapfght_state::irq_enable_w(int state)
{
m_main_irq_enabled = state ? true : false;
if (!m_main_irq_enabled)
m_maincpu->set_input_line(0, CLEAR_LINE);
}
void slapfght_state::sound_reset_w(int state)
{
m_audiocpu->set_input_line(INPUT_LINE_RESET, state ? CLEAR_LINE : ASSERT_LINE);
if (state == 0)
m_sound_nmi_enabled = false;
}
uint8_t slapfght_state::vblank_r()
{
return m_screen->vblank() ? 1 : 0;
}
void slapfght_state::io_map_nomcu(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).r(FUNC(slapfght_state::vblank_r));
map(0x00, 0x0f).w("mainlatch", FUNC(ls259_device::write_a0));
}
void slapfght_state::io_map_mcu(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).r(FUNC(slapfght_state::tigerh_mcu_status_r));
map(0x00, 0x0f).w("mainlatch", FUNC(ls259_device::write_a0));
}
void slapfght_state::getstarb1_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).r(FUNC(slapfght_state::getstarb1_prot_r));
map(0x00, 0x0f).w("mainlatch", FUNC(ls259_device::write_a0));
}
void slapfght_state::getstarb2_io_map(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).r(FUNC(slapfght_state::getstar_mcusim_status_r));
map(0x00, 0x0f).w("mainlatch", FUNC(ls259_device::write_a0));
}
/***************************************************************************
Sound Z80 I/O Memory Maps
***************************************************************************/
INTERRUPT_GEN_MEMBER(slapfght_state::sound_nmi)
{
if (m_sound_nmi_enabled)
device.execute().pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
void slapfght_state::sound_nmi_enable_w(offs_t offset, uint8_t data)
{
m_sound_nmi_enabled = offset ? false : true;
}
void slapfght_state::perfrman_sound_map(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x8800, 0x8fff).ram().share("share1");
map(0xa080, 0xa080).w("ay1", FUNC(ay8910_device::address_w));
map(0xa081, 0xa081).r("ay1", FUNC(ay8910_device::data_r));
map(0xa082, 0xa082).w("ay1", FUNC(ay8910_device::data_w));
map(0xa090, 0xa090).w("ay2", FUNC(ay8910_device::address_w));
map(0xa091, 0xa091).r("ay2", FUNC(ay8910_device::data_r));
map(0xa092, 0xa092).w("ay2", FUNC(ay8910_device::data_w));
map(0xa0e0, 0xa0e0).select(0x0010).w(FUNC(slapfght_state::sound_nmi_enable_w));
}
void slapfght_state::tigerh_sound_map(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0xa080, 0xa080).w("ay1", FUNC(ay8910_device::address_w));
map(0xa081, 0xa081).r("ay1", FUNC(ay8910_device::data_r));
map(0xa082, 0xa082).w("ay1", FUNC(ay8910_device::data_w));
map(0xa090, 0xa090).w("ay2", FUNC(ay8910_device::address_w));
map(0xa091, 0xa091).r("ay2", FUNC(ay8910_device::data_r));
map(0xa092, 0xa092).w("ay2", FUNC(ay8910_device::data_w));
map(0xa0e0, 0xa0e0).select(0x0010).w(FUNC(slapfght_state::sound_nmi_enable_w));
map(0xc800, 0xcfff).ram().share("share1");
map(0xd000, 0xffff).ram();
}
/***************************************************************************
Inputs
***************************************************************************/
static INPUT_PORTS_START( slapfght_generic )
PORT_START("IN0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL
PORT_START("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN2 )
PORT_START("DSW1")
PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:8,7,6")
// PORT_DIPSETTING( 0x01, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x02, DEF_STR( 3C_1C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x07, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x06, DEF_STR( 1C_2C ) )
PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) )
PORT_DIPSETTING( 0x00, DEF_STR( Free_Play ) )
PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:5")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x10, DEF_STR( Cocktail ) )
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_SERVICE_DIPLOC(0x40, IP_ACTIVE_LOW, "SW1:2" )
PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW1:1" )
PORT_START("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:8,7")
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,5")
PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x08, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
/* Filled by "Bonus Lives" settings */
PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_LOW, "SW2:4" )
PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:3" )
PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW2:2" )
PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:1" )
INPUT_PORTS_END
static INPUT_PORTS_START( perfrman )
PORT_INCLUDE(slapfght_generic)
PORT_MODIFY("DSW1")
PORT_DIPNAME( 0x20, 0x20, "Intermissions" ) PORT_DIPLOCATION("SW1:3") /* "Screen Test" in the "test mode" */
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0xf0, 0x70, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,3,2,1")
PORT_DIPSETTING( 0xb0, "20k, 120k, then every 100k" )
PORT_DIPSETTING( 0xa0, "40k, 120k, then every 100k" )
PORT_DIPSETTING( 0x90, "60k, 160k, then every 100k" )
PORT_DIPSETTING( 0x80, "Every 100k" )
PORT_DIPSETTING( 0x70, "20k, 220k, then every 200k" )
PORT_DIPSETTING( 0x60, "40k, 240k, then every 200k" )
PORT_DIPSETTING( 0x50, "60k, 260k, then every 200k" )
PORT_DIPSETTING( 0x40, "Every 200k" )
PORT_DIPSETTING( 0x30, "20k, 320k, then every 300k" )
PORT_DIPSETTING( 0x20, "40k, 340k, then every 300k" )
PORT_DIPSETTING( 0x10, "60k, 360k, then every 300k" )
PORT_DIPSETTING( 0x00, "Every 300k" )
PORT_DIPSETTING( 0xf0, "20k only" )
PORT_DIPSETTING( 0xe0, "40k only" )
PORT_DIPSETTING( 0xd0, "60k only" )
PORT_DIPSETTING( 0xc0, DEF_STR( None ) )
INPUT_PORTS_END
static INPUT_PORTS_START( tigerh )
PORT_INCLUDE(slapfght_generic)
PORT_MODIFY("IN1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 )
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL
PORT_MODIFY("DSW1")
PORT_DIPNAME( 0x80, 0x00, "Player Speed" ) PORT_DIPLOCATION("SW1:1")
PORT_DIPSETTING( 0x80, DEF_STR( Normal ) )
PORT_DIPSETTING( 0x00, "Fast" )
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:8,7")
PORT_DIPSETTING( 0x01, "1" )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x03, "3" )
PORT_DIPSETTING( 0x02, "5" )
PORT_DIPNAME( 0x0c, 0x08, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,5")
PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x08, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x10, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4") // see notes for 'tigerhb3'
PORT_DIPSETTING( 0x10, "20k and every 80k" )
PORT_DIPSETTING( 0x00, "50k and every 120k" )
PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:3" )
PORT_DIPUNUSED_DIPLOC( 0x40, IP_ACTIVE_LOW, "SW2:2" )
PORT_DIPUNUSED_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:1" )
INPUT_PORTS_END
static INPUT_PORTS_START( slapfigh )
PORT_INCLUDE(slapfght_generic)
PORT_MODIFY("DSW1")
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:8,7")
PORT_DIPSETTING( 0x02, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x01, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:6,5")
PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) )
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) )
PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x20, "Screen Test" ) PORT_CODE(KEYCODE_F1) PORT_TOGGLE PORT_DIPLOCATION("SW1:3")
PORT_DIPSETTING( 0x20, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
PORT_DIPSETTING( 0x40, DEF_STR( Off ) )
PORT_DIPSETTING( 0x00, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) )
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) PORT_DIPLOCATION("SW1:1")
PORT_MODIFY("DSW2")
PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:8" )
PORT_SERVICE_DIPLOC(0x02, IP_ACTIVE_LOW, "SW2:7" )
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:6,5")
PORT_DIPSETTING( 0x08, "1" )
PORT_DIPSETTING( 0x00, "2" )
PORT_DIPSETTING( 0x0c, "3" )
PORT_DIPSETTING( 0x04, "5" )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,3")
PORT_DIPSETTING( 0x30, "30000 100000" )
PORT_DIPSETTING( 0x10, "50000 200000" )
PORT_DIPSETTING( 0x20, "50000" )
PORT_DIPSETTING( 0x00, "100000" )
PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:2,1")
PORT_DIPSETTING( 0x40, DEF_STR( Easy ) )
PORT_DIPSETTING( 0xc0, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x80, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
INPUT_PORTS_END
static INPUT_PORTS_START( getstar )
PORT_INCLUDE(slapfght_generic)
PORT_MODIFY("DSW2")
/* harder default difficulty (confirmed by manual) */
PORT_DIPNAME( 0x0c, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,5")
PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x08, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4,3")
PORT_DIPSETTING( 0x30, "50k only" )
PORT_DIPSETTING( 0x20, "100k only" )
PORT_DIPSETTING( 0x10, "150k only" )
PORT_DIPSETTING( 0x00, "200k only" )
INPUT_PORTS_END
static INPUT_PORTS_START( getstarj )
PORT_INCLUDE(getstar)
/* easier default difficulty (to be confirmed) and different bonus lives settings */
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:6,5")
PORT_DIPSETTING( 0x0c, DEF_STR( Easy ) )
PORT_DIPSETTING( 0x08, DEF_STR( Medium ) )
PORT_DIPSETTING( 0x04, DEF_STR( Hard ) )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW2:4")
PORT_DIPSETTING( 0x10, "30k, 130k, then every 100k" )
PORT_DIPSETTING( 0x00, "50k, 200k, then every 150k" )
PORT_DIPUNUSED_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW2:3" )
INPUT_PORTS_END
static INPUT_PORTS_START( getstarb2 )
PORT_INCLUDE(getstarj)
/* RIGHT and DOWN are swapped due to code at 0x0551 */
PORT_MODIFY("IN0")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_COCKTAIL
/* different lives settings due to code at 0x0e36 */
PORT_MODIFY("DSW2")
PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:8,7")
PORT_DIPSETTING( 0x02, "3" )
PORT_DIPSETTING( 0x01, "4" )
PORT_DIPSETTING( 0x00, "5" )
PORT_DIPSETTING( 0x03, "240 (Cheat)")
/* difficulty settings have no effect due to code at 0x0e7c */
/* I don't mark the Dips as "unused" because they are still read in the "test mode" */
INPUT_PORTS_END
/***************************************************************************
Driver/Machine Inits
***************************************************************************/
void slapfght_state::machine_start()
{
// zerofill
m_palette_bank = 0;
m_scrollx_lo = 0;
m_scrollx_hi = 0;
m_scrolly = 0;
m_main_irq_enabled = false;
m_sound_nmi_enabled = false;
m_getstar_status = 0;
m_getstar_sequence_index = 0;
m_getstar_status_state = 0;
m_getstar_cmd = 0;
m_gs_a = 0;
m_gs_d = 0;
m_gs_e = 0;
m_tigerhb_cmd = 0;
// savestates
save_item(NAME(m_palette_bank));
save_item(NAME(m_scrollx_lo));
save_item(NAME(m_scrollx_hi));
save_item(NAME(m_scrolly));
save_item(NAME(m_main_irq_enabled));
save_item(NAME(m_sound_nmi_enabled));
save_item(NAME(m_getstar_status));
save_item(NAME(m_getstar_sequence_index));
save_item(NAME(m_getstar_status_state));
save_item(NAME(m_getstar_cmd));
save_item(NAME(m_gs_a));
save_item(NAME(m_gs_d));
save_item(NAME(m_gs_e));
save_item(NAME(m_tigerhb_cmd));
}
void slapfght_state::machine_reset()
{
m_getstar_status = 0xc7;
m_getstar_status_state = 0;
m_getstar_sequence_index = 0;
// reset sound
m_sound_nmi_enabled = false;
m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
/**************************************************************************/
void slapfght_state::init_banks()
{
uint8_t *ROM = memregion("maincpu")->base();
membank("bank1")->configure_entries(0, 2, &ROM[0x10000], 0x4000);
membank("bank1")->set_entry(0);
}
void slapfght_state::init_slapfigh()
{
init_banks();
}
void slapfght_state::init_getstarb1()
{
m_getstar_id = GETSTARB1;
init_banks();
/* requires this or it gets stuck with 'rom test' on screen */
/* it is possible the program roms are slightly corrupt like the gfx roms, or
that the bootleg simply shouldn't execute the code due to the modified roms */
/* TODO: find & fix the cause of the following happening. */
uint8_t *ROM = memregion("maincpu")->base();
ROM[0x6d56] = 0xc3; // jp instead of jp z
}
void slapfght_state::init_getstarb2()
{
m_getstar_id = GETSTARB2;
init_banks();
}
/***************************************************************************
GFX Decode, Chip Interfaces
***************************************************************************/
static const gfx_layout charlayout =
{
8,8, /* 8*8 characters */
RGN_FRAC(1,2), /* 1024 characters */
2, /* 2 bits per pixel */
{ RGN_FRAC(0,2), RGN_FRAC(1,2) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 /* every char takes 8 consecutive bytes */
};
static const gfx_layout tilelayout =
{
8,8, /* 8*8 tiles */
RGN_FRAC(1,4), /* 2048/4096 tiles */
4, /* 4 bits per pixel */
{ RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 /* every tile takes 8 consecutive bytes */
};
static const gfx_layout spritelayout =
{
16,16, /* 16*16 sprites */
RGN_FRAC(1,4), /* 512/1024 sprites */
4, /* 4 bits per pixel */
{ RGN_FRAC(0,4), RGN_FRAC(1,4), RGN_FRAC(2,4), RGN_FRAC(3,4) },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10 ,11, 12, 13, 14, 15 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
32*8 /* every sprite takes 64 consecutive bytes */
};
static const gfx_layout perfrman_charlayout =
{
8,8, /* 8*8 characters */
RGN_FRAC(1,3), /* 1024 characters */
3, /* 3 bits per pixel */
{ RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
{ 0, 1, 2, 3, 4, 5, 6, 7 },
{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
8*8 /* every char takes 8 consecutive bytes */
};
static const gfx_layout perfrman_spritelayout =
{
16,16, /* 16*16 sprites */
RGN_FRAC(1,3), /* 256 sprites */
3, /* 3 bits per pixel */
{ RGN_FRAC(0,3), RGN_FRAC(1,3), RGN_FRAC(2,3) },
{ 0, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10 ,11, 12, 13, 14, 15 },
{ 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16,
8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 },
32*8
};
static GFXDECODE_START( gfx_perfrman )
GFXDECODE_ENTRY( "gfx1", 0, perfrman_charlayout, 0, 16 )
GFXDECODE_ENTRY( "gfx2", 0, perfrman_spritelayout, 128, 16 )
GFXDECODE_END
static GFXDECODE_START( gfx_slapfght )
GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 64 )
GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 0, 16 )
GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0, 16 )
GFXDECODE_END
/***************************************************************************
Machine Drivers
***************************************************************************/
void slapfght_state::perfrman(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 16_MHz_XTAL/4); // 4MHz? XTAL is known, divider is guessed
m_maincpu->set_addrmap(AS_PROGRAM, &slapfght_state::perfrman_map);
m_maincpu->set_addrmap(AS_IO, &slapfght_state::io_map_nomcu);
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(slapfght_state::sound_reset_w));
mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w));
mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w));
mainlatch.q_out_cb<6>().set(FUNC(slapfght_state::palette_bank_w));
Z80(config, m_audiocpu, 16_MHz_XTAL/8); // 2MHz? XTAL is known, divider is guessed
m_audiocpu->set_addrmap(AS_PROGRAM, &slapfght_state::perfrman_sound_map);
m_audiocpu->set_periodic_int(FUNC(slapfght_state::sound_nmi), attotime::from_hz(240)); // music speed, verified
config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
// pure guesswork, hopefully we can get real values
m_screen->set_raw(16_MHz_XTAL/3, 344, 0, 256, 270, 0, 240);
m_screen->set_screen_update(FUNC(slapfght_state::screen_update_perfrman));
m_screen->screen_vblank().set(m_spriteram_buffer, FUNC(buffered_spriteram8_device::vblank_copy_falling));
m_screen->screen_vblank().append(FUNC(slapfght_state::vblank_irq));
m_screen->set_palette(m_palette);
BUFFERED_SPRITERAM8(config, m_spriteram_buffer);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_perfrman);
PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 256);
MCFG_VIDEO_START_OVERRIDE(slapfght_state, perfrman)
/* sound hardware */
SPEAKER(config, "mono").front_center();
ay8910_device &ay1(AY8910(config, "ay1", 16_MHz_XTAL/8));
ay1.port_a_read_callback().set_ioport("IN0");
ay1.port_b_read_callback().set_ioport("IN1");
ay1.add_route(ALL_OUTPUTS, "mono", 0.25);
ay8910_device &ay2(AY8910(config, "ay2", 16_MHz_XTAL/8));
ay2.port_a_read_callback().set_ioport("DSW1");
ay2.port_b_read_callback().set_ioport("DSW2");
ay2.add_route(ALL_OUTPUTS, "mono", 0.25);
}
void slapfght_state::tigerh(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 36_MHz_XTAL/6); // 6MHz
m_maincpu->set_addrmap(AS_PROGRAM, &slapfght_state::tigerh_map_mcu);
m_maincpu->set_addrmap(AS_IO, &slapfght_state::io_map_mcu);
ls259_device &mainlatch(LS259(config, "mainlatch"));
mainlatch.q_out_cb<0>().set(FUNC(slapfght_state::sound_reset_w));
mainlatch.q_out_cb<1>().set(FUNC(slapfght_state::flipscreen_w));
mainlatch.q_out_cb<3>().set(FUNC(slapfght_state::irq_enable_w));
Z80(config, m_audiocpu, 36_MHz_XTAL/12); // 3MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &slapfght_state::tigerh_sound_map);
m_audiocpu->set_periodic_int(FUNC(slapfght_state::sound_nmi), attotime::from_hz(360)); // music speed, verified with pcb recording
TAITO68705_MCU_TIGER(config, m_bmcu, 36_MHz_XTAL/12); // 3MHz
config.set_perfect_quantum(m_maincpu);
/* video hardware */
SCREEN(config, m_screen, SCREEN_TYPE_RASTER);
m_screen->set_raw(36_MHz_XTAL/6, 388, 0, 296, 270, 0, 240);
m_screen->set_screen_update(FUNC(slapfght_state::screen_update_slapfight));
m_screen->screen_vblank().set(m_spriteram_buffer, FUNC(buffered_spriteram8_device::vblank_copy_falling));
m_screen->screen_vblank().append(FUNC(slapfght_state::vblank_irq));
m_screen->set_palette(m_palette);
BUFFERED_SPRITERAM8(config, m_spriteram_buffer);
GFXDECODE(config, m_gfxdecode, m_palette, gfx_slapfght);
PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 256);
MCFG_VIDEO_START_OVERRIDE(slapfght_state, slapfight)
/* sound hardware */
SPEAKER(config, "mono").front_center();
ay8910_device &ay1(AY8910(config, "ay1", 36_MHz_XTAL/24)); // 1.5MHz
ay1.port_a_read_callback().set_ioport("IN0");
ay1.port_b_read_callback().set_ioport("IN1");
ay1.add_route(ALL_OUTPUTS, "mono", 0.25);
ay8910_device &ay2(AY8910(config, "ay2", 36_MHz_XTAL/24)); // 1.5MHz
ay2.port_a_read_callback().set_ioport("DSW1");
ay2.port_b_read_callback().set_ioport("DSW2");
ay2.add_route(ALL_OUTPUTS, "mono", 0.25);
}
void slapfght_state::tigerhb1(machine_config &config)
{
tigerh(config);
/* basic machine hardware */
m_maincpu->set_addrmap(AS_PROGRAM, &slapfght_state::tigerhb1_map);
m_maincpu->set_addrmap(AS_IO, &slapfght_state::io_map_nomcu);