Previous 15994 Revisions Next

r3461 Saturday 18th October, 2008 at 18:55:33 UTC by Nathan Woods
[ARCADIA] Cleanups, and fixed colors. (bug #1399) [Manfred Schneider]
[docs]messnew.txt
[src/mess/drivers]arcadia.c
[src/mess/video]arcadia.c

src/mess/video/arcadia.c
r3460r3461
11/******************************************************************************
2 PeT mess@utanet.at 2001
3******************************************************************************/
4#include "driver.h"
5#include "includes/arcadia.h"
2Consolidation and enhancment of documentation by Manfred Schneider based on previous work from
3 PeT mess@utanet.at and Paul Robson (autismuk@aol.com)
64
7/* TODO: implement the RESET key on the front panel
8         uncrapify the color table code
9         find a dump of the charactyer ROM
10         convert the drawing code to tilemap
5 Schematics, manuals and anything you can desire for at http://amigan.classicgaming.gamespy.com/
116
12Schematics, manuals and anything you can desire for at http://amigan.classicgaming.gamespy.com/
7 TODO: find a dump of the charactyer ROM
8             convert the drawing code to tilemap
139
14*/
15
16/*
1710  emulation of signetics 2637 video/audio device
1811
19  seams to me like a special microcontroller
20  mask programmed
21  1k x 8 ram available; only first 0x300 bytes mapped to cpu
22*/
12General
13The UVI is capable of controlling 512 Bytes of RAM. It also generates a select signal
14for a 128 byte wide area.
15This whole addres space maps in the arcadia and compatible machines from $1800 - $1AFF.
2316
24/*
250x18fe bit 4 set means sound off?
171. Video Memory
2618
27Sound is implemented on the latest code version, but I lost the
28source to it. I *think* it's a straightforward value to frequency
29calculation, might be 7874/(n+1) (from the Acetronic system),
30but it is almost certainly something like
31
32Clock Freq / (2^Something) / (Byte Data + 1)
33
34It is more or less right on the release version, so a bit of
35experimenting should come up with the right code.
36
37I also believe (and this isn't clear from the tech I think) that
38the CPU is frozen during display time.
39
40PSR
41
42
43             Technical Information about the Emerson Arcadia 2001
44
45Written by Paul Robson (autismuk@aol.com)
46
47Created on 25th June 1998.
48Last updated on 22nd July 1998.
49
50Introduction
51------------
52
53This document is an attempt to exactly describe the internal workings of
54the Emerson Arcadia 2001 Videogame Console.
55
561. General
57----------
58
59- Signetics 2650 CPU at 3.58 Mhz
60- 1k x 8 of RAM (physically present but mostly unavailable :-( )
61- 128 x 208 pixel resolution (alternate 128 x 104 mode available)
62- 16 x 26 background display (2 colour 8 x 8 pixel characters) (can be 16x13=
63)
64- 4 x 8 x 8 Sprites (2 colour 8 x 8 pixels)
65- total of 8 user defined characters available... jaw drops in amazement.
66- 2 x 2 axis Analogue Joysticks
67- 2 x 12 button Controllers
68- 3 buttons on system unit and CPU Reset
69- Single channel beeper
70
712. Memory map
72-------------
73
74The memory map of the 2001 is below.
75
760000..0FFF      4k ROM Block 1 (first 4k of a cartridge)
771000..17FF      (Unmapped)
781800..18CF      Screen display , upper 13 lines, characters/palette high bit=
79s
8018D0..18EF      Free for user programs.
8118F0..18F7      Sprite coordinates y0x0y1x1y2x2y3x3 (Section 10).
82                The sprite uses a UDG 0 =3D $1980,1 =3D $1988,2 =3D $1990 3=20=
83=3D $1998
8418F8..18FB      User memory.
8518FC            A control byte, function unknown [is almost always EE ED or=20=
86EF]
8718FD..18FE      Sound Hardware Pitch & Volume. The 3 high bits of 18FE contr=
88ol
89                the horizontal scanline scrolling.
9018FF            Current Character Line
911900..1902      Keypad Player 1
921903            Unmapped
931904..1906      Keypad Player 2
941907            Unmapped
951908            Controller Buttons
961909..197F      Unmapped
971980..19BF      User defined characters (8 possible, 8 bytes per character)
9819C0..19F7      Unknown usage - not used for anything, apparently.
9919F8            Screen resolution (bit 6)
10019F9            Background Colour / Colour #0 (bits 0..5)
10119FA            Sprite Colour 2 & 3 (bits 0..5)
10219FB            Sprite Colour 0 & 1 (bits 0..5)
10319FC..19FD      Sprite-Sprite & Sprite-Background Collision bits (see later)
10419FE..19FF      Paddles (read only) 19FE is Player 2 , 19FF is Player 1
1051A00..1ACF      Screen display , lower 13 lines, characters/palette high bit=
106s
1071AD0..1AFF      User memory
1081B00..1FFF      Unmapped
1092000..2FFF      4k ROM Block 2 (for 8k carts such as Jungler)
1103000..7FFF      Unknown. The flyers talk about the ability to have 28k
111                carts. This would only be feasible if 0000-7FFF was all ROM
112                except for the '1111' page.
113
1143. Video Memory
115---------------
116
11719The screen table is at 1800-CF and 1A00-CF. Each page has 13 lines of the
11820screen (16 bytes per line,26 lines in total, 208 scan lines). The 2 most
11921significant bits of each byte are colour data, the 6 least significant
r3460r3461
14547half width/double height perhaps. Breakaway sets this when the bats are
14648double size in vertical mode.
14749
1484. Character codes
149------------------
15050
512. Character codes
52
15153Character codes 00..37 to be in a ROM somewhere in the Emerson. These
15254are known, others may be discovered by comparing the screen snapshots
15355against the character tables. If the emulator displays an exclamation
r3460r3461
1596110..19  0..9
160621A..33  A..Z
1616334      Decimal Point
16235..37  Unknown - Control Characters ?
6435      comma
6536        +
6637         $
1636738..3F  User Defined Characters (8 off, from 1980..19FF)
16468
16569Character data is stored 8 bits per character , as a single plane graphic
r3460r3461
16771are two colours per character and 4 possible palette selections for the
16872background.
16973
170A character set is available from Paul Robson (autismuk@aol.com) on
171request.
17274
1735. ROM Images
174-------------
753. Sound
17576
176ROM Images are loaded into 0000-0FFF. If the ROM is an 8k ROM it is
177also loaded into 2000-2FFF. I do not know how 12k images or greater
178are mapped but I doubt that many exist (there is very little RAM
179available for user programs).
77fixed frequency sound and random Noise generator.
7818FD pitch (lower 7 bits)
7918FE volume  ( bits 0 - 2)
8018fe bit 3 set means sound on
8118fe bit 4 set means random noise on
18082
1816. Controls
182-----------
83Calculation of sound frequency is done as follows
84 1/Freq = 2 (pitch +1) * (horizontal line period)
18385
184All key controls are indicated by a bit going to '1'. Unused bits at
185the memory location are set to zero.
86 
874. Sprites
18688
187Keypads
188-------
189
1901900-1902 (Player 1) 1904-1906 (Player 2)
191
192The keypads are arranged as follows :-
193
194        1       2       3
195        4       5       6
196        7       8       9
197      Enter     0     Clear
198
199Row 1/4/7 is 1900/4, Row 2/5/8/0 is 1901/5 and Row 3/6/9 is 1902/6
200The topmost key is bit 3, the lowermost key is bit 0.
201
202Location $1908 contains bit 0 Start,bit 1 Option,bit 2 Difficulty.
203These keys are "latched" i.e. a press causes a logic 1 to appear
204on the current frame.
205
206The paddles are mapped onto 19FE (player 2) and 19FF (player 1). The
207currently selected direction seems to toggle every frame, and the
208only way it seems to be possible to work out which axis is being
209accessed is to count the number of frames. Each game I have tried
210is doing this. "Cat Tracks" swaps the paddles every game ; the reason
211is as yet unknown.
212
213The fire buttons are equivalent to Keypad #2 e.g. they are 1901 and
2141905 bit 3.
215
2167. Sound
217--------
218
219Single channel buzz. Need to do more with this !
220
22118FC control byte ?
22218FD pitch
22318FE volume ? (lower 4 bits)
224
2258. Sprites
226----------
227
22889Sprite pointers are at 18F0..18F7 (there are four of them). The graphics
22990used are the ones in the 1980..19BF UDG table (the first four).
23091
231Sprite addresses (x,y) are converted to offsets in the 128 x 208 as follows=20=
232:-
92Sprite addresses (x,y) are converted to offsets in the 128 x 208 as follows:
23393
234941) 1's complement the y coordinate
235952) subtract 16 from the y coordinate
2363) subtract 44 from the x coordinate
963) subtract 43 from the x coordinate
23797
2389. Palette
239----------
985. Palette
24099
241100The Palette is encoded between 19F8-19FB. This section describes the method
242by which colours are allocated. There are 8 colours, information is coded 3=20
243bits per colour (usually 2 colours per byte)
101by which colours are allocated. There are 8 colours, information is coded
1023 bits per colour (usually 2 colours per byte)
244103
245 Colour Code    Name    Colour Elements
246 ------ ----    ----    ---------------
247  7     111     Black   (GRB =3D 000)
248  6     110     Blue    (GRB =3D 001)
249  5     101     Red     (GRB =3D 010)
250  4     100     Magenta (GRB =3D 011)
251  3     011     Green   (GRB =3D 100)
252  2     010     Cyan    (GRB =3D 101)
253  1     001     Yellow  (GRB =3D 110)
254  0     000     White   (GRB =3D 111)
104 Colour   Code   Name   
105 ------      -----   -------
106  7           111     Black   
107  6           110     Blue
108  5           101     Red
109  4           100     Magenta
110  3           011     Green
111  2           010     Cyan
112  1           001     Yellow
113  0           000     White
255114
256Bits 0..2 of $19F9 are the background colour
257Bits 3..5 of $19F9 are the colours of tile set 0
258                tiles 1,2 and 3 are generated by adding 2,4,6 to the colour.
259                this is probably what the xor gates are for !
260Bits 0..5 of $19FB are the colours of Sprites 0 & 1 (sprite 1 is low bits)
115Bits 0..2 of $19F9 are the screen colour
116Bits 3..5 of $19F9 are the colours of characters
117Bit 6 of $19f9 is for poti axis
118Bit 7 of $19f9 is for character size (1 = 8x8; 0 = 8x16)
261119Bits 0..5 of $19FA are the colours of Sprites 2 & 3 (sprite 3 is low bits)
120Bit 6 of $19FA is for size of sprite 3 (0 = 8x16; 1 = 8x8)
121Bit 7 of $19FA is for size of sprite 2 (0 = 8x16; 1 = 8x8)
122Bits 0..5 of $19FB are the colours of Sprites 0 & 1 (sprite 1 is low bits)
123Bit 6 of $19FB is for size of sprite 1 (0 = 8x16; 1 = 8x8)
124Bit 7 of $19FB is for size of sprite 0 (0 = 8x16; 1 = 8x8)
262125
263Bits 6..7 of $19F9..B and all of $19F8 (except bit 6) currently has
264no known function. Brightness ???
265126
26610. Collision Detection
267-----------------------
1276. Collision Detection
268128
269129Bits are set to zero on a collision - I think they are reset at the
270130frame start. There are two locations : one is for sprite/background
r3460r3461
279139        bit 4 is sprite 1 / 3 collision (guess)
280140        bit 5 is sprite 2 / 3 collision (guess)
281141
28211. Other information
283---------------------
284
285Interrupts are not supported.. maybe. All cartridges have a RETC UN
286at 0003 (presumably the interrupt vector). This may be called on VSYNC
287or VBLANK, but until I find a cart which uses it, who cares !
288
289The Read/Write 2650 CPU Commands do not appear to be connected to
290anything in hardware. No cartridge has been found which uses them.
291The emulator crashes to the debugger with these commands, as it does
292with any illegal commands.
293
29412. Frame Description
295---------------------
296
297This describes the frame rendition (for NTSC). The description Starts at
298the end of a display frame, e.g. scanline 216 on the diagram. For a PAL
299machine these will be slightly different - however I don't think that
300this would affect anything because of the way timing is usually done on
301games, and the fact that scanline level operations are virtually
302impossible.
303
3041.   Set the VBLANK (SENSE) line to logic 1, indicating entry of vblank
3052.   Set the current character address to $FD (off screen)
3063.   Wait for 46+8 Scanlines. (see frame diagram)
3074.   Set the VBLANK (SENSE) line to logic 0.
3085.   Reset the Collision Bytes to $FF
3096.   For 1800..18C0, then for 1A00..1AC0 (if not low resolution)
3106a.    Set the current character address to $Fx
3116b.    wait for 8 (standard) or 16 (low resolution) Scanlines
3126c.    Render the line using the current character & vertical scroll data
3136d.    Draw all sprites which terminate in the area just drawn.
3147.   Restart the frame (from Stage 1).
315
316Stage 5 can be replaced by execute 208 Scanlines if this is not a 'redraw'
317frame.
318
3190       ---------------------------
320        ! Initial Vertical Blank  !
3218       ---------------------------
322        ! Display (208 scanlines) !
323216     ---------------------------
324        !     Frame Retrace       !
325262     ---------------------------
326
327---------------------------------------------------------------
328
329pet additions:
330Golf has a 4kbyte block at 0x0000 and a 2kbyte block at 0x4000.
331
33219f9 bit 6
333switches between the axes of the analog stick
334of both? players
335(must not affect ad converter immediately)
336
337Sprites are used around the playfield a lot
338(space vultures, grand slam tennis, space attack, ...)
339some cartridges think the left 16? pixels are not displayed
340so I display a 32 pixel frame left and right,
341a 8 pixel frame at the top and a bottom frame of 24 pixel
342
343character color ((ch&0xc0)>>5) | ((mem[0x19f9]&8)>>3)
344
3451903 palladium player 1 4 additional keys
3461907 palladium player 2 4 additional keys
347
34819f8 bit 6
349 off 13 charlines
350 on  26 charlines
35119f9
352 bit 7
353  off doublescan
354  on no doublescan
355
142   
1437. Graphic Mode
35614419f8 bit 7 graphics mode on (lower 6 bits descripe rectangles)
3571450xc0 in line switches to graphics mode in this line
3581460x40 in line switches to char mode in this line
359 22111000
360 22111000
361 22111000
362 22111000
363 55444333
364 55444333
365 55444333
366 55444333
147 22211100
148 22211100
149 22211100
150 22211100
151 55544433
152 55544433
153 55544433
154 55544433
367155
368sprite doublescanned (vertical enlarged)
369sprite 0 0x19fb bit 7
370sprite 1 0x19fb bit 6
371sprite 2 0x19fa bit 7
372sprite 3 0x19fa bit 6
373
37418fc crtc vertical position register
375in PAL palladium
376 0xff 16*16+6 visible
377  about 8 lines above and below
378 0x00 in PAL palladium
379  7 lines visible
380
38118fd
382 bit 7 on
383  alternate character mode color2x2
384  (2 backgrounds, 2 foreground colors)
385
386color2x2
387 character bit 7 -> background select
388  0 19f8 bits 2..0
389  1 19f9 bits 2..0
390 character bit 6 -> foreground select
391  0 19f8 bits 5..3
392  1 19f9 bits 5..3
393
394normal mode:
395 character bit 7..6 foreground colors bits 2..1
396 19f9 bits 0..2 ->background color
397 19f9 bit3 foreground color bit 0
398
39919f8, 19f9 readback alway 0xff
4001900 readback 0x5y
40117bf readback 0x54
4021b00 holds value for a moment, gets 0x50
403
404sprite y position
405 basically the same as crtc vertical psoition register, but 1 line later
406
407sprite x position
408 not 44 but 43
409
156 8. Memory Map
157 The offsets in the following memory Map are from the view of the UVI.
158 In the arcadia and compatibles the base offset is $1800 thats how the CPU sees the UVI
159 
160 0000 - 00FF   external RAM
161   0000 - 00CF     upper screen character/graphics codes organised as 16 char x 13 rows
162   00D0 - 00EF    RAM (not used by UVI, can be used by CPU)
163   00F0         vertical offset object 0
164   00F1         horizontal offset object 0
165   00F2         vertical offset object 1
166   00F3         horizontal offset object 1
167   00F4         vertical offset object 2
168   00F5         horizontal offset object 2
169   00F6         vertical offset object 3
170   00F7         horizontal offset object 3
171   00F8 - 00FB   RAM (not used by UVI, can be used by CPU)
172   00FC         complement number of rows from the trailing edge of VRST
173            to the start of character display
174   00FD         bit0 - 6 sound frequeny,  bit 7 color mode
175   00FE         bit0 - 2 loudness, bit 3 sound enable when set, bit 4 random noise enable when set
176            bit 5 - 7 delay for row of characters
177   00FF         bit 0 - 3 DMA number, bit 4 - 7 unused
1780100 - 017F      CE area. In arcadia used for keypad.
1790180 - 01FF      internal UVI registers
180   0180 - 0187   image of object 0 or UDC-code $38
181   0188 - 018F      image of object 1 or UDC-code $39
182   0190 - 0197   image of object 2 or UDC-code $3A
183   0198 - 019F      image of object 3 or UDC-code $3B
184   01A0 - 01A7   image of UDC-code $3C
185   01A8 - 01AF   image of UDC-code $3D
186   01B0 - 01B7   image of UDC-code $3E
187   01B8 - 01BF      image of UDC-code $3F
188   01C0 - 01F7      unused
189   01F8         bit 0 - 2 alternate screen color, bit 3 - 5 alternate character color
190            bit 6 Refresh mode when set entire character field will be display twice
191            bit 7 Grahics mode
192   01F9         bit 0 - 2 screen color, bit 3 - 5 character color
193            bit 6 poti mux control
194            bit 7 character size when set size=8x8 else size=8x16
195   01FA         bit 0 - 2 color of object 3, bit 3 - 5 color of object 2
196            bit 6 size of object 3 when set size=8x8 else size=8x16
197            bit 7 size of object 2 when set size=8x8 else size=8x16
198   01FB         bit 0 - 2 color of object 1, bit 3 - 5 color of object 0
199            bit 6 size of object 1 when set size=8x8 else size=8x16
200            bit 7 size of object 0 when set size=8x8 else size=8x16
201   01FC         object - character collision bits
202            bit 0 when low object 0 collided with character
203            bit 1 when low object 1 collided with character
204            bit 2 when low object 2 collided with character
205            bit 3 when low object 3 collided with character
206            bit 4 - 7 unused set to high
207   01FD         inter object collision
208            bit 0 - when low object 1 and 2 collide
209            bit 1 - when low object 1 and 3 collide
210            bit 2 - when low object 1 and 4 collide
211            bit 3 - when low object 2 and 3 collide
212            bit 4 - when low object 2 and 4 collide
213            bit 5 - when low object 3 and 4 collide
214            bit 6 - 7 unused set to high
215   01FE         digital value of POT1 or POT3 input. Valid only during VRST
216   01FF         digital value of POT2 or POT4 input. Valid only furing VRST
2170200 - 02FF   2nd external RAM
218   0200 - 02CF   lower screen character/graphics codes organised as 16 char x 13 rows   
219   02D0 - 02FF   RAM (not used by UVI, can be used by CPU)         
410220*/
411221
222#include "driver.h"
223#include "includes/arcadia.h"
412224
413225static UINT8 arcadia_rectangle[0x40][8];
414226static UINT8 chars[0x40][8]={
r3460r3461
430242    { 255,254,252,248,240,224,192,128 }, //; 0E (diagonal block)
431243    { 255,127,63,31,15,7,3,1 }, //         ; 0F (diagonal block)
432244    { 0x00,0x1c,0x22,0x26,0x2a,0x32,0x22,0x1c },// 10 0
433    { 0x00,0x08,0x18,0x08,0x08,0x08,0x08,0x1c },// 10 1
434    { 0x00,0x1c,0x22,0x02,0x0c,0x10,0x20,0x3e },// 10 2
435    { 0x00,0x3e,0x02,0x04,0x0c,0x02,0x22,0x1c },// 10 3
436    { 0x00,0x04,0x0c,0x14,0x24,0x3e,0x04,0x04 },// 10 4
437    { 0x00,0x3e,0x20,0x3c,0x02,0x02,0x22,0x1c },// 10 5
438    { 0x00,0x0c,0x10,0x20,0x3c,0x22,0x22,0x1c },// 10 6
439    { 0x00,0x7c,0x02,0x04,0x08,0x10,0x10,0x10 },// 10 7
440    { 0x00,0x1c,0x22,0x22,0x1c,0x22,0x22,0x1c },// 10 8
441    { 0x00,0x1c,0x22,0x22,0x3e,0x02,0x04,0x18 },// 10 9
442    { 0x00,0x08,0x14,0x22,0x22,0x3e,0x22,0x22 },// 10 A
443    { 0x00,0x3c,0x22,0x22,0x3c,0x22,0x22,0x3c },// 10 B
444    { 0x00,0x1c,0x22,0x20,0x20,0x20,0x22,0x1c },// 10 C
445    { 0x00,0x3c,0x22,0x22,0x22,0x22,0x22,0x3c },// 10 D
446    { 0x00,0x3e,0x20,0x20,0x3c,0x20,0x20,0x3e },// 10 E
447    { 0x00,0x3e,0x20,0x20,0x3c,0x20,0x20,0x20 },// 10 F
448    { 0x00,0x1e,0x20,0x20,0x20,0x26,0x22,0x1e },// 10 G
449    { 0x00,0x22,0x22,0x22,0x3e,0x22,0x22,0x22 },// 10 H
450    { 0x00,0x1c,0x08,0x08,0x08,0x08,0x08,0x1c },// 10 I
451    { 0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x1c },// 10 J
452    { 0x00,0x22,0x24,0x28,0x30,0x28,0x24,0x22 },// 10 K
453    { 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x3e },// 10 L
454    { 0x00,0x22,0x36,0x2a,0x2a,0x22,0x22,0x22 },// 10 M
455    { 0x00,0x22,0x22,0x32,0x2a,0x26,0x22,0x22 },// 10 N
456    { 0x00,0x1c,0x22,0x22,0x22,0x22,0x22,0x1c },// 10 O
457    { 0x00,0x3c,0x22,0x22,0x3c,0x20,0x20,0x20 },// 10 P
458    { 0x00,0x1c,0x22,0x22,0x22,0x2a,0x24,0x1a },// 10 Q
459    { 0x00,0x3c,0x22,0x22,0x3c,0x28,0x24,0x22 },// 10 R
460    { 0x00,0x1c,0x22,0x20,0x1c,0x02,0x22,0x1c },// 10 S
461    { 0x00,0x3e,0x08,0x08,0x08,0x08,0x08,0x08 },// 10 T
462    { 0x00,0x22,0x22,0x22,0x22,0x22,0x22,0x1c },// 10 U
463    { 0x00,0x22,0x22,0x22,0x22,0x22,0x14,0x08 },// 10 V
464    { 0x00,0x22,0x22,0x22,0x2a,0x2a,0x36,0x22 },// 10 W
465    { 0x00,0x22,0x22,0x14,0x08,0x14,0x22,0x22 },// 10 X
466    { 0x00,0x22,0x22,0x14,0x08,0x08,0x08,0x08 },// 10 Y
467    { 0x00,0x3e,0x02,0x04,0x08,0x10,0x20,0x3e },// 10 Z
245    { 0x00,0x08,0x18,0x08,0x08,0x08,0x08,0x1c },// 11 1
246    { 0x00,0x1c,0x22,0x02,0x0c,0x10,0x20,0x3e },// 12 2
247    { 0x00,0x3e,0x02,0x04,0x0c,0x02,0x22,0x1c },// 13 3
248    { 0x00,0x04,0x0c,0x14,0x24,0x3e,0x04,0x04 },// 14 4
249    { 0x00,0x3e,0x20,0x3c,0x02,0x02,0x22,0x1c },// 15 5
250    { 0x00,0x0c,0x10,0x20,0x3c,0x22,0x22,0x1c },// 16 6
251    { 0x00,0x7c,0x02,0x04,0x08,0x10,0x10,0x10 },// 17 7
252    { 0x00,0x1c,0x22,0x22,0x1c,0x22,0x22,0x1c },// 18 8
253    { 0x00,0x1c,0x22,0x22,0x3e,0x02,0x04,0x18 },// 19 9
254    { 0x00,0x08,0x14,0x22,0x22,0x3e,0x22,0x22 },// 1A A
255    { 0x00,0x3c,0x22,0x22,0x3c,0x22,0x22,0x3c },// 1B B
256    { 0x00,0x1c,0x22,0x20,0x20,0x20,0x22,0x1c },// 1C C
257    { 0x00,0x3c,0x22,0x22,0x22,0x22,0x22,0x3c },// 1D D
258    { 0x00,0x3e,0x20,0x20,0x3c,0x20,0x20,0x3e },// 1E E
259    { 0x00,0x3e,0x20,0x20,0x3c,0x20,0x20,0x20 },// 1F F
260    { 0x00,0x1e,0x20,0x20,0x20,0x26,0x22,0x1e },// 20 G
261    { 0x00,0x22,0x22,0x22,0x3e,0x22,0x22,0x22 },// 21 H
262    { 0x00,0x1c,0x08,0x08,0x08,0x08,0x08,0x1c },// 22 I
263    { 0x00,0x02,0x02,0x02,0x02,0x02,0x22,0x1c },// 23 J
264    { 0x00,0x22,0x24,0x28,0x30,0x28,0x24,0x22 },// 24 K
265    { 0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x3e },// 25 L
266    { 0x00,0x22,0x36,0x2a,0x2a,0x22,0x22,0x22 },// 26 M
267    { 0x00,0x22,0x22,0x32,0x2a,0x26,0x22,0x22 },// 27 N
268    { 0x00,0x1c,0x22,0x22,0x22,0x22,0x22,0x1c },// 28 O
269    { 0x00,0x3c,0x22,0x22,0x3c,0x20,0x20,0x20 },// 29 P
270    { 0x00,0x1c,0x22,0x22,0x22,0x2a,0x24,0x1a },// 2A Q
271    { 0x00,0x3c,0x22,0x22,0x3c,0x28,0x24,0x22 },// 2B R
272    { 0x00,0x1c,0x22,0x20,0x1c,0x02,0x22,0x1c },// 2C S
273    { 0x00,0x3e,0x08,0x08,0x08,0x08,0x08,0x08 },// 2D T
274    { 0x00,0x22,0x22,0x22,0x22,0x22,0x22,0x1c },// 2E U
275    { 0x00,0x22,0x22,0x22,0x22,0x22,0x14,0x08 },// 2F V
276    { 0x00,0x22,0x22,0x22,0x2a,0x2a,0x36,0x22 },// 30 W
277    { 0x00,0x22,0x22,0x14,0x08,0x14,0x22,0x22 },// 31 X
278    { 0x00,0x22,0x22,0x14,0x08,0x08,0x08,0x08 },// 32 Y
279    { 0x00,0x3e,0x02,0x04,0x08,0x10,0x20,0x3e },// 33 Z
468280    { 0,0,0,0,0,0,0,8 },         // 34 .
469281    { 0,0,0,0,0,8,8,0x10 },         // 35 ,
470282    { 0,0,8,8,0x3e,8,8,0 },         // 36 +
r3460r3461
488300    int breaker;
489301    union {
490302   UINT8 data[0x400];
491   struct {
492       // 0x1800
493       UINT8 chars1[13][16];
494       UINT8 ram1[2][16];
495       struct {
496      UINT8 y,x;
497       } pos[4];
498       UINT8 ram2[4];
499       UINT8 vpos;
500       UINT8 sound1, sound2;
501       UINT8 char_line;
502       // 0x1900
503       UINT8 pad1a, pad1b, pad1c, pad1d;
504       UINT8 pad2a, pad2b, pad2c, pad2d;
505       UINT8 keys, unmapped3[0x80-9];
506       UINT8 chars[8][8];
507       UINT8 unknown[0x38];
508       UINT8 pal[4];
509       UINT8 collision_bg,
510      collision_sprite;
511       UINT8 ad[2];
512       // 0x1a00
513       UINT8 chars2[13][16];
514       UINT8 ram3[3][16];
515   } d;
516    } reg;
303   struct   {
304         // 0x1800
305         UINT8 chars1[13][16];
306         UINT8 ram1[2][16];
307         struct   {
308            UINT8 y,x;
309               } pos[4];
310         UINT8 ram2[4];
311         UINT8 vpos;
312         UINT8 sound1, sound2;
313         UINT8 char_line;
314         // 0x1900
315         UINT8 pad1a, pad1b, pad1c, pad1d;
316         UINT8 pad2a, pad2b, pad2c, pad2d;
317         UINT8 keys, unmapped3[0x80-9];
318         UINT8 chars[8][8];
319         UINT8 unknown[0x38];
320         UINT8 pal[4];
321         UINT8 collision_bg,
322         collision_sprite;
323         UINT8 ad[2];
324         // 0x1a00
325         UINT8 chars2[13][16];
326         UINT8 ram3[3][16];
327         } d;
328      } reg;
517329   bitmap_t *bitmap;
518330} arcadia_video={ 0 };
519331
r3460r3461
558370    case 0x108: data=input_port_read(machine, "panel");break;
559371#if 0
560372    case 0x1fe:
561   if (arcadia_video.ad_select) data=input_port_read(machine, "controller1_joy_y")<<3;
562   else data=input_port_read(machine, "controller1_joy_x")<<3;
373   if (arcadia_video.ad_select)
374      data=input_port_read(machine, "controller1_joy_y")<<3;
375   else
376      data=input_port_read(machine, "controller1_joy_x")<<3;
563377   break;
564378    case 0x1ff:
565   if (arcadia_video.ad_select) data=input_port_read(machine, "controller2_joy_y")<<3;
566   else data=input_port_read(machine, "controller2_joy_x")<<3;
379   if (arcadia_video.ad_select)
380      data=input_port_read(machine, "controller2_joy_y")<<3;
381   else
382      data=input_port_read(machine, "controller2_joy_x")<<3;
567383   break;
568384#else
569385    case 0x1fe:
r3460r3461
595411
596412WRITE8_HANDLER(arcadia_video_w)
597413{
414   arcadia_video.reg.data[offset]=data;
598415    switch (offset) {
599416    case 0xfc:
600   arcadia_video.reg.data[offset]=data;
601417   arcadia_video.ypos=255-data+YPOS;
602418   break;
603419    case 0xfd:
604   arcadia_video.reg.data[offset]=data;
605420   arcadia_soundport_w(machine, offset&3, data);
606421   arcadia_video.multicolor=data&0x80;
607422   break;
608423    case 0xfe:
609   arcadia_video.reg.data[offset]=data;
610424   arcadia_soundport_w(machine, offset&3, data);
611425   arcadia_video.shift=(data>>5);
612426   break;
613427    case 0xf0: case 0xf2: case 0xf4: case 0xf6:
614   arcadia_video.reg.data[offset]=data;
615428   arcadia_video.pos[(offset>>1)&3].y=(data^0xff)+1;
616429   break;
617430    case 0xf1: case 0xf3: case 0xf5: case 0xf7:
618   arcadia_video.reg.data[offset]=data;
619431   arcadia_video.pos[(offset>>1)&3].x=data-43;
620432   break;
621433    case 0x180: case 0x181: case 0x182: case 0x183: case 0x184: case 0x185: case 0x186: case 0x187:
r3460r3461
626438    case 0x1a8: case 0x1a9: case 0x1aa: case 0x1ab: case 0x1ac: case 0x1ad: case 0x1ae: case 0x1af:
627439    case 0x1b0: case 0x1b1: case 0x1b2: case 0x1b3: case 0x1b4: case 0x1b5: case 0x1b6: case 0x1b7:
628440    case 0x1b8: case 0x1b9: case 0x1ba: case 0x1bb: case 0x1bc: case 0x1bd: case 0x1be: case 0x1bf:
629   arcadia_video.reg.data[offset]=data;
630441   chars[0x38|((offset>>3)&7)][offset&7]=data;
631442   break;
632443    case 0x1f8:
633   arcadia_video.reg.data[offset]=data;
634444   arcadia_video.lines26=data&0x40;
635445   arcadia_video.graphics=data&0x80;
636446   break;
637447    case 0x1f9:
638   arcadia_video.reg.data[offset]=data;
639448   arcadia_video.doublescan=!(data&0x80);
640449   arcadia_video.ad_delay=10;
641450   break;
642    default:
643   arcadia_video.reg.data[offset]=data;
644451    }
645452}
646453
647INLINE void arcadia_draw_char(running_machine *machine, bitmap_t *bitmap, UINT8 *ch, int color,
454INLINE void arcadia_draw_char(running_machine *machine, bitmap_t *bitmap, UINT8 *ch, int charcode,
648455               int y, int x)
649456{
650   /* 7-Sep-2007 - whomever wrote this crap code was dynamically remapping
651    * the color table, a vile gross hack.  Doesn't look like this is going
652    * to survive the 0.118u5 transition */
653    int k,b;
654    if (arcadia_video.multicolor) {
655   int c;
656   if (color&0x40) c=arcadia_video.reg.d.pal[1];
657   else c=arcadia_video.reg.d.pal[0];
658   /*imachine->gfx[0]->colortable[1]=(c>>3)&7;*/
457    int k,b,cc,sc, colour;
458    if (arcadia_video.multicolor)
459   {
460      if (charcode&0x40)
461         cc=((arcadia_video.reg.d.pal[1]>>3)&7);
462      else
463         cc=((arcadia_video.reg.d.pal[0]>>3)&7);
659464
660   if (color&0x80) c=arcadia_video.reg.d.pal[1];
661   else c=arcadia_video.reg.d.pal[0];
662   /*machine->gfx[0]->colortable[0]=c&7;*/
465      if (charcode&0x80)
466         sc=(arcadia_video.reg.d.pal[1]&7);
467      else
468         sc=(arcadia_video.reg.d.pal[0]&7);
663469
664    } else {
665   /*machine->gfx[0]->colortable[1]=
666       ((arcadia_video.reg.d.pal[1]>>3)&1)|((color>>5)&6);*/
470    }
471   else
472   {
473      cc=((arcadia_video.reg.d.pal[1]>>3)&1)|((charcode>>5)&6);
474      sc=(arcadia_video.reg.d.pal[1]&7);
667475    }
476   colour = (((sc << 3) | cc) + 4);
668477
669    if (arcadia_video.doublescan) {
670   for (k=0; (k<8)&&(y<bitmap->height); k++, y+=2) {
478    if (arcadia_video.doublescan)
479   {
480   for (k=0; (k<8)&&(y<bitmap->height); k++, y+=2)
481      {
671482       b=ch[k];
672483       arcadia_video.bg[y][x>>3]|=b>>(x&7);
673484       arcadia_video.bg[y][(x>>3)+1]|=b<<(8-(x&7));
r3460r3461
675486            if (y+1<bitmap->height) {
676487                arcadia_video.bg[y+1][x>>3]|=b>>(x&7);
677488                arcadia_video.bg[y+1][(x>>3)+1]|=b<<(8-(x&7));
678                drawgfx(bitmap, machine->gfx[0], b,0,
489                drawgfx(bitmap, machine->gfx[0], b,colour,
679490                        0,0,x,y,
680491                        0, TRANSPARENCY_NONE,0);
681                drawgfx(bitmap, machine->gfx[0], b,0,
492                drawgfx(bitmap, machine->gfx[0], b,colour,
682493                        0,0,x,y+1,
683494                        0, TRANSPARENCY_NONE,0);
684495            }
685   }
686    } else {
687   for (k=0; (k<8)&&(y<bitmap->height); k++, y++) {
496      }
497    }
498   else
499   {
500   for (k=0; (k<8)&&(y<bitmap->height); k++, y++)
501      {
688502       b=ch[k];
689503            arcadia_video.bg[y][x>>3]|=b>>(x&7);
690504       arcadia_video.bg[y][(x>>3)+1]|=b<<(8-(x&7));
691505
692       drawgfx(bitmap, machine->gfx[0], b,0,
506       drawgfx(bitmap, machine->gfx[0], b,colour,
693507          0,0,x,y,
694508          0, TRANSPARENCY_NONE,0);
695   }
509      }
696510    }
697511}
698512
r3460r3461
703517    int graphics=arcadia_video.graphics;
704518    h=arcadia_video.doublescan?16:8;
705519
706    if (bitmap->height-arcadia_video.line<h) h=bitmap->height-arcadia_video.line;
707    plot_box(bitmap, 0, y, bitmap->width, h, 0);
520    if (bitmap->height-arcadia_video.line<h)
521      h=bitmap->height-arcadia_video.line;
522   
523   plot_box(bitmap, 0, y, bitmap->width, h, (arcadia_video.reg.d.pal[1]&7));
708524    memset(arcadia_video.bg[y], 0, sizeof(arcadia_video.bg[0])*h);
709    for (x=XPOS+arcadia_video.shift, j=0; j<16;j++,x+=8) {
710   ch=chars1[j];
711   // hangman switches with 0x40
712   // alien invaders shield lines start with 0xc0
713   if ((ch&0x3f)==0) {
714       switch (ch) {
715      case 0xc0: graphics=TRUE;break;
716      case 0x40: graphics=FALSE;break;
717//      case 0x80:
525   
526   for (x=XPOS+arcadia_video.shift, j=0; j<16;j++,x+=8)
527   {
528      ch=chars1[j];
529// hangman switches with 0x40
530// alien invaders shield lines start with 0xc0
531      if ((ch&0x3f)==0)
532      {
533         switch (ch) {
534         case 0xc0: graphics=TRUE;break;
535         case 0x40: graphics=FALSE;break;
536//         case 0x80:
718537//         alien invaders shields are empty 0x80
719//          popmessage(5, "graphics code 0x80 used");
720       }
721   }
722   if (graphics)
723       arcadia_draw_char(machine, bitmap, arcadia_rectangle[ch&0x3f], ch, y, x);
724   else
725       arcadia_draw_char(machine, bitmap, chars[ch&0x3f], ch, y, x);
538//             popmessage(5, "graphics code 0x80 used");
539         }
540      }
541      if (graphics)
542         arcadia_draw_char(machine, bitmap, arcadia_rectangle[ch&0x3f], ch, y, x);
543      else
544         arcadia_draw_char(machine, bitmap, chars[ch&0x3f], ch, y, x);
726545    }
727546}
728547
r3460r3461
746565
747566static void arcadia_draw_sprites(running_machine *machine, bitmap_t *bitmap)
748567{
749    int i, k, x, y;
568    int i, k, x, y, color=0;
750569    UINT8 b;
751570
752571    arcadia_video.reg.d.collision_bg|=0xf;
753572    arcadia_video.reg.d.collision_sprite|=0x3f;
754    for (i=0; i<4; i++) {
573    for (i=0; i<4; i++)
574   {
755575   int doublescan = FALSE;
756576   if (arcadia_video.pos[i].y<=-YPOS) continue;
757577   if (arcadia_video.pos[i].y>=bitmap->height-YPOS-8) continue;
758578   if (arcadia_video.pos[i].x<=-XPOS) continue;
759579   if (arcadia_video.pos[i].x>=128+XPOS-8) continue;
760580
761   /* 7-Sep-2007 - whomever wrote this crap code was dynamically remapping
762    * the color table, a vile gross hack.  Doesn't look like this is going
763    * to survive the 0.118u5 transition */
764   switch (i) {
581   switch (i)
582   {
765583   case 0:
766       /*machine->gfx[0]->colortable[1]=(arcadia_video.reg.d.pal[3]>>3)&7;*/
584       color=(arcadia_video.reg.d.pal[3]>>3)&7;
767585       doublescan=arcadia_video.reg.d.pal[3]&0x80?FALSE:TRUE;
768586       break;
769587   case 1:
770       /*machine->gfx[0]->colortable[1]=arcadia_video.reg.d.pal[3]&7;*/
588       color=arcadia_video.reg.d.pal[3]&7;
771589       doublescan=arcadia_video.reg.d.pal[3]&0x40?FALSE:TRUE;
772590       break;
773591   case 2:
774       /*machine->gfx[0]->colortable[1]=(arcadia_video.reg.d.pal[2]>>3)&7;*/
592       color=(arcadia_video.reg.d.pal[2]>>3)&7;
775593       doublescan=arcadia_video.reg.d.pal[2]&0x80?FALSE:TRUE;
776594       break;
777595   case 3:
778       /*machine->gfx[0]->colortable[1]=arcadia_video.reg.d.pal[2]&7;*/
596       color=arcadia_video.reg.d.pal[2]&7;
779597       doublescan=arcadia_video.reg.d.pal[2]&0x40?FALSE:TRUE;
780598       break;
781599   }
782   for (k=0; k<8; k++) {
600   for (k=0; k<8; k++)
601   {
602      int j, m;
783603       b=arcadia_video.reg.d.chars[i][k];
784604       x=arcadia_video.pos[i].x+XPOS;
785       if (!doublescan) {
605       if (!doublescan)
606      {
786607      y=arcadia_video.pos[i].y+YPOS+k;
787      drawgfx(bitmap, machine->gfx[0], b,0,
788         0,0,x,y,
789         0, TRANSPARENCY_PEN,0);
790       } else {
608      for (j=0,m=0x80; j<8; j++, m>>=1)
609      {
610         if (b & m)
611         {
612            *BITMAP_ADDR16(bitmap, y, x + j) = color;
613         }
614      }
615       }
616      else
617      {
791618      y=arcadia_video.pos[i].y+YPOS+k*2;
792      drawgfx(bitmap, machine->gfx[0], b,0,
793         0,0,x,y,
794         0, TRANSPARENCY_PEN,0);
795      drawgfx(bitmap, machine->gfx[0], b,0,
796         0,0,x,y+1,
797         0, TRANSPARENCY_PEN,0);
619      for (j=0,m=0x80; j<8; j++, m>>=1)
620      {
621         if (b & m)
622         {
623            *BITMAP_ADDR16(bitmap, y, x + j) = color;
624            *BITMAP_ADDR16(bitmap, y+1, x + j) = color;
625         }
626      }
798627       }
799       if (arcadia_video.reg.d.collision_bg&(1<<i)) {
800      if ( (b<<(8-(x&7))) & ((arcadia_video.bg[y][x>>3]<<8)
801                   |arcadia_video.bg[y][(x>>3)+1]) )
802          arcadia_video.reg.d.collision_bg&=~(1<<i);
628       if (arcadia_video.reg.d.collision_bg&(1<<i))
629      {
630         if ( (b<<(8-(x&7))) & ((arcadia_video.bg[y][x>>3]<<8)
631                        |arcadia_video.bg[y][(x>>3)+1]) )
632            arcadia_video.reg.d.collision_bg&=~(1<<i);
803633       }
804634   }
805635    }
r3460r3461
825655   // unbelievable, reflects only charline, but alien invaders uses it for
826656   // alien scrolling
827657
828   /* 7-Sep-2007 - whomever wrote this crap code was dynamically remapping
829    * the color table, a vile gross hack.  Doesn't look like this is going
830    * to survive the 0.118u5 transition */
831   /*machine->gfx[0]->colortable[0]=arcadia_video.reg.d.pal[1]&7;*/
832
833658   if (arcadia_video.line<arcadia_video.ypos)
834659   {
835      plot_box(arcadia_video.bitmap, 0, arcadia_video.line, width, 1, 0);
660      plot_box(arcadia_video.bitmap, 0, arcadia_video.line, width, 1, (arcadia_video.reg.d.pal[1])&7);
836661      memset(arcadia_video.bg[arcadia_video.line], 0, sizeof(arcadia_video.bg[0]));
837662   }
838663   else
r3460r3461
843668
844669      if (arcadia_video.charline<13)
845670      {
846         if (((arcadia_video.line-arcadia_video.ypos)&(h-1))==0) {
671         if (((arcadia_video.line-arcadia_video.ypos)&(h-1))==0)
672         {
847673            arcadia_vh_draw_line(machine, arcadia_video.bitmap, arcadia_video.charline*h+arcadia_video.ypos,
848674               arcadia_video.reg.d.chars1[arcadia_video.charline]);
849675         }
850676      }
851      else if (arcadia_video.lines26 && (arcadia_video.charline<26))
852      {
853         if (((arcadia_video.line-arcadia_video.ypos)&(h-1))==0)
677      else
678         if (arcadia_video.lines26 && (arcadia_video.charline<26))
854679         {
855            arcadia_vh_draw_line(machine, arcadia_video.bitmap, arcadia_video.charline*h+arcadia_video.ypos,
856               arcadia_video.reg.d.chars2[arcadia_video.charline-13]);
857         }
680            if (((arcadia_video.line-arcadia_video.ypos)&(h-1))==0)
681            {
682               arcadia_vh_draw_line(machine, arcadia_video.bitmap, arcadia_video.charline*h+arcadia_video.ypos,
683                  arcadia_video.reg.d.chars2[arcadia_video.charline-13]);
684            }
858685         arcadia_video.charline-=13;
859      }
860      else
861      {
686         }
687         else
688         {
862689         arcadia_video.charline=0xd;
863         plot_box(arcadia_video.bitmap, 0, arcadia_video.line, width, 1, 0);
690         plot_box(arcadia_video.bitmap, 0, arcadia_video.line, width, 1, (arcadia_video.reg.d.pal[1])&7);
864691         memset(arcadia_video.bg[arcadia_video.line], 0, sizeof(arcadia_video.bg[0]));
865      }
692         }
866693   }
867694   if (arcadia_video.line==261)
868695      arcadia_draw_sprites(machine, arcadia_video.bitmap);
src/mess/drivers/arcadia.c
r3460r3461
11/******************************************************************************
2 PeT mess@utanet.at May 2001
2Consolidation and enhancment of documentation by Manfred Schneider based on previous work from
3 PeT mess@utanet.at and Paul Robson (autismuk@aol.com)
34
4 Paul Robson's Emulator at www.classicgaming.com/studio2 made it possible
5******************************************************************************/
5 Schematics, manuals and anything you can desire for at http://amigan.classicgaming.gamespy.com/
66
7/*
8Schematics, manuals and anything you can desire for at http://amigan.classicgaming.gamespy.com/
7 TODO: implement the RESET key on the front panel
8         find a dump of the charactyer ROM
9         convert the drawing code to tilemap
10 
11 
12 1. General
13   SYSTEM
14- Signetics 2650 CPU at 3.58/4 Mhz(for NTSC) or at 4,433/5 (for PAL)
15- 1k x 8 of RAM (physically present but only 512 byte available)
16- 2 x 2 axis Analogue Joysticks
17- 2 x 12 button Controllers
18- 3 buttons on system unit and CPU Reset
19   VIDEO
20- 128 x 208 pixel resolution (alternate 128 x 104 mode available)
21- 16 x 26 (can be 16x13) background display (2 colour 8 x 8 pixel characters)
22- 4 x 8 x 8 Sprites (2 colour 8 x 8 pixels)
23- total of 8 user defined characters available
24   SOUND
25- Single channel beeper
926
10TODO: Define a proper color table - see machine/arcadia.c for details
11*/
1227
282. Memory map
29The memory map of the 2001 is below.
300000 - 0FFF   4k ROM Block 1 (first 4k of a cartridge)
311000 - 13FF      mirror of $1800-$1BFF
321400 - 17FF      mirror of $1800-$1BFF
331800 - 1BFF      UVI2637 Area (detail description in video/arcadia.c)
34   1800 - 18CF      Screen display , upper 13 lines, characters/palette high bits
35   18D0 - 18EF   Free for user programs.
36   18F0 - 18F7      Sprite coordinates y0x0y1x1y2x2y3x3
37   18F8 - 1908      registers of UVI
38   1909 - 197F      Unmapped
39   1980 - 19BF      User defined characters (8 possible, 8 bytes per character)
40   19C0 - 19F7      Unmapped
41   19F8 - 19FF      registers of UVI
42   1A00 - 1ACF   Screen display , lower 13 lines, characters/palette high bits
43   1AD0 - 1AFF   User memory
44   1B00 - 1BFF      mirror of 1900-19FF
451C00 - 1FFF      mirror of 1800-1BFF
462000 - 2FFF   4k ROM Block 2 (for 8k carts such as Jungler)
473000 - 3FFF   mirror of 1000-1FFF
484000 - 4FFF   mirror of 0000-0FFF
495000 - 5FFF   mirror of 1000-1FFF
506000 - 6FFF   mirror of 0000-0FFF
517000 - 7FFF   mirror of 1000-1FFF
52
53The Palladium VCG memory map is as follows.
540000 - 0FFF   4k ROM Block 1 (first 4k of a cartridge)
551000 - 17FF      could be ROM or RAM but no Cartridge uses this
561800 - 1BFF      UVI2637 Area (detail description in video/arcadia.c)
57   1800 - 18CF      Screen display , upper 13 lines, characters/palette high bits
58   18D0 - 18EF   Free for user programs.
59   18F0 - 18F7      Sprite coordinates y0x0y1x1y2x2y3x3
60   18F8 - 1908      registers of UVI
61   1909 - 197F      Unmapped
62   1980 - 19BF      User defined characters (8 possible, 8 bytes per character)
63   19C0 - 19F7      Unmapped
64   19F8 - 19FF      registers of UVI
65   1A00 - 1ACF   Screen display , lower 13 lines, characters/palette high bits
66   1AD0 - 1AFF   User memory
67   1B00 - 1BFF      mirror of 1900-19FF
681C00 - 1FFF      could be ROM or RAM but no Cartridge uses this
692000 - 2FFF   4k ROM Block  (for 8k carts such as Jungler)
703000 - 3FFF   could be ROM or RAM but no Cartridge uses this
714000 - 4FFF   4k ROM Block  (first 2K used by Golf)
725000 - 5FFF   4k ROM Block
736000 - 6FFF   4k ROM Block
747000 - 7FFF   4k ROM Block
75
76
773. ROM Images
78ROM Images are loaded into 0000-0FFF. If the ROM is an 8k ROM the
79second half of the Rom is located at 2000-2FFF. Except for the Golf cart
80which is located from 0x0000-0x0FFF and a 2kbyte block from 0x4000 only on
81Palladium VCG.
82
83
844. Controls
85All key controls are indicated by a bit going to '1'. Unused bits at
86the memory location are set to zero.
87
88Keypads
89
901900-1902 (Player 1) 1904-1906 (Player 2)
91The keypads are arranged as follows :-
92
93        1       2       3
94        4       5       6
95        7       8       9
96      Enter     0     Clear
97
98Row 1/4/7 is 1900/4, Row 2/5/8/0 is 1901/5 and Row 3/6/9 is 1902/6
99The topmost key is bit 3, the lowermost key is bit 0.
100
101Location $1908 contains bit 0 Start,bit 1 Option,bit 2 Difficulty.
102These keys are "latched" i.e. a press causes a logic 1 to appear
103on the current frame.
104
105The fire buttons are equivalent to Keypad #2 e.g. they are 1901 and
1061905 bit 3.
107
108Palladium has 4 additional key per keypad which are mapped at
1091903 palladium player 1
1101907 palladium player 2
111
112
1135. Other information
114Interrupts are not supported
115The Read/Write 2650 CPU Port-Commands do not appear to be connected to
116anything in hardware. No cartridge has been found which uses them.
117
118 ******************************************************************************/
119
13120#include <assert.h>
14121#include "driver.h"
15122#include "cpu/s2650/s2650.h"
r3460r3461
281388
282389static const gfx_layout arcadia_charlayout =
283390{
284   8,1,
285   256,                                    /* 256 characters */
286   1,                      /* 1 bits per pixel */
391   8,                  /*width*/
392   1,                  /*heigth*/
393   256,               /* 256 characters */
394   1,                  /* 1 bits per pixel */
287395   { 0 },                  /* no bitplanes; 1 bit per pixel */
288   /* x offsets */
289   {
290   0,
291   1,
292   2,
293   3,
294   4,
295   5,
296   6,
297   7,
298   },
299   /* y offsets */
300   { 0 },
396   { 0, 1, 2, 3, 4, 5, 6, 7 },   /* x offsets */
397   { 0 },               /* y offsets */
301398   1*8
302399};
303400
304401static GFXDECODE_START( arcadia )
305   GFXDECODE_ENTRY( "gfx1", 0x0000, arcadia_charlayout, 0, 128 )
402   GFXDECODE_ENTRY( "gfx1", 0x0000, arcadia_charlayout, 0, 68 )
306403GFXDECODE_END
307404
308static const rgb_t arcadia_palette[] =
405static const rgb_t arcadia_colors[] =
309406{
310407   RGB_WHITE,               /* white */
311408   MAKE_RGB(0xff, 0xff, 0x00),   /* yellow */
r3460r3461
317414   RGB_BLACK               /* black */
318415};
319416
320static const unsigned short arcadia_colortable[2][2] = {
321   { 0, 1 },
322   { 1, 0 }
417static const unsigned short arcadia_palette[128+8] =  /* bgnd, fgnd */
418{
419   0,1,2,3,4,5,6,7,
420   
421   0,0, 0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,7,
422   1,0, 1,1, 1,2, 1,3, 1,4, 1,5, 1,6, 1,7,
423   2,0, 2,1, 2,2, 2,3, 2,4, 2,5, 2,6, 2,7,
424   3,0, 3,1, 3,2, 3,3, 3,4, 3,5, 3,6, 3,7,
425   4,0, 4,1, 4,2, 4,3, 4,4, 4,5, 4,6, 4,7,
426   5,0, 5,1, 5,2, 5,3, 5,4, 5,5, 5,6, 5,7,
427   6,0, 6,1, 6,2, 6,3, 6,4, 6,5, 6,6, 6,7,
428   7,0, 7,1, 7,2, 7,3, 7,4, 7,5, 7,6, 7,7
323429};
324430
325431static PALETTE_INIT( arcadia )
326432{
327   palette_set_colors(machine, 0, arcadia_palette, ARRAY_LENGTH(arcadia_palette));
433   int i;
434
435   machine->colortable = colortable_alloc(machine, 8);
436
437   for (i = 0; i < 8; i++)
438      colortable_palette_set_color(machine->colortable, i, arcadia_colors[i]);
439
440   for (i = 0; i < 128+8; i++)
441      colortable_entry_set_value(machine->colortable, i, arcadia_palette[i]);
328442}
329443
330444static MACHINE_DRIVER_START( arcadia )
331445   /* basic machine hardware */
332   MDRV_CPU_ADD("main", S2650, 3580000/3)        /* 1.796 Mhz */
446   MDRV_CPU_ADD("main", S2650, 3580000/4)        /* 0.895 Mhz */
333447   MDRV_CPU_PROGRAM_MAP(arcadia_mem, 0)
334448   MDRV_CPU_IO_MAP(arcadia_io, 0)
335449   MDRV_CPU_PERIODIC_INT(arcadia_video_line, 262*60)
docs/messnew.txt
r3460r3461
4747
4848- [ABC800M] Added keyboard hack to enable system use. [Curt Coder]
4949
50- [ARCADIA] Cleanups, and fixed colors.  (bug #1399) [Manfred Schneider]
51
5052- [C16] Added support for tape emulation using MESS core functions (only
5153  loading, both .wav and .tap formats) [Fabio Priuli, Roberto Zandona']
5254

Previous 15994 Revisions Next


© 1998-2018 The MESS Team