/
mpu4vid.cpp
9219 lines (7513 loc) · 552 KB
/
mpu4vid.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:James Wallace, Philip Bennett
/***********************************************************************************************************
Barcrest MPU4 Extension driver by J.Wallace, Phil Bennett and Anonymous.
--- Board Setup ---
For the Barcrest MPU4 Video system, the GAME CARD (cartridge) contains the MPU4 video bios in the usual ROM
space (occupying 16k), an interface card to connect an additional Video board, and a 6850 serial IO to
communicate with said board.
The VIDEO BOARD is driven by a 10mhz 68000 processor, and contains a 6840PTM, 6850 serial IO
(the other end of the communications), an SAA1099 for stereo sound and SCN2674 gfx chip.
The VIDEO CARTRIDGE plugs into the video board, and contains the program ROMs for the video based game.
Like the MPU4 game card, in some cases an extra OKI sound chip is added to the video board's game card,
as well as extra RAM.
There is a protection chip similar to and replacing the MPU4 Characteriser.
No video card schematics ever left the PCB factory, but some decent scans of the board have been made,
now also available for review.
Additional: 68k HALT line is tied to the reset circuit of the MPU4.
--- Preliminary MPU4 Video Interface Card Memorymap ---
hex |r/w| D D D D D D D D |
location | | 7 6 5 4 3 2 1 0 | function
-----------+---+-----------------+--------------------------------------------------------------------------
0000-07FF |R/W| D D D D D D D D | 2k RAM
-----------+---+-----------------+--------------------------------------------------------------------------
0800 |R/W| | ACIA 6850
-----------+---+-----------------+--------------------------------------------------------------------------
0900- |R/W| D D D D D D D D | MC6840 PTM IC2
Clock1 <--------------------------------------
| |
V |
Output1 ---> Clock2 |
|
Output2 --+-> Clock3 |
| |
| Output3 ---> 'to audio amp' ??
|
+--------> CA1 IC3 (
IRQ line connected to CPU
-----------+---+-----------------+--------------------------------------------------------------------------
0A00-0A03 |R/W| D D D D D D D D | PIA6821 IC3 port A Lamp Drives 1,2,3,4,6,7,8,9 (sic)(IC14)
| | |
| | | CA1 <= output2 from PTM6840 (IC2)
| | | CA2 => alpha data
| | |
| | | port B Lamp Drives 10,11,12,13,14,15,16,17 (sic)(IC13)
| | |
| | | CB2 => alpha reset (clock on Dutch systems)
| | |
-----------+---+-----------------+--------------------------------------------------------------------------
0B00-0B03 |R/W| D D D D D D D D | PIA6821 IC4 port A = data for 7seg leds (pins 10 - 17, via IC32)
| | |
| | | CA1 INPUT, 50 Hz input (used to generate IRQ)
| | | CA2 OUTPUT, connected to pin2 74LS138 CE for multiplexer
| | | (B on LED strobe multiplexer)
| | | IRQA connected to IRQ of CPU
| | | port B
| | | PB7 = INPUT, serial port Receive data (Rx)
| | | PB6 = INPUT, reel A sensor
| | | PB5 = INPUT, reel B sensor
| | | PB4 = INPUT, reel C sensor
| | | PB3 = INPUT, reel D sensor
| | | PB2 = INPUT, Connected to CA1 (50Hz signal)
| | | PB1 = INPUT, undercurrent sense
| | | PB0 = INPUT, overcurrent sense
| | |
| | | CB1 INPUT, used to generate IRQ on edge of serial input line
| | | CB2 OUTPUT, enable signal for reel optics
| | | IRQB connected to IRQ of CPU
| | |
-----------+---+-----------------+--------------------------------------------------------------------------
0C00-0C03 |R/W| D D D D D D D D | PIA6821 IC5 port A
| | |
| | | PA0-PA7, INPUT AUX1 connector
| | |
| | | CA2 OUTPUT, serial port Transmit line
| | | CA1 not connected
| | | IRQA connected to IRQ of CPU
| | |
| | | port B
| | |
| | | PB0-PB7 INPUT, AUX2 connector
| | |
| | | CB1 INPUT, connected to PB7 (Aux2 connector pin 4)
| | |
| | | CB2 OUTPUT, AY8913 chip select line
| | | IRQB connected to IRQ of CPU
| | |
-----------+---+-----------------+--------------------------------------------------------------------------
0D00-0D03 |R/W| D D D D D D D D | PIA6821 IC6
| | |
| | | port A
| | |
| | | PA0 - PA7 (INPUT/OUTPUT) data port AY8913 sound chip
| | |
| | | CA1 INPUT, not connected
| | | CA2 OUTPUT, BC1 pin AY8913 sound chip
| | | IRQA , connected to IRQ CPU
| | |
| | | port B
| | |
| | | PB0-PB3 OUTPUT, reel A
| | | PB4-PB7 OUTPUT, reel B
| | |
| | | CB1 INPUT, not connected
| | | CB2 OUTPUT, B01R pin AY8913 sound chip
| | | IRQB , connected to IRQ CPU
| | |
-----------+---+-----------------+--------------------------------------------------------------------------
0E00-0E03 |R/W| D D D D D D D D | PIA6821 IC7
| | |
| | | port A
| | |
| | | PA0-PA3 OUTPUT, reel C
| | | PA4-PA7 OUTPUT, reel D
| | | CA1 INPUT, not connected
| | | CA2 OUTPUT, A on LED strobe multiplexer
| | | IRQA , connected to IRQ CPU
| | |
| | | port B
| | |
| | | PB0-PB6 OUTPUT mech meter 1-7 or reel E + F
| | | PB7 Voltage drop sensor
| | | CB1 INPUT, not connected
| | | CB2 OUTPUT,mech meter 8
| | | IRQB , connected to IRQ CPU
| | |
-----------+---+-----------------+--------------------------------------------------------------------------
0F00-0F03 |R/W| D D D D D D D D | PIA6821 IC8
| | |
| | | port A
| | |
| | | PA0-PA7 INPUT multiplexed inputs data
| | |
| | | CA1 INPUT, not connected
| | | CA2 OUTPUT, C on LED strobe multiplexer
| | | IRQA connected to IRQ CPU
| | |
| | | port B
| | |
| | | PB0-PB7 OUTPUT triacs outputs connector PL6
| | | used for slides / hoppers
| | |
| | | CB1 INPUT, not connected
| | | CB2 OUTPUT, pin1 alpha display PL7 (clock signal)
| | | IRQB connected to IRQ CPU
| | |
-----------+---+-----------------+--------------------------------------------------------------------------
4000-40FF |R/W| D D D D D D D D | RAM ?
-----------+---+-----------------+--------------------------------------------------------------------------
BE00-BFFF |R/W| D D D D D D D D | RAM
-----------+---+-----------------+--------------------------------------------------------------------------
C000-FFFF | R | D D D D D D D D | ROM
-----------+---+-----------------+--------------------------------------------------------------------------
Everything here is preliminary... the boards are quite fussy with regards their self tests
and the timing may have to be perfect for them to function correctly. (as the comms are
timer driven, the video is capable of various raster effects etc.)
TODO:
- Correctly implement characteriser protection for each game.
- Get the BWB games running
* They have a slightly different 68k memory map. The 6850 is at e00000 and the 6840 is at e01000
They appear to hang on the handshake with the MPU4 board
- Layouts needed for the other working games, and DIP switches need checking/altering (no test mode?)
- BWB Vid5 cabinets seem to have the speakers wired the other way according to test (left/right swapped)
- BWB sampled sound seems to not play despite hookup.
***********************************************************************************************************/
#include "emu.h"
#include "mpu4.h"
#include "cpu/m6809/m6809.h"
#include "cpu/m68000/m68000.h"
#include "machine/6821pia.h"
#include "machine/6840ptm.h"
#include "machine/6850acia.h"
#include "machine/meters.h"
#include "machine/nvram.h"
#include "machine/roc10937.h"
#include "machine/steppers.h"
#include "sound/ay8910.h"
#include "sound/okim6376.h"
#include "sound/saa1099.h"
#include "video/ef9369.h"
#include "video/scn2674.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
#include "crmaze2p.lh"
#include "crmaze4p.lh"
#include "v4addlad.lh"
#include "v4barqst.lh"
#include "v4dbltak.lh"
#include "v4psi.lh"
#include "v4strike.lh"
#define VERBOSE (0)
#include "logmacro.h"
#define VIDEO_MASTER_CLOCK XTAL(10'000'000)
namespace {
class mpu4vid_state : public mpu4_state
{
public:
mpu4vid_state(const machine_config &mconfig, device_type type, const char *tag) :
mpu4_state(mconfig, type, tag),
m_videocpu(*this, "video"),
m_scn2674(*this, "scn2674_vid"),
m_vid_vidram(*this, "vid_vidram", 0x20000, ENDIANNESS_BIG),
m_vid_mainram(*this, "vid_mainram"),
m_acia_0(*this, "acia6850_0"),
m_acia_1(*this, "acia6850_1"),
m_ptm(*this, "6840ptm_68k"),
m_trackx_port(*this, "TRACKX"),
m_tracky_port(*this, "TRACKY"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_ef9369(*this, "ef9369")
{
}
void mpu4_vid(machine_config &config);
void mpu4_vid_strike(machine_config &config);
void mpu4_vid_cheatchr(machine_config &config);
void bwbvid(machine_config &config);
void crmaze_base(machine_config &config);
void crmaze(machine_config &config);
void bwbvid_oki(machine_config &config);
void bwbvid_oki_bt471(machine_config &config);
void bwbvid_oki_bt471_german(machine_config &config);
void mating(machine_config &config);
void vid_oki(machine_config &config);
void init_v4barqst2();
void init_quidgrid();
void init_v4barqst();
void init_timemchn();
void init_v4opt3();
void init_eyesdown();
void init_crmaze();
void init_crmaze_flutter();
void init_prizeinv();
void init_strikeit();
void init_v4wize();
void init_turnover();
//void init_adders();
void init_mating();
void init_skiltrek();
void init_cybcas();
void init_bwbhack();
protected:
virtual void machine_start() override;
virtual void machine_reset() override;
virtual void video_start() override;
private:
required_device<m68000_base_device> m_videocpu;
optional_device<scn2674_device> m_scn2674;
memory_share_creator<uint16_t> m_vid_vidram;
optional_shared_ptr<uint16_t> m_vid_mainram;
required_device<acia6850_device> m_acia_0;
required_device<acia6850_device> m_acia_1;
required_device<ptm6840_device> m_ptm;
optional_ioport m_trackx_port;
optional_ioport m_tracky_port;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
optional_device<ef9369_device> m_ef9369;
//Video
uint8_t m_m6840_irq_state;
uint8_t m_m6850_irq_state;
uint16_t m_gfx_index;
int8_t m_cur[2];
SCN2674_DRAW_CHARACTER_MEMBER(display_pixels);
void m6809_acia_irq(int state);
void m68k_acia_irq(int state);
void cpu1_ptm_irq(int state);
void vid_o1_callback(int state);
void vid_o2_callback(int state);
void vid_o3_callback(int state);
uint8_t pia_ic5_porta_track_r();
void update_mpu68_interrupts(int state);
uint16_t mpu4_vid_vidram_r(offs_t offset);
void mpu4_vid_vidram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
EF9369_COLOR_UPDATE(ef9369_color_update);
void vidcharacteriser_w(offs_t offset, uint8_t data);
uint8_t vidcharacteriser_r(offs_t offset);
void mpu_video_reset(int state);
void vram_w(offs_t offset, uint8_t data);
uint8_t vram_r(offs_t offset);
void ic3ss_vid_w(offs_t offset, uint8_t data);
void bwbvidoki_68k_base_map(address_map &map);
void bwbvidoki_68k_map(address_map &map);
void bwbvidoki_68k_bt471_map(address_map &map);
void bwbvid_68k_map(address_map &map);
void mpu4_68k_map_base(address_map &map);
void mpu4_68k_map(address_map &map);
void mpu4_68k_map_strike(address_map &map);
void mpu4_vram(address_map &map);
void mpu4oki_68k_map(address_map &map);
void mpu4_6809_map(address_map &map);
void mpu4_6809_german_map(address_map &map);
uint8_t vidcharacteriser_4k_lookup_r(offs_t offset);
void hack_bwb_startup_protection();
uint8_t mpu4_vid_bt_a00004_r(offs_t offset);
void mpu4_vid_bt_a00002_w(offs_t offset, uint8_t data);
void mpu4_vid_bt_a00008_w(offs_t offset, uint8_t data);
uint8_t m_bt_palbase;
uint8_t m_bt_which;
uint8_t m_btpal_r[0x100];
uint8_t m_btpal_g[0x100];
uint8_t m_btpal_b[0x100];
};
/*************************************
*
* Interrupt system
*
*************************************/
/* The interrupt system consists of a 74148 priority encoder
with the following interrupt priorities. A lower number
indicates a lower priority:
7 - Game Card
6 - Game Card
5 - Game Card
4 - Game Card
3 - 2674 AVDC
2 - 6850 ACIA
1 - 6840 PTM
0 - Unused
*/
void mpu4vid_state::update_mpu68_interrupts(int state)
{
m_videocpu->set_input_line(1, m_m6840_irq_state ? ASSERT_LINE : CLEAR_LINE);
m_videocpu->set_input_line(2, m_m6850_irq_state ? ASSERT_LINE : CLEAR_LINE);
}
/* Communications with 6809 board */
void mpu4vid_state::m6809_acia_irq(int state)
{
m_acia_1->write_cts(state);
m_maincpu->set_input_line(M6809_IRQ_LINE, state);
}
void mpu4vid_state::m68k_acia_irq(int state)
{
m_acia_0->write_cts(state);
m_m6850_irq_state = state;
update_mpu68_interrupts(1);
}
void mpu4vid_state::cpu1_ptm_irq(int state)
{
m_m6840_irq_state = state;
update_mpu68_interrupts(1);
}
void mpu4vid_state::vid_o1_callback(int state)
{
m_ptm->set_c2(state); /* this output is the clock for timer2 */
m_acia_0->write_txc(state);
m_acia_0->write_rxc(state);
m_acia_1->write_txc(state);
m_acia_1->write_rxc(state);
}
void mpu4vid_state::vid_o2_callback(int state)
{
m_ptm->set_c3(state); /* this output is the clock for timer3 */
}
void mpu4vid_state::vid_o3_callback(int state)
{
m_ptm->set_c1(state); /* this output is the clock for timer1 */
}
static const gfx_layout mpu4_vid_char_8x8_layout =
{
8,8,
0x1000, /* 0x1000 tiles (128k of GFX RAM, 0x20 bytes per tile) */
4,
{ 0,8,16,24 },
{ 0,1,2,3,4,5,6,7 },
{ 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32},
8*32
};
void mpu4vid_state::vram_w(offs_t offset, uint8_t data)
{
m_vid_mainram[offset] = data | (m_vid_mainram[offset] & 0xff00);
}
uint8_t mpu4vid_state::vram_r(offs_t offset)
{
return m_vid_mainram[offset];
}
void mpu4vid_state::mpu4_vram(address_map &map)
{
map(0x0000, 0x7fff).rw(FUNC(mpu4vid_state::vram_r), FUNC(mpu4vid_state::vram_w));
}
SCN2674_DRAW_CHARACTER_MEMBER(mpu4vid_state::display_pixels)
{
if (!lg)
{
uint16_t tile = m_vid_mainram[address & 0x7fff];
const uint8_t *line = m_gfxdecode->gfx(m_gfx_index+0)->get_data(tile & 0xfff);
int offset = m_gfxdecode->gfx(m_gfx_index+0)->rowbytes() * linecount;
for (int i = 0; i < 8; i++)
{
uint8_t pen = line[offset + i];
int extra = tile >> 12;
if (m_ef9369)
{
// TODO: calculate instead?
static const uint8_t lookup[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2, 0, 0, 2, 2,
0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3,
0, 0, 0, 0, 4, 4, 4, 4, 0, 0, 0, 0, 4, 4, 4, 4,
0, 1, 0, 1, 4, 5, 4, 5, 0, 1, 0, 1, 4, 5, 4, 5,
0, 0, 2, 2, 4, 4, 6, 6, 0, 0, 2, 2, 4, 4, 6, 6,
0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7,
0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8,
0, 1, 0, 1, 0, 1, 0, 1, 8, 9, 8, 9, 8, 9, 8, 9,
0, 0, 2, 2, 0, 0, 2, 2, 8, 8,10,10, 8, 8,10,10,
0, 1, 2, 3, 0, 1, 2, 3, 8, 9,10,11, 8, 9,10,11,
0, 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8,12,12,12,12,
0, 1, 0, 1, 4, 5, 4, 5, 8, 9, 8, 9,12,13,12,13,
0, 0, 2, 2, 4, 4, 6, 6, 8, 8,10,10,12,12,14,14,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15
};
bitmap.pix(y, x + i) = m_palette->pen(lookup[(extra << 4) | (pen & 0xf)]);
}
else
{
bitmap.pix(y, x + i) = m_palette->pen((extra<<4) | (pen & 0xf));
}
}
}
}
uint16_t mpu4vid_state::mpu4_vid_vidram_r(offs_t offset)
{
return m_vid_vidram[offset];
}
void mpu4vid_state::mpu4_vid_vidram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_vid_vidram[offset]);
offset <<= 1;
m_gfxdecode->gfx(m_gfx_index+0)->mark_dirty(offset/0x20);
}
void mpu4vid_state::video_start()
{
memset(m_vid_vidram,0,0x20000);
/* find first empty slot to decode gfx */
for (m_gfx_index = 0; m_gfx_index < MAX_GFX_ELEMENTS; m_gfx_index++)
if (m_gfxdecode->gfx(m_gfx_index) == nullptr)
break;
assert(m_gfx_index != MAX_GFX_ELEMENTS);
/* create the char set (gfx will then be updated dynamically from RAM) */
m_gfxdecode->set_gfx(
m_gfx_index+0,
std::make_unique<gfx_element>(
m_palette,
mpu4_vid_char_8x8_layout,
reinterpret_cast<uint8_t *>(m_vid_vidram.target()),
NATIVE_ENDIAN_VALUE_LE_BE(8,0),
m_palette->entries() / 16,
0));
}
EF9369_COLOR_UPDATE( mpu4vid_state::ef9369_color_update )
{
m_palette->set_pen_color(entry, pal4bit(cc), pal4bit(cb), pal4bit(ca));
}
/*************************************
*
* Trackball interface
*
*************************************/
uint8_t mpu4vid_state::pia_ic5_porta_track_r()
{
/* The SWP trackball interface connects a standard trackball to the AUX1 port on the MPU4
mainboard. As per usual, they've taken the cheap route here, reading and processing the
raw quadrature signal from the encoder wheels for a 4 bit interface, rather than use any
additional hardware to simplify matters. What makes matters worse is that there is a 45 degree rotation to take into account.
For our purposes, two fake ports give the X and Y positions, which are then worked back into the signal levels.
We invert the X and Y data at source due to the use of Schmitt triggers in the interface, which
clean up the pulses and flip the active phase.*/
LOG("%s: IC5 PIA Read of Port A (AUX1)\n",machine().describe_context());
uint8_t data = m_aux1_port->read();
int8_t dx = m_trackx_port->read();
int8_t dy = m_tracky_port->read();
m_cur[0] = dy + dx;
m_cur[1] = dy - dx;
uint8_t xa, xb, ya, yb;
/* generate pulses for the input port (A and B are 1 unit out of phase for direction sensing)*/
xa = ((m_cur[0] + 1) & 3) <= 1;
xb = (m_cur[0] & 3) <= 1;
ya = ((m_cur[1] + 1) & 3) <= 1;
yb = (m_cur[1] & 3) <= 1;
data |= (xa << 4); // XA
data |= (ya << 5); // YA
data |= (xb << 6); // XB
data |= (yb << 7); // YB
return data;
}
/*************************************
*
* Input defintions
*
*************************************/
INPUT_PORTS_START( mpu4vid )
PORT_START("ORANGE1") //0 - 7
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("00")// 20p level
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("01")// 100p level
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("02")// Token 1 level
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("03")// Token 2 level
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("04")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("05")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("06")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("07")
PORT_START("ORANGE2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("08")// 8 - 11 is JP Key
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("09")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("10")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("11")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("12")// 12 - 15 is % Key
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("13")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("14")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("15")
PORT_START("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("16")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("17")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("18")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("19")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("20")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox (Back) Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
PORT_START("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("24")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("25")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("26")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("27")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("28")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("29")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("30")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1)
PORT_START("DIL1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_START("DIL2")
PORT_DIPNAME( 0x01, 0x00, "1 Pound for change" ) PORT_DIPLOCATION("DIL2:01")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "DIL202" ) PORT_DIPLOCATION("DIL2:02")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x00, "DIL203" ) PORT_DIPLOCATION("DIL2:03")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x00, "Attract mode inhibit" ) PORT_DIPLOCATION("DIL2:04")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x08, DEF_STR( On ) )
PORT_DIPNAME( 0x10, 0x00, "DIL205" ) PORT_DIPLOCATION("DIL2:05")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x10, DEF_STR( On ) )
PORT_DIPNAME( 0x20, 0x00, "Coin alarm inhibit" ) PORT_DIPLOCATION("DIL2:06")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x00, "DIL207" ) PORT_DIPLOCATION("DIL2:07")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, "Single coin entry" ) PORT_DIPLOCATION("DIL2:08")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x80, DEF_STR( On ) )
PORT_START("AUX1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_0")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_1")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_2")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_3")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_4")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_5")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_6")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A1_7")
PORT_START("AUX2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM) //Lockouts, in same order as below
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("10p")//PORT_IMPULSE(5)
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("20p")//PORT_IMPULSE(5)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("50p")//PORT_IMPULSE(5)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("100p")//PORT_IMPULSE(5)
INPUT_PORTS_END
static INPUT_PORTS_START( crmaze )
PORT_INCLUDE( mpu4vid )
PORT_MODIFY("ORANGE1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("ORANGE2")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK1")
PORT_BIT(0x1F, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Yellow")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Red")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Left Red")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Left Yellow")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Getout Yellow")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Escape/Getout Red")/* Labelled Escape on cabinet, Getout in test */
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("AUX1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_CUSTOM)
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_CUSTOM)//XA
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_CUSTOM)//YA
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_CUSTOM)//XB
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_CUSTOM)//YB
PORT_START("TRACKX")//FAKE
PORT_BIT( 0xff, 0, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_INVERT
PORT_START("TRACKY")//FAKE
PORT_BIT( 0xff, 0, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_INVERT
INPUT_PORTS_END
static INPUT_PORTS_START( mating )
PORT_INCLUDE( crmaze )
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Red")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Yellow")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Right Yellow")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Right Red")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static INPUT_PORTS_START( barquest )
PORT_INCLUDE( mpu4vid )
PORT_MODIFY("ORANGE1")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("ORANGE2")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("C")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("B")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("A")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Pass")
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("C")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("B")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON9) PORT_NAME("A")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Continue")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Collect")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1)
PORT_MODIFY("AUX1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static INPUT_PORTS_START( skiltrek )
PORT_INCLUDE( mpu4vid )
PORT_MODIFY("ORANGE1")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("ORANGE2")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Pass")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("C")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("B")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("A")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Continue")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("C")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("B")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("A")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_START1)
PORT_BIT(0xE0, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("AUX1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static INPUT_PORTS_START( turnover )
PORT_INCLUDE( mpu4vid )
PORT_MODIFY("ORANGE1")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("ORANGE2")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Pass")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("C")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("B")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("A")
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Continue")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("C")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("B")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("A")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1)
PORT_MODIFY("AUX1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static INPUT_PORTS_START( adders )
PORT_INCLUDE( mpu4vid )
PORT_MODIFY("ORANGE1")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("ORANGE2")
PORT_BIT( 0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("C")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("B")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("A")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Pass")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Collect")
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("C")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("B")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("A")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Continue")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_START1)
PORT_MODIFY("AUX1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static INPUT_PORTS_START( strike )
PORT_INCLUDE( mpu4vid )
PORT_MODIFY("ORANGE1")
PORT_BIT( 0x0F, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON9) PORT_NAME("Freeze")
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON10) PORT_NAME("Go On!")
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("ORANGE2")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_MODIFY("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Play")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Green (Left)")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Yellow (Left)")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Red (Left)")
PORT_MODIFY("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON7) PORT_NAME("Help")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_BUTTON6) PORT_NAME("Green (Right)")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_BUTTON5) PORT_NAME("Yellow (Right)")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_BUTTON4) PORT_NAME("Red (Right)")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON8) PORT_NAME("Collect")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1)
PORT_MODIFY("AUX1")
PORT_BIT(0xFF, IP_ACTIVE_HIGH, IPT_UNUSED)
INPUT_PORTS_END
static INPUT_PORTS_START( bwbvid )
PORT_START("ORANGE1")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM )// 20p level
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_CUSTOM )// Short token bottom level
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM )// 100p level
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM )// Long token bottom level
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_CUSTOM )// Prize token level sensor
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM )// Short token top level
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN )
PORT_START("ORANGE2")
PORT_CONFNAME( 0x0F, 0x00, "Jackpot / Prize Key" )
PORT_CONFSETTING( 0x00, "Not fitted" )
PORT_CONFSETTING( 0x01, "3 GBP" )
PORT_CONFSETTING( 0x02, "4 GBP" )
PORT_CONFSETTING( 0x08, "5 GBP" )
PORT_CONFSETTING( 0x03, "6 GBP" )
PORT_CONFSETTING( 0x04, "6 GBP Token" )
PORT_CONFSETTING( 0x05, "8 GBP" )
PORT_CONFSETTING( 0x06, "8 GBP Token" )
PORT_CONFSETTING( 0x07, "10 GBP" )
PORT_CONFSETTING( 0x09, "15 GBP" )
PORT_CONFSETTING( 0x0A, "25 GBP" )
PORT_CONFSETTING( 0x0B, "25 GBP - Licensed Betting Office Profile" )
PORT_CONFSETTING( 0x0C, "35 GBP" )
PORT_CONFSETTING( 0x0D, "70 GBP" )
PORT_CONFSETTING( 0x0E, "Reserved 0e" )
PORT_CONFSETTING( 0x0F, "Reserved 0f" )
PORT_CONFNAME( 0xF0, 0x00, "Percentage Key" )
PORT_CONFSETTING( 0x00, "Not fitted / 68% (Invalid for UK Games)" )
PORT_CONFSETTING( 0x10, "70" )
PORT_CONFSETTING( 0x20, "72" )
PORT_CONFSETTING( 0x30, "74" )
PORT_CONFSETTING( 0x40, "76" )
PORT_CONFSETTING( 0x50, "78" )
PORT_CONFSETTING( 0x60, "80" )
PORT_CONFSETTING( 0x70, "82" )
PORT_CONFSETTING( 0x80, "84" )
PORT_CONFSETTING( 0x90, "86" )
PORT_CONFSETTING( 0xA0, "88" )
PORT_CONFSETTING( 0xB0, "90" )
PORT_CONFSETTING( 0xC0, "92" )
PORT_CONFSETTING( 0xD0, "94" )
PORT_CONFSETTING( 0xE0, "96" )
PORT_CONFSETTING( 0xF0, "98" )
PORT_START("BLACK1")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Button 9")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Button 10")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 11")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 12")
PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_CUSTOM) // Prize Shelf Opto
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Test Button") PORT_CODE(KEYCODE_W)
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_SERVICE) PORT_NAME("Refill Key") PORT_CODE(KEYCODE_R) PORT_TOGGLE
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_INTERLOCK) PORT_NAME("Cashbox (Back) Door") PORT_CODE(KEYCODE_Q) PORT_TOGGLE
PORT_START("BLACK2")
PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 1")
PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 2")
PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 3")
PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 4")
PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 5")
PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 6")
PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Button 7")
PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_START1) //Button 8
PORT_START("DIL1")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:01")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL1:02")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x02, DEF_STR( On ) )
PORT_DIPNAME( 0x04, 0x00, "High Token Payout Proportion" ) PORT_DIPLOCATION("DIL1:03")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x04, DEF_STR( Yes ) )
PORT_DIPNAME( 0x08, 0x00, "Low Token Payout Proportion" ) PORT_DIPLOCATION("DIL1:04")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x08, DEF_STR( Yes ) )
PORT_DIPNAME( 0xF0, 0x00, "Target Percentage (if key not fitted)" )PORT_DIPLOCATION("DIL1:05,06,07,08")
PORT_DIPSETTING( 0x00, "Unset (Program Optimum)" )
PORT_DIPSETTING( 0x10, "70" )
PORT_DIPSETTING( 0x20, "72" )
PORT_DIPSETTING( 0x30, "74" )
PORT_DIPSETTING( 0x40, "76" )
PORT_DIPSETTING( 0x50, "78" )
PORT_DIPSETTING( 0x60, "80" )
PORT_DIPSETTING( 0x70, "82" )
PORT_DIPSETTING( 0x80, "84" )
PORT_DIPSETTING( 0x90, "86" )
PORT_DIPSETTING( 0xA0, "88" )
PORT_DIPSETTING( 0xB0, "90" )
PORT_DIPSETTING( 0xC0, "92" )
PORT_DIPSETTING( 0xD0, "94" )
PORT_DIPSETTING( 0xE0, "96" )
PORT_DIPSETTING( 0xF0, "98" )
PORT_START("DIL2")
PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIL2:01") //Clear MPU on some machines
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x01, DEF_STR( On ) )
PORT_DIPNAME( 0x02, 0x00, "Enable Cash Refill") PORT_DIPLOCATION("DIL2:02")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x02, DEF_STR( Yes ) )
PORT_DIPNAME( 0x04, 0x00, "Inhibit Win Banking" ) PORT_DIPLOCATION("DIL2:03") //If on, wins are paid live, as opposed to stored
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x04, DEF_STR( On ) )
PORT_DIPNAME( 0x08, 0x00, "High Prize Payout proportion (if available)" ) PORT_DIPLOCATION("DIL2:04") //Non Prize machines use this to inhibit OCD attract mode
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x08, DEF_STR( Yes ) )
PORT_DIPNAME( 0x10, 0x00, "Halt Payout when Empty" ) PORT_DIPLOCATION("DIL2:05")
PORT_DIPSETTING( 0x00, DEF_STR( No ) )
PORT_DIPSETTING( 0x10, DEF_STR( Yes ) )
PORT_DIPNAME( 0x20, 0x00, "Coin Alarm Inhibit" ) PORT_DIPLOCATION("DIL2:06")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x20, DEF_STR( On ) )
PORT_DIPNAME( 0x40, 0x00, "Excess Token Lockout" ) PORT_DIPLOCATION("DIL2:07") //If an 'arcade' ROM, this flips, or is unused entirely.
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )
PORT_DIPSETTING( 0x40, DEF_STR( On ) )
PORT_DIPNAME( 0x80, 0x00, "Single Credit Entry" ) PORT_DIPLOCATION("DIL2:08")
PORT_DIPSETTING( 0x00, DEF_STR( Off ) )