/
jclub2.cpp
1616 lines (1297 loc) · 67.7 KB
/
jclub2.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
/************************************************************************************************************
Seta's Jockey Club II (ジョッキークラブ II)
Various hardware revisions, all use a MC68EC020FG16 CPU.
---------------------------------------------------------------------------------------------
Year + Game PCB Video Sound Other
---------------------------------------------------------------------------------------------
1994 Jockey Club II (older hw) E06-00409/E06-00407* ST-0020 ST-0016 ST-0013 ST-0017
1996 Jockey Club II (newer hw) E79-001 rev 01a ST-0032 <-- ST-0013 ST-0017
2001 Dark Horse (bootleg hw) - 3 x FPGA M6295 -
---------------------------------------------------------------------------------------------
* Spotted also on E48-0027 Terminal P.C.B.
ST-0013: unknown function. Doesn't seem to be used anywhere else?
ST-0016: Z80 with integrated video + sound capabilities. Video functionality is probably not used here.
ST-0017: unknown function (maybe I/O or RLE). Also used in srmp6 (see srmp6.cpp).
ST-0020: zooming sprites + blitter + tilemaps chip. Also used by gdfs in ssv.cpp (see st0020.cpp)
ST-0032: similar to ST-0020 but the ram / list formats aren't the same. Maybe it handles sound as
there doesn't seem to be any other dedicated sound chip. Doesn't seem to be used anywhere else?
Notes:
- Reset, Meter, Last Game and Config (in later games) are revolving keys, so once you turn them they stay "active".
- Boot with Test switch on (F2) for service mode. Note that Config (if present) has to be off for this to work.
- The EEPROM holds an ID at $14 e.g. SETA1997JC26203W:
6 = config version, 203 = program version, W = fixed wide monitor (N = fixed normal, ' ' = configurable, E = Extended config)
The ID can be reprogrammed by booting with a key combination (see below) that enables Write ID mode.
Later games require to enter a valid Vender Code (up to 8 hex digits) which is saved (encoded as 8 bytes)
at address $2a in the EEPROM (shown in service mode after the version) with a matching configuration id at $28 (2 bytes).
The code affects the game settings (accounting for e.g. laws of the target market) and appearence (e.g. hiding the game title)
Vender Codes and configuration ids for e.g. jclub2v203 are at 209B6C. Enter the digits using these inputs -> outputs:
P1 start + 1..8 -> 1..8 | 7-8 -> A | P1 start + 7-8 -> F | P1 start + other keys -> 9 | any key -> F | payout -> end
- Administrator Setup allows the setting of 3 rows of 8 characters (0-9 A-Z !). The meaning is unknown. Edit them with:
6-7 -> left | 7-8 -> right | start -> down | 1 -> increment | 1-2 -> decrement | payout -> end
- The program can be upgraded by placing a ROM in the socket next to the main program ROM.
- An undumped v4.00 exists, with copyright 1994-97 Seta Corporation on the E84-0001 Rev.B hardware.
jclub2v100/jclub2v101 (these can generate a valid EEPROM without a vender code):
- Boot with Reset + P1 Start : Configuration Setup (operator options)
- Boot with Reset + P1 Cancel : Backup Data Clear (needed to clear hardware/emergency/ID errors)
- Boot with Test + P1 Start : Write To ID Code (writes ID to EEPROM, configurable monitor)
- Boot with Test + P1 Payout + P1 Cancel : Write To ID Code(Wide) (writes ID to EEPROM, fixed wide monitor)
jclub2v110 (from this version onwards a vender code is needed to generate a valid EEPROM):
- All of the above plus...
- Boot with Test + P1 Start + P1 Cancel : Write To ID Code(A) (writes ID to EEPROM, configurable monitor, no game title)
- Boot with invalid ID in the EEPROM i.e. : Now Update ID Enter Vender Code (update ID in EEPROM from a previous version)
EEPROM does not contain SETA at $14 and JC2X at $1c, where X is from the current version:
' '(v100) | A(v101) | 2/3(v110) | 4/5(v112) | 6(v203) | Z(v200-220)
Bug: this will be triggered if the EEPROM is blank or from a newer version, but the update will fail even with a correct vender code!
Simply use the key combination for Write ID (thus writing the ID from scratch).
jclub2v112:
- Vender codes are associated with a set of features encoded by up to 3 letters (e.g. AEW) shown after writing the ID:
1) A / empty = no game title (Anonymous?) / game title
2) E / empty = more configuration options (Extended?) if the monitor is not fixed (the last letter of the ID becomes E)
3) W / N / empty = Fixed Wide / Fixed Normal / Configurable monitor (goes in the last letter of the ID, unless it's E)
- Boot with Reset + P1 Start : Configuration Setup (operator options)
- Boot with Reset + P1 Cancel : Backup Data Clear (needed to clear hardware/emergency/ID errors)
- Boot with Test + P1 Start + P1 Cancel : Write ID Enter Write Code (writes ID to EEPROM, features depend on vender code)
- They fixed the Update ID bug: it will only show if the EEPROM can be updated. Otherwise Broken ID will be shown (equivalent to Write ID).
jclub2v200 and above:
- Vender codes are associated with an hex number instead of the 3 letters above:
$00 (on some sets produces Failed Write Sequence) .. $10, $20x (special with some settings shown but not changeable)
- Boot with Test + P1 Payout + P1 Cancel : Administrator Setup (release payout quickly! Or it will end with a failure)
jclub2v203 and above:
- Boot with Reset + P1 Start : Configuration Setup (press Test for operator options)
- Boot with Reset + Test + P1 Cancel : Backup All Clear (needed to clear hardware/emergency/ID errors)
darkhors (allegedly based on v400):
- Sprite ram is parsed and converted from the original format (ST-0032 zooming sprites + tilemaps)
to this hardware's plain sprites + 2 tilemaps.
- Boot with Config : System Setup (has printer and rtc setup)
- Boot with Reset + Test + P1 Cancel : Backup All Clear
- Boot with Config + P1 Payout + P1 Cancel : Administrator Setup (release payout quickly, or it will end with a failure)
- Boot with Config + P1 Start + P1 Cancel : Write ID Enter Write Code
To do:
- Emulate coin double sensor. At the moment you will need to enter the config menu and change to single sensor
- Visible area under non-wide setting is $160 pixels wide instead of $150
- Extend palette to 0x20000 entries (palette_device::allocate_palette() prevents more than 0x10000)
- Correct clocks
- darkhors: fix the disalignment between sprites and tilemap (gap in the fence) during play. Other screens are fine
************************************************************************************************************/
#include "emu.h"
#include "cpu/m68000/m68020.h"
#include "machine/eepromser.h"
#include "machine/nvram.h"
#include "st0016.h"
#include "machine/ticket.h"
#include "machine/timer.h"
#include "machine/watchdog.h"
#include "sound/setapcm.h"
#include "sound/okim6295.h"
#include "st0020.h"
#include "emupal.h"
#include "speaker.h"
#include "tilemap.h"
#include "jclub2o.lh"
#include "jclub2.lh"
namespace {
// Common between all hardware (jclub2o, jclub2 and darkhors)
class common_state : public driver_device
{
public:
common_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_eeprom(*this, "eeprom"),
m_hopper1(*this, "hopper1"), m_hopper2(*this, "hopper2"),
m_palette(*this, "palette"),
m_key1(*this, "KEY1.%u", 0), m_key2(*this, "KEY2.%u", 0),
m_input_sel1(0), m_input_sel2(0),
m_out1(0), m_out2(0), m_out3(0)
{ }
uint8_t read_key(required_ioport_array<8> & key, uint8_t mask);
uint8_t console_r();
void console_w(uint8_t data);
uint8_t console_status_r();
void eeprom_93c46_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
TIMER_DEVICE_CALLBACK_MEMBER(scanline_irq);
protected:
required_device<cpu_device> m_maincpu;
required_device<eeprom_serial_93cxx_device> m_eeprom;
required_device<ticket_dispenser_device> m_hopper1, m_hopper2;
required_device<palette_device> m_palette;
required_ioport_array<8> m_key1, m_key2;
uint8_t m_input_sel1, m_input_sel2;
uint32_t m_out1, m_out2, m_out3;
void debug_out();
};
// Newer jclub2 hardware (without ST-0016)
class jclub2_state : public common_state
{
public:
jclub2_state(const machine_config &mconfig, device_type type, const char *tag) :
common_state(mconfig, type, tag),
m_st0020(*this, "st0020")
{ }
void input_sel1_out3_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
void input_sel2_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t p1_r();
uint32_t p2_r();
void out1_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
void out2_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void jclub2(machine_config &config);
void jclub2_map(address_map &map);
protected:
required_device<st0020_device> m_st0020;
};
// Older jclub2 hardware (with ST-0016)
class jclub2o_state : public jclub2_state
{
public:
jclub2o_state(const machine_config &mconfig, device_type type, const char *tag) :
jclub2_state(mconfig, type, tag),
m_soundcpu(*this, "soundcpu"),
m_soundbank(*this, "soundbank")
{ }
required_device<st0016_cpu_device> m_soundcpu;
required_memory_bank m_soundbank;
void eeprom_s29290_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
// ST-0016 <-> 68EC020
uint8_t cmd1_r();
uint8_t cmd2_r();
void cmd1_w(uint8_t data);
void cmd2_w(uint8_t data);
uint8_t cmd_stat_r();
void st0016_rom_bank_w(uint8_t data); // temp?
// 68EC020 <-> ST-0016
uint32_t cmd1_word_r();
uint32_t cmd2_word_r();
void cmd1_word_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
void cmd2_word_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t cmd_stat_word_r();
void init_jclub2o();
void jclub2o(machine_config &config);
void jclub2o_map(address_map &map);
void st0016_io(address_map &map);
void st0016_mem(address_map &map);
private:
uint8_t m_cmd1;
uint8_t m_cmd2;
uint8_t m_cmd_stat;
};
// bootleg darkhors hardware
class darkhors_state : public common_state
{
public:
darkhors_state(const machine_config &mconfig, device_type type, const char *tag) :
common_state(mconfig, type, tag),
m_tmapram(*this, "tmapram"),
m_tmapscroll(*this, "tmapscroll"),
m_tmapram2(*this, "tmapram2"),
m_tmapscroll2(*this, "tmapscroll2"),
m_spriteram(*this, "spriteram"),
m_gfxdecode(*this, "gfxdecode")
{ }
void init_darkhors();
void darkhors(machine_config &config);
void darkhorsa(machine_config &config);
protected:
virtual void video_start() override;
private:
void input_sel_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
uint32_t input_r();
void out1_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
void tmapram_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
void tmapram2_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
TILE_GET_INFO_MEMBER(get_tile_info_0);
TILE_GET_INFO_MEMBER(get_tile_info_1);
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
void darkhors_map(address_map &map);
void darkhorsa_map(address_map &map);
required_shared_ptr<uint32_t> m_tmapram;
required_shared_ptr<uint32_t> m_tmapscroll;
required_shared_ptr<uint32_t> m_tmapram2;
required_shared_ptr<uint32_t> m_tmapscroll2;
required_shared_ptr<uint32_t> m_spriteram;
required_device<gfxdecode_device> m_gfxdecode;
tilemap_t *m_tmap = nullptr;
tilemap_t *m_tmap2 = nullptr;
};
/***************************************************************************
Common Functions
***************************************************************************/
uint8_t common_state::console_r()
{
return 0;
}
void common_state::console_w(uint8_t data)
{
}
uint8_t common_state::console_status_r()
{
// bit 0: 1 = can send to debug console
// bi1 1: 1 = can read from debug console
return 0x3;
}
uint8_t common_state::read_key(required_ioport_array<8> & key, uint8_t mask)
{
switch(mask)
{
case 0x01: return key[0]->read();
case 0x02: return key[1]->read();
case 0x04: return key[2]->read();
case 0x08: return key[3]->read();
case 0x10: return key[4]->read();
case 0x20: return key[5]->read();
case 0x40: return key[6]->read();
case 0x80: return key[7]->read();
}
return 0xff;
}
void common_state::debug_out()
{
// popmessage("OUT: %04X | %04X | %02X--", m_out1 >> 16, m_out2 >> 16, m_out3 >> 24);
}
/***************************************************************************
Video Hardware
(jclub2)
***************************************************************************/
uint32_t jclub2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_palette->black_pen(), cliprect);
m_st0020->update_screen(screen, bitmap, cliprect, true);
return 0;
}
/***************************************************************************
Video Hardware
(darkhors)
***************************************************************************/
TILE_GET_INFO_MEMBER(darkhors_state::get_tile_info_0)
{
uint16_t tile = m_tmapram[tile_index] >> 16;
uint16_t color = m_tmapram[tile_index] & 0xffff;
tileinfo.set(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0);
}
TILE_GET_INFO_MEMBER(darkhors_state::get_tile_info_1)
{
uint16_t tile = m_tmapram2[tile_index] >> 16;
uint16_t color = m_tmapram2[tile_index] & 0xffff;
tileinfo.set(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0);
}
void darkhors_state::tmapram_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(&m_tmapram[offset]);
m_tmap->mark_tile_dirty(offset);
}
void darkhors_state::tmapram2_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(&m_tmapram2[offset]);
m_tmap2->mark_tile_dirty(offset);
}
void darkhors_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint32_t *s = m_spriteram;
uint32_t *end = m_spriteram + 0x02000/4;
for ( ; s < end; s += 8/4 )
{
int sx = (s[ 0 ] >> 16);
int sy = (s[ 0 ] & 0xffff);
int attr = (s[ 1 ] >> 16);
int code = (s[ 1 ] & 0xffff);
// List end
if (sx & 0x8000)
break;
int flipx = 0;
int flipy = 0;
int color = (attr & 0x0200) ? (attr & 0x1ff) : (attr & 0x1ff) * 4;
// Sign extend the position
sx = (sx & 0x1ff) - (sx & 0x200);
sy = (sy & 0x1ff) - (sy & 0x200);
sy = -sy;
sy += 0xf8;
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
code/2, color,
flipx, flipy, sx, sy, 0);
}
}
void darkhors_state::video_start()
{
common_state::video_start();
m_tmap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkhors_state::get_tile_info_0)), TILEMAP_SCAN_ROWS, 16,16, 0x40,0x40);
m_tmap2= &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(darkhors_state::get_tile_info_1)), TILEMAP_SCAN_ROWS, 16,16, 0x40,0x40);
m_tmap->set_transparent_pen(0);
m_tmap2->set_transparent_pen(0);
m_gfxdecode->gfx(0)->set_granularity(64); // 256 colour sprites with palette selectable on 64 colour boundaries
}
uint32_t darkhors_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int layers_ctrl = -1;
#ifdef MAME_DEBUG
if (machine().input().code_pressed(KEYCODE_Z))
{
int mask = 0;
if (machine().input().code_pressed(KEYCODE_Q)) mask |= 1;
if (machine().input().code_pressed(KEYCODE_W)) mask |= 2;
if (machine().input().code_pressed(KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
bitmap.fill(m_palette->black_pen(), cliprect);
m_tmap->set_scrollx(0, (m_tmapscroll[0] >> 16) - 5);
m_tmap->set_scrolly(0, (m_tmapscroll[0] & 0xffff) - 0xff );
if (layers_ctrl & 1) m_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
m_tmap2->set_scrollx(0, (m_tmapscroll2[0] >> 16) - 5);
m_tmap2->set_scrolly(0, (m_tmapscroll2[0] & 0xffff) - 0xff );
if (layers_ctrl & 2) m_tmap2->draw(screen, bitmap, cliprect, 0, 0);
if (layers_ctrl & 4) draw_sprites(bitmap,cliprect);
#ifdef MAME_DEBUG
#if 0
popmessage("%04X-%04X %04X-%04X %04X-%04X %04X-%04X %04X-%04X %04X-%04X",
m_tmapscroll[0] >> 16, m_tmapscroll[0] & 0xffff,
m_tmapscroll[1] >> 16, m_tmapscroll[1] & 0xffff,
m_tmapscroll[2] >> 16, m_tmapscroll[2] & 0xffff,
m_tmapscroll[3] >> 16, m_tmapscroll[3] & 0xffff,
m_tmapscroll[4] >> 16, m_tmapscroll[4] & 0xffff,
m_tmapscroll[5] >> 16, m_tmapscroll[5] & 0xffff
);
#endif
#endif
return 0;
}
/***************************************************************************
Memory Map
***************************************************************************/
// I/O (both older and newer jclub2 hardware)
void jclub2_state::input_sel2_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
// sometimes 0x80000000 bit is set
// (it is cleared before reading from 4d0000.b / 4d0004.b / 4d0008.b / 4d000c.b)
if (ACCESSING_BITS_16_23)
m_input_sel2 = data >> 16;
}
void jclub2_state::input_sel1_out3_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(&m_out3);
if (ACCESSING_BITS_16_23)
m_input_sel1 = data >> 16;
if (ACCESSING_BITS_24_31)
{
// 0x0800 P2 divider coil
// -
debug_out();
}
}
uint32_t jclub2_state::p1_r()
{
uint32_t ret = ioport("P1LOW")->read() & 0x00ffffff;
return ret | (read_key(m_key1, m_input_sel1) << 24);
}
uint32_t jclub2_state::p2_r()
{
uint32_t ret = ioport("P2LOW")->read() & 0x00ffffff;
return ret | (read_key(m_key2, m_input_sel2) << 24);
}
void jclub2_state::out1_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(&m_out1);
if (ACCESSING_BITS_16_31)
{
// 0x1000 P2 hopper rotate
// -
// 0x0200 P1 divider coil
// 0x0100 P2 lockout coil
// 0x0080 P1 lockout coil
// -
// 0x0020 counter meter 6
// 0x0010 counter meter 1
// 0x0008 counter meter 4
// 0x0004 counter meter 3
// 0x0002 counter meter 5
// 0x0001 counter meter 2
m_hopper2->motor_w( data & 0x10000000);
machine().bookkeeping().coin_lockout_w(1, (~data) & 0x01000000);
machine().bookkeeping().coin_lockout_w(0, (~data) & 0x00800000);
debug_out();
}
}
void jclub2_state::out2_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(&m_out2);
if (ACCESSING_BITS_16_31)
{
// 0x8000 P1 hopper rotate
m_hopper1->motor_w(data & 0x80000000);
debug_out();
}
}
// Older hardware (ST-0020 + ST-0016) only
void jclub2o_state::eeprom_s29290_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (data & ~0xff000000)
logerror("%s: Unknown EEPROM bit written %08X\n", machine().describe_context(), data);
if (ACCESSING_BITS_24_31)
{
// latch the bit
m_eeprom->di_write((data & 0x01000000) >> 24);
// reset line asserted: reset.
m_eeprom->cs_write((data & 0x08000000) ? ASSERT_LINE : CLEAR_LINE );
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write((data & 0x04000000) ? ASSERT_LINE : CLEAR_LINE );
}
}
// 68EC020 <-> ST-0016
uint32_t jclub2o_state::cmd1_word_r()
{
m_cmd_stat &= ~0x02;
return m_cmd1 << 24;
}
uint32_t jclub2o_state::cmd2_word_r()
{
m_cmd_stat &= ~0x08;
return m_cmd2 << 24;
}
uint32_t jclub2o_state::cmd_stat_word_r()
{
return m_cmd_stat << 24;
}
void jclub2o_state::cmd1_word_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (ACCESSING_BITS_24_31)
{
m_cmd_stat |= 0x01;
m_cmd1 = data >> 24;
logerror("%s: cmd1_w %02x\n", machine().describe_context(), m_cmd1);
}
}
void jclub2o_state::cmd2_word_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (ACCESSING_BITS_24_31)
{
m_cmd_stat |= 0x04;
m_cmd2 = data >> 24;
logerror("%s: cmd2_w %02x\n", machine().describe_context(), m_cmd2);
}
}
void jclub2o_state::jclub2o_map(address_map &map)
{
map(0x000000, 0x27ffff).rom();
map(0x400000, 0x41ffff).ram().share("nvram"); // battery
map(0x490000, 0x490003).w(FUNC(jclub2o_state::eeprom_s29290_w));
map(0x4a0000, 0x4a0003).w(FUNC(jclub2o_state::out2_w));
// map(0x4a0010, 0x4a0013).w(FUNC(jclub2o_map::));
// map(0x4a0020, 0x4a0023).w(FUNC(jclub2o_map::));
// map(0x4a0030, 0x4a0033).w(FUNC(jclub2o_map::));
// ST-0016
map(0x4b0000, 0x4b0003).rw(FUNC(jclub2o_state::cmd1_word_r), FUNC(jclub2o_state::cmd1_word_w));
map(0x4b0004, 0x4b0007).rw(FUNC(jclub2o_state::cmd2_word_r), FUNC(jclub2o_state::cmd2_word_w));
map(0x4b0008, 0x4b000b).r(FUNC(jclub2o_state::cmd_stat_word_r));
map(0x4d0000, 0x4d0003).nopr().nopw(); // reads seem unused? this write would go to two 7-segs (but the code is never called)
map(0x4d0004, 0x4d0007).nopr();
map(0x4d0008, 0x4d000b).nopr();
map(0x4d000c, 0x4d000f).nopr();
map(0x4e0000, 0x4e0003).r(FUNC(jclub2o_state::p2_r)).w(FUNC(jclub2o_state::input_sel2_w));
map(0x580000, 0x580003).portr("EEPROM");
map(0x580004, 0x580007).r(FUNC(jclub2o_state::p1_r));
map(0x580008, 0x58000b).portr("COIN");
map(0x58000c, 0x58000f).w(FUNC(jclub2o_state::input_sel1_out3_w));
map(0x580010, 0x580013).w(FUNC(jclub2o_state::out1_w));
// map(0x580018, 0x58001b).w(FUNC(jclub2o_map::));
// map(0x58001c, 0x58001f).w(FUNC(jclub2o_map::));
map(0x580200, 0x580201).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x580401, 0x580401).rw(FUNC(jclub2o_state::console_r), FUNC(jclub2o_state::console_w));
map(0x580421, 0x580421).r(FUNC(jclub2o_state::console_status_r)); //.w(FUNC(jclub2o_map::));
// map(0x580440, 0x580443).w(FUNC(jclub2o_map::));
// ST-0020
map(0x600000, 0x67ffff).rw(m_st0020, FUNC(st0020_device::sprram_r), FUNC(st0020_device::sprram_w));
map(0x680000, 0x69ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");
map(0x6a0000, 0x6bffff).ram();
map(0x6c0000, 0x6c00ff).rw(m_st0020, FUNC(st0020_device::regs_r), FUNC(st0020_device::regs_w));
map(0x700000, 0x7fffff).rw(m_st0020, FUNC(st0020_device::gfxram_r), FUNC(st0020_device::gfxram_w));
}
// ST-0016 map
// common rombank? should go in machine/st0016 with larger address space exposed?
void jclub2o_state::st0016_rom_bank_w(uint8_t data)
{
m_soundbank->set_entry(data & 0x1f);
}
uint8_t jclub2o_state::cmd1_r()
{
m_cmd_stat &= ~0x01;
return m_cmd1;
}
uint8_t jclub2o_state::cmd2_r()
{
m_cmd_stat &= ~0x04;
return m_cmd2;
}
uint8_t jclub2o_state::cmd_stat_r()
{
return m_cmd_stat;
}
void jclub2o_state::cmd1_w(uint8_t data)
{
m_cmd1 = data;
m_cmd_stat |= 0x02;
logerror("%s: cmd1_w %02x\n", machine().describe_context(), m_cmd1);
}
void jclub2o_state::cmd2_w(uint8_t data)
{
m_cmd2 = data;
m_cmd_stat |= 0x08;
logerror("%s: cmd2_w %02x\n", machine().describe_context(), m_cmd2);
}
void jclub2o_state::st0016_mem(address_map &map)
{
map(0x0000, 0x7fff).rom();
map(0x8000, 0xbfff).bankr("soundbank");
map(0xe800, 0xe8ff).ram();
//map(0xe900, 0xe9ff) // sound - internal
//map(0xec00, 0xec1f).rw(FUNC(jclub2o_state::st0016_character_ram_r), FUNC(jclub2o_state::st0016_character_ram_w));
map(0xf000, 0xffff).ram();
}
void jclub2o_state::st0016_io(address_map &map)
{
map.global_mask(0xff);
//map(0x00, 0xbf).rw(FUNC(jclub2o_state::st0016_vregs_r), FUNC(jclub2o_state::st0016_vregs_w));
map(0xc0, 0xc0).rw(FUNC(jclub2o_state::cmd1_r), FUNC(jclub2o_state::cmd1_w));
map(0xc1, 0xc1).rw(FUNC(jclub2o_state::cmd2_r), FUNC(jclub2o_state::cmd2_w));
map(0xc2, 0xc2).r(FUNC(jclub2o_state::cmd_stat_r));
map(0xe1, 0xe1).w(FUNC(jclub2o_state::st0016_rom_bank_w));
map(0xe7, 0xe7).nopw(); // watchdog?
//map(0xf0, 0xf0).r(FUNC(jclub2o_state::st0016_dma_r));
}
// Newer hardware (ST-0032) only
void common_state::eeprom_93c46_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (data & ~0xff000000)
logerror("%s: Unknown EEPROM bit written %08X\n", machine().describe_context(), data);
if (ACCESSING_BITS_24_31)
{
// latch the bit
m_eeprom->di_write((data & 0x04000000) >> 26);
// reset line asserted: reset.
m_eeprom->cs_write((data & 0x01000000) ? ASSERT_LINE : CLEAR_LINE );
// clock line asserted: write latch or select next bit to read
m_eeprom->clk_write((data & 0x02000000) ? ASSERT_LINE : CLEAR_LINE );
}
}
void jclub2_state::jclub2_map(address_map &map)
{
map(0x000000, 0x27ffff).rom();
map(0x400000, 0x41ffff).ram().share("nvram"); // battery
map(0x490000, 0x490003).w(FUNC(jclub2_state::eeprom_93c46_w));
map(0x4a0000, 0x4a0003).w(FUNC(jclub2_state::out2_w));
map(0x4d0000, 0x4d0003).nopr().nopw(); // reads seem unused? this write would go to two 7-segs (but the code is never called)
map(0x4d0004, 0x4d0007).nopr();
map(0x4d0008, 0x4d000b).nopr();
map(0x4d000c, 0x4d000f).nopr();
map(0x4e0000, 0x4e0003).r(FUNC(jclub2_state::p2_r)).w(FUNC(jclub2_state::input_sel2_w));
map(0x580000, 0x580003).portr("EEPROM");
map(0x580004, 0x580007).r(FUNC(jclub2_state::p1_r));
map(0x580008, 0x58000b).portr("COIN");
map(0x58000c, 0x58000f).w(FUNC(jclub2_state::input_sel1_out3_w));
map(0x580010, 0x580013).w(FUNC(jclub2_state::out1_w));
// map(0x580018, 0x58001b).w(FUNC(jclub2_map::));
// map(0x58001c, 0x58001f).w(FUNC(jclub2_map::));
map(0x580200, 0x580201).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x580401, 0x580401).rw(FUNC(jclub2_state::console_r), FUNC(jclub2_state::console_w));
map(0x580421, 0x580421).r(FUNC(jclub2_state::console_status_r)); //.w(FUNC(jclub2_map::));
// map(0x580440, 0x580443).w(FUNC(jclub2_map::));
// ST-0032
map(0x800000, 0x87ffff).rw(m_st0020, FUNC(st0020_device::sprram_r), FUNC(st0020_device::sprram_w));
map(0x880000, 0x89ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");
map(0x8a0000, 0x8bffff).ram(); // this should still be palette ram!
map(0x8c0000, 0x8c00ff).rw(m_st0020, FUNC(st0020_device::regs_r), FUNC(st0020_device::regs_w));
map(0x8e0000, 0x8e01ff).rw("st0032_snd", FUNC(st0032_sound_device::snd_r), FUNC(st0032_sound_device::snd_w));
map(0x8e0200, 0x8e0201).rw("st0032_snd", FUNC(st0032_sound_device::key_r), FUNC(st0032_sound_device::key_w));
map(0x8e0210, 0x8e0213).ram(); // sound?
map(0x900000, 0x9fffff).rw(m_st0020, FUNC(st0020_device::gfxram_r), FUNC(st0020_device::gfxram_w));
}
// bootleg darkhors hardware
void darkhors_state::input_sel_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
if (ACCESSING_BITS_16_23)
m_input_sel1 = data >> 16;
if (ACCESSING_BITS_24_31)
m_input_sel2 = data >> 24;
}
uint32_t darkhors_state::input_r()
{
return (read_key(m_key1, m_input_sel1) << 16) |
(read_key(m_key2, m_input_sel2) << 24) ;
}
void darkhors_state::out1_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
COMBINE_DATA(&m_out1);
if (ACCESSING_BITS_16_31)
{
// note: the output test is buggy and crashes
// when pressing start (rts @ 328b8)
// 0x8000 P2 lockout coil
// 0x4000 P2 divider coil
// 0x2000 P2 hopper rotate
// 0x1000 P1 lockout coil
// 0x0800 P1 divider coil
// 0x0400 P1 hopper rotate
// -
// 0x0100 tower lamp 3
// 0x0080 tower lamp 2
// 0x0040 tower lamp 1
// 0x0020 counter meter 6
// 0x0010 counter meter 5
// 0x0008 counter meter 4
// 0x0004 counter meter 3
// 0x0002 counter meter 2
// 0x0001 counter meter 1
machine().bookkeeping().coin_lockout_w(1, (~data) & 0x80000000);
machine().bookkeeping().coin_lockout_w(0, (~data) & 0x10000000);
debug_out();
}
}
void darkhors_state::darkhors_map(address_map &map)
{
map(0x000000, 0x0fffff).rom();
map(0x400000, 0x41ffff).ram().share("nvram"); // battery
map(0x490040, 0x490043).w(FUNC(darkhors_state::eeprom_93c46_w));
map(0x4e0080, 0x4e0083).portr("SERVICE").w(FUNC(darkhors_state::out1_w));
map(0x580000, 0x580003).portr("UNKNOWN");
map(0x580004, 0x580007).portr("COIN");
map(0x580008, 0x58000b).r(FUNC(darkhors_state::input_r));
map(0x58000c, 0x58000f).w(FUNC(darkhors_state::input_sel_w));
// map(0x580010, 0x580013).w(FUNC(darkhors_state::));
// map(0x580018, 0x58001b).w(FUNC(darkhors_state::));
// map(0x58001c, 0x58001f).w(FUNC(darkhors_state::));
map(0x580084, 0x580084).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write));
// map(0x58008c, 0x58008f).w(FUNC(darkhors_state::));
map(0x580200, 0x580201).r("watchdog", FUNC(watchdog_timer_device::reset16_r));
map(0x580401, 0x580401).rw(FUNC(darkhors_state::console_r), FUNC(darkhors_state::console_w));
map(0x580421, 0x580421).r(FUNC(darkhors_state::console_status_r));
map(0x800000, 0x86bfff).ram();
map(0x86c000, 0x86ffff).ram().w(FUNC(darkhors_state::tmapram_w)).share("tmapram");
map(0x870000, 0x873fff).ram().w(FUNC(darkhors_state::tmapram2_w)).share("tmapram2");
map(0x874000, 0x87dfff).ram();
map(0x87e000, 0x87ffff).ram().share("spriteram");
map(0x880000, 0x89ffff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette");
map(0x8a0000, 0x8bffff).ram(); // this should still be palette ram!
map(0x8c0120, 0x8c012f).writeonly().share("tmapscroll");
map(0x8c0130, 0x8c013f).writeonly().share("tmapscroll2");
}
void darkhors_state::darkhorsa_map(address_map &map)
{
darkhors_map(map);
map(0x8c0020, 0x8c002f).writeonly().share("tmapscroll");
map(0x8c0030, 0x8c003f).writeonly().share("tmapscroll2");
map(0x8c0120, 0x8c012f).unmaprw();
map(0x8c0130, 0x8c013f).unmaprw();
}
/***************************************************************************
Input Ports
***************************************************************************/
/***************************************************************************
Keyboards (39 pressure sensitive keys)
white---------------------- cyan-------------------
1-2 1-3 1-4 1-5 1-6 1-7 1-8 2-3 2-4 2-5 2-6 2-7 2-8
orange------------- green---------- grey------- yel
3-4 3-5 3-6 3-7 3-8 4-5 4-6 4-7 4-8 5-6 5-7 5-8 CAN
cyan--- whi red---------------------------- yellow-
6-7 6-8 7-8 1 2 3 4 5 6 7 8 PAY STA
***************************************************************************/
static INPUT_PORTS_START( keyboards )
PORT_START("KEY1.0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1") PORT_CODE(KEYCODE_1_PAD)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2") PORT_CODE(KEYCODE_2_PAD)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3") PORT_CODE(KEYCODE_3_PAD)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4") PORT_CODE(KEYCODE_4_PAD)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5") PORT_CODE(KEYCODE_5_PAD)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 6") PORT_CODE(KEYCODE_6_PAD)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 7") PORT_CODE(KEYCODE_7_PAD)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 8") PORT_CODE(KEYCODE_8_PAD)
PORT_START("KEY2.0")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 6")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 7")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 8")
PORT_START("KEY1.1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-2") PORT_CODE(KEYCODE_Z)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-3") PORT_CODE(KEYCODE_A)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-4") PORT_CODE(KEYCODE_Q)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-5") PORT_CODE(KEYCODE_Y)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-6") PORT_CODE(KEYCODE_J)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-7") PORT_CODE(KEYCODE_0_PAD)
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 1-8") PORT_CODE(KEYCODE_ENTER_PAD)
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.1")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-2")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-3")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-4")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-5")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-6")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-7")
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 1-8")
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1.2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-3") PORT_CODE(KEYCODE_X)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-4") PORT_CODE(KEYCODE_S)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-5") PORT_CODE(KEYCODE_W)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-6") PORT_CODE(KEYCODE_U)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-7") PORT_CODE(KEYCODE_K)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 2-8") PORT_CODE(KEYCODE_DEL_PAD)
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-3")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-4")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-5")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-6")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-7")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 2-8")
PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1.3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-4") PORT_CODE(KEYCODE_C)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-5") PORT_CODE(KEYCODE_D)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-6") PORT_CODE(KEYCODE_E)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-7") PORT_CODE(KEYCODE_I)
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 3-8") PORT_CODE(KEYCODE_L)
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.3")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-4")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-5")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-6")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-7")
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 3-8")
PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1.4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-5") PORT_CODE(KEYCODE_V)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-6") PORT_CODE(KEYCODE_F)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-7") PORT_CODE(KEYCODE_R)
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 4-8") PORT_CODE(KEYCODE_O)
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.4")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-5")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-6")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-7")
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 4-8")
PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1.5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-6") PORT_CODE(KEYCODE_B)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-7") PORT_CODE(KEYCODE_G)
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 5-8") PORT_CODE(KEYCODE_T)
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.5")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-6")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-7")
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 5-8")
PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1.6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 6-7") PORT_CODE(KEYCODE_N)
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 6-8") PORT_CODE(KEYCODE_H)
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.6")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 6-7")
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 6-8")
PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY1.7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P1 Bet 7-8") PORT_CODE(KEYCODE_M)
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_START("KEY2.7")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("P2 Bet 7-8")
PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNKNOWN )
INPUT_PORTS_END
static INPUT_PORTS_START( jclub2v100 )
// P2 at 4e0000.b, P1 at 580004.b
PORT_INCLUDE( keyboards )
PORT_START("EEPROM") // 580000.w
PORT_BIT( 0x74ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_CONFNAME(0x01000000, 0x01000000, "Coin Chutes Polarity" )
PORT_CONFSETTING( 0x01000000, DEF_STR( Normal) )
PORT_CONFSETTING( 0x00000000, "Reverse" ) // warning message
PORT_CONFNAME(0x02000000, 0x02000000, "Main Loop Down" )
PORT_CONFSETTING( 0x02000000, DEF_STR( Off ) )
PORT_CONFSETTING( 0x00000000, DEF_STR( On ) ) // Emergency Error 0001
PORT_CONFNAME(0x08000000, 0x08000000, "System Int Down")