summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/adp.c
blob: 4ccc29ab60448383220ac4515a75c4501016553b (plain) (blame)
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
/*
ADP (Merkur?) games from '90 running on similar hardware.
(68k + HD63484 + YM2149)

Skeleton driver by TS -  analog at op.pl

TODO:
(almost everything)
 - add sound and i/o
 - protection in Fashion Gambler (NVRam based?)

Supported games :
- Quick Jack      ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1993")
- Skat TV           ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1994")
- Skat TV v. TS3  ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1995")
- Fashion Gambler ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1997")
- Backgammon        ("COPYRIGHT BY ADP LUEBBECKE GERMANY 1994")



Skat TV (Version TS3)
Three board stack.

CPU Board:
----------
 ____________________________________________________________
 |           ______________  ______________     ___________ |
 | 74HC245N  | t1 i       |  |KM681000ALP7|     |+        | |
 | 74HC573   |____________|  |____________|     |  3V Bat | |
 |                                              |         | |
 |           ______________  ______________     |        -| |
 |           | t1 ii      |  |KM681000ALP7|     |_________| |
 |     |||   |____________|  |____________| |||             |
 |     |||   ___________                    |||  M62X42B    |
 | X   |||   |         |                    |||             |
 |     |||   |68EC000 8|  74HC32   74HC245  |||  MAX691CPE  |
 |     |||   |         |  74AC138  74HC573  |||    74HC32   |
 |           |         |                                    |
 | 74HC573   |_________|  74HC08   74HC10  74HC32  74HC21   |
 |__________________________________________________________|

Parts:

 68EC000FN8         - Motorola 68k CPU
 KM681000ALP7       - 128K X 8 Bit Low Power CMOS Static RAM
 OKIM62X42B         - Real-time Clock ic With Built-in Crystal
 MAX691CPE          - P Reset ic With Watchdog And Battery Switchover
 X                    - 8MHz xtal
 3V Bat             - Lithium 3V power module

Video Board:
------------
 ____________________________________________________________
 |           ______________  ______________                 |
 |           | t2 i       |  |KM681000ALP7|     74HC573     |
 |           |____________|  |____________|                *|
 |                                              74HC573    *|
 |           ______________  ______________                *|
 |           | t2 ii      |  |KM681000ALP7|               P3|
 |       ||| |____________|  |____________|   |||          *|
 |       ||| ___________                      |||          *|
 |       ||| |         |                      |||          *|
 |       ||| | HD63484 |  74HC04   74HC00     |||         P6|
 |       ||| |         |  74HC74   74HC08     |||  74HC245  |
 |           |         |                                    |
 | 74HC573   |_________|  74HC166  74HC166 74HC166 74HC166  |
 |__________________________________________________________|

Parts:

 HD63484CP8         - Advanced CRT Controller
 KM681000ALP7       - 128K X 8 Bit Low Power CMOS Static RAM

Connectors:

 Two connectors to link with CPU Board
 Two connectors to link with Sound and I/O Board
 P3  - Monitor
 P6  - Lightpen

Sound  and I/O board:
---------------------
 _________________________________________________________________________________
 |                        TS271CN    74HC02                        ****  ****    |
 |*                      ________________                          P1    P2     *|
 |*         74HC574      | YM2149F      |                                       *|
 |*                  ||| |______________|   74HC393  74HC4015 |||               *|
 |P3        74HC245  |||                                      |||              P6|
 |*                  ||| ________________          X          ||| TL7705ACP     *|
 |*                  ||| |SCN68681C1N40 |                     |||               *|
 |*                  ||| |______________|   74HC32   74AC138  |||               *|
 |P7                 |||                                      |||              P8|
 |*                        TC428CPA                                             *|
 |*                                                                             *|
 |*    P11  P12    P13    P14       P15   P16   P17      P18   P19   P20  P21   *|
 |P9   **** *****  *****  ****  OO  ****  ****  *******  ****  ****  ***  *** P10|
 |_______________________________________________________________________________|

Parts:

 YM2149F         - Yamaha PSG
 SCN68681C1N40   - Dual Asynchronous Receiver/transmitter (DUART);
 TS271CN         - Programmable Low Power CMOS Single Op-amp
 TL7705ACP       - Supply Voltage Supervisor
 TC428CPA        - Dual CMOS High-speed Driver
 OO              - LEDs (red)
 X               - 3.6864MHz xtal

Connectors:

 Two connectors to link with Video Board
 P1  - Tueroeffn
 P2  - PSG In/Out
 P3  - Lautsprecher
 P6  - Service - Tast.
 P7  - Maschine (barely readable)
 P8  - Muenzeinheit
 P9  - Atzepter
 P10 - Reset Fadenfoul
 P11 - Netzteil
 P12 - Serienplan
 P13 - Serienplan 2
 P14 - Muenzeinheit 2
 P15 - I2C Bus
 P16 - Kodierg.
 P17 - TTL Ein-Aueg.
 P18 - Out
 P19 - In
 P20 - Serielle-S.
 P21 - Tuerschalter

There's also (external) JAMMA adapter - 4th board filled with resistors and diodes.

*/

#include "driver.h"
#include "sound/ay8910.h"
#include "video/hd63484.h"
#include "machine/microtch.h"
#include "machine/68681.h"
#include "deprecat.h"

static UINT8 register_active;
static struct
{
	const device_config *duart68681;
} skattv_devices;

/***************************************************************************

    68681 DUART <-> Microtouch touch screen controller communication

***************************************************************************/

static void duart_irq_handler(const device_config *device, UINT8 vector)
{
	cpunum_set_input_line_and_vector(device->machine, 0, 4, HOLD_LINE, vector);
};

static void duart_tx(const device_config *device, int channel, UINT8 data)
{
	if ( channel == 0 )
	{
		microtouch_rx(1, &data);
	}
};

static void microtouch_tx(UINT8 data)
{
	duart68681_rx_data(skattv_devices.duart68681, 0, data);
}

static UINT8 duart_input(const device_config *device)
{
	return input_port_read(Machine, "DSW1");
}

static MACHINE_START( skattv )
{
	microtouch_init(microtouch_tx, 0);
}

static MACHINE_RESET( skattv )
{
	skattv_devices.duart68681 = device_list_find_by_tag( machine->config->devicelist, DUART68681, "duart68681" );
}

static const duart68681_config skattv_duart68681_config =
{
	XTAL_8_664MHz / 2, //??
	duart_irq_handler,
	duart_tx,
	duart_input,
	NULL
};

static PALETTE_INIT( adp )
{
    int i;


    for (i = 0;i < machine->config->total_colors;i++)
    {
        int bit0,bit1,bit2,r,g,b;


        // red component
        bit0 = (i >> 0) & 0x01;
        bit1 = (i >> 3) & 0x01;
        bit2 = (i >> 0) & 0x01;
        r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
        // green component
        bit0 = (i >> 1) & 0x01;
        bit1 = (i >> 3) & 0x01;
        bit2 = (i >> 1) & 0x01;
        g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
        // blue component
        bit0 = (i >> 2) & 0x01;
        bit1 = (i >> 3) & 0x01;
        bit2 = (i >> 2) & 0x01;
        b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;

        palette_set_color(machine,i,MAKE_RGB(r,g,b));
    }
}

static VIDEO_START(adp)
{
//  UINT32 i;
//  UINT16 *prgrom = (UINT16*)memory_region(machine, "main");

	HD63484_start();

//  for (i = 0; i < 0x70000; i++)
//      HD63484_ram[0x90000 + i] = prgrom[i];

}

static VIDEO_UPDATE(adp)
{
	int x,y,b;

	b = ((HD63484_reg[0xcc/2] & 0x000f) << 16) + HD63484_reg[0xce/2];

	if (input_code_pressed(KEYCODE_M)) b = 0;
	if (input_code_pressed(KEYCODE_Q)) b += 0x060 * 280 * 1;
	if (input_code_pressed(KEYCODE_W)) b += 0x060 * 280 * 2;
	if (input_code_pressed(KEYCODE_E)) b += 0x060 * 280 * 3;
	if (input_code_pressed(KEYCODE_R)) b += 0x060 * 280 * 4;
	if (input_code_pressed(KEYCODE_T)) b += 0x060 * 280 * 5;
	if (input_code_pressed(KEYCODE_Y)) b += 0x060 * 280 * 6;
	if (input_code_pressed(KEYCODE_U)) b += 0x060 * 280 * 7;
	if (input_code_pressed(KEYCODE_I)) b += 0x060 * 280 * 8;
	if (input_code_pressed(KEYCODE_A)) b += 0x060 * 280 * 9;
	if (input_code_pressed(KEYCODE_S)) b += 0x060 * 280 * 10;
	if (input_code_pressed(KEYCODE_D)) b += 0x060 * 280 * 11;
	if (input_code_pressed(KEYCODE_F)) b += 0x060 * 280 * 12;
	if (input_code_pressed(KEYCODE_G)) b += 0x060 * 280 * 13;
	if (input_code_pressed(KEYCODE_H)) b += 0x060 * 280 * 14;
	if (input_code_pressed(KEYCODE_J)) b += 0x060 * 280 * 15;
	if (input_code_pressed(KEYCODE_K)) b += 0x060 * 280 * 16;
	if (input_code_pressed(KEYCODE_Z)) b += 0x060 * 280 * 17;
	if (input_code_pressed(KEYCODE_X)) b += 0x060 * 280 * 18;
	if (input_code_pressed(KEYCODE_C)) b += 0x060 * 280 * 19;
	if (input_code_pressed(KEYCODE_V)) b += 0x060 * 280 * 20;
	if (input_code_pressed(KEYCODE_B)) b += 0x060 * 280 * 21;
	if (input_code_pressed(KEYCODE_N)) b += 0x060 * 280 * 22;

	for (y = 0;y < 280;y++)
	{
		for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4)
		{
			b &= (HD63484_RAM_SIZE-1);
			*BITMAP_ADDR16(bitmap, y, x    ) = ((HD63484_ram[b] & 0x000f) >>  0) << 0;
			*BITMAP_ADDR16(bitmap, y, x + 1) = ((HD63484_ram[b] & 0x00f0) >>  4) << 0;
			*BITMAP_ADDR16(bitmap, y, x + 2) = ((HD63484_ram[b] & 0x0f00) >>  8) << 0;
			*BITMAP_ADDR16(bitmap, y, x + 3) = ((HD63484_ram[b] & 0xf000) >> 12) << 0;
			b++;
		}
	}
if (!input_code_pressed(KEYCODE_O))
	if ((HD63484_reg[0x06/2] & 0x0300) == 0x0300)
	{
		int sy = (HD63484_reg[0x94/2] & 0x0fff) - (HD63484_reg[0x88/2] >> 8);
		int h = HD63484_reg[0x96/2] & 0x0fff;
		int sx = ((HD63484_reg[0x92/2] >> 8) - (HD63484_reg[0x84/2] >> 8)) * 2 * 2;
		int w = (HD63484_reg[0x92/2] & 0xff) * 2;
		if (sx < 0) sx = 0;	// not sure about this (shangha2 title screen)

		b = (((HD63484_reg[0xdc/2] & 0x000f) << 16) + HD63484_reg[0xde/2]);

		for (y = sy ; y <= sy + h && y < 280 ; y++)
		{
			for (x = 0 ; x < (HD63484_reg[0xca/2] & 0x0fff) * 4 ; x += 4)
			{
				b &= (HD63484_RAM_SIZE - 1);
				if (x <= w && x + sx >= 0 && x + sx < (HD63484_reg[0xca/2] & 0x0fff) * 4)
					{
						*BITMAP_ADDR16(bitmap, y, x + sx    ) = ((HD63484_ram[b] & 0x000f) >>  0) << 0;
						*BITMAP_ADDR16(bitmap, y, x + sx + 1) = ((HD63484_ram[b] & 0x00f0) >>  4) << 0;
						*BITMAP_ADDR16(bitmap, y, x + sx + 2) = ((HD63484_ram[b] & 0x0f00) >>  8) << 0;
						*BITMAP_ADDR16(bitmap, y, x + sx + 3) = ((HD63484_ram[b] & 0xf000) >> 12) << 0;
					}
				b++;
			}
		}
	}

	return 0;
}

static READ16_HANDLER(test_r)
{
// printf("ra=%04x ",register_active);
if (register_active == 0x0000) {
	if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff;
	if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff;
	if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff;
	if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff;
	if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff;
	if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff;
	if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff;
	if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff;
	if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff;
	if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff;
	if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff;
	if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff;
	if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff;
	if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff;
	if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff;
	if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff;
return 0x4;
}
	if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff;
	if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff;
	if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff;
	if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff;
	if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff;
	if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff;
	if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff;
	if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff;

	// return 0x0004 ^ 0xffff; // 0x0004
	switch (mame_rand(machine) & 3)
	{
		case 0:
			return 0;
		case 1:
			return 0xffff;
		default:
			return mame_rand(machine) & 0xffff;
	}
}

/*
static READ16_HANDLER(test1_r)
{
	if (input_code_pressed(KEYCODE_Q)) return 0x0001;
	if (input_code_pressed(KEYCODE_W)) return 0x0002;
	if (input_code_pressed(KEYCODE_E)) return 0x0004;
	if (input_code_pressed(KEYCODE_R)) return 0x0008;
	if (input_code_pressed(KEYCODE_T)) return 0x0010;
	if (input_code_pressed(KEYCODE_Y)) return 0x0020;
	if (input_code_pressed(KEYCODE_U)) return 0x0040;
	if (input_code_pressed(KEYCODE_I)) return 0x0080;
	if (input_code_pressed(KEYCODE_A)) return 0x0100;
	if (input_code_pressed(KEYCODE_S)) return 0x0200;
	if (input_code_pressed(KEYCODE_D)) return 0x0400;
	if (input_code_pressed(KEYCODE_F)) return 0x0800;
	if (input_code_pressed(KEYCODE_G)) return 0x1000;
	if (input_code_pressed(KEYCODE_H)) return 0x2000;
	if (input_code_pressed(KEYCODE_J)) return 0x4000;
	if (input_code_pressed(KEYCODE_K)) return 0x8000;

	switch (mame_rand(machine) & 3)
	{
		case 0:
			return 0;
		case 1:
			return 0xffff;
		default:
			return mame_rand(machine) % 0xffff;
	}
}
*/

static READ16_HANDLER(rh1_r)
{
// printf("ra=%04x ",register_active);
/*
	if ((register_active == 0x0e) || (register_active == 0x0e) || (register_active == 0x0e))
		{
	if (input_code_pressed(KEYCODE_1)) return 0x0001 ^ 0xffff;
	if (input_code_pressed(KEYCODE_2)) return 0x0002 ^ 0xffff;
	if (input_code_pressed(KEYCODE_3)) return 0x0004 ^ 0xffff;
	if (input_code_pressed(KEYCODE_4)) return 0x0008 ^ 0xffff;
	if (input_code_pressed(KEYCODE_5)) return 0x0010 ^ 0xffff;
	if (input_code_pressed(KEYCODE_6)) return 0x0020 ^ 0xffff;
	if (input_code_pressed(KEYCODE_7)) return 0x0040 ^ 0xffff;
	if (input_code_pressed(KEYCODE_8)) return 0x0080 ^ 0xffff;
	if (input_code_pressed(KEYCODE_A)) return 0x0100 ^ 0xffff;
	if (input_code_pressed(KEYCODE_S)) return 0x0200 ^ 0xffff;
	if (input_code_pressed(KEYCODE_D)) return 0x0400 ^ 0xffff;
	if (input_code_pressed(KEYCODE_F)) return 0x0800 ^ 0xffff;
	if (input_code_pressed(KEYCODE_G)) return 0x1000 ^ 0xffff;
	if (input_code_pressed(KEYCODE_H)) return 0x2000 ^ 0xffff;
	if (input_code_pressed(KEYCODE_J)) return 0x4000 ^ 0xffff;
	if (input_code_pressed(KEYCODE_K)) return 0x8000 ^ 0xffff;

		}
*/
	switch (mame_rand(machine) & 3)
	{
		case 0:
			return 0;
		case 1:
			return 0xffff;
		default:
			return mame_rand(machine) % 0xffff;
	}
}

static WRITE16_HANDLER(wh1_w)
{
	// register_active = data;
}

static WRITE16_HANDLER(wh2_w)
{
	register_active = data;
}

static ADDRESS_MAP_START( skattv_mem, ADDRESS_SPACE_PROGRAM, 16 )
	AM_RANGE(0x000000, 0x0fffff) AM_ROM
	AM_RANGE(0x800080, 0x800081) AM_READWRITE(HD63484_status_r, HD63484_address_w)
	AM_RANGE(0x800082, 0x800083) AM_READWRITE(HD63484_data_r, HD63484_data_w)
	AM_RANGE(0x800100, 0x800101) AM_READWRITE(test_r,wh2_w) //related to input
	AM_RANGE(0x800140, 0x800141) AM_READWRITE(rh1_r,wh1_w) //18b too
	AM_RANGE(0x800142, 0x800143) AM_READWRITE(rh1_r,wh1_w) //18b too
	AM_RANGE(0x800180, 0x80019f) AM_DEVREADWRITE8( DUART68681, "duart68681", duart68681_r, duart68681_w, 0xff )
//  AM_RANGE(0xffd246, 0xffd247) AM_READ(handler3_r)
//  AM_RANGE(0xffd248, 0xffd249) AM_READ(handler3_r)
	AM_RANGE(0xffc000, 0xffffff) AM_RAM
ADDRESS_MAP_END

static ADDRESS_MAP_START( quickjac_mem, ADDRESS_SPACE_PROGRAM, 16 )
	AM_RANGE(0x000000, 0x0fffff) AM_ROM
	AM_RANGE(0x400000, 0x40001f) AM_DEVREADWRITE8( DUART68681, "duart68681", duart68681_r, duart68681_w, 0xff )
	AM_RANGE(0x800080, 0x800081) AM_READWRITE(HD63484_status_r, HD63484_address_w) // bad
	AM_RANGE(0x800082, 0x800083) AM_READWRITE(HD63484_data_r, HD63484_data_w) // bad
	AM_RANGE(0x800100, 0x8001ff) AM_READ(test_r) //18b too
	AM_RANGE(0xffc000, 0xffffff) AM_RAM
ADDRESS_MAP_END

static ADDRESS_MAP_START( backgamn_mem, ADDRESS_SPACE_PROGRAM, 16 )
	AM_RANGE(0x000000, 0x0fffff) AM_ROM
	AM_RANGE(0x500000, 0x503fff) AM_RAM // sound?
	AM_RANGE(0x503ffa, 0x503ffb) AM_READWRITE(HD63484_status_r, HD63484_address_w) // bad
	AM_RANGE(0x503ffc, 0x503ffd) AM_READWRITE(HD63484_data_r, HD63484_data_w) // bad
	AM_RANGE(0x600000, 0x60001f) AM_NOP // sound?
	AM_RANGE(0x800084, 0xffbfff) AM_RAM // used?
ADDRESS_MAP_END

static INPUT_PORTS_START( adp )

INPUT_PORTS_END

static INPUT_PORTS_START( skattv )
	PORT_INCLUDE(microtouch)

	PORT_START("DSW1")
	PORT_BIT( 0x0001, IP_ACTIVE_HIGH,  IPT_COIN5    )
	PORT_BIT( 0x0002, IP_ACTIVE_LOW,  IPT_COIN6    )
	PORT_BIT( 0x0004, IP_ACTIVE_LOW,  IPT_BILL1    )
	PORT_BIT( 0x0008, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
	PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW )
	PORT_BIT( 0x0020, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
	PORT_BIT( 0x0040, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
	PORT_BIT( 0x0080, IP_ACTIVE_LOW,  IPT_UNKNOWN  )
INPUT_PORTS_END

/*
static INTERRUPT_GEN( adp_int )
{
    cpunum_set_input_line(machine, 0, 1, HOLD_LINE); // ??? All irqs have the same vector, and the mask used is 0 or 7
}
*/

static MACHINE_DRIVER_START( quickjac )
	MDRV_CPU_ADD("main", M68000, 8000000)
	MDRV_CPU_PROGRAM_MAP(quickjac_mem, 0)
//  MDRV_CPU_VBLANK_INT("main", adp_int)

	MDRV_MACHINE_START(skattv)
	MDRV_MACHINE_RESET(skattv)

	MDRV_DEVICE_ADD( "duart68681", DUART68681 )
	MDRV_DEVICE_CONFIG( skattv_duart68681_config )

	MDRV_SCREEN_ADD("main", RASTER)
	MDRV_SCREEN_REFRESH_RATE(30)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(384, 280)
	MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 280-1)
	MDRV_PALETTE_LENGTH(0x10)

	MDRV_PALETTE_INIT(adp)
	MDRV_VIDEO_START(adp)
	MDRV_VIDEO_UPDATE(adp)

	MDRV_SPEAKER_STANDARD_MONO("mono")
	MDRV_SOUND_ADD("ay", AY8910, 3686400/2)
	MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

MACHINE_DRIVER_END

static MACHINE_DRIVER_START( skattv )
	MDRV_CPU_ADD("main", M68000, 8000000)
	MDRV_CPU_PROGRAM_MAP(skattv_mem, 0)
//  MDRV_CPU_VBLANK_INT("main", adp_int)

	MDRV_MACHINE_START(skattv)
	MDRV_MACHINE_RESET(skattv)

	MDRV_DEVICE_ADD( "duart68681", DUART68681 )
	MDRV_DEVICE_CONFIG( skattv_duart68681_config )

	MDRV_SCREEN_ADD("main", RASTER)
	MDRV_SCREEN_REFRESH_RATE(30)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(384, 280)
	MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 280-1)
	MDRV_PALETTE_LENGTH(0x10)

	MDRV_PALETTE_INIT(adp)
	MDRV_VIDEO_START(adp)
	MDRV_VIDEO_UPDATE(adp)

	MDRV_SPEAKER_STANDARD_MONO("mono")
	MDRV_SOUND_ADD("ay", AY8910, 3686400/2)
	MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

MACHINE_DRIVER_END

static MACHINE_DRIVER_START( backgamn )
	MDRV_CPU_ADD("main", M68000, 8000000)
	MDRV_CPU_PROGRAM_MAP(backgamn_mem, 0)

	MDRV_SCREEN_ADD("main", RASTER)
	MDRV_SCREEN_REFRESH_RATE(60)
	MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
	MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
	MDRV_SCREEN_SIZE(640, 480)
	MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
	MDRV_PALETTE_LENGTH(0x10)

//  MDRV_PALETTE_INIT(adp)
	MDRV_VIDEO_START(adp)
	MDRV_VIDEO_UPDATE(adp)

	MDRV_SPEAKER_STANDARD_MONO("mono")
	MDRV_SOUND_ADD("ay", AY8910, 3686400/2)
	MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)

MACHINE_DRIVER_END

ROM_START( quickjac )
	ROM_REGION( 0x100000, "main", 0 )
	ROM_LOAD16_BYTE( "quick_jack_index_a.1.u2.bin", 0x00000, 0x10000, CRC(c2fba6fe) SHA1(f79e5913f9ded1e370cc54dd55860263b9c51d61) )
	ROM_LOAD16_BYTE( "quick_jack_index_a.2.u6.bin", 0x00001, 0x10000, CRC(210cb89b) SHA1(8eac60d40b60e845f9c02fee6c447f125ba5d1ab) )

	ROM_REGION( 0x40000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "quick_jack_video_inde_a.1.u2.bin", 0x00000, 0x20000, CRC(73c27fc6) SHA1(12429bc0009b7754e08d2b6a5e1cd8251ab66e2d) )
	ROM_LOAD16_BYTE( "quick_jack_video_inde_a.2.u6.bin", 0x00001, 0x20000, CRC(61d55be2) SHA1(bc17dc91fd1ef0f862eb0d7dbbbfa354a8403eb8) )
ROM_END

ROM_START( skattv )
	ROM_REGION( 0x100000, "main", 0 )
	ROM_LOAD16_BYTE( "f2_i.bin", 0x00000, 0x20000, CRC(3cb8b431) SHA1(e7930876b6cd4cba837c3da05d6948ef9167daea) )
	ROM_LOAD16_BYTE( "f2_ii.bin", 0x00001, 0x20000, CRC(0db1d2d5) SHA1(a29b0299352e0b2b713caf02aa7978f2a4b34e37) )

	ROM_REGION( 0x40000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "f1_i.bin", 0x00000, 0x20000, CRC(4869a889) SHA1(ad9f3fcdfd3630f9ad5b93a9d2738de9fc3514d3) )
	ROM_LOAD16_BYTE( "f1_ii.bin", 0x00001, 0x20000, CRC(17681537) SHA1(133685854b2080aaa3d0cced0287bc454d1f3bfc) )
ROM_END

ROM_START( skattva )
	ROM_REGION( 0x100000, "main", 0 )
	ROM_LOAD16_BYTE( "skat_tv_version_ts3.1.u2.bin", 0x00000, 0x20000, CRC(68f82fe8) SHA1(d5f9cb600531cdd748616d8c042b6a151ebe205a) )
	ROM_LOAD16_BYTE( "skat_tv_version_ts3.2.u6.bin", 0x00001, 0x20000, CRC(4f927832) SHA1(bbe013005fd00dd42d12939eab5c80ec44a54b71) )

	ROM_REGION( 0x40000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "skat_tv_videoprom_t2.1.u2.bin", 0x00000, 0x20000, CRC(de6f275b) SHA1(0c396fa4d1975c8ccc4967d330b368c0697d2124) )
	ROM_LOAD16_BYTE( "skat_tv_videoprom_t2.2.u5.bin", 0x00001, 0x20000, CRC(af3e60f9) SHA1(c88976ea42cf29a092fdee18377b32ffe91e9f33) )
ROM_END

ROM_START( backgamn )
	ROM_REGION( 0x100000, "main", 0 )
	ROM_LOAD16_BYTE( "b_f2_i.bin", 0x00000, 0x10000, CRC(9e42937c) SHA1(85d462a560b85b03ee9d341e18815b7c396118ac) )
	ROM_LOAD16_BYTE( "b_f2_ii.bin", 0x00001, 0x10000, CRC(8e0ee50c) SHA1(2a05c337db1131b873646aa4109593636ebaa356) )

	ROM_REGION( 0x40000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "b_f1_i.bin", 0x00000, 0x20000, NO_DUMP )
	ROM_LOAD16_BYTE( "b_f1_ii.bin", 0x00001, 0x20000, NO_DUMP )
ROM_END

ROM_START( fashiong )
	ROM_REGION( 0x100000, "main", 0 )
	ROM_LOAD16_BYTE( "fashion_gambler_s6_i.bin", 0x00000, 0x80000, CRC(827a164d) SHA1(dc16380226cabdefbfd893cb50cbfca9e134be40) )
	ROM_LOAD16_BYTE( "fashion_gambler_s6_ii.bin", 0x00001, 0x80000, CRC(5a2466d1) SHA1(c113a2295beed2011c70887a1f2fcdec00b055cb) )

	ROM_REGION( 0x100000, "gfx1", 0 )
	ROM_LOAD16_BYTE( "fashion_gambler_video_s2_i.bin", 0x00000, 0x80000, CRC(d1ee9133) SHA1(e5fdfa303a3317f8f5fbdc03438ee97415afff4b) )
	ROM_LOAD16_BYTE( "fashion_gambler_video_s2_ii.bin", 0x00001, 0x80000, CRC(07b1e722) SHA1(594cbe9edfea6b04a4e49d1c1594f1c3afeadef5) )

	ROM_REGION( 0x4000, "user1", 0 )
	//nvram - 16 bit
	ROM_LOAD16_BYTE( "m48z08post.bin", 0x0000, 0x2000, CRC(2d317a04) SHA1(c690c0d4b2259231d642ab5a30fcf389ba987b70) )
	ROM_LOAD16_BYTE( "m48z08posz.bin", 0x0001, 0x2000, CRC(7c5a4b78) SHA1(262d0d7f5b24e356ab54eb2450bbaa90e3fb5464) )
ROM_END

GAME( 1990, backgamn,        0, backgamn,    adp,    0, ROT0,  "ADP", "Backgammon", GAME_NOT_WORKING )
GAME( 1993, quickjac,        0, quickjac,    skattv,    0, ROT0,  "ADP", "Quick Jack", GAME_NOT_WORKING )
GAME( 1994, skattv,          0, skattv,      skattv,    0, ROT0,  "ADP", "Skat TV", GAME_NOT_WORKING )
GAME( 1995, skattva,    skattv, skattv,      skattv,    0, ROT0,  "ADP", "Skat TV (version TS3)", GAME_NOT_WORKING )
GAME( 1997, fashiong,        0, skattv,      adp,    0, ROT0,  "ADP", "Fashion Gambler", GAME_NOT_WORKING )