Previous 199869 Revisions Next

r31992 Monday 8th September, 2014 at 12:20:30 UTC by Fabio Priuli
let's give antic its own include. nw.
[src/mame/includes]atari.h
[src/mame/video]antic.c antic.h* atari.c

trunk/src/mame/includes/atari.h
r31991r31992
1414
1515#include "machine/6821pia.h"
1616#include "sound/pokey.h"
17#include "video/antic.h"
1718#include "video/gtia.h"
1819
1920
r31991r31992
8485#define FRAME_RATE_50HZ (double)1789790/114/TOTAL_LINES_50HZ
8586#define FRAME_RATE_60HZ (double)1789790/114/TOTAL_LINES_60HZ
8687
87#define HWIDTH          48      /* total characters per line */
88#define HCHARS          44      /* visible characters per line */
89#define VHEIGHT         32
90#define VCHARS          (VDATA_END-VDATA_START+7)/8
91#define BUF_OFFS0       (HWIDTH-HCHARS)/2
92#define MIN_X           ((HWIDTH-42)/2)*8
93#define MAX_X           MIN_X+42*8-1
94#define MIN_Y           VDATA_START
95#define MAX_Y           VDATA_END-8-1
9688
97#define PMOFFSET        32      /* # of pixels to adjust p/m hpos */
98
99#define VPAGE           0xf000  /* 4K page mask for video data src */
100#define VOFFS           0x0fff  /* 4K offset mask for video data src */
101#define DPAGE           0xfc00  /* 1K page mask for display list */
102#define DOFFS           0x03ff  /* 1K offset mask for display list */
103
104#define DLI_NMI         0x80    /* 10000000b bit mask for display list interrupt */
105#define VBL_NMI         0x40    /* 01000000b bit mask for vertical blank interrupt */
106
107#define ANTIC_DLI       0x80    /* 10000000b cmds with display list intr    */
108#define ANTIC_LMS       0x40    /* 01000000b cmds with load memory scan     */
109#define ANTIC_VSCR      0x20    /* 00100000b cmds with vertical scroll      */
110#define ANTIC_HSCR      0x10    /* 00010000b cmds with horizontal scroll    */
111#define ANTIC_MODE      0x0f    /* 00001111b cmd mode mask                  */
112
113#define DMA_ANTIC       0x20    /* 00100000b ANTIC DMA enable               */
114#define DMA_PM_DBLLINE  0x10    /* 00010000b double line player/missile     */
115#define DMA_PLAYER      0x08    /* 00001000b player DMA enable              */
116#define DMA_MISSILE     0x04    /* 00000100b missile DMA enable             */
117
118#define OFS_MIS_SINGLE  3*256   /* offset missiles single line DMA          */
119#define OFS_PL0_SINGLE  4*256   /* offset player 0 single line DMA          */
120#define OFS_PL1_SINGLE  5*256   /* offset player 1 single line DMA          */
121#define OFS_PL2_SINGLE  6*256   /* offset player 2 single line DMA          */
122#define OFS_PL3_SINGLE  7*256   /* offset player 3 single line DMA          */
123
124#define OFS_MIS_DOUBLE  3*128   /* offset missiles double line DMA          */
125#define OFS_PL0_DOUBLE  4*128   /* offset player 0 double line DMA          */
126#define OFS_PL1_DOUBLE  5*128   /* offset player 1 double line DMA          */
127#define OFS_PL2_DOUBLE  6*128   /* offset player 2 double line DMA          */
128#define OFS_PL3_DOUBLE  7*128   /* offset player 3 double line DMA          */
129
130#define PFD     0x00    /* 00000000b playfield default color */
131
132#define PBK     0x00    /* 00000000b playfield background */
133#define PF0     0x01    /* 00000001b playfield color #0   */
134#define PF1     0x02    /* 00000010b playfield color #1   */
135#define PF2     0x04    /* 00000100b playfield color #2   */
136#define PF3     0x08    /* 00001000b playfield color #3   */
137#define PL0     0x11    /* 00010001b player #0            */
138#define PL1     0x12    /* 00010010b player #1            */
139#define PL2     0x14    /* 00010100b player #2            */
140#define PL3     0x18    /* 00011000b player #3            */
141#define MI0     0x21    /* 00100001b missile #0           */
142#define MI1     0x22    /* 00100010b missile #1           */
143#define MI2     0x24    /* 00100100b missile #2           */
144#define MI3     0x28    /* 00101000b missile #3           */
145#define T00     0x40    /* 01000000b text mode pixels 00  */
146#define P000    0x48    /* 01001000b player #0 pixels 00  */
147#define P100    0x4a    /* 01001010b player #1 pixels 00  */
148#define P200    0x4c    /* 01001100b player #2 pixels 00  */
149#define P300    0x4e    /* 01001110b player #3 pixels 00  */
150#define P400    0x4f    /* 01001111b missiles  pixels 00  */
151#define T01     0x50    /* 01010000b text mode pixels 01  */
152#define P001    0x58    /* 01011000b player #0 pixels 01  */
153#define P101    0x5a    /* 01011010b player #1 pixels 01  */
154#define P201    0x5c    /* 01011100b player #2 pixels 01  */
155#define P301    0x5e    /* 01011110b player #3 pixels 01  */
156#define P401    0x5f    /* 01011111b missiles  pixels 01  */
157#define T10     0x60    /* 01100000b text mode pixels 10  */
158#define P010    0x68    /* 01101000b player #0 pixels 10  */
159#define P110    0x6a    /* 01101010b player #1 pixels 10  */
160#define P210    0x6c    /* 01101100b player #2 pixels 10  */
161#define P310    0x6e    /* 01101110b player #3 pixels 10  */
162#define P410    0x6f    /* 01101111b missiles  pixels 10  */
163#define T11     0x70    /* 01110000b text mode pixels 11  */
164#define P011    0x78    /* 01111000b player #0 pixels 11  */
165#define P111    0x7a    /* 01111010b player #1 pixels 11  */
166#define P211    0x7c    /* 01111100b player #2 pixels 11  */
167#define P311    0x7e    /* 01111110b player #3 pixels 11  */
168#define P411    0x7f    /* 01111111b missiles  pixels 11  */
169#define G00     0x80    /* 10000000b hires gfx pixels 00  */
170#define G01     0x90    /* 10010000b hires gfx pixels 01  */
171#define G10     0xa0    /* 10100000b hires gfx pixels 10  */
172#define G11     0xb0    /* 10110000b hires gfx pixels 11  */
173#define GT1     0xc0    /* 11000000b gtia mode 1          */
174#define GT2     0xd0    /* 11010000b gtia mode 2          */
175#define GT3     0xe0    /* 11100000b gtia mode 3          */
176#define ILL     0xfe    /* 11111110b illegal priority     */
177#define EOR     0xff    /* 11111111b EOR mode color       */
178
179#define LUM     0x0f    /* 00001111b luminance bits       */
180#define HUE     0xf0    /* 11110000b hue bits             */
181
182#define TRIGGER_VBLANK  64715
183#define TRIGGER_STEAL   64716
184#define TRIGGER_HSYNC   64717
185
186#define GTIA_MISSILE    0x01
187#define GTIA_PLAYER     0x02
188#define GTIA_TRIGGER    0x04
189
190/*****************************************************************************
191 * If your memcpy does not expand too well if you use it with constant
192 * size_t field, you might want to define these macros somehow different.
193 * NOTE: dst is not necessarily UINT32 aligned (because of horz scrolling)!
194 *****************************************************************************/
195#define COPY4(dst,s1) *dst++ = s1
196#define COPY8(dst,s1,s2) *dst++ = s1; *dst++ = s2
197#define COPY16(dst,s1,s2,s3,s4) *dst++ = s1; *dst++ = s2; *dst++ = s3; *dst++ = s4
198
199struct ANTIC_R {
200   UINT8   antic00;    /* 00 nothing */
201   UINT8   antic01;    /* 01 nothing */
202   UINT8   antic02;    /* 02 nothing */
203   UINT8   antic03;    /* 03 nothing */
204   UINT8   antic04;    /* 04 nothing */
205   UINT8   antic05;    /* 05 nothing */
206   UINT8   antic06;    /* 06 nothing */
207   UINT8   antic07;    /* 07 nothing */
208   UINT8   antic08;    /* 08 nothing */
209   UINT8   antic09;    /* 09 nothing */
210   UINT8   antic0a;    /* 0a nothing */
211   UINT8   vcount;     /* 0b vertical (scanline) counter */
212   UINT8   penh;       /* 0c light pen horizontal pos */
213   UINT8   penv;       /* 0d light pen vertical pos */
214   UINT8   antic0e;    /* 0e nothing */
215   UINT8   nmist;      /* 0f NMI status */
216};  /* read registers */
217
218struct ANTIC_W {
219   UINT8   dmactl;     /* 00 write DMA control */
220   UINT8   chactl;     /* 01 write character control */
221   UINT8   dlistl;     /* 02 display list low */
222   UINT8   dlisth;     /* 03 display list high */
223   UINT8   hscrol;     /* 04 horz scroll */
224   UINT8   vscrol;     /* 05 vert scroll */
225   UINT8   pmbasl;     /* 06 player/missile base addr low */
226   UINT8   pmbash;     /* 07 player/missile base addr high */
227   UINT8   chbasl;     /* 08 character generator base addr low */
228   UINT8   chbash;     /* 09 character generator base addr high */
229   UINT8   wsync;      /* 0a wait for hsync */
230   UINT8   antic0b;    /* 0b nothing */
231   UINT8   antic0c;    /* 0c nothing */
232   UINT8   antic0d;    /* 0d nothing */
233   UINT8   nmien;      /* 0e NMI enable */
234   UINT8   nmires;     /* 0f NMI reset */
235};  /* write registers */
236
237/* per scanline buffer for video data (and optimization variables) */
238struct VIDEO {
239   UINT32  cmd;                /* antic command for this scanline */
240   UINT16  data[HWIDTH];       /* graphics data buffer (text through chargen) */
241};
242
243typedef void (*atari_renderer_func)(address_space &space, VIDEO *video);
244
245struct ANTIC {
246   atari_renderer_func renderer;   /* current renderer */
247   UINT32  cmd;                /* currently executed display list command */
248   UINT32  steal_cycles;       /* steal how many cpu cycles for this line ? */
249   UINT32  vscrol_old;         /* old vscrol value */
250   UINT32  hscrol_old;         /* old hscrol value */
251   INT32   modelines;          /* number of lines for current ANTIC mode */
252   UINT32  chbase;             /* character mode source base */
253   UINT32  chand;              /* character and mask (chactl) */
254   UINT32  chxor;              /* character xor mask (chactl) */
255   UINT32  scanline;           /* current scan line */
256   UINT32  pfwidth;            /* playfield width */
257   UINT32  dpage;              /* display list address page */
258   UINT32  doffs;              /* display list offset into page */
259   UINT32  vpage;              /* video data source page */
260   UINT32  voffs;              /* video data offset into page */
261   UINT32  pmbase_s;           /* p/m graphics single line source base */
262   UINT32  pmbase_d;           /* p/m graphics double line source base */
263   ANTIC_R r;                  /* ANTIC read registers */
264   ANTIC_W w;                  /* ANTIC write registers */
265   UINT8   cclock[256+32];     /* color clock buffer filled by ANTIC */
266   UINT8   pmbits[256+32];     /* player missile buffer filled by GTIA */
267   UINT8   *prio_table[64];    /* player/missile priority tables */
268   VIDEO   *video[312];        /* video buffer */
269   UINT32  *cclk_expand;       /* shared buffer for the following: */
270   UINT32  *pf_21;             /* 1cclk 2 color txt 2,3 */
271   UINT32  *pf_x10b;           /* 1cclk 4 color txt 4,5, gfx D,E */
272   UINT32  *pf_3210b2;         /* 1cclk 5 color txt 6,7, gfx 9,B,C */
273   UINT32  *pf_210b4;          /* 4cclk 4 color gfx 8 */
274   UINT32  *pf_210b2;          /* 2cclk 4 color gfx A */
275   UINT32  *pf_1b;             /* 1cclk hires gfx F */
276   UINT32  *pf_gtia1;          /* 1cclk gtia mode 1 */
277   UINT32  *pf_gtia2;          /* 1cclk gtia mode 2 */
278   UINT32  *pf_gtia3;          /* 1cclk gtia mode 3 */
279   UINT8   *used_colors;       /* shared buffer for the following: */
280   UINT8   *uc_21;             /* used colors for txt (2,3) */
281   UINT8   *uc_x10b;           /* used colors for txt 4,5, gfx D,E */
282   UINT8   *uc_3210b2;         /* used colors for txt 6,7, gfx 9,B,C */
283   UINT8   *uc_210b4;          /* used colors for gfx 8 */
284   UINT8   *uc_210b2;          /* used colors for gfx A */
285   UINT8   *uc_1b;             /* used colors for gfx F */
286   UINT8   *uc_g1;             /* used colors for gfx GTIA 1 */
287   UINT8   *uc_g2;             /* used colors for gfx GTIA 2 */
288   UINT8   *uc_g3;             /* used colors for gfx GTIA 3 */
289   bitmap_ind16 *bitmap;
290};
291
292#define RDANTIC(space)      space.read_byte(antic.dpage+antic.doffs)
293#define RDVIDEO(space,o)    space.read_byte(antic.vpage+((antic.voffs+(o))&VOFFS))
294#define RDCHGEN(space,o)    space.read_byte(antic.chbase+(o))
295#define RDPMGFXS(space,o)   space.read_byte(antic.pmbase_s+(o)+(antic.scanline>>1))
296#define RDPMGFXD(space,o)   space.read_byte(antic.pmbase_d+(o)+antic.scanline)
297
298#define PREPARE()                                               \
299   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]
300
301#define PREPARE_TXT2(space,width)                               \
302   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
303   int i;                                                      \
304   for( i = 0; i < width; i++ )                                \
305   {                                                           \
306      UINT16 ch = RDVIDEO(space,i) << 3;                      \
307      if( ch & 0x400 )                                        \
308      {                                                       \
309         ch = RDCHGEN(space,(ch & 0x3f8) + antic.w.chbasl);  \
310         ch = (ch ^ antic.chxor) & antic.chand;              \
311      }                                                       \
312      else                                                    \
313      {                                                       \
314         ch = RDCHGEN(space,ch + antic.w.chbasl);            \
315      }                                                       \
316      video->data[i] = ch;                                    \
317   }
318
319#define PREPARE_TXT3(space,width)                               \
320   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
321   int i;                                                      \
322   for( i = 0; i < width; i++ )                                \
323   {                                                           \
324      UINT16 ch = RDVIDEO(space,i) << 3;                      \
325      if( ch & 0x400 )                                        \
326      {                                                       \
327         ch &= 0x3f8;                                        \
328         if( (ch & 0x300) == 0x300 )                         \
329         {                                                   \
330            if (antic.w.chbasl < 2) /* first two lines empty */ \
331               ch = 0x00;                                  \
332            else /* lines 2..7 are standard, 8&9 are 0&1 */ \
333               ch = RDCHGEN(space,ch + (antic.w.chbasl & 7));\
334         }                                                   \
335         else                                                \
336         {                                                   \
337            if (antic.w.chbasl > 7) /* last two lines empty */  \
338               ch = 0x00;                                  \
339            else /* lines 0..7 are standard */              \
340               ch = RDCHGEN(space,ch + antic.w.chbasl);        \
341         }                                                   \
342         ch = (ch ^ antic.chxor) & antic.chand;              \
343      }                                                       \
344      else                                                    \
345      {                                                       \
346         if( (ch & 0x300) == 0x300 )                         \
347         {                                                   \
348            if (antic.w.chbasl < 2) /* first two lines empty */ \
349               ch = 0x00;                                  \
350            else /* lines 2..7 are standard, 8&9 are 0&1 */ \
351               ch = RDCHGEN(space,ch + (antic.w.chbasl & 7));\
352         }                                                   \
353         else                                                \
354         {                                                   \
355            if (antic.w.chbasl > 7) /* last two lines empty */  \
356               ch = 0x00;                                  \
357            else /* lines 0..7 are standard */              \
358               ch = RDCHGEN(space,ch + antic.w.chbasl);        \
359         }                                                   \
360      }                                                       \
361      video->data[i] = ch;                                    \
362   }
363
364#define PREPARE_TXT45(space,width,shift)                            \
365   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
366   int i;                                                      \
367   for( i = 0; i < width; i++ )                                \
368   {                                                           \
369      UINT16 ch = RDVIDEO(space,i) << 3;                      \
370      ch = ((ch>>2)&0x100)|RDCHGEN(space,(ch&0x3f8)+(antic.w.chbasl>>shift)); \
371      video->data[i] = ch;                                    \
372   }
373
374
375#define PREPARE_TXT67(space,width,shift)                            \
376   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
377   int i;                                                      \
378   for( i = 0; i < width; i++ )                                \
379   {                                                           \
380      UINT16 ch = RDVIDEO(space,i) << 3;                      \
381      ch = (ch&0x600)|(RDCHGEN(space,(ch&0x1f8)+(antic.w.chbasl>>shift))<<1); \
382      video->data[i] = ch;                                    \
383   }
384
385#define PREPARE_GFX8(space,width)                                 \
386   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
387   int i;                                                      \
388   for( i = 0; i < width; i++ )                                \
389      video->data[i] = RDVIDEO(space,i) << 2
390
391#define PREPARE_GFX9BC(space,width)                             \
392   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
393   int i;                                                      \
394   for( i = 0; i < width; i++ )                                \
395      video->data[i] = RDVIDEO(space,i) << 1
396
397#define PREPARE_GFXA(space,width)                               \
398   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
399   int i;                                                      \
400   for( i = 0; i < width; i++ )                                \
401      video->data[i] = RDVIDEO(space,i) << 1
402
403#define PREPARE_GFXDE(space,width)                              \
404   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
405   int i;                                                      \
406   for( i = 0; i < width; i++ )                                \
407      video->data[i] = RDVIDEO(space,i)
408
409#define PREPARE_GFXF(space,width)                               \
410   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
411   int i;                                                      \
412   for( i = 0; i < width; i++ )                                \
413      video->data[i] = RDVIDEO(space,i)
414
415#define PREPARE_GFXG1(space,width)                              \
416   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
417   int i;                                                      \
418   for( i = 0; i < width; i++ )                                \
419      video->data[i] = RDVIDEO(space,i)
420
421#define PREPARE_GFXG2(space,width)                              \
422   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
423   int i;                                                      \
424   for( i = 0; i < width; i++ )                                \
425      video->data[i] = RDVIDEO(space,i)
426
427#define PREPARE_GFXG3(space,width)                              \
428   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
429   int i;                                                      \
430   for( i = 0; i < width; i++ )                                \
431      video->data[i] = RDVIDEO(space,i)
432
433/******************************************************************
434 * common end of a single antic/gtia mode emulation function
435 ******************************************************************/
436#define POST()                                                  \
437   --antic.modelines
438
439#define POST_GFX(width)                                         \
440   antic.steal_cycles += width;                                \
441   if( --antic.modelines == 0 )                                \
442      antic.voffs = (antic.voffs + width) & VOFFS
443
444#define POST_TXT(width)                                         \
445   antic.steal_cycles += width;                                \
446   if( --antic.modelines == 0 )                                \
447      antic.voffs = (antic.voffs + width) & VOFFS;            \
448   else                                                        \
449   if( antic.w.chactl & 4 )                                    \
450      antic.w.chbasl--;                                       \
451   else                                                        \
452      antic.w.chbasl++
453
454/* erase a number of color clocks to background color PBK */
455#define ERASE4  {   \
456   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
457   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
458   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
459   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
460}
461
462#define ZAP48()                                                 \
463   dst = (UINT32 *)&antic.cclock[PMOFFSET];                    \
464   dst[ 0] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
465   dst[ 1] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
466   dst[ 2] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
467   dst[45] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
468   dst[46] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
469   dst[47] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK
470
471#define ERASE8  \
472   ERASE4;     \
473   ERASE4
474
475#define REP08(FUNC)                         \
476   ERASE8;                                 \
477   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
478   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
479   ERASE8
480
481#define REP10(FUNC)                         \
482   ERASE4;                                 \
483   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
484   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
485   FUNC( 8); FUNC( 9);                     \
486   ERASE4
487
488#define REP12(FUNC)                         \
489   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
490   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
491   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11)
492
493#define REP16(FUNC)                         \
494   ERASE8;                                 \
495   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
496   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
497   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
498   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
499   ERASE8
500
501#define REP20(FUNC)                         \
502   ERASE4;                                 \
503   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
504   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
505   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
506   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
507   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
508   ERASE4
509
510#define REP24(FUNC)                         \
511   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
512   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
513   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
514   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
515   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
516   FUNC(20); FUNC(21); FUNC(22); FUNC(23)
517
518#define REP32(FUNC)                         \
519   ERASE8;                                 \
520   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
521   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
522   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
523   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
524   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
525   FUNC(20); FUNC(21); FUNC(22); FUNC(23); \
526   FUNC(24); FUNC(25); FUNC(26); FUNC(27); \
527   FUNC(28); FUNC(29); FUNC(30); FUNC(31); \
528   ERASE8
529
530#define REP40(FUNC)                         \
531   ERASE4;                                 \
532   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
533   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
534   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
535   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
536   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
537   FUNC(20); FUNC(21); FUNC(22); FUNC(23); \
538   FUNC(24); FUNC(25); FUNC(26); FUNC(27); \
539   FUNC(28); FUNC(29); FUNC(30); FUNC(31); \
540   FUNC(32); FUNC(33); FUNC(34); FUNC(35); \
541   FUNC(36); FUNC(37); FUNC(38); FUNC(39); \
542   ERASE4
543
544#define REP48(FUNC)                         \
545   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
546   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
547   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
548   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
549   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
550   FUNC(20); FUNC(21); FUNC(22); FUNC(23); \
551   FUNC(24); FUNC(25); FUNC(26); FUNC(27); \
552   FUNC(28); FUNC(29); FUNC(30); FUNC(31); \
553   FUNC(32); FUNC(33); FUNC(34); FUNC(35); \
554   FUNC(36); FUNC(37); FUNC(38); FUNC(39); \
555   FUNC(40); FUNC(41); FUNC(42); FUNC(43); \
556   FUNC(44); FUNC(45); FUNC(46); FUNC(47);
557
558/*----------- defined in video/antic.c -----------*/
559
560extern ANTIC antic;
561
562void antic_start(running_machine &machine);
563void antic_vstart(running_machine &machine);
564void antic_reset(void);
565void antic_render(address_space &space, int param1, int param2, int param3);
566
567
56889#endif /* ATARI_H */
trunk/src/mame/video/antic.c
r31991r31992
77******************************************************************************/
88
99#include "emu.h"
10#include "antic.h"
11#include "includes/atari.h"
1012#include "cpu/m6502/m6502.h"
11#include "includes/atari.h"
1213
1314#ifdef MAME_DEBUG
1415#define VERBOSE 1
r31991r31992
2122// declaration of renderer functions
2223#define ANTIC_RENDERER(name) void name(address_space &space, VIDEO *video)
2324
24ANTIC_RENDERER( antic_mode_0_xx );
25ANTIC_RENDERER( antic_mode_2_32 );
26ANTIC_RENDERER( antic_mode_2_40 );
27ANTIC_RENDERER( antic_mode_2_48 );
28ANTIC_RENDERER( antic_mode_3_32 );
29ANTIC_RENDERER( antic_mode_3_40 );
30ANTIC_RENDERER( antic_mode_3_48 );
31ANTIC_RENDERER( antic_mode_4_32 );
32ANTIC_RENDERER( antic_mode_4_40 );
33ANTIC_RENDERER( antic_mode_4_48 );
34ANTIC_RENDERER( antic_mode_5_32 );
35ANTIC_RENDERER( antic_mode_5_40 );
36ANTIC_RENDERER( antic_mode_5_48 );
37ANTIC_RENDERER( antic_mode_6_32 );
38ANTIC_RENDERER( antic_mode_6_40 );
39ANTIC_RENDERER( antic_mode_6_48 );
40ANTIC_RENDERER( antic_mode_7_32 );
41ANTIC_RENDERER( antic_mode_7_40 );
42ANTIC_RENDERER( antic_mode_7_48 );
43ANTIC_RENDERER( antic_mode_8_32 );
44ANTIC_RENDERER( antic_mode_8_40 );
45ANTIC_RENDERER( antic_mode_8_48 );
46ANTIC_RENDERER( antic_mode_9_32 );
47ANTIC_RENDERER( antic_mode_9_40 );
48ANTIC_RENDERER( antic_mode_9_48 );
49ANTIC_RENDERER( antic_mode_a_32 );
50ANTIC_RENDERER( antic_mode_a_40 );
51ANTIC_RENDERER( antic_mode_a_48 );
52ANTIC_RENDERER( antic_mode_b_32 );
53ANTIC_RENDERER( antic_mode_b_40 );
54ANTIC_RENDERER( antic_mode_b_48 );
55ANTIC_RENDERER( antic_mode_c_32 );
56ANTIC_RENDERER( antic_mode_c_40 );
57ANTIC_RENDERER( antic_mode_c_48 );
58ANTIC_RENDERER( antic_mode_d_32 );
59ANTIC_RENDERER( antic_mode_d_40 );
60ANTIC_RENDERER( antic_mode_d_48 );
61ANTIC_RENDERER( antic_mode_e_32 );
62ANTIC_RENDERER( antic_mode_e_40 );
63ANTIC_RENDERER( antic_mode_e_48 );
64ANTIC_RENDERER( antic_mode_f_32 );
65ANTIC_RENDERER( antic_mode_f_40 );
66ANTIC_RENDERER( antic_mode_f_48 );
67ANTIC_RENDERER( gtia_mode_1_32 );
68ANTIC_RENDERER( gtia_mode_1_40 );
69ANTIC_RENDERER( gtia_mode_1_48 );
70ANTIC_RENDERER( gtia_mode_2_32 );
71ANTIC_RENDERER( gtia_mode_2_40 );
72ANTIC_RENDERER( gtia_mode_2_48 );
73ANTIC_RENDERER( gtia_mode_3_32 );
74ANTIC_RENDERER( gtia_mode_3_40 );
75ANTIC_RENDERER( gtia_mode_3_48 );
25static ANTIC_RENDERER( antic_mode_0_xx );
26static ANTIC_RENDERER( antic_mode_2_32 );
27static ANTIC_RENDERER( antic_mode_2_40 );
28static ANTIC_RENDERER( antic_mode_2_48 );
29static ANTIC_RENDERER( antic_mode_3_32 );
30static ANTIC_RENDERER( antic_mode_3_40 );
31static ANTIC_RENDERER( antic_mode_3_48 );
32static ANTIC_RENDERER( antic_mode_4_32 );
33static ANTIC_RENDERER( antic_mode_4_40 );
34static ANTIC_RENDERER( antic_mode_4_48 );
35static ANTIC_RENDERER( antic_mode_5_32 );
36static ANTIC_RENDERER( antic_mode_5_40 );
37static ANTIC_RENDERER( antic_mode_5_48 );
38static ANTIC_RENDERER( antic_mode_6_32 );
39static ANTIC_RENDERER( antic_mode_6_40 );
40static ANTIC_RENDERER( antic_mode_6_48 );
41static ANTIC_RENDERER( antic_mode_7_32 );
42static ANTIC_RENDERER( antic_mode_7_40 );
43static ANTIC_RENDERER( antic_mode_7_48 );
44static ANTIC_RENDERER( antic_mode_8_32 );
45static ANTIC_RENDERER( antic_mode_8_40 );
46static ANTIC_RENDERER( antic_mode_8_48 );
47static ANTIC_RENDERER( antic_mode_9_32 );
48static ANTIC_RENDERER( antic_mode_9_40 );
49static ANTIC_RENDERER( antic_mode_9_48 );
50static ANTIC_RENDERER( antic_mode_a_32 );
51static ANTIC_RENDERER( antic_mode_a_40 );
52static ANTIC_RENDERER( antic_mode_a_48 );
53static ANTIC_RENDERER( antic_mode_b_32 );
54static ANTIC_RENDERER( antic_mode_b_40 );
55static ANTIC_RENDERER( antic_mode_b_48 );
56static ANTIC_RENDERER( antic_mode_c_32 );
57static ANTIC_RENDERER( antic_mode_c_40 );
58static ANTIC_RENDERER( antic_mode_c_48 );
59static ANTIC_RENDERER( antic_mode_d_32 );
60static ANTIC_RENDERER( antic_mode_d_40 );
61static ANTIC_RENDERER( antic_mode_d_48 );
62static ANTIC_RENDERER( antic_mode_e_32 );
63static ANTIC_RENDERER( antic_mode_e_40 );
64static ANTIC_RENDERER( antic_mode_e_48 );
65static ANTIC_RENDERER( antic_mode_f_32 );
66static ANTIC_RENDERER( antic_mode_f_40 );
67static ANTIC_RENDERER( antic_mode_f_48 );
68static ANTIC_RENDERER( gtia_mode_1_32 );
69static ANTIC_RENDERER( gtia_mode_1_40 );
70static ANTIC_RENDERER( gtia_mode_1_48 );
71static ANTIC_RENDERER( gtia_mode_2_32 );
72static ANTIC_RENDERER( gtia_mode_2_40 );
73static ANTIC_RENDERER( gtia_mode_2_48 );
74static ANTIC_RENDERER( gtia_mode_3_32 );
75static ANTIC_RENDERER( gtia_mode_3_40 );
76static ANTIC_RENDERER( gtia_mode_3_48 );
7677
7778
7879
r31991r31992
10881089/*************  ANTIC mode 00: *********************************
10891090 * generate 1-8 empty scanlines
10901091 ***************************************************************/
1091ANTIC_RENDERER( antic_mode_0_xx )
1092static ANTIC_RENDERER( antic_mode_0_xx )
10921093{
10931094   PREPARE();
10941095   memset(dst, PBK, HWIDTH*4);
r31991r31992
11051106 ***************************************************************/
11061107#define MODE2(s) COPY4(dst, antic.pf_21[video->data[s]])
11071108
1108ANTIC_RENDERER( antic_mode_2_32 )
1109static ANTIC_RENDERER( antic_mode_2_32 )
11091110{
11101111   PREPARE_TXT2(space, 32);
11111112   REP32(MODE2);
11121113   POST_TXT(32);
11131114}
1114ANTIC_RENDERER( antic_mode_2_40 )
1115static ANTIC_RENDERER( antic_mode_2_40 )
11151116{
11161117   PREPARE_TXT2(space, 40);
11171118   REP40(MODE2);
11181119   POST_TXT(40);
11191120}
1120ANTIC_RENDERER( antic_mode_2_48 )
1121static ANTIC_RENDERER( antic_mode_2_48 )
11211122{
11221123   PREPARE_TXT2(space, 48);
11231124   REP48(MODE2);
r31991r31992
11291130 ***************************************************************/
11301131#define MODE3(s) COPY4(dst, antic.pf_21[video->data[s]])
11311132
1132ANTIC_RENDERER( antic_mode_3_32 )
1133static ANTIC_RENDERER( antic_mode_3_32 )
11331134{
11341135   PREPARE_TXT3(space, 32);
11351136   REP32(MODE3);
11361137   POST_TXT(32);
11371138}
1138ANTIC_RENDERER( antic_mode_3_40 )
1139static ANTIC_RENDERER( antic_mode_3_40 )
11391140{
11401141   PREPARE_TXT3(space, 40);
11411142   REP40(MODE3);
11421143   POST_TXT(40);
11431144}
1144ANTIC_RENDERER( antic_mode_3_48 )
1145static ANTIC_RENDERER( antic_mode_3_48 )
11451146{
11461147   PREPARE_TXT3(space, 48);
11471148   REP48(MODE3);
r31991r31992
11531154 ***************************************************************/
11541155#define MODE4(s) COPY4(dst, antic.pf_x10b[video->data[s]])
11551156
1156ANTIC_RENDERER( antic_mode_4_32 )
1157static ANTIC_RENDERER( antic_mode_4_32 )
11571158{
11581159   PREPARE_TXT45(space, 32,0);
11591160   REP32(MODE4);
11601161   POST_TXT(32);
11611162}
1162ANTIC_RENDERER( antic_mode_4_40 )
1163static ANTIC_RENDERER( antic_mode_4_40 )
11631164{
11641165   PREPARE_TXT45(space, 40,0);
11651166   REP40(MODE4);
11661167   POST_TXT(40);
11671168}
1168ANTIC_RENDERER( antic_mode_4_48 )
1169static ANTIC_RENDERER( antic_mode_4_48 )
11691170{
11701171   PREPARE_TXT45(space, 48,0);
11711172   REP48(MODE4);
r31991r31992
11771178 ***************************************************************/
11781179#define MODE5(s) COPY4(dst, antic.pf_x10b[video->data[s]])
11791180
1180ANTIC_RENDERER( antic_mode_5_32 )
1181static ANTIC_RENDERER( antic_mode_5_32 )
11811182{
11821183   PREPARE_TXT45(space, 32,1);
11831184   REP32(MODE5);
11841185   POST_TXT(32);
11851186}
1186ANTIC_RENDERER( antic_mode_5_40 )
1187static ANTIC_RENDERER( antic_mode_5_40 )
11871188{
11881189   PREPARE_TXT45(space, 40,1);
11891190   REP40(MODE5);
11901191   POST_TXT(40);
11911192}
1192ANTIC_RENDERER( antic_mode_5_48 )
1193static ANTIC_RENDERER( antic_mode_5_48 )
11931194{
11941195   PREPARE_TXT45(space, 48,1);
11951196   REP48(MODE5);
r31991r31992
12011202 ***************************************************************/
12021203#define MODE6(s) COPY8(dst, antic.pf_3210b2[video->data[s]], antic.pf_3210b2[video->data[s]+1])
12031204
1204ANTIC_RENDERER( antic_mode_6_32 )
1205static ANTIC_RENDERER( antic_mode_6_32 )
12051206{
12061207   PREPARE_TXT67(space, 16,0);
12071208   REP16(MODE6);
12081209   POST_TXT(16);
12091210}
1210ANTIC_RENDERER( antic_mode_6_40 )
1211static ANTIC_RENDERER( antic_mode_6_40 )
12111212{
12121213   PREPARE_TXT67(space, 20,0);
12131214   REP20(MODE6);
12141215   POST_TXT(20);
12151216}
1216ANTIC_RENDERER( antic_mode_6_48 )
1217static ANTIC_RENDERER( antic_mode_6_48 )
12171218{
12181219   PREPARE_TXT67(space, 24,0);
12191220   REP24(MODE6);
r31991r31992
12251226 ***************************************************************/
12261227#define MODE7(s) COPY8(dst, antic.pf_3210b2[video->data[s]], antic.pf_3210b2[video->data[s]+1])
12271228
1228ANTIC_RENDERER( antic_mode_7_32 )
1229static ANTIC_RENDERER( antic_mode_7_32 )
12291230{
12301231   PREPARE_TXT67(space, 16,1);
12311232   REP16(MODE7);
12321233   POST_TXT(16);
12331234}
1234ANTIC_RENDERER( antic_mode_7_40 )
1235static ANTIC_RENDERER( antic_mode_7_40 )
12351236{
12361237   PREPARE_TXT67(space, 20,1);
12371238   REP20(MODE7);
12381239   POST_TXT(20);
12391240}
1240ANTIC_RENDERER( antic_mode_7_48 )
1241static ANTIC_RENDERER( antic_mode_7_48 )
12411242{
12421243   PREPARE_TXT67(space, 24,1);
12431244   REP24(MODE7);
r31991r31992
12491250 ***************************************************************/
12501251#define MODE8(s) COPY16(dst, antic.pf_210b4[video->data[s]],antic.pf_210b4[video->data[s]+1],antic.pf_210b4[video->data[s]+2],antic.pf_210b4[video->data[s]+3])
12511252
1252ANTIC_RENDERER( antic_mode_8_32 )
1253static ANTIC_RENDERER( antic_mode_8_32 )
12531254{
12541255   PREPARE_GFX8(space, 8);
12551256   REP08(MODE8);
12561257   POST_GFX(8);
12571258}
1258ANTIC_RENDERER( antic_mode_8_40 )
1259static ANTIC_RENDERER( antic_mode_8_40 )
12591260{
12601261   PREPARE_GFX8(space, 10);
12611262   REP10(MODE8);
12621263   POST_GFX(10);
12631264}
1264ANTIC_RENDERER( antic_mode_8_48 )
1265static ANTIC_RENDERER( antic_mode_8_48 )
12651266{
12661267   PREPARE_GFX8(space, 12);
12671268   REP12(MODE8);
r31991r31992
12731274 ***************************************************************/
12741275#define MODE9(s) COPY8(dst, antic.pf_3210b2[video->data[s]], antic.pf_3210b2[video->data[s]+1])
12751276
1276ANTIC_RENDERER( antic_mode_9_32 )
1277static ANTIC_RENDERER( antic_mode_9_32 )
12771278{
12781279   PREPARE_GFX9BC(space, 16);
12791280   REP16(MODE9);
12801281   POST_GFX(16);
12811282}
1282ANTIC_RENDERER( antic_mode_9_40 )
1283static ANTIC_RENDERER( antic_mode_9_40 )
12831284{
12841285   PREPARE_GFX9BC(space, 20);
12851286   REP20(MODE9);
12861287   POST_GFX(20);
12871288}
1288ANTIC_RENDERER( antic_mode_9_48 )
1289static ANTIC_RENDERER( antic_mode_9_48 )
12891290{
12901291   PREPARE_GFX9BC(space, 24);
12911292   REP24(MODE9);
r31991r31992
12971298 ***************************************************************/
12981299#define MODEA(s) COPY8(dst, antic.pf_210b2[video->data[s]], antic.pf_210b2[video->data[s]+1])
12991300
1300ANTIC_RENDERER( antic_mode_a_32 )
1301static ANTIC_RENDERER( antic_mode_a_32 )
13011302{
13021303   PREPARE_GFXA(space, 16);
13031304   REP16(MODEA);
13041305   POST_GFX(16);
13051306}
1306ANTIC_RENDERER( antic_mode_a_40 )
1307static ANTIC_RENDERER( antic_mode_a_40 )
13071308{
13081309   PREPARE_GFXA(space, 20);
13091310   REP20(MODEA);
13101311   POST_GFX(20);
13111312}
1312ANTIC_RENDERER( antic_mode_a_48 )
1313static ANTIC_RENDERER( antic_mode_a_48 )
13131314{
13141315   PREPARE_GFXA(space, 24);
13151316   REP24(MODEA);
r31991r31992
13211322 ***************************************************************/
13221323#define MODEB(s) COPY8(dst, antic.pf_3210b2[video->data[s]], antic.pf_3210b2[video->data[s]+1])
13231324
1324ANTIC_RENDERER( antic_mode_b_32 )
1325static ANTIC_RENDERER( antic_mode_b_32 )
13251326{
13261327   PREPARE_GFX9BC(space, 16);
13271328   REP16(MODEB);
13281329   POST_GFX(16);
13291330}
1330ANTIC_RENDERER( antic_mode_b_40 )
1331static ANTIC_RENDERER( antic_mode_b_40 )
13311332{
13321333   PREPARE_GFX9BC(space, 20);
13331334   REP20(MODEB);
13341335   POST_GFX(20);
13351336}
1336ANTIC_RENDERER( antic_mode_b_48 )
1337static ANTIC_RENDERER( antic_mode_b_48 )
13371338{
13381339   PREPARE_GFX9BC(space, 24);
13391340   REP24(MODEB);
r31991r31992
13451346 ***************************************************************/
13461347#define MODEC(s) COPY8(dst, antic.pf_3210b2[video->data[s]], antic.pf_3210b2[video->data[s]+1])
13471348
1348ANTIC_RENDERER( antic_mode_c_32 )
1349static ANTIC_RENDERER( antic_mode_c_32 )
13491350{
13501351   PREPARE_GFX9BC(space, 16);
13511352   REP16(MODEC);
13521353   POST_GFX(16);
13531354}
1354ANTIC_RENDERER( antic_mode_c_40 )
1355static ANTIC_RENDERER( antic_mode_c_40 )
13551356{
13561357   PREPARE_GFX9BC(space, 20);
13571358   REP20(MODEC);
13581359   POST_GFX(20);
13591360}
1360ANTIC_RENDERER( antic_mode_c_48 )
1361static ANTIC_RENDERER( antic_mode_c_48 )
13611362{
13621363   PREPARE_GFX9BC(space, 24);
13631364   REP24(MODEC);
r31991r31992
13691370 ***************************************************************/
13701371#define MODED(s) COPY4(dst, antic.pf_x10b[video->data[s]])
13711372
1372ANTIC_RENDERER( antic_mode_d_32 )
1373static ANTIC_RENDERER( antic_mode_d_32 )
13731374{
13741375   PREPARE_GFXDE(space, 32);
13751376   REP32(MODED);
13761377   POST_GFX(32);
13771378}
1378ANTIC_RENDERER( antic_mode_d_40 )
1379static ANTIC_RENDERER( antic_mode_d_40 )
13791380{
13801381   PREPARE_GFXDE(space, 40);
13811382   REP40(MODED);
13821383   POST_GFX(40);
13831384}
1384ANTIC_RENDERER( antic_mode_d_48 )
1385static ANTIC_RENDERER( antic_mode_d_48 )
13851386{
13861387   PREPARE_GFXDE(space, 48);
13871388   REP48(MODED);
r31991r31992
13931394 ***************************************************************/
13941395#define MODEE(s) COPY4(dst, antic.pf_x10b[video->data[s]])
13951396
1396ANTIC_RENDERER( antic_mode_e_32 )
1397static ANTIC_RENDERER( antic_mode_e_32 )
13971398{
13981399   PREPARE_GFXDE(space, 32);
13991400   REP32(MODEE);
14001401   POST_GFX(32);
14011402}
1402ANTIC_RENDERER( antic_mode_e_40 )
1403static ANTIC_RENDERER( antic_mode_e_40 )
14031404{
14041405   PREPARE_GFXDE(space, 40);
14051406   REP40(MODEE);
14061407   POST_GFX(40);
14071408}
1408ANTIC_RENDERER( antic_mode_e_48 )
1409static ANTIC_RENDERER( antic_mode_e_48 )
14091410{
14101411   PREPARE_GFXDE(space, 48);
14111412   REP48(MODEE);
r31991r31992
14171418 ***************************************************************/
14181419#define MODEF(s) COPY4(dst, antic.pf_1b[video->data[s]])
14191420
1420ANTIC_RENDERER( antic_mode_f_32 )
1421static ANTIC_RENDERER( antic_mode_f_32 )
14211422{
14221423   PREPARE_GFXF(space, 32);
14231424   REP32(MODEF);
14241425   POST_GFX(32);
14251426}
1426ANTIC_RENDERER( antic_mode_f_40 )
1427static ANTIC_RENDERER( antic_mode_f_40 )
14271428{
14281429   PREPARE_GFXF(space, 40);
14291430   REP40(MODEF);
14301431   POST_GFX(40);
14311432}
1432ANTIC_RENDERER( antic_mode_f_48 )
1433static ANTIC_RENDERER( antic_mode_f_48 )
14331434{
14341435   PREPARE_GFXF(space, 48);
14351436   REP48(MODEF);
r31991r31992
14411442 ***************************************************************/
14421443#define GTIA1(s) COPY4(dst, antic.pf_gtia1[video->data[s]])
14431444
1444ANTIC_RENDERER( gtia_mode_1_32 )
1445static ANTIC_RENDERER( gtia_mode_1_32 )
14451446{
14461447   PREPARE_GFXG1(space, 32);
14471448   REP32(GTIA1);
14481449   POST_GFX(32);
14491450}
1450ANTIC_RENDERER( gtia_mode_1_40 )
1451static ANTIC_RENDERER( gtia_mode_1_40 )
14511452{
14521453   PREPARE_GFXG1(space, 40);
14531454   REP40(GTIA1);
14541455   POST_GFX(40);
14551456}
1456ANTIC_RENDERER( gtia_mode_1_48 )
1457static ANTIC_RENDERER( gtia_mode_1_48 )
14571458{
14581459   PREPARE_GFXG1(space, 48);
14591460   REP48(GTIA1);
r31991r31992
14651466 ***************************************************************/
14661467#define GTIA2(s) COPY4(dst, antic.pf_gtia2[video->data[s]])
14671468
1468ANTIC_RENDERER( gtia_mode_2_32 )
1469static ANTIC_RENDERER( gtia_mode_2_32 )
14691470{
14701471   PREPARE_GFXG2(space, 32);
14711472   REP32(GTIA2);
14721473   POST_GFX(32);
14731474}
1474ANTIC_RENDERER( gtia_mode_2_40 )
1475static ANTIC_RENDERER( gtia_mode_2_40 )
14751476{
14761477   PREPARE_GFXG2(space, 40);
14771478   REP40(GTIA2);
14781479   POST_GFX(40);
14791480}
1480ANTIC_RENDERER( gtia_mode_2_48 )
1481static ANTIC_RENDERER( gtia_mode_2_48 )
14811482{
14821483   PREPARE_GFXG2(space, 48);
14831484   REP48(GTIA2);
r31991r31992
14891490 ***************************************************************/
14901491#define GTIA3(s) COPY4(dst, antic.pf_gtia3[video->data[s]])
14911492
1492ANTIC_RENDERER( gtia_mode_3_32 )
1493static ANTIC_RENDERER( gtia_mode_3_32 )
14931494{
14941495   PREPARE_GFXG3(space, 32);
14951496   REP32(GTIA3);
14961497   POST_GFX(32);
14971498}
1498ANTIC_RENDERER( gtia_mode_3_40 )
1499static ANTIC_RENDERER( gtia_mode_3_40 )
14991500{
15001501   PREPARE_GFXG3(space, 40);
15011502   REP40(GTIA3);
15021503   POST_GFX(40);
15031504}
1504ANTIC_RENDERER( gtia_mode_3_48 )
1505static ANTIC_RENDERER( gtia_mode_3_48 )
15051506{
15061507   PREPARE_GFXG3(space, 48);
15071508   REP48(GTIA3);
trunk/src/mame/video/antic.h
r0r31992
1/***************************************************************************
2
3    Atari 400/800
4
5    ANTIC video controller
6 
7    Juergen Buchmueller, June 1998
8
9***************************************************************************/
10
11#ifndef __ANTIC_H__
12#define __ANTIC_H__
13
14#include "emu.h"
15
16#define HWIDTH          48      /* total characters per line */
17#define HCHARS          44      /* visible characters per line */
18#define VHEIGHT         32
19#define VCHARS          (VDATA_END-VDATA_START+7)/8
20#define BUF_OFFS0       (HWIDTH-HCHARS)/2
21#define MIN_X           ((HWIDTH-42)/2)*8
22#define MAX_X           MIN_X+42*8-1
23#define MIN_Y           VDATA_START
24#define MAX_Y           VDATA_END-8-1
25
26#define PMOFFSET        32      /* # of pixels to adjust p/m hpos */
27
28#define VPAGE           0xf000  /* 4K page mask for video data src */
29#define VOFFS           0x0fff  /* 4K offset mask for video data src */
30#define DPAGE           0xfc00  /* 1K page mask for display list */
31#define DOFFS           0x03ff  /* 1K offset mask for display list */
32
33#define DLI_NMI         0x80    /* 10000000b bit mask for display list interrupt */
34#define VBL_NMI         0x40    /* 01000000b bit mask for vertical blank interrupt */
35
36#define ANTIC_DLI       0x80    /* 10000000b cmds with display list intr    */
37#define ANTIC_LMS       0x40    /* 01000000b cmds with load memory scan     */
38#define ANTIC_VSCR      0x20    /* 00100000b cmds with vertical scroll      */
39#define ANTIC_HSCR      0x10    /* 00010000b cmds with horizontal scroll    */
40#define ANTIC_MODE      0x0f    /* 00001111b cmd mode mask                  */
41
42#define DMA_ANTIC       0x20    /* 00100000b ANTIC DMA enable               */
43#define DMA_PM_DBLLINE  0x10    /* 00010000b double line player/missile     */
44#define DMA_PLAYER      0x08    /* 00001000b player DMA enable              */
45#define DMA_MISSILE     0x04    /* 00000100b missile DMA enable             */
46
47#define OFS_MIS_SINGLE  3*256   /* offset missiles single line DMA          */
48#define OFS_PL0_SINGLE  4*256   /* offset player 0 single line DMA          */
49#define OFS_PL1_SINGLE  5*256   /* offset player 1 single line DMA          */
50#define OFS_PL2_SINGLE  6*256   /* offset player 2 single line DMA          */
51#define OFS_PL3_SINGLE  7*256   /* offset player 3 single line DMA          */
52
53#define OFS_MIS_DOUBLE  3*128   /* offset missiles double line DMA          */
54#define OFS_PL0_DOUBLE  4*128   /* offset player 0 double line DMA          */
55#define OFS_PL1_DOUBLE  5*128   /* offset player 1 double line DMA          */
56#define OFS_PL2_DOUBLE  6*128   /* offset player 2 double line DMA          */
57#define OFS_PL3_DOUBLE  7*128   /* offset player 3 double line DMA          */
58
59#define PFD     0x00    /* 00000000b playfield default color */
60
61#define PBK     0x00    /* 00000000b playfield background */
62#define PF0     0x01    /* 00000001b playfield color #0   */
63#define PF1     0x02    /* 00000010b playfield color #1   */
64#define PF2     0x04    /* 00000100b playfield color #2   */
65#define PF3     0x08    /* 00001000b playfield color #3   */
66#define PL0     0x11    /* 00010001b player #0            */
67#define PL1     0x12    /* 00010010b player #1            */
68#define PL2     0x14    /* 00010100b player #2            */
69#define PL3     0x18    /* 00011000b player #3            */
70#define MI0     0x21    /* 00100001b missile #0           */
71#define MI1     0x22    /* 00100010b missile #1           */
72#define MI2     0x24    /* 00100100b missile #2           */
73#define MI3     0x28    /* 00101000b missile #3           */
74#define T00     0x40    /* 01000000b text mode pixels 00  */
75#define P000    0x48    /* 01001000b player #0 pixels 00  */
76#define P100    0x4a    /* 01001010b player #1 pixels 00  */
77#define P200    0x4c    /* 01001100b player #2 pixels 00  */
78#define P300    0x4e    /* 01001110b player #3 pixels 00  */
79#define P400    0x4f    /* 01001111b missiles  pixels 00  */
80#define T01     0x50    /* 01010000b text mode pixels 01  */
81#define P001    0x58    /* 01011000b player #0 pixels 01  */
82#define P101    0x5a    /* 01011010b player #1 pixels 01  */
83#define P201    0x5c    /* 01011100b player #2 pixels 01  */
84#define P301    0x5e    /* 01011110b player #3 pixels 01  */
85#define P401    0x5f    /* 01011111b missiles  pixels 01  */
86#define T10     0x60    /* 01100000b text mode pixels 10  */
87#define P010    0x68    /* 01101000b player #0 pixels 10  */
88#define P110    0x6a    /* 01101010b player #1 pixels 10  */
89#define P210    0x6c    /* 01101100b player #2 pixels 10  */
90#define P310    0x6e    /* 01101110b player #3 pixels 10  */
91#define P410    0x6f    /* 01101111b missiles  pixels 10  */
92#define T11     0x70    /* 01110000b text mode pixels 11  */
93#define P011    0x78    /* 01111000b player #0 pixels 11  */
94#define P111    0x7a    /* 01111010b player #1 pixels 11  */
95#define P211    0x7c    /* 01111100b player #2 pixels 11  */
96#define P311    0x7e    /* 01111110b player #3 pixels 11  */
97#define P411    0x7f    /* 01111111b missiles  pixels 11  */
98#define G00     0x80    /* 10000000b hires gfx pixels 00  */
99#define G01     0x90    /* 10010000b hires gfx pixels 01  */
100#define G10     0xa0    /* 10100000b hires gfx pixels 10  */
101#define G11     0xb0    /* 10110000b hires gfx pixels 11  */
102#define GT1     0xc0    /* 11000000b gtia mode 1          */
103#define GT2     0xd0    /* 11010000b gtia mode 2          */
104#define GT3     0xe0    /* 11100000b gtia mode 3          */
105#define ILL     0xfe    /* 11111110b illegal priority     */
106#define EOR     0xff    /* 11111111b EOR mode color       */
107
108#define LUM     0x0f    /* 00001111b luminance bits       */
109#define HUE     0xf0    /* 11110000b hue bits             */
110
111#define TRIGGER_VBLANK  64715
112#define TRIGGER_STEAL   64716
113#define TRIGGER_HSYNC   64717
114
115
116/*****************************************************************************
117 * If your memcpy does not expand too well if you use it with constant
118 * size_t field, you might want to define these macros somehow different.
119 * NOTE: dst is not necessarily UINT32 aligned (because of horz scrolling)!
120 *****************************************************************************/
121#define COPY4(dst,s1) *dst++ = s1
122#define COPY8(dst,s1,s2) *dst++ = s1; *dst++ = s2
123#define COPY16(dst,s1,s2,s3,s4) *dst++ = s1; *dst++ = s2; *dst++ = s3; *dst++ = s4
124
125struct ANTIC_R {
126   UINT8   antic00;    /* 00 nothing */
127   UINT8   antic01;    /* 01 nothing */
128   UINT8   antic02;    /* 02 nothing */
129   UINT8   antic03;    /* 03 nothing */
130   UINT8   antic04;    /* 04 nothing */
131   UINT8   antic05;    /* 05 nothing */
132   UINT8   antic06;    /* 06 nothing */
133   UINT8   antic07;    /* 07 nothing */
134   UINT8   antic08;    /* 08 nothing */
135   UINT8   antic09;    /* 09 nothing */
136   UINT8   antic0a;    /* 0a nothing */
137   UINT8   vcount;     /* 0b vertical (scanline) counter */
138   UINT8   penh;       /* 0c light pen horizontal pos */
139   UINT8   penv;       /* 0d light pen vertical pos */
140   UINT8   antic0e;    /* 0e nothing */
141   UINT8   nmist;      /* 0f NMI status */
142};  /* read registers */
143
144struct ANTIC_W {
145   UINT8   dmactl;     /* 00 write DMA control */
146   UINT8   chactl;     /* 01 write character control */
147   UINT8   dlistl;     /* 02 display list low */
148   UINT8   dlisth;     /* 03 display list high */
149   UINT8   hscrol;     /* 04 horz scroll */
150   UINT8   vscrol;     /* 05 vert scroll */
151   UINT8   pmbasl;     /* 06 player/missile base addr low */
152   UINT8   pmbash;     /* 07 player/missile base addr high */
153   UINT8   chbasl;     /* 08 character generator base addr low */
154   UINT8   chbash;     /* 09 character generator base addr high */
155   UINT8   wsync;      /* 0a wait for hsync */
156   UINT8   antic0b;    /* 0b nothing */
157   UINT8   antic0c;    /* 0c nothing */
158   UINT8   antic0d;    /* 0d nothing */
159   UINT8   nmien;      /* 0e NMI enable */
160   UINT8   nmires;     /* 0f NMI reset */
161};  /* write registers */
162
163/* per scanline buffer for video data (and optimization variables) */
164struct VIDEO {
165   UINT32  cmd;                /* antic command for this scanline */
166   UINT16  data[HWIDTH];       /* graphics data buffer (text through chargen) */
167};
168
169typedef void (*atari_renderer_func)(address_space &space, VIDEO *video);
170
171struct ANTIC {
172   atari_renderer_func renderer;   /* current renderer */
173   UINT32  cmd;                /* currently executed display list command */
174   UINT32  steal_cycles;       /* steal how many cpu cycles for this line ? */
175   UINT32  vscrol_old;         /* old vscrol value */
176   UINT32  hscrol_old;         /* old hscrol value */
177   INT32   modelines;          /* number of lines for current ANTIC mode */
178   UINT32  chbase;             /* character mode source base */
179   UINT32  chand;              /* character and mask (chactl) */
180   UINT32  chxor;              /* character xor mask (chactl) */
181   UINT32  scanline;           /* current scan line */
182   UINT32  pfwidth;            /* playfield width */
183   UINT32  dpage;              /* display list address page */
184   UINT32  doffs;              /* display list offset into page */
185   UINT32  vpage;              /* video data source page */
186   UINT32  voffs;              /* video data offset into page */
187   UINT32  pmbase_s;           /* p/m graphics single line source base */
188   UINT32  pmbase_d;           /* p/m graphics double line source base */
189   ANTIC_R r;                  /* ANTIC read registers */
190   ANTIC_W w;                  /* ANTIC write registers */
191   UINT8   cclock[256+32];     /* color clock buffer filled by ANTIC */
192   UINT8   pmbits[256+32];     /* player missile buffer filled by GTIA */
193   UINT8   *prio_table[64];    /* player/missile priority tables */
194   VIDEO   *video[312];        /* video buffer */
195   UINT32  *cclk_expand;       /* shared buffer for the following: */
196   UINT32  *pf_21;             /* 1cclk 2 color txt 2,3 */
197   UINT32  *pf_x10b;           /* 1cclk 4 color txt 4,5, gfx D,E */
198   UINT32  *pf_3210b2;         /* 1cclk 5 color txt 6,7, gfx 9,B,C */
199   UINT32  *pf_210b4;          /* 4cclk 4 color gfx 8 */
200   UINT32  *pf_210b2;          /* 2cclk 4 color gfx A */
201   UINT32  *pf_1b;             /* 1cclk hires gfx F */
202   UINT32  *pf_gtia1;          /* 1cclk gtia mode 1 */
203   UINT32  *pf_gtia2;          /* 1cclk gtia mode 2 */
204   UINT32  *pf_gtia3;          /* 1cclk gtia mode 3 */
205   UINT8   *used_colors;       /* shared buffer for the following: */
206   UINT8   *uc_21;             /* used colors for txt (2,3) */
207   UINT8   *uc_x10b;           /* used colors for txt 4,5, gfx D,E */
208   UINT8   *uc_3210b2;         /* used colors for txt 6,7, gfx 9,B,C */
209   UINT8   *uc_210b4;          /* used colors for gfx 8 */
210   UINT8   *uc_210b2;          /* used colors for gfx A */
211   UINT8   *uc_1b;             /* used colors for gfx F */
212   UINT8   *uc_g1;             /* used colors for gfx GTIA 1 */
213   UINT8   *uc_g2;             /* used colors for gfx GTIA 2 */
214   UINT8   *uc_g3;             /* used colors for gfx GTIA 3 */
215   bitmap_ind16 *bitmap;
216};
217
218#define RDANTIC(space)      space.read_byte(antic.dpage+antic.doffs)
219#define RDVIDEO(space,o)    space.read_byte(antic.vpage+((antic.voffs+(o))&VOFFS))
220#define RDCHGEN(space,o)    space.read_byte(antic.chbase+(o))
221#define RDPMGFXS(space,o)   space.read_byte(antic.pmbase_s+(o)+(antic.scanline>>1))
222#define RDPMGFXD(space,o)   space.read_byte(antic.pmbase_d+(o)+antic.scanline)
223
224#define PREPARE()                                               \
225   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET]
226
227#define PREPARE_TXT2(space,width)                               \
228   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
229   for (int i = 0; i < width; i++)                             \
230   {                                                           \
231      UINT16 ch = RDVIDEO(space,i) << 3;                      \
232      if (ch & 0x400)                                         \
233      {                                                       \
234         ch = RDCHGEN(space,(ch & 0x3f8) + antic.w.chbasl);  \
235         ch = (ch ^ antic.chxor) & antic.chand;              \
236      }                                                       \
237      else                                                    \
238      {                                                       \
239         ch = RDCHGEN(space,ch + antic.w.chbasl);            \
240      }                                                       \
241      video->data[i] = ch;                                    \
242   }
243
244#define PREPARE_TXT3(space,width)                               \
245   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
246   for (int i = 0; i < width; i++)                             \
247   {                                                           \
248      UINT16 ch = RDVIDEO(space,i) << 3;                      \
249      if (ch & 0x400)                                         \
250      {                                                       \
251         ch &= 0x3f8;                                        \
252         if ((ch & 0x300) == 0x300)                          \
253         {                                                   \
254            if (antic.w.chbasl < 2) /* first two lines empty */ \
255               ch = 0x00;                                  \
256            else /* lines 2..7 are standard, 8&9 are 0&1 */ \
257               ch = RDCHGEN(space,ch + (antic.w.chbasl & 7));\
258         }                                                   \
259         else                                                \
260         {                                                   \
261            if (antic.w.chbasl > 7) /* last two lines empty */  \
262               ch = 0x00;                                  \
263            else /* lines 0..7 are standard */              \
264               ch = RDCHGEN(space,ch + antic.w.chbasl);    \
265         }                                                   \
266         ch = (ch ^ antic.chxor) & antic.chand;              \
267      }                                                       \
268      else                                                    \
269      {                                                       \
270         if ((ch & 0x300) == 0x300)                          \
271         {                                                   \
272            if (antic.w.chbasl < 2) /* first two lines empty */ \
273               ch = 0x00;                                  \
274            else /* lines 2..7 are standard, 8&9 are 0&1 */ \
275               ch = RDCHGEN(space,ch + (antic.w.chbasl & 7));\
276         }                                                   \
277         else                                                \
278         {                                                   \
279            if (antic.w.chbasl > 7) /* last two lines empty */  \
280               ch = 0x00;                                  \
281            else /* lines 0..7 are standard */              \
282               ch = RDCHGEN(space,ch + antic.w.chbasl);    \
283         }                                                   \
284      }                                                       \
285      video->data[i] = ch;                                    \
286   }
287
288#define PREPARE_TXT45(space,width,shift)                        \
289   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
290   for (int i = 0; i < width; i++)                             \
291   {                                                           \
292      UINT16 ch = RDVIDEO(space,i) << 3;                      \
293      ch = ((ch>>2)&0x100)|RDCHGEN(space,(ch&0x3f8)+(antic.w.chbasl>>shift)); \
294      video->data[i] = ch;                                    \
295   }
296
297
298#define PREPARE_TXT67(space,width,shift)                        \
299   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
300   for (int i = 0; i < width; i++)                             \
301   {                                                           \
302      UINT16 ch = RDVIDEO(space,i) << 3;                      \
303      ch = (ch&0x600)|(RDCHGEN(space,(ch&0x1f8)+(antic.w.chbasl>>shift))<<1); \
304      video->data[i] = ch;                                    \
305   }
306
307#define PREPARE_GFX8(space,width)                               \
308   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
309   for (int i = 0; i < width; i++)                             \
310      video->data[i] = RDVIDEO(space,i) << 2
311
312#define PREPARE_GFX9BC(space,width)                             \
313   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
314   for (int i = 0; i < width; i++)                             \
315      video->data[i] = RDVIDEO(space,i) << 1
316
317#define PREPARE_GFXA(space,width)                               \
318   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
319   for (int i = 0; i < width; i++)                             \
320      video->data[i] = RDVIDEO(space,i) << 1
321
322#define PREPARE_GFXDE(space,width)                              \
323   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
324   for (int i = 0; i < width; i++)                             \
325      video->data[i] = RDVIDEO(space,i)
326
327#define PREPARE_GFXF(space,width)                               \
328   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
329   for (int i = 0; i < width; i++)                             \
330      video->data[i] = RDVIDEO(space,i)
331
332#define PREPARE_GFXG1(space,width)                              \
333   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
334   for (int i = 0; i < width; i++)                             \
335      video->data[i] = RDVIDEO(space,i)
336
337#define PREPARE_GFXG2(space,width)                              \
338   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
339   for (int i = 0; i < width; i++)                             \
340      video->data[i] = RDVIDEO(space,i)
341
342#define PREPARE_GFXG3(space,width)                              \
343   UINT32 *dst = (UINT32 *)&antic.cclock[PMOFFSET];            \
344   for (int i = 0; i < width; i++)                             \
345      video->data[i] = RDVIDEO(space,i)
346
347/******************************************************************
348 * common end of a single antic/gtia mode emulation function
349 ******************************************************************/
350#define POST()                                                  \
351   --antic.modelines
352
353#define POST_GFX(width)                                         \
354   antic.steal_cycles += width;                                \
355   if (--antic.modelines == 0)                                 \
356      antic.voffs = (antic.voffs + width) & VOFFS
357
358#define POST_TXT(width)                                         \
359   antic.steal_cycles += width;                                \
360   if (--antic.modelines == 0)                                 \
361      antic.voffs = (antic.voffs + width) & VOFFS;            \
362   else if (antic.w.chactl & 4)                                \
363      antic.w.chbasl--;                                       \
364   else                                                        \
365      antic.w.chbasl++
366
367/* erase a number of color clocks to background color PBK */
368#define ERASE4  {   \
369   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
370   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
371   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
372   *dst++ = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;  \
373   }
374
375#define ZAP48()                                                 \
376   dst = (UINT32 *)&antic.cclock[PMOFFSET];                    \
377   dst[ 0] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
378   dst[ 1] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
379   dst[ 2] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
380   dst[45] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
381   dst[46] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK;     \
382   dst[47] = (PBK << 24) | (PBK << 16) | (PBK << 8) | PBK
383
384#define ERASE8  \
385   ERASE4;     \
386   ERASE4
387
388#define REP08(FUNC)                         \
389   ERASE8;                                 \
390   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
391   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
392   ERASE8
393
394#define REP10(FUNC)                         \
395   ERASE4;                                 \
396   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
397   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
398   FUNC( 8); FUNC( 9);                     \
399   ERASE4
400
401#define REP12(FUNC)                         \
402   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
403   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
404   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11)
405
406#define REP16(FUNC)                         \
407   ERASE8;                                 \
408   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
409   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
410   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
411   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
412   ERASE8
413
414#define REP20(FUNC)                         \
415   ERASE4;                                 \
416   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
417   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
418   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
419   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
420   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
421   ERASE4
422
423#define REP24(FUNC)                         \
424   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
425   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
426   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
427   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
428   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
429   FUNC(20); FUNC(21); FUNC(22); FUNC(23)
430
431#define REP32(FUNC)                         \
432   ERASE8;                                 \
433   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
434   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
435   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
436   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
437   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
438   FUNC(20); FUNC(21); FUNC(22); FUNC(23); \
439   FUNC(24); FUNC(25); FUNC(26); FUNC(27); \
440   FUNC(28); FUNC(29); FUNC(30); FUNC(31); \
441   ERASE8
442
443#define REP40(FUNC)                         \
444   ERASE4;                                 \
445   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
446   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
447   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
448   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
449   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
450   FUNC(20); FUNC(21); FUNC(22); FUNC(23); \
451   FUNC(24); FUNC(25); FUNC(26); FUNC(27); \
452   FUNC(28); FUNC(29); FUNC(30); FUNC(31); \
453   FUNC(32); FUNC(33); FUNC(34); FUNC(35); \
454   FUNC(36); FUNC(37); FUNC(38); FUNC(39); \
455   ERASE4
456
457#define REP48(FUNC)                         \
458   FUNC( 0); FUNC( 1); FUNC( 2); FUNC( 3); \
459   FUNC( 4); FUNC( 5); FUNC( 6); FUNC( 7); \
460   FUNC( 8); FUNC( 9); FUNC(10); FUNC(11); \
461   FUNC(12); FUNC(13); FUNC(14); FUNC(15); \
462   FUNC(16); FUNC(17); FUNC(18); FUNC(19); \
463   FUNC(20); FUNC(21); FUNC(22); FUNC(23); \
464   FUNC(24); FUNC(25); FUNC(26); FUNC(27); \
465   FUNC(28); FUNC(29); FUNC(30); FUNC(31); \
466   FUNC(32); FUNC(33); FUNC(34); FUNC(35); \
467   FUNC(36); FUNC(37); FUNC(38); FUNC(39); \
468   FUNC(40); FUNC(41); FUNC(42); FUNC(43); \
469   FUNC(44); FUNC(45); FUNC(46); FUNC(47);
470
471
472void antic_start(running_machine &machine);
473void antic_vstart(running_machine &machine);
474void antic_reset(void);
475void antic_render(address_space &space, int param1, int param2, int param3);
476
477
478extern ANTIC antic;
479
480#endif /* __GTIA_H__ */
Property changes on: trunk/src/mame/video/antic.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mame/video/atari.c
r31991r31992
4141 ************************************************************************/
4242UINT32 atari_common_state::screen_update_atari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
4343{
44   UINT32 new_tv_artifacts;
45
44   UINT32 new_tv_artifacts = screen.ioport("artifacts")->read_safe(0);
4645   copybitmap(bitmap, *antic.bitmap, 0, 0, 0, 0, cliprect);
4746
48   new_tv_artifacts = screen.ioport("artifacts")->read_safe(0);
49   if( tv_artifacts != new_tv_artifacts )
50   {
47   if (tv_artifacts != new_tv_artifacts)
5148      tv_artifacts = new_tv_artifacts;
52   }
5349
5450   return 0;
5551}

Previous 199869 Revisions Next


© 1997-2024 The MAME Team