Previous 15994 Revisions Next

r12083 Monday 27th June, 2011 at 13:47:46 UTC by Miodrag Milanović
Moved H file to proper location (no whatsnew)
[src/mess/audio]intv.c
[src/mess/drivers]intv.c
[src/mess/includes]stic.h
[src/mess/machine]intv.c
[src/mess/video]intv.c stic.c stic.h*

src/mess/audio/intv.c
r12082r12083
11#include "emu.h"
2#include "includes/stic.h"
2#include "video/stic.h"
33#include "includes/intv.h"
44#include "sound/ay8910.h"
55
src/mess/machine/intv.c
r12082r12083
11#include "emu.h"
2#include "includes/stic.h"
2#include "video/stic.h"
33#include "includes/intv.h"
44#include "cpu/cp1610/cp1610.h"
55#include "image.h"
src/mess/includes/stic.h
r12082r12083
1/*****************************************************************************
2 *
3 * includes/stic.h
4 *
5 ****************************************************************************/
6
7#ifndef STIC_H_
8#define STIC_H_
9
10// GROM/GRAM cards are 8x8
11#define STIC_CARD_WIDTH            8
12#define STIC_CARD_HEIGHT         8
13
14// Intellivision resolution is 20x12 BACKTAB CARDs, minus the rightmost column,
15// for an effective resolution of (19 * 8 + 1 * 7) x (12 * 8) == 159x96.
16//
17// MOB scanline height can be half of a card scanline height, so y-coordinates
18// are scaled by 2.
19#define STIC_X_SCALE            1
20#define STIC_Y_SCALE            2
21
22// the Intellivision emulation scales to match the output format at the last
23// step. The Intellivision keyboard component appears to be 320x96, but can
24// also run Intellivision carts, so x-coordinates are conditionally scaled
25// by 2.
26#define INTV_X_SCALE            1
27#define INTV_Y_SCALE            1
28#define INTVKBD_X_SCALE            2
29#define INTVKBD_Y_SCALE            INTV_Y_SCALE
30
31// overscan sizes in intv pixels
32// these values are approximate.
33#define STIC_OVERSCAN_LEFT_WIDTH   13
34#define STIC_OVERSCAN_RIGHT_WIDTH   17
35#define STIC_OVERSCAN_TOP_HEIGHT   12
36#define STIC_OVERSCAN_BOTTOM_HEIGHT   12
37
38/*** STIC registers *********************************************************/
39
40// number of STIC registers
41#define STIC_REGISTERS            0x33
42
43// STIC MOBs (Moveable OBjects)
44enum
45{
46   STIC_MOB0,
47   STIC_MOB1,
48   STIC_MOB2,
49   STIC_MOB3,
50   STIC_MOB4,
51   STIC_MOB5,
52   STIC_MOB6,
53   STIC_MOB7,
54
55   STIC_MOBS
56};
57
58// STIC Color Stack
59enum
60{
61   STIC_CSR0,
62   STIC_CSR1,
63   STIC_CSR2,
64   STIC_CSR3,
65
66   STIC_CSRS
67};
68
69/****************************************************************************
70 *                                                         *
71 * MXR      0000[..0007]   MOB X REGISTER               RW            *
72 *                                                         *
73 * (MSB)                              (LSB)                  *
74 * +-+-+-+-+-+-----+---+---+--+--+--+--+--+--+--+--+                  *
75 * | | | | | |XSIZE|VIS|COL|X7|X6|X5|X4|X3|X2|X1|X0|                  *
76 * +-+-+-+-+-+-----+---+---+--+--+--+--+--+--+--+--+                  *
77 *                                                         *
78 * Xn      x-position                  [0..255]                  *
79 * COL      collision detection            [1=enable]                  *
80 * VIS      visibility                  [1=visible]                  *
81 * XSIZE   double width               [1=double]                  *
82 *                                                         *
83 ****************************************************************************
84 *                                                         *
85 *   NOTES                                                   *
86 *                                                         *
87 *   1. If X=0, the sprite is not visible and does not register collisions.   *
88 *   2. The horizontal handle is 8 pixels from the left of the sprite,      *
89 *      regardless of width.                                       *
90 *                                                         *
91 ****************************************************************************/
92#define STIC_MXR               0x0000
93
94#define STIC_MXR_XSIZE            0x0400
95#define STIC_MXR_VIS            0x0200
96#define STIC_MXR_COL            0x0100
97#define STIC_MXR_X               0x00FF
98
99/****************************************************************************
100 *                                                         *
101 * MYR      0008[..000F]   MOB Y REGISTER               RW            *
102 *                                                         *
103 * (MSB)                                     (LSB)            *
104 * +-+-+-+-+-----+-----+-----+-----+----+--+--+--+--+--+--+--+            *
105 * | | | | |YFLIP|XFLIP|YSIZE|YFULL|YRES|Y6|Y5|Y4|Y3|Y2|Y1|Y0|            *
106 * +-+-+-+-+-----+-----+-----+-----+----+--+--+--+--+--+--+--+            *
107 *                                                         *
108 * Yn      y-position                  [0..127]                  *
109 * YRES      y-resolution               [0=8 scanlines,1=16 scanlines]   *
110 * YFULL   double scanline height         [1=double]                  *
111 * YSIZE   quadruple scanline height      [1=quadruple]               *
112 * XFLIP   horizontally flip image         [1=flip]                  *
113 * YFLIP   vertically flip image         [1=flip]                  *
114 *                                                         *
115 ****************************************************************************
116 *                                                         *
117 *   NOTES                                                   *
118 *                                                         *
119 *   1. A sprite with YRES=1 will display two cards.                     *
120 *   2. A sprite with YFULL=0 and YSIZE=0 will have scanlines half the      *
121 *      height of a background card.                                 *
122 *   3, The minimum size of a sprite is 8x8 (XSIZE=YRES=YSIZE=YFULL=0).      *
123 *   4. The maximum size of a sprite is 16x128 (XSIZE=YRES=YSIZE=YFULL=1).   *
124 *   5. The Y-position is measured in double height scanlines.            *
125 *   6. The vertical handle is 8 double height scanlines from the top of the   *
126 *      sprite, regardless of height.                              *
127 *                                                         *
128 ****************************************************************************/
129#define STIC_MYR               0x0008
130
131#define STIC_MYR_YFLIP            0x0800
132#define STIC_MYR_XFLIP            0x0400
133#define STIC_MYR_YSIZE            0x0200
134#define STIC_MYR_YFULL            0x0100
135#define STIC_MYR_YRES            0x0080
136#define STIC_MYR_Y               0x007F
137
138/****************************************************************************
139 *                                                         *
140 * SAR      0010[..0017]   MOB ATTRIBUTE REGISTER         RW            *
141 *                                                         *
142 * (MSB)                               (LSB)                  *
143 * +-+-+---+---+---+-+-+--+--+--+--+--+--+---+---+---+                  *
144 * | | |PRI|FG3|SEL| | |C5|C4|C3|C2|C1|C0|FG2|FG1|FG0|                  *
145 * +-+-+---+---+---+-+-+--+--+--+--+--+--+---+---+---+                  *
146 *                                                         *
147 * FGn      foreground color            [0..15]                     *
148 * Cn      card #                     [0..63]                     *
149 * SEL      card memory   select            [0=GROM, 1=GRAM]            *
150 * PRI      sprite priority               [1=behind set background bit]   *
151 *                                                         *
152 ****************************************************************************/
153#define STIC_MAR               0x0010
154
155#define STIC_MAR_PRI            0x2000
156#define STIC_MAR_FG3            0x1000
157#define STIC_MAR_SEL            0x0800
158#define STIC_MAR_C               0x07F8
159#define STIC_MAR_FG20            0x0007
160
161/****************************************************************************
162 *                                                         *
163 * SCR      0018[..001F]   MOB COLLISION REGISTER         RW            *
164 *                                                         *
165 * (MSB)                                        (LSB)         *
166 * +-+-+-+-+-+-+----+----+----+----+----+----+----+----+----+----+         *
167 * | | | | | | |BRDR|BKGD|SPR7|SPR6|SPR5|SPR4|SPR3|SPR2|SPR1|SPR0|         *
168 * +-+-+-+-+-+-+----+----+----+----+----+----+----+----+----+----+         *
169 *                                                         *
170 * SPRn         1=collision with sprite #n                           *
171 * BKGD         1=collsion with set background bit                     *
172 * BRDR         1=collision with screen border                        *
173 *                                                         *
174 ****************************************************************************
175 *                                                         *
176 *   NOTES                                                   *
177 *                                                         *
178 *   1. All collisions are latched.  Successive reads read from the latch.   *
179 *      A write will reset the latch.                              *
180 *   2. Sprites with VIS=0 register collisions.                        *
181 *   3. Sprites with X=0 do not register collisions.                     *
182 *   4. Two overlapping sprites with different priorities, one completely   *
183 *      hidden behind the background, still register a collision.         *
184 *                                                         *
185 ****************************************************************************/
186#define STIC_MCR               0x0018
187
188#define STIC_MCR_BRDR            0x0200
189#define STIC_MCR_BKGD            0x0100
190#define STIC_MCR_SPR7            0x0080
191#define STIC_MCR_SPR6            0x0040
192#define STIC_MCR_SPR5            0x0020
193#define STIC_MCR_SPR4            0x0010
194#define STIC_MCR_SPR3            0x0008
195#define STIC_MCR_SPR2            0x0004
196#define STIC_MCR_SPR1            0x0002
197#define STIC_MCR_SPR0            0x0001
198
199/****************************************************************************
200 *                                                         *
201 * DER      0021         DISPLAY ENABLE REGISTER         W            *
202 *                                                         *
203 * (MSB)                  (LSB)                              *
204 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
205 * | | | | | | | | | | | | | | | | |                              *
206 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
207 *                                                         *
208 ****************************************************************************
209 *                                                         *
210 *   NOTES                                                   *
211 *                                                         *
212 *   1. Any write during VBLANK enables STIC output.                     *
213 *                                                         *
214 ****************************************************************************/
215#define STIC_DER               0x0020
216
217/****************************************************************************
218 *                                                         *
219 * GMR      0021         GRAPHICS MODE REGISTER         RW            *
220 *                                                         *
221 * (MSB)                  (LSB)                              *
222 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
223 * | | | | | | | | | | | | | | | | |                              *
224 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
225 *                                                         *
226 ****************************************************************************
227 *                                                         *
228 *   NOTES                                                   *
229 *                                                         *
230 *   1. Any write during VBLANK enables FOREGROUND/BACKGROUND mode.         *
231 *   2. Any read during VBLANK enables COLOR STACK/COLORED SQUARES mode.      *
232 *                                                         *
233 ****************************************************************************/
234#define STIC_GMR               0x0021
235
236/****************************************************************************
237 *                                                         *
238 * CSR      0028         COLOR STACK REGISTER         RW            *
239 *                                                         *
240 * (MSB)                        (LSB)                        *
241 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
242 * | | | | | | | | | | | | |BG3|BG2|BG1|BG0|                        *
243 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
244 *                                                         *
245 * BGn      background color            [0..15]                     *
246 *                                                         *
247 ****************************************************************************/
248#define STIC_CSR               0x0028
249
250#define STIC_CSR_BG               0x000F
251
252/****************************************************************************
253 *                                                         *
254 * BCR      002C         BORDER COLOR REGISTER         RW            *
255 *                                                         *
256 * (MSB)                        (LSB)                        *
257 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
258 * | | | | | | | | | | | | |BC3|BC2|BC1|BC0|                        *
259 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
260 *                                                         *
261 * BCn      border color               [0..15]                     *
262 *                                                         *
263 ****************************************************************************
264 *                                                         *
265 *   NOTES                                                   *
266 *                                                         *
267 *   1. Affects overscan, and column and row blockouts.                  *
268 *                                                         *
269 ****************************************************************************/
270#define STIC_BCR               0x002C
271
272#define STIC_BCR_BC               0x000F
273
274/****************************************************************************
275 *                                                         *
276 * HDR      0030         HORIZONTAL DELAY REGISTER      RW            *
277 *                                                         *
278 * (MSB)                        (LSB)                        *
279 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
280 * | | | | | | | | | | | | | |DEL2|DEL1|DEL0|                        *
281 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
282 *                                                         *
283 * DELn      horizontal delay            [0..7]                     *
284 *                                                         *
285 ****************************************************************************
286 *                                                         *
287 *   NOTES                                                   *
288 *                                                         *
289 *   1. Affects both BACKTAB and MOBs.                              *
290 *                                                         *
291 ****************************************************************************/
292#define STIC_HDR               0x0030
293
294#define STIC_HDR_DEL            0x0007
295
296/****************************************************************************
297 *                                                         *
298 * STIC_VDR      0030         VERTICAL DELAY REGISTER         RW         *
299 *                                                         *
300 * (MSB)                        (LSB)                        *
301 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
302 * | | | | | | | | | | | | | |DEL2|DEL1|DEL0|                        *
303 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
304 *                                                         *
305 * DELn      vertical delay               [0..7]                     *
306 *                                                         *
307 ****************************************************************************
308 *                                                         *
309 *   NOTES                                                   *
310 *                                                         *
311 *   1. Affects both BACKTAB and MOBs.                              *
312 *                                                         *
313 ****************************************************************************/
314#define STIC_VDR               0x0031
315
316#define STIC_VDR_DEL            0x0007
317
318/****************************************************************************
319 *                                                         *
320 * STIC_CBR      0032         CARD BLOCKOUT REGISTER         RW         *
321 *                                                         *
322 * (MSB)                     (LSB)                           *
323 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+---+                           *
324 * | | | | | | | | | | | | | | |ROW|COL|                           *
325 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+---+                           *
326 *                                                         *
327 * COL      blockout first card column      [1=blockout]               *
328 * ROW      blockout first card row         [1=blockout]               *
329 *                                                         *
330 ****************************************************************************
331 *                                                         *
332 *   NOTES                                                   *
333 *                                                         *
334 *   1. Generally used in conjunction with HDR and VDR registers, to achieve   *
335 *      smooth scrolling.                                       *
336 *                                                         *
337 ****************************************************************************/
338#define STIC_CBR               0x0032
339
340#define STIC_CBR_ROW            0x0002
341#define STIC_CBR_COL            0x0001
342
343/*** BACKTAB ****************************************************************/
344
345// BACKTAB is made up of 20x12 cards
346// (the first 19 columns are 8x8, the 20th column is 7x8)
347#define STIC_BACKTAB_WIDTH         20
348#define STIC_BACKTAB_HEIGHT         12
349
350/****************************************************************************
351 *                                                         *
352 * FOREGROUND/BACKGROUND MODE                                    *
353 *                                                         *
354 * (MSB)                                  (LSB)               *
355 * +-+-+---+---+---+---+---+--+--+--+--+--+--+---+---+---+               *
356 * | | |BG2|BG3|SEL|BG1|BG0|C5|C4|C3|C2|C1|C0|FG2|FG1|FG0|               *
357 * +-+-+---+---+---+---+---+--+--+--+--+--+--+---+---+---+               *
358 *                                                         *
359 * FGn      foreground color            [0..7]                     *
360 * Cn      card #                     [0..63]                     *
361 * SEL      card memory   select            [0=GROM, 1=GRAM]            *
362 * BGn      background color            [0..15]                     *
363 *                                                         *
364 ****************************************************************************/
365#define STIC_FBM_BG2            0x2000
366#define STIC_FBM_BG310            0x1600
367#define STIC_FBM_SEL            0x0800
368#define STIC_FBM_C               0x01F8
369#define STIC_FBM_FG               0x0007
370
371/****************************************************************************
372 *                                                         *
373 * COLOR STACK MODE                                             *
374 *                                                         *
375 * (MSB)                                 (LSB)               *
376 * +-+-+---+---+---+--+--+--+--+--+--+--+--+---+---+---+               *
377 * | | |ADV|FG3|SEL|C7|C6|C5|C4|C3|C2|C1|C0|FG2|FG1|FG0|               *
378 * +-+-+---+---+---+--+--+--+--+--+--+--+--+---+---+---+               *
379 *                                                         *
380 * FGn      foreground color            [0..15]                     *
381 * Cn      card #                     [GROM=0..212, GRAM=0..63]      *
382 * SEL      card memory   select            [0=GROM, 1=GRAM]            *
383 * ADV      advance color stack index      [1=advance]                  *
384 *                                                         *
385 ****************************************************************************
386 *                                                         *
387 * NOTES:                                                   *
388 *                                                         *
389 * 1. When FG3=1 and SEL=0, COLORED SQUARES MODE is enabled.            *
390 * 2. When SEL=1, C7 and C6 can be used as user-defined flags.            *
391 *                                                         *
392 ****************************************************************************/
393#define STIC_CSTM_ADV            0x2000
394#define STIC_CSTM_FG3            0x1000
395#define STIC_CSTM_SEL            0x0800
396#define STIC_CSTM_C7            0x0400
397#define STIC_CSTM_C6            0x0200
398#define STIC_CSTM_C50            0x01F8
399#define STIC_CSTM_FG20            0x0007
400
401#define STIC_CSTM_C               (STIC_CSTM_C7|STIC_CSTM_C6|STIC_CSTM_C50)
402
403/****************************************************************************
404 *                                                         *
405 * COLORED SQUARES MODE                                          *
406 *                                                         *
407 * (MSB)                           (LSB)                     *
408 * +-+-+--+-+-+--+--+--+--+--+--+--+--+--+--+--+                     *
409 * | | |D2|1|0|D1|D0|C2|C1|C0|B2|B1|B0|A2|A1|A0|                     *
410 * +-+-+--+-+-+--+--+--+--+--+--+--+--+--+--+--+                     *
411 *                                                         *
412 * An      color a                     [0..7]                     *
413 * Bn      color b                     [0..7]                     *
414 * Cn      color c                     [0..7]                     *
415 * Dn      color d                     [0..7]                     *
416 *                                                         *
417 ****************************************************************************
418 *                                                         *
419 * NOTES:                                                   *
420 *                                                         *
421 * 1. Each color corresponds to one of the following 4 x 4 squares:         *
422 *                                                         *
423 *      +---+---+                                             *
424 *      | a | b |                                             *
425 *      +---+---+                                             *
426 *      | c | d |                                             *
427 *      +---+---+                                             *
428 *                                                         *
429 * 2. When color 7 is specified, the color is taken from the color stack.   *
430 *                                                         *
431 ****************************************************************************/
432#define STIC_CSQM_D2            0x2000
433#define STIC_CSQM_D10            0x0600
434#define STIC_CSQM_C               0x01C0
435#define STIC_CSQM_B               0x0038
436#define STIC_CSQM_A               0x0007
437
438#define STIC_CSQM_WIDTH            (STIC_CARD_WIDTH / 2)
439#define STIC_CSQM_HEIGHT         (STIC_CARD_HEIGHT / 2)
440
441#endif /* STIC_H_ */
442
src/mess/video/stic.c
r12082r12083
11#include "emu.h"
2#include "includes/stic.h"
2#include "video/stic.h"
33#include "includes/intv.h"
44
55/* STIC variables */
src/mess/video/stic.h
r0r12083
1/*****************************************************************************
2 *
3 * includes/stic.h
4 *
5 ****************************************************************************/
6
7#ifndef STIC_H_
8#define STIC_H_
9
10// GROM/GRAM cards are 8x8
11#define STIC_CARD_WIDTH            8
12#define STIC_CARD_HEIGHT         8
13
14// Intellivision resolution is 20x12 BACKTAB CARDs, minus the rightmost column,
15// for an effective resolution of (19 * 8 + 1 * 7) x (12 * 8) == 159x96.
16//
17// MOB scanline height can be half of a card scanline height, so y-coordinates
18// are scaled by 2.
19#define STIC_X_SCALE            1
20#define STIC_Y_SCALE            2
21
22// the Intellivision emulation scales to match the output format at the last
23// step. The Intellivision keyboard component appears to be 320x96, but can
24// also run Intellivision carts, so x-coordinates are conditionally scaled
25// by 2.
26#define INTV_X_SCALE            1
27#define INTV_Y_SCALE            1
28#define INTVKBD_X_SCALE            2
29#define INTVKBD_Y_SCALE            INTV_Y_SCALE
30
31// overscan sizes in intv pixels
32// these values are approximate.
33#define STIC_OVERSCAN_LEFT_WIDTH   13
34#define STIC_OVERSCAN_RIGHT_WIDTH   17
35#define STIC_OVERSCAN_TOP_HEIGHT   12
36#define STIC_OVERSCAN_BOTTOM_HEIGHT   12
37
38/*** STIC registers *********************************************************/
39
40// number of STIC registers
41#define STIC_REGISTERS            0x33
42
43// STIC MOBs (Moveable OBjects)
44enum
45{
46   STIC_MOB0,
47   STIC_MOB1,
48   STIC_MOB2,
49   STIC_MOB3,
50   STIC_MOB4,
51   STIC_MOB5,
52   STIC_MOB6,
53   STIC_MOB7,
54
55   STIC_MOBS
56};
57
58// STIC Color Stack
59enum
60{
61   STIC_CSR0,
62   STIC_CSR1,
63   STIC_CSR2,
64   STIC_CSR3,
65
66   STIC_CSRS
67};
68
69/****************************************************************************
70 *                                                         *
71 * MXR      0000[..0007]   MOB X REGISTER               RW            *
72 *                                                         *
73 * (MSB)                              (LSB)                  *
74 * +-+-+-+-+-+-----+---+---+--+--+--+--+--+--+--+--+                  *
75 * | | | | | |XSIZE|VIS|COL|X7|X6|X5|X4|X3|X2|X1|X0|                  *
76 * +-+-+-+-+-+-----+---+---+--+--+--+--+--+--+--+--+                  *
77 *                                                         *
78 * Xn      x-position                  [0..255]                  *
79 * COL      collision detection            [1=enable]                  *
80 * VIS      visibility                  [1=visible]                  *
81 * XSIZE   double width               [1=double]                  *
82 *                                                         *
83 ****************************************************************************
84 *                                                         *
85 *   NOTES                                                   *
86 *                                                         *
87 *   1. If X=0, the sprite is not visible and does not register collisions.   *
88 *   2. The horizontal handle is 8 pixels from the left of the sprite,      *
89 *      regardless of width.                                       *
90 *                                                         *
91 ****************************************************************************/
92#define STIC_MXR               0x0000
93
94#define STIC_MXR_XSIZE            0x0400
95#define STIC_MXR_VIS            0x0200
96#define STIC_MXR_COL            0x0100
97#define STIC_MXR_X               0x00FF
98
99/****************************************************************************
100 *                                                         *
101 * MYR      0008[..000F]   MOB Y REGISTER               RW            *
102 *                                                         *
103 * (MSB)                                     (LSB)            *
104 * +-+-+-+-+-----+-----+-----+-----+----+--+--+--+--+--+--+--+            *
105 * | | | | |YFLIP|XFLIP|YSIZE|YFULL|YRES|Y6|Y5|Y4|Y3|Y2|Y1|Y0|            *
106 * +-+-+-+-+-----+-----+-----+-----+----+--+--+--+--+--+--+--+            *
107 *                                                         *
108 * Yn      y-position                  [0..127]                  *
109 * YRES      y-resolution               [0=8 scanlines,1=16 scanlines]   *
110 * YFULL   double scanline height         [1=double]                  *
111 * YSIZE   quadruple scanline height      [1=quadruple]               *
112 * XFLIP   horizontally flip image         [1=flip]                  *
113 * YFLIP   vertically flip image         [1=flip]                  *
114 *                                                         *
115 ****************************************************************************
116 *                                                         *
117 *   NOTES                                                   *
118 *                                                         *
119 *   1. A sprite with YRES=1 will display two cards.                     *
120 *   2. A sprite with YFULL=0 and YSIZE=0 will have scanlines half the      *
121 *      height of a background card.                                 *
122 *   3, The minimum size of a sprite is 8x8 (XSIZE=YRES=YSIZE=YFULL=0).      *
123 *   4. The maximum size of a sprite is 16x128 (XSIZE=YRES=YSIZE=YFULL=1).   *
124 *   5. The Y-position is measured in double height scanlines.            *
125 *   6. The vertical handle is 8 double height scanlines from the top of the   *
126 *      sprite, regardless of height.                              *
127 *                                                         *
128 ****************************************************************************/
129#define STIC_MYR               0x0008
130
131#define STIC_MYR_YFLIP            0x0800
132#define STIC_MYR_XFLIP            0x0400
133#define STIC_MYR_YSIZE            0x0200
134#define STIC_MYR_YFULL            0x0100
135#define STIC_MYR_YRES            0x0080
136#define STIC_MYR_Y               0x007F
137
138/****************************************************************************
139 *                                                         *
140 * SAR      0010[..0017]   MOB ATTRIBUTE REGISTER         RW            *
141 *                                                         *
142 * (MSB)                               (LSB)                  *
143 * +-+-+---+---+---+-+-+--+--+--+--+--+--+---+---+---+                  *
144 * | | |PRI|FG3|SEL| | |C5|C4|C3|C2|C1|C0|FG2|FG1|FG0|                  *
145 * +-+-+---+---+---+-+-+--+--+--+--+--+--+---+---+---+                  *
146 *                                                         *
147 * FGn      foreground color            [0..15]                     *
148 * Cn      card #                     [0..63]                     *
149 * SEL      card memory   select            [0=GROM, 1=GRAM]            *
150 * PRI      sprite priority               [1=behind set background bit]   *
151 *                                                         *
152 ****************************************************************************/
153#define STIC_MAR               0x0010
154
155#define STIC_MAR_PRI            0x2000
156#define STIC_MAR_FG3            0x1000
157#define STIC_MAR_SEL            0x0800
158#define STIC_MAR_C               0x07F8
159#define STIC_MAR_FG20            0x0007
160
161/****************************************************************************
162 *                                                         *
163 * SCR      0018[..001F]   MOB COLLISION REGISTER         RW            *
164 *                                                         *
165 * (MSB)                                        (LSB)         *
166 * +-+-+-+-+-+-+----+----+----+----+----+----+----+----+----+----+         *
167 * | | | | | | |BRDR|BKGD|SPR7|SPR6|SPR5|SPR4|SPR3|SPR2|SPR1|SPR0|         *
168 * +-+-+-+-+-+-+----+----+----+----+----+----+----+----+----+----+         *
169 *                                                         *
170 * SPRn         1=collision with sprite #n                           *
171 * BKGD         1=collsion with set background bit                     *
172 * BRDR         1=collision with screen border                        *
173 *                                                         *
174 ****************************************************************************
175 *                                                         *
176 *   NOTES                                                   *
177 *                                                         *
178 *   1. All collisions are latched.  Successive reads read from the latch.   *
179 *      A write will reset the latch.                              *
180 *   2. Sprites with VIS=0 register collisions.                        *
181 *   3. Sprites with X=0 do not register collisions.                     *
182 *   4. Two overlapping sprites with different priorities, one completely   *
183 *      hidden behind the background, still register a collision.         *
184 *                                                         *
185 ****************************************************************************/
186#define STIC_MCR               0x0018
187
188#define STIC_MCR_BRDR            0x0200
189#define STIC_MCR_BKGD            0x0100
190#define STIC_MCR_SPR7            0x0080
191#define STIC_MCR_SPR6            0x0040
192#define STIC_MCR_SPR5            0x0020
193#define STIC_MCR_SPR4            0x0010
194#define STIC_MCR_SPR3            0x0008
195#define STIC_MCR_SPR2            0x0004
196#define STIC_MCR_SPR1            0x0002
197#define STIC_MCR_SPR0            0x0001
198
199/****************************************************************************
200 *                                                         *
201 * DER      0021         DISPLAY ENABLE REGISTER         W            *
202 *                                                         *
203 * (MSB)                  (LSB)                              *
204 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
205 * | | | | | | | | | | | | | | | | |                              *
206 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
207 *                                                         *
208 ****************************************************************************
209 *                                                         *
210 *   NOTES                                                   *
211 *                                                         *
212 *   1. Any write during VBLANK enables STIC output.                     *
213 *                                                         *
214 ****************************************************************************/
215#define STIC_DER               0x0020
216
217/****************************************************************************
218 *                                                         *
219 * GMR      0021         GRAPHICS MODE REGISTER         RW            *
220 *                                                         *
221 * (MSB)                  (LSB)                              *
222 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
223 * | | | | | | | | | | | | | | | | |                              *
224 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                              *
225 *                                                         *
226 ****************************************************************************
227 *                                                         *
228 *   NOTES                                                   *
229 *                                                         *
230 *   1. Any write during VBLANK enables FOREGROUND/BACKGROUND mode.         *
231 *   2. Any read during VBLANK enables COLOR STACK/COLORED SQUARES mode.      *
232 *                                                         *
233 ****************************************************************************/
234#define STIC_GMR               0x0021
235
236/****************************************************************************
237 *                                                         *
238 * CSR      0028         COLOR STACK REGISTER         RW            *
239 *                                                         *
240 * (MSB)                        (LSB)                        *
241 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
242 * | | | | | | | | | | | | |BG3|BG2|BG1|BG0|                        *
243 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
244 *                                                         *
245 * BGn      background color            [0..15]                     *
246 *                                                         *
247 ****************************************************************************/
248#define STIC_CSR               0x0028
249
250#define STIC_CSR_BG               0x000F
251
252/****************************************************************************
253 *                                                         *
254 * BCR      002C         BORDER COLOR REGISTER         RW            *
255 *                                                         *
256 * (MSB)                        (LSB)                        *
257 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
258 * | | | | | | | | | | | | |BC3|BC2|BC1|BC0|                        *
259 * +-+-+-+-+-+-+-+-+-+-+-+-+---+---+---+---+                        *
260 *                                                         *
261 * BCn      border color               [0..15]                     *
262 *                                                         *
263 ****************************************************************************
264 *                                                         *
265 *   NOTES                                                   *
266 *                                                         *
267 *   1. Affects overscan, and column and row blockouts.                  *
268 *                                                         *
269 ****************************************************************************/
270#define STIC_BCR               0x002C
271
272#define STIC_BCR_BC               0x000F
273
274/****************************************************************************
275 *                                                         *
276 * HDR      0030         HORIZONTAL DELAY REGISTER      RW            *
277 *                                                         *
278 * (MSB)                        (LSB)                        *
279 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
280 * | | | | | | | | | | | | | |DEL2|DEL1|DEL0|                        *
281 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
282 *                                                         *
283 * DELn      horizontal delay            [0..7]                     *
284 *                                                         *
285 ****************************************************************************
286 *                                                         *
287 *   NOTES                                                   *
288 *                                                         *
289 *   1. Affects both BACKTAB and MOBs.                              *
290 *                                                         *
291 ****************************************************************************/
292#define STIC_HDR               0x0030
293
294#define STIC_HDR_DEL            0x0007
295
296/****************************************************************************
297 *                                                         *
298 * STIC_VDR      0030         VERTICAL DELAY REGISTER         RW         *
299 *                                                         *
300 * (MSB)                        (LSB)                        *
301 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
302 * | | | | | | | | | | | | | |DEL2|DEL1|DEL0|                        *
303 * +-+-+-+-+-+-+-+-+-+-+-+-+-+----+----+----+                        *
304 *                                                         *
305 * DELn      vertical delay               [0..7]                     *
306 *                                                         *
307 ****************************************************************************
308 *                                                         *
309 *   NOTES                                                   *
310 *                                                         *
311 *   1. Affects both BACKTAB and MOBs.                              *
312 *                                                         *
313 ****************************************************************************/
314#define STIC_VDR               0x0031
315
316#define STIC_VDR_DEL            0x0007
317
318/****************************************************************************
319 *                                                         *
320 * STIC_CBR      0032         CARD BLOCKOUT REGISTER         RW         *
321 *                                                         *
322 * (MSB)                     (LSB)                           *
323 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+---+                           *
324 * | | | | | | | | | | | | | | |ROW|COL|                           *
325 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+---+---+                           *
326 *                                                         *
327 * COL      blockout first card column      [1=blockout]               *
328 * ROW      blockout first card row         [1=blockout]               *
329 *                                                         *
330 ****************************************************************************
331 *                                                         *
332 *   NOTES                                                   *
333 *                                                         *
334 *   1. Generally used in conjunction with HDR and VDR registers, to achieve   *
335 *      smooth scrolling.                                       *
336 *                                                         *
337 ****************************************************************************/
338#define STIC_CBR               0x0032
339
340#define STIC_CBR_ROW            0x0002
341#define STIC_CBR_COL            0x0001
342
343/*** BACKTAB ****************************************************************/
344
345// BACKTAB is made up of 20x12 cards
346// (the first 19 columns are 8x8, the 20th column is 7x8)
347#define STIC_BACKTAB_WIDTH         20
348#define STIC_BACKTAB_HEIGHT         12
349
350/****************************************************************************
351 *                                                         *
352 * FOREGROUND/BACKGROUND MODE                                    *
353 *                                                         *
354 * (MSB)                                  (LSB)               *
355 * +-+-+---+---+---+---+---+--+--+--+--+--+--+---+---+---+               *
356 * | | |BG2|BG3|SEL|BG1|BG0|C5|C4|C3|C2|C1|C0|FG2|FG1|FG0|               *
357 * +-+-+---+---+---+---+---+--+--+--+--+--+--+---+---+---+               *
358 *                                                         *
359 * FGn      foreground color            [0..7]                     *
360 * Cn      card #                     [0..63]                     *
361 * SEL      card memory   select            [0=GROM, 1=GRAM]            *
362 * BGn      background color            [0..15]                     *
363 *                                                         *
364 ****************************************************************************/
365#define STIC_FBM_BG2            0x2000
366#define STIC_FBM_BG310            0x1600
367#define STIC_FBM_SEL            0x0800
368#define STIC_FBM_C               0x01F8
369#define STIC_FBM_FG               0x0007
370
371/****************************************************************************
372 *                                                         *
373 * COLOR STACK MODE                                             *
374 *                                                         *
375 * (MSB)                                 (LSB)               *
376 * +-+-+---+---+---+--+--+--+--+--+--+--+--+---+---+---+               *
377 * | | |ADV|FG3|SEL|C7|C6|C5|C4|C3|C2|C1|C0|FG2|FG1|FG0|               *
378 * +-+-+---+---+---+--+--+--+--+--+--+--+--+---+---+---+               *
379 *                                                         *
380 * FGn      foreground color            [0..15]                     *
381 * Cn      card #                     [GROM=0..212, GRAM=0..63]      *
382 * SEL      card memory   select            [0=GROM, 1=GRAM]            *
383 * ADV      advance color stack index      [1=advance]                  *
384 *                                                         *
385 ****************************************************************************
386 *                                                         *
387 * NOTES:                                                   *
388 *                                                         *
389 * 1. When FG3=1 and SEL=0, COLORED SQUARES MODE is enabled.            *
390 * 2. When SEL=1, C7 and C6 can be used as user-defined flags.            *
391 *                                                         *
392 ****************************************************************************/
393#define STIC_CSTM_ADV            0x2000
394#define STIC_CSTM_FG3            0x1000
395#define STIC_CSTM_SEL            0x0800
396#define STIC_CSTM_C7            0x0400
397#define STIC_CSTM_C6            0x0200
398#define STIC_CSTM_C50            0x01F8
399#define STIC_CSTM_FG20            0x0007
400
401#define STIC_CSTM_C               (STIC_CSTM_C7|STIC_CSTM_C6|STIC_CSTM_C50)
402
403/****************************************************************************
404 *                                                         *
405 * COLORED SQUARES MODE                                          *
406 *                                                         *
407 * (MSB)                           (LSB)                     *
408 * +-+-+--+-+-+--+--+--+--+--+--+--+--+--+--+--+                     *
409 * | | |D2|1|0|D1|D0|C2|C1|C0|B2|B1|B0|A2|A1|A0|                     *
410 * +-+-+--+-+-+--+--+--+--+--+--+--+--+--+--+--+                     *
411 *                                                         *
412 * An      color a                     [0..7]                     *
413 * Bn      color b                     [0..7]                     *
414 * Cn      color c                     [0..7]                     *
415 * Dn      color d                     [0..7]                     *
416 *                                                         *
417 ****************************************************************************
418 *                                                         *
419 * NOTES:                                                   *
420 *                                                         *
421 * 1. Each color corresponds to one of the following 4 x 4 squares:         *
422 *                                                         *
423 *      +---+---+                                             *
424 *      | a | b |                                             *
425 *      +---+---+                                             *
426 *      | c | d |                                             *
427 *      +---+---+                                             *
428 *                                                         *
429 * 2. When color 7 is specified, the color is taken from the color stack.   *
430 *                                                         *
431 ****************************************************************************/
432#define STIC_CSQM_D2            0x2000
433#define STIC_CSQM_D10            0x0600
434#define STIC_CSQM_C               0x01C0
435#define STIC_CSQM_B               0x0038
436#define STIC_CSQM_A               0x0007
437
438#define STIC_CSQM_WIDTH            (STIC_CARD_WIDTH / 2)
439#define STIC_CSQM_HEIGHT         (STIC_CARD_HEIGHT / 2)
440
441#endif /* STIC_H_ */
442
src/mess/video/intv.c
r12082r12083
11#include "emu.h"
2#include "includes/stic.h"
2#include "video/stic.h"
33#include "includes/intv.h"
44
55#define FOREGROUND_BIT 0x0010
src/mess/drivers/intv.c
r12082r12083
3434#include "emu.h"
3535#include "cpu/m6502/m6502.h"
3636#include "cpu/cp1610/cp1610.h"
37#include "includes/stic.h"
37#include "video/stic.h"
3838#include "includes/intv.h"
3939#include "imagedev/cartslot.h"
4040#include "sound/ay8910.h"

Previous 15994 Revisions Next


© 1998-2018 The MESS Team