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
|
// license:BSD-3-Clause
// copyright-holders:hap
/***************************************************************************
NEC uCOM4 MCU tabletops/handhelds or other simple devices.
known chips:
serial device etc.
-----------------------------------------------
@048 uPD552 1980, Tomy Tennis
*085 uPD650 1980, Roland TR-808
102 uPD553 1981, Bandai Block Out
*128 uPD650 1982, Roland TR-606
133 uPD650 1982, Roland TB-303
@160 uPD553 1982, Tomy Pac Man
@206 uPD553 1982, Epoch Dracula
@258 uPD553 1984, Tomy Alien Chase
(* denotes not yet emulated by MESS, @ denotes it's in this driver)
***************************************************************************/
#include "emu.h"
#include "cpu/ucom4/ucom4.h"
#include "sound/speaker.h"
// test-layouts - use external artwork
#include "alnchase.lh"
#include "edracula.lh"
#include "tmpacman.lh"
#include "tmtennis.lh"
class hh_ucom4_state : public driver_device
{
public:
hh_ucom4_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_inp_matrix(*this, "IN"),
m_speaker(*this, "speaker"),
m_display_wait(33),
m_display_maxy(1),
m_display_maxx(0)
{ }
// devices
required_device<cpu_device> m_maincpu;
optional_ioport_array<3> m_inp_matrix; // max 3
optional_device<speaker_sound_device> m_speaker;
// misc common
UINT16 m_inp_mux;
UINT8 read_inputs(int columns);
virtual void machine_start();
// display common
int m_display_wait;
int m_display_maxy;
int m_display_maxx;
UINT32 m_grid;
UINT32 m_plate;
UINT32 m_display_state[0x20];
UINT32 m_display_cache[0x20];
UINT8 m_display_decay[0x20][0x20];
UINT16 m_7seg_mask[0x20];
TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick);
void display_update();
void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety);
// game-specific handlers
DECLARE_WRITE8_MEMBER(edracula_grid_w);
DECLARE_WRITE8_MEMBER(edracula_plate_w);
DECLARE_WRITE8_MEMBER(edracula_port_i_w);
DECLARE_READ8_MEMBER(tmtennis_input_r);
DECLARE_WRITE8_MEMBER(tmtennis_grid_w);
DECLARE_WRITE8_MEMBER(tmtennis_plate_w);
DECLARE_WRITE8_MEMBER(tmtennis_port_e_w);
void tmtennis_set_clock();
DECLARE_INPUT_CHANGED_MEMBER(tmtennis_difficulty_switch);
DECLARE_MACHINE_RESET(tmtennis);
void tmpacman_display();
DECLARE_WRITE8_MEMBER(tmpacman_grid_w);
DECLARE_WRITE8_MEMBER(tmpacman_plate_w);
DECLARE_WRITE8_MEMBER(tmpacman_port_e_w);
DECLARE_READ8_MEMBER(alnchase_input_r);
DECLARE_WRITE8_MEMBER(alnchase_display_w);
DECLARE_WRITE8_MEMBER(alnchase_port_e_w);
};
void hh_ucom4_state::machine_start()
{
// zerofill
memset(m_display_state, 0, sizeof(m_display_state));
memset(m_display_cache, 0, sizeof(m_display_cache));
memset(m_display_decay, 0, sizeof(m_display_decay));
memset(m_7seg_mask, 0, sizeof(m_7seg_mask));
m_inp_mux = 0;
m_grid = 0;
m_plate = 0;
// register for savestates
save_item(NAME(m_display_maxy));
save_item(NAME(m_display_maxx));
save_item(NAME(m_display_wait));
save_item(NAME(m_display_state));
save_item(NAME(m_display_cache));
save_item(NAME(m_display_decay));
save_item(NAME(m_7seg_mask));
save_item(NAME(m_inp_mux));
save_item(NAME(m_grid));
save_item(NAME(m_plate));
}
/***************************************************************************
Helper Functions
***************************************************************************/
// The device strobes the outputs very fast, it is unnoticeable to the user.
// To prevent flickering here, we need to simulate a decay.
void hh_ucom4_state::display_update()
{
UINT32 active_state[0x20];
for (int y = 0; y < m_display_maxy; y++)
{
active_state[y] = 0;
for (int x = 0; x < m_display_maxx; x++)
{
// turn on powered segments
if (m_display_state[y] >> x & 1)
m_display_decay[y][x] = m_display_wait;
// determine active state
int ds = (m_display_decay[y][x] != 0) ? 1 : 0;
active_state[y] |= (ds << x);
}
}
// on difference, send to output
for (int y = 0; y < m_display_maxy; y++)
if (m_display_cache[y] != active_state[y])
{
if (m_7seg_mask[y] != 0)
output_set_digit_value(y, active_state[y] & m_7seg_mask[y]);
const int mul = (m_display_maxx <= 10) ? 10 : 100;
for (int x = 0; x < m_display_maxx; x++)
output_set_lamp_value(y * mul + x, active_state[y] >> x & 1);
}
memcpy(m_display_cache, active_state, sizeof(m_display_cache));
}
TIMER_DEVICE_CALLBACK_MEMBER(hh_ucom4_state::display_decay_tick)
{
// slowly turn off unpowered segments
for (int y = 0; y < m_display_maxy; y++)
for (int x = 0; x < m_display_maxx; x++)
if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0)
m_display_decay[y][x]--;
display_update();
}
void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety)
{
m_display_maxx = maxx;
m_display_maxy = maxy;
// update current state
UINT32 mask = (1 << maxx) - 1;
for (int y = 0; y < maxy; y++)
m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0;
display_update();
}
UINT8 hh_ucom4_state::read_inputs(int columns)
{
UINT8 ret = 0;
// read selected input rows
for (int i = 0; i < columns; i++)
if (m_inp_mux >> i & 1)
ret |= m_inp_matrix[i]->read();
return ret;
}
/***************************************************************************
Minidrivers (I/O, Inputs, Machine Config)
***************************************************************************/
/***************************************************************************
Epoch Dracula (manufactured in Japan)
* PCB label 96121
* NEC uCOM-43 MCU, labeled D553C 206
* cyan/red/green VFD display NEC FIP8BM20T (FIP=fluorescent indicator panel)
known releases:
- Japan: Dracula House, yellow case
- USA: Dracula, red case
- Other: Dracula, yellow case, published by Hales
NOTE!: MESS external artwork is recommended
***************************************************************************/
WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w)
{
// C,D: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
display_matrix(18, 8, m_plate, m_grid);
}
WRITE8_MEMBER(hh_ucom4_state::edracula_plate_w)
{
// E-H,I01: vfd matrix plate
int shift = (offset - NEC_UCOM4_PORTE) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
display_matrix(18, 8, m_plate, m_grid);
}
WRITE8_MEMBER(hh_ucom4_state::edracula_port_i_w)
{
edracula_plate_w(space, offset, data & 3);
// I2: speaker out
m_speaker->level_w(data >> 2 & 1);
}
static INPUT_PORTS_START( edracula )
PORT_START("IN.0") // port A
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SELECT )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
PORT_START("IN.1") // port B
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
INPUT_PORTS_END
static MACHINE_CONFIG_START( edracula, hh_ucom4_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
MCFG_UCOM4_READ_A_CB(IOPORT("IN.0"))
MCFG_UCOM4_READ_B_CB(IOPORT("IN.1"))
MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, edracula_grid_w))
MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, edracula_grid_w))
MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, edracula_plate_w))
MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, edracula_port_i_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_edracula)
/* no video! */
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
/***************************************************************************
Tomy(tronic) Tennis (manufactured in Japan)
* board labeled TOMY TN-04 TENNIS
* NEC uCOM-44 MCU, labeled D552C 048
* VFD display NEC FIP11AM15T
The initial release of this game was in 1979, known as Pro-Tennis,
it has a D553 instead of D552, with just a little over 50% ROM used.
This is an early VFD simple electronic tennis game. Player 1 is on the right
side, player 2 or CPU on the left. Each player has six possible positions
where to hit the ball. A backdrop behind the VFD shows a tennis court.
NOTE!: MESS external artwork is recommended
***************************************************************************/
READ8_MEMBER(hh_ucom4_state::tmtennis_input_r)
{
// A,B: buttons
return ~read_inputs(2) >> (offset*4);
}
WRITE8_MEMBER(hh_ucom4_state::tmtennis_grid_w)
{
// G-I: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTG) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
display_matrix(12, 12, m_plate, m_grid);
}
WRITE8_MEMBER(hh_ucom4_state::tmtennis_plate_w)
{
// C-F: vfd matrix plate
if (offset == NEC_UCOM4_PORTF) offset--;
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
display_matrix(12, 12, m_plate, m_grid);
}
WRITE8_MEMBER(hh_ucom4_state::tmtennis_port_e_w)
{
// E0,E1: input mux
// E2: speaker out
// E3: N/C
m_inp_mux = data & 3;
m_speaker->level_w(data >> 2 & 1);
}
/* Pro-Tennis physical button layout and labels is like this:
[SERVE] [1] [2] [3] [3] [2] [1] [SERVE]
[4] [5] [6] [6] [5] [4]
PRACTICE<--PRO1-->PRO2 1PLAYER<--OFF-->2PLAYER
*/
static INPUT_PORTS_START( tmtennis )
PORT_START("IN.0") // E0 port A/B
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("P1 Serve")
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("P2 Serve")
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 )
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 )
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 )
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 )
PORT_START("IN.1") // E1 port A/B
PORT_CONFNAME( 0x101, 0x100, DEF_STR( Difficulty ) ) PORT_CHANGED_MEMBER(DEVICE_SELF, hh_ucom4_state, tmtennis_difficulty_switch, NULL)
PORT_CONFSETTING( 0x001, "Practice" )
PORT_CONFSETTING( 0x100, "Pro 1" ) // -> tmtennis_difficulty_switch
PORT_CONFSETTING( 0x000, "Pro 2" )
PORT_CONFNAME( 0x02, 0x00, "Players" )
PORT_CONFSETTING( 0x00, "1" )
PORT_CONFSETTING( 0x02, "2" )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_PLAYER(2)
PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_PLAYER(2)
PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_PLAYER(2)
PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_PLAYER(2)
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_PLAYER(2)
INPUT_PORTS_END
void hh_ucom4_state::tmtennis_set_clock()
{
// MCU clock is from an LC circuit oscillating by default at ~360kHz,
// but on PRO1, the difficulty switch puts a capacitor across the LC circuit
// to slow it down to ~260kHz.
m_maincpu->set_unscaled_clock(m_inp_matrix[1]->read() & 0x100 ? 260000 : 360000);
}
INPUT_CHANGED_MEMBER(hh_ucom4_state::tmtennis_difficulty_switch)
{
tmtennis_set_clock();
}
MACHINE_RESET_MEMBER(hh_ucom4_state, tmtennis)
{
tmtennis_set_clock();
}
static MACHINE_CONFIG_START( tmtennis, hh_ucom4_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", NEC_D552, 360000) // see tmtennis_set_clock
MCFG_UCOM4_READ_A_CB(READ8(hh_ucom4_state, tmtennis_input_r))
MCFG_UCOM4_READ_B_CB(READ8(hh_ucom4_state, tmtennis_input_r))
MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w))
MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w))
MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, tmtennis_port_e_w))
MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, tmtennis_plate_w))
MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w))
MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w))
MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, tmtennis_grid_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_tmtennis)
MCFG_MACHINE_RESET_OVERRIDE(hh_ucom4_state, tmtennis)
/* no video! */
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
/***************************************************************************
Tomy(tronic) Pac-Man (manufactured in Japan)
* boards are labeled TN-08 2E108E01
* NEC uCOM-43 MCU, labeled D553C 160
* cyan/red/green VFD display NEC FIP8AM18T
* bright yellow round casing
known releases:
- Japan: Puck Man
- USA: Pac Man
- UK: Puckman (Tomy), and also published by Grandstand as Munchman
- Australia: Pac Man-1, published by Futuretronics
NOTE!: MESS external artwork is recommended
***************************************************************************/
void hh_ucom4_state::tmpacman_display()
{
UINT8 grid = BITSWAP8((UINT8)m_grid,0,1,2,3,4,5,6,7);
UINT32 plate = BITSWAP24(m_plate,23,22,21,20,19,16,17,18,11,10,9,8,0,2,3,1,4,5,6,7,12,13,14,15);
display_matrix(19, 8, plate | 0x100, grid);
}
WRITE8_MEMBER(hh_ucom4_state::tmpacman_grid_w)
{
// C,D: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
tmpacman_display();
}
WRITE8_MEMBER(hh_ucom4_state::tmpacman_plate_w)
{
// E023,F-I: vfd matrix plate
int shift = (offset - NEC_UCOM4_PORTE) * 4;
m_plate = (m_plate & ~(0xf << shift)) | (data << shift);
tmpacman_display();
}
WRITE8_MEMBER(hh_ucom4_state::tmpacman_port_e_w)
{
// E1: speaker out
m_speaker->level_w(data >> 1 & 1);
tmpacman_plate_w(space, offset, data);
}
static INPUT_PORTS_START( tmpacman )
PORT_START("IN.0") // port A
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY // 4 separate directional buttons, hence 16way
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY
PORT_START("IN.1") // port B
PORT_CONFNAME( 0x01, 0x00, DEF_STR( Difficulty ) )
PORT_CONFSETTING( 0x00, "Amateur" )
PORT_CONFSETTING( 0x01, "Professional" )
PORT_BIT( 0x0e, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
static MACHINE_CONFIG_START( tmpacman, hh_ucom4_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_430kHz)
MCFG_UCOM4_READ_A_CB(IOPORT("IN.0"))
MCFG_UCOM4_READ_B_CB(IOPORT("IN.1"))
MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, tmpacman_grid_w))
MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, tmpacman_grid_w))
MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, tmpacman_port_e_w))
MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, tmpacman_plate_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_tmpacman)
/* no video! */
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
/***************************************************************************
Tomy Alien Chase (manufactured in Japan)
* boards are labeled TN-16 2E121B01
* NEC uCOM-43 MCU, labeled D553C 258
* red/green VFD display NEC FIP9AM24T with color overlay, 2-sided*
*Player one views the VFD from the front (grid+filament side) while the
opposite player views it from the back side (through the conductive traces),
basically a mirror-image.
This is a space-themed tabletop VFD electronic game. To start, simply
press [UP]. Hold a joystick direction to move around.
NOTE!: MESS external artwork is recommended
***************************************************************************/
READ8_MEMBER(hh_ucom4_state::alnchase_input_r)
{
// A: buttons
return read_inputs(2);
}
WRITE8_MEMBER(hh_ucom4_state::alnchase_display_w)
{
if (offset <= NEC_UCOM4_PORTE)
{
// C,D,E0: vfd matrix grid
int shift = (offset - NEC_UCOM4_PORTC) * 4;
m_grid = (m_grid & ~(0xf << shift)) | (data << shift);
// C0(grid 0): input enable PL1
// D0(grid 4): input enable PL2
m_inp_mux = (m_grid & 1) | (m_grid >> 3 & 2);
}
if (offset >= NEC_UCOM4_PORTE)
{
// E23,F-I: vfd matrix plate
int shift = (offset - NEC_UCOM4_PORTE) * 4;
m_plate = ((m_plate << 2 & ~(0xf << shift)) | (data << shift)) >> 2;
}
display_matrix(17, 9, m_plate, m_grid);
}
WRITE8_MEMBER(hh_ucom4_state::alnchase_port_e_w)
{
// E1: speaker out
m_speaker->level_w(data >> 1 & 1);
alnchase_display_w(space, offset, data);
}
/* physical button layout and labels is like this:
POWER SOUND LEVEL PLAYER
ON ON PRO TWO START
o o | |
| | | | [joystick]
| | o o
OFF OFF AMA ONE GAME 0,1,2,3
1 PLAYER SIDE
other player side only has a joystick
*/
static INPUT_PORTS_START( alnchase )
PORT_START("IN.0") // C0 port A
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
PORT_START("IN.1") // D0 port A
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) // on non-mirrored view, swap P2 left/right
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) // "
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
PORT_START("IN.2") // port B
PORT_CONFNAME( 0x01, 0x01, "Players" )
PORT_CONFSETTING( 0x01, "1" )
PORT_CONFSETTING( 0x00, "2" )
PORT_CONFNAME( 0x02, 0x00, DEF_STR( Difficulty ) )
PORT_CONFSETTING( 0x00, "Amateur" )
PORT_CONFSETTING( 0x02, "Professional" )
PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED )
INPUT_PORTS_END
static MACHINE_CONFIG_START( alnchase, hh_ucom4_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", NEC_D553, XTAL_400kHz)
MCFG_UCOM4_READ_A_CB(READ8(hh_ucom4_state, alnchase_input_r))
MCFG_UCOM4_READ_B_CB(IOPORT("IN.2"))
MCFG_UCOM4_WRITE_C_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
MCFG_UCOM4_WRITE_D_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
MCFG_UCOM4_WRITE_E_CB(WRITE8(hh_ucom4_state, alnchase_port_e_w))
MCFG_UCOM4_WRITE_F_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
MCFG_UCOM4_WRITE_G_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
MCFG_UCOM4_WRITE_H_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
MCFG_UCOM4_WRITE_I_CB(WRITE8(hh_ucom4_state, alnchase_display_w))
MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_ucom4_state, display_decay_tick, attotime::from_msec(1))
MCFG_DEFAULT_LAYOUT(layout_alnchase)
/* no video! */
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
MACHINE_CONFIG_END
/***************************************************************************
Game driver(s)
***************************************************************************/
ROM_START( edracula )
ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD( "d553c-206", 0x0000, 0x0800, CRC(b524857b) SHA1(c1c89ed5dd4bb1e6e98462dc8fa5af2aa48d8ede) )
ROM_END
ROM_START( tmtennis )
ROM_REGION( 0x0400, "maincpu", 0 )
ROM_LOAD( "d552c-048", 0x0000, 0x0400, CRC(78702003) SHA1(4d427d4dbeed901770c682338867f58c7b54eee3) )
ROM_END
ROM_START( tmpacman )
ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD( "d553c-160", 0x0000, 0x0800, CRC(b21a8af7) SHA1(e3122be1873ce76a4067386bf250802776f0c2f9) )
ROM_END
ROM_START( alnchase )
ROM_REGION( 0x0800, "maincpu", 0 )
ROM_LOAD( "d553c-258", 0x0000, 0x0800, CRC(c5284ff5) SHA1(6a20aaacc9748f0e0335958f3cea482e36153704) )
ROM_END
CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK )
|