summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/gatron.c
blob: ddf105269a7ef20e818ce07f6b19bb073e69c2cf (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
/******************************************************************************

    GAME-A-TRON gaming hardware
    ---------------------------

    Driver by Roberto Fresca.


    Games running on this hardware:

    * Card Games??,  1983, Game-A-Tron.
    * Slots Game??,  1983, Game-A-Tron.


    The names of both games are unknown. Only were arbitrary called "Card Games"
    and "Slot Game" till we can find some evidence of the real names.


*******************************************************************************


    Hardware Notes:
    ---------------


    * PCB1: SLOTS GAME?.

    Board silkscreend:

     GAME-A-TRON CORP.
    (c)1983 PAT.PENDING

    ROMS: - U31 - 2732 (PT-1R-V)
          - U32 - 2732 (PT-2G-V)
          - U33 - 2732 (PT-3B-V)

          - U00 - 2764 (PULL-TABS-1-90)

    Most chips, except for the EPROMS, were covered in a hard black plastic so that
    their numbers could not be read.

    U30 was silkscreend VRAM,    24 pin.
    U11 was silkscreend scp RAM, 24 pin.
    U13 was silkscreend CPU,     40 pin.
    U12 was silkscreend DECODE,  16 pin.

    1x 16MHz Crystal

    1x Duracell PX-2 I, 4.5V battery.



    * PCB2: CARD GAMES?.

    Board silkscreend:

     GAME-A-TRON CORP.
    (c)1983 PAT.PENDING

    ROMS: - U31 - 2732 (POKER-R)
          - U32 - 2732 (POKER-G)
          - U33 - 2732 (BLACK)

          - U00 - 2764 (2764-POKER)
          - U08 - 2732 (2732-POKER-4-1)

    Most chips, except for the EPROMS, were covered in a hard black plastic so that
    their numbers could not be read.

    CPU at u13 still covered in black plastic.
    U05               M5L8255AP-5
    U11	   SCP RAM    TC5516APL  (2Kx8)
    U30    VRAM       HM6116LP-3 (2Kx8)

    1x 16MHz Crystal

    1x Duracell PX-2 I, 4.5V battery.


*******************************************************************************


    *** Game Notes ***


    All games:

	The first time the machine is turned on, will show the legend "DATA ERROR".
    You must to RESET (F3) the machine to initialize the NVRAM properly.


    * Card Games:

    Pressing SERVICE 1 (key 9) you enter the Test/Setting Mode. You can test
    inputs there, and change all the game settings. Press "DISCARD 1" (key Z)
    to choose an option, and "DISCARD 5" (key B) to change the settings.
    Press "SERVICE 2" (key 0) to exit.

    The setting options are:

        HIGHEST-ANTE-IS:   1-5-10-15-20-25-30-35-40-45-50.
        JOKERS:            0-1-2.
        BONUS DRAWS:       0-1.
        DOUBLE-UPS:        0-1-2-3-4-5-6-7-8-9.
        WIN-ON:            JACKS AND UP - PAIR OF ACES.
        SKILL LEVEL:       50-55-60-65-70-75-80-85-90-95-100.
        CREDITS-PER-COIN:  1-5-10-15-20-25-30-35-40-45-50-55-60-65-70-75-80-85-90-95-100.

    The game allow to choose one of the following card games:

    - DRAW POKER.
    - STUD POKER.
    - ACEY-DEUCY.
    - BLACKJACK.
    - HIGH-LOW.

    Press "DISCARD 1" (key Z) to switch between games.
    Press "BET/ANTE" (key N) to bet credits and then start the game.

    The rest of buttons are self-explanatory.

    
    * Slots Game:

    Pressing SERVICE 1 (key 9) you enter the Test/Setting Mode. You can test
    inputs there, and change all the game settings. Press "SUPER STAR TICKET"
    (key Z) to choose an option, and "BIG BAR TICKET" (key C) to change the
    settings. Press "SERVICE 2" (key 0) to exit.

    The setting options are:

        HIGHEST-ANTE-IS:   1-5-10-15-20-25.
        SKILL LEVEL:       50-55-60-65-70-75-80-85-90-95-100.
        CREDITS-PER-COIN:  1-5-10-15-20-25-30-35-40-45-50-55-60-65-70-75-80-85-90-95-100.
        MUSIC:             PLAYS - OFF

    You must bet through "ANTE" (key 1), and then choose a ticket to play.

    Press "SUPER STAR TICKET" (key Z) to play with Super Star (left) Ticket.
    Press "LADY LUCK TICKET" (key X) to play with Lady Luck (center) Ticket.
    Press "BIG BAR TICKET" (key C) to play with Big Bar (right) Ticket.


*******************************************************************************

    --------------------
    ***  Memory Map  ***
    --------------------

    0x0000 - 0x5FFF    ; ROM space.
    0x6000 - 0x67FF    ; Video RAM (only the first 0x300 bytes are used).
    0x8000 - 0x87FF    ; Main RAM.
    0xA000 - 0xA000    ; Unknown Writes.
    0xE000 - 0xE000    ; Unknown Writes (watchdog?).


*******************************************************************************


    DRIVER UPDATES:


    [2008-05-10]

    - Initial release.
    - Properly decoded graphics.
    - Proper memory map.
    - Added NVRAM support.
    - Proper Inputs through 8255 PPI I/O chip.
    - Both games are working.
    - Added technical & game notes.


    TODO:

    - Outputs.
    - Sound.


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


#define MASTER_CLOCK	XTAL_16MHz

#include "driver.h"
#include "machine/8255ppi.h"


/*************************
*     Video Hardware     *
*************************/

static tilemap *bg_tilemap;


static WRITE8_HANDLER( gat_videoram_w )
{
	videoram[offset] = data;
	tilemap_mark_tile_dirty(bg_tilemap, offset);
}


static TILE_GET_INFO( get_bg_tile_info )
{
/*  - bits -
    7654 3210
    xxxx xxxx   tiles code.

    only one color code
*/

	int code = videoram[tile_index];

	SET_TILE_INFO(0, code, 0, 0);
}


static VIDEO_START( gat )
{
	bg_tilemap = tilemap_create(get_bg_tile_info, tilemap_scan_cols, 8, 16, 48, 16);
}


static VIDEO_UPDATE( gat )
{
	tilemap_draw(bitmap, cliprect, bg_tilemap, 0, 0);
	return 0;
}


static PALETTE_INIT( gat )
{

}


/*************************
*      Machine Init      *
*************************/

static const ppi8255_interface ppi8255_intf =
{
	input_port_0_r,	/* Port A read */
	input_port_1_r,	/* Port B read */
	NULL,			/* Port C read */
	NULL,			/* Port A write */
	NULL,			/* Port B write */
	NULL,			/* Port C write */
};


/*************************
* Memory Map Information *
*************************/

static ADDRESS_MAP_START( gat_map, ADDRESS_SPACE_PROGRAM, 8 )
	AM_RANGE(0x0000, 0x5fff) AM_ROM
	AM_RANGE(0x6000, 0x63ff) AM_RAM AM_WRITE(gat_videoram_w) AM_BASE(&videoram)
	AM_RANGE(0x8000, 0x87ff) AM_RAM AM_BASE(&generic_nvram) AM_SIZE(&generic_nvram_size)	/* battery backed RAM */
	AM_RANGE(0xa000, 0xa000) AM_NOP	/* unknown writes */
	AM_RANGE(0xe000, 0xe000) AM_NOP /* watchdog? */
ADDRESS_MAP_END

static ADDRESS_MAP_START( gat_portmap, ADDRESS_SPACE_IO, 8 )
	ADDRESS_MAP_GLOBAL_MASK(0xff)
	AM_RANGE(0x00, 0x03) AM_DEVREADWRITE(PPI8255, "ppi8255", ppi8255_r, ppi8255_w)
ADDRESS_MAP_END

/* I/O byte R/W

   0x0200 ;R   ???!

   0x9200 ;R
   0x9201 ;R
   0x9203 ;W   (0x92)

   0xC002 ;W   (0xC0)
   0xC202 ;W   (0xC2)

   0xFF01 ;R

   -----------------

   unknown writes:

   0xA000 ;W   (3 consecutive writes: 8x - Cx - 93)
   0xE000 ;W   (0x04)

*/

/*************************
*      Input Ports       *
*************************/

static INPUT_PORTS_START( gatcards )
	PORT_START_TAG("IN0")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON8 ) PORT_NAME("Discard 4") PORT_CODE(KEYCODE_V)
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Bet/Ante") PORT_CODE(KEYCODE_N)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Deal/Hit") PORT_CODE(KEYCODE_2)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Stand") PORT_CODE(KEYCODE_A)
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("Start") PORT_CODE(KEYCODE_1)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON9 ) PORT_NAME("Discard 5") PORT_CODE(KEYCODE_B)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_NAME("Discard 3") PORT_CODE(KEYCODE_C)

	PORT_START_TAG("IN1")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON6 )  PORT_NAME("Discard 2") PORT_CODE(KEYCODE_X)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Service 2 (Test Mode Out / Coin Stuck)") PORT_CODE(KEYCODE_0)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* Payout? */
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service 1 (Test/Settings)") PORT_CODE(KEYCODE_9)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON5 )  PORT_NAME("Discard 1") PORT_CODE(KEYCODE_Z)
INPUT_PORTS_END

static INPUT_PORTS_START( gatslots )
	PORT_START_TAG("IN0")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Ante") PORT_CODE(KEYCODE_1)
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("Big Bar Ticket") PORT_CODE(KEYCODE_C)
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Lady Luck Ticket") PORT_CODE(KEYCODE_X)

	PORT_START_TAG("IN1")
	PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE2 ) PORT_NAME("Service 2 (Test Mode Out / Coin Stuck)") PORT_CODE(KEYCODE_0)
	PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )	/* Payout? */
	PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Service 1 (Test/Settings)") PORT_CODE(KEYCODE_9)
	PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
	PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )  PORT_NAME("Super Star Ticket") PORT_CODE(KEYCODE_Z)
INPUT_PORTS_END


/*************************
*    Graphics Layouts    *
*************************/

static const gfx_layout charlayout =
{

	8, 16,
	RGN_FRAC(1,3),	/* 256 tiles */
	3,
	{ 0, RGN_FRAC(1,3), RGN_FRAC(2,3) },    /* bitplanes are separated */
	{ 0, 1, 2, 3, 4, 5, 6, 7 },
	{ 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 
	  8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
	16*8	/* every char takes 16 consecutive bytes */

};


/******************************
* Graphics Decode Information *
******************************/

static GFXDECODE_START( gat )
	GFXDECODE_ENTRY( REGION_GFX1, 0, charlayout, 0, 16 )
GFXDECODE_END


/*************************
*    Machine Drivers     *
*************************/

static MACHINE_DRIVER_START( gat )

	/* basic machine hardware */
	MDRV_CPU_ADD_TAG("main", Z80, MASTER_CLOCK/24)	/* guess */
	MDRV_CPU_PROGRAM_MAP(gat_map, 0)
	MDRV_CPU_IO_MAP(gat_portmap,0)
	MDRV_CPU_VBLANK_INT("main", nmi_line_pulse)

	MDRV_NVRAM_HANDLER(generic_0fill)

	MDRV_DEVICE_ADD( "ppi8255", PPI8255 )
	MDRV_DEVICE_CONFIG( ppi8255_intf )

	/* video hardware */
	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(48*8, 16*16)
	MDRV_SCREEN_VISIBLE_AREA(0*8, 48*8-1, 0*8, 16*16-1)

	MDRV_GFXDECODE(gat)

	MDRV_PALETTE_INIT(gat)
	MDRV_PALETTE_LENGTH(8)

	MDRV_VIDEO_START(gat)
	MDRV_VIDEO_UPDATE(gat)

MACHINE_DRIVER_END


/*************************
*        Rom Load        *
*************************/

ROM_START( gatcards )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )
	ROM_LOAD( "gat1.0",		0x0000, 0x2000, CRC(8361fccd) SHA1(4faae6bb3104c1f4a0939d613966085d7e34c1df))
	ROM_LOAD( "gat1.8",		0x2000, 0x1000, CRC(61e71f31) SHA1(b8d162a47752cff7412b3920ec9dd7a469e81e62) )

	ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "gat1.33",		0x0000, 0x1000, CRC(3f8a2d59) SHA1(d61dce33aa8637105905830e2f37c1052c441194) )
	ROM_LOAD( "gat1.32",		0x1000, 0x1000, CRC(3e7772b2) SHA1(c7499ff148e5a9cbf0958820c41ea09a843ab355) )
	ROM_LOAD( "gat1.31",		0x2000, 0x1000, CRC(18d090ec) SHA1(3504f18b3984d16545dbe61a03fbf6b8e2027150) )
ROM_END

ROM_START( gatslots )
	ROM_REGION( 0x10000, REGION_CPU1, 0 )
	ROM_LOAD( "gat.0",		0x0000, 0x2000, CRC(7cfd490d) SHA1(8eb360f8f4806a4281dae12236d30aa86d00993d) )

	ROM_REGION( 0x3000, REGION_GFX1, ROMREGION_DISPOSE )
	ROM_LOAD( "gat.33",		0x0000, 0x1000, CRC(3505cec1) SHA1(98ab0383c4be382aea81ab93433f2f29a075f65d) )
	ROM_LOAD( "gat.32",		0x1000, 0x1000, CRC(4a3f4f36) SHA1(3dc29f78b7df1a433d0b39bfeaa227615e70ceed) )
	ROM_LOAD( "gat.31",		0x2000, 0x1000, CRC(6d1b80f4) SHA1(f2da4b4ae1eb05f9ea02e7495ee8110698cc5d1b) )
ROM_END


/*************************
*      Game Drivers      *
*************************/

/*    YEAR  NAME      PARENT  MACHINE  INPUT     INIT  ROT    COMPANY        FULLNAME      FLAGS */
GAME( 1983, gatcards, 0,      gat,     gatcards, 0,    ROT0, "Game-A-Tron", "Card Games?", GAME_NO_SOUND )
GAME( 1983, gatslots, 0,      gat,     gatslots, 0,    ROT0, "Game-A-Tron", "Slots Game?", GAME_NO_SOUND )