Previous 15994 Revisions Next

r3898 Friday 19th December, 2008 at 22:52:16 UTC by Wilbert Pol
Removed deprecat.h from machine/vc20.c
[src/mess/includes]vc20.h
[src/mess/machine]vc20.c
[src/mess/video]vic6560.c vic6560.h

src/mess/video/vic6560.c
r3897r3898
9999
100100static bitmap_t *vic6560_bitmap;
101101static int rasterline = 0, lastline = 0;
102static void vic6560_drawlines (int start, int last);
102static void vic6560_drawlines (running_machine *machine, int start, int last);
103103
104static int (*vic_dma_read) (int);
105static int (*vic_dma_read_color) (int);
104static int (*vic_dma_read) (running_machine *machine, int);
105static int (*vic_dma_read_color) (running_machine *machine, int);
106106
107107static int vic656x_xsize, vic656x_ysize, vic656x_lines, vic656x_vretracerate;
108108static int charheight, matrix8x16, inverted;
r3897r3898
124124   vic656x_vretracerate = VIC656X_VRETRACERATE;
125125}
126126
127void vic6560_init (int (*dma_read) (int), int (*dma_read_color) (int))
127void vic6560_init (int (*dma_read) (running_machine *machine, int), int (*dma_read_color) (running_machine *machine, int))
128128{
129129   vic6560_pal = FALSE;
130130   vic_dma_read = dma_read;
r3897r3898
132132   vic656x_init ();
133133}
134134
135void vic6561_init (int (*dma_read) (int), int (*dma_read_color) (int))
135void vic6561_init (int (*dma_read) (running_machine *machine, int), int (*dma_read_color) (running_machine *machine, int))
136136{
137137   vic6560_pal = TRUE;
138138   vic_dma_read = dma_read;
r3897r3898
175175      case 5:
176176      case 0xe:
177177      case 0xf:
178         vic6560_drawlines (lastline, rasterline);
178         vic6560_drawlines (space->machine, lastline, rasterline);
179179         break;
180180      }
181181      vic6560[offset] = data;
r3897r3898
229229      val = ((rasterline & 1) << 7) | (vic6560[offset] & 0x7f);
230230      break;
231231   case 4:                     /*rasterline */
232      vic6560_drawlines (lastline, rasterline);
232      vic6560_drawlines (space->machine, lastline, rasterline);
233233      val = (rasterline / 2) & 0xff;
234234      break;
235235   case 6:                     /*lightpen horizontal */
r3897r3898
262262   return val;
263263}
264264
265static void vic6560_draw_character (int ybegin, int yend,
265static void vic6560_draw_character (running_machine *machine, int ybegin, int yend,
266266                           int ch, int yoff, int xoff,
267267                           UINT16 *color)
268268{
r3897r3898
270270
271271   for (y = ybegin; y <= yend; y++)
272272   {
273      code = vic_dma_read ((chargenaddr + ch * charheight + y) & 0x3fff);
273      code = vic_dma_read (machine, (chargenaddr + ch * charheight + y) & 0x3fff);
274274      *BITMAP_ADDR16(vic6560_bitmap, y + yoff, xoff + 0) = color[code >> 7];
275275      *BITMAP_ADDR16(vic6560_bitmap, y + yoff, xoff + 1) = color[(code >> 6) & 1];
276276      *BITMAP_ADDR16(vic6560_bitmap, y + yoff, xoff + 2) = color[(code >> 5) & 1];
r3897r3898
282282   }
283283}
284284
285static void vic6560_draw_character_multi (int ybegin, int yend,
285static void vic6560_draw_character_multi (running_machine *machine, int ybegin, int yend,
286286                                int ch, int yoff, int xoff, UINT16 *color)
287287{
288288   int y, code;
289289
290290   for (y = ybegin; y <= yend; y++)
291291   {
292      code = vic_dma_read ((chargenaddr + ch * charheight + y) & 0x3fff);
292      code = vic_dma_read (machine, (chargenaddr + ch * charheight + y) & 0x3fff);
293293      *BITMAP_ADDR16(vic6560_bitmap, y + yoff, xoff + 0) =
294294         *BITMAP_ADDR16(vic6560_bitmap, y + yoff, xoff + 1) = color[code >> 6];
295295      *BITMAP_ADDR16(vic6560_bitmap, y + yoff, xoff + 2) =
r3897r3898
302302}
303303
304304
305static void vic6560_drawlines (int first, int last)
305static void vic6560_drawlines (running_machine *machine, int first, int last)
306306{
307307   int line, vline;
308308   int offs, yoff, xoff, ybegin, yend, i;
r3897r3898
341341      }
342342      for (xoff = xpos; (xoff < xpos + xsize) && (xoff < vic656x_xsize); xoff += 8, offs++)
343343      {
344         ch = vic_dma_read ((videoaddr + offs) & 0x3fff);
345         attr = (vic_dma_read_color ((videoaddr + offs) & 0x3fff)) & 0xf;
344         ch = vic_dma_read (machine, (videoaddr + offs) & 0x3fff);
345         attr = (vic_dma_read_color (machine, (videoaddr + offs) & 0x3fff)) & 0xf;
346346         if (inverted)
347347         {
348348            if (attr & 8)
349349            {
350350               multiinverted[0] = attr & 7;
351               vic6560_draw_character_multi (ybegin, yend, ch, yoff, xoff,
351               vic6560_draw_character_multi (machine, ybegin, yend, ch, yoff, xoff,
352352                                      multiinverted);
353353            }
354354            else
355355            {
356356               monoinverted[0] = attr;
357               vic6560_draw_character (ybegin, yend, ch, yoff, xoff, monoinverted);
357               vic6560_draw_character (machine, ybegin, yend, ch, yoff, xoff, monoinverted);
358358            }
359359         }
360360         else
r3897r3898
362362            if (attr & 8)
363363            {
364364               multi[2] = attr & 7;
365               vic6560_draw_character_multi (ybegin, yend, ch, yoff, xoff, multi);
365               vic6560_draw_character_multi (machine, ybegin, yend, ch, yoff, xoff, multi);
366366            }
367367            else
368368            {
369369               mono[1] = attr;
370               vic6560_draw_character (ybegin, yend, ch, yoff, xoff, mono);
370               vic6560_draw_character (machine, ybegin, yend, ch, yoff, xoff, mono);
371371            }
372372         }
373373      }
r3897r3898
403403   if (rasterline >= vic656x_lines)
404404   {
405405      rasterline = 0;
406      vic6560_drawlines (lastline, vic656x_lines);
406      vic6560_drawlines (device->machine, lastline, vic656x_lines);
407407      lastline = 0;
408408   }
409409}
src/mess/video/vic6560.h
r3897r3898
105105/* call to init videodriver */
106106/* pal version */
107107/* dma_read: videochip fetched 12 bit data from system bus */
108extern void vic6560_init (int (*dma_read) (int), int (*dma_read_color) (int));
109extern void vic6561_init (int (*dma_read) (int), int (*dma_read_color) (int));
108extern void vic6560_init (int (*dma_read) (running_machine *machine, int), int (*dma_read_color) (running_machine *machine, int));
109extern void vic6561_init (int (*dma_read) (running_machine *machine, int), int (*dma_read_color) (running_machine *machine, int));
110110
111111/* internal */
112112extern int vic6560_pal;
src/mess/includes/vc20.h
r3897r3898
3030
3131/* split for more performance */
3232/* VIC reads bits 8 till 11 */
33int vic6560_dma_read_color (int offset);
33int vic6560_dma_read_color (running_machine *machine, int offset);
3434
3535/* VIC reads bits 0 till 7 */
36int vic6560_dma_read (int offset);
36int vic6560_dma_read (running_machine *machine, int offset);
3737
3838DRIVER_INIT( vc20 );
3939DRIVER_INIT( vic20 );
src/mess/machine/vc20.c
r3897r3898
2929#include "devices/cassette.h"
3030#include "devices/cartslot.h"
3131
32#include "deprecat.h"
3332
3433#define VERBOSE_LEVEL 0
3534#define DBG_LOG(N,M,A) \
r3897r3898
472471}
473472
474473
475int vic6560_dma_read_color (int offset)
474int vic6560_dma_read_color (running_machine *machine, int offset)
476475{
477476   return vc20_memory_9400[offset & 0x3ff];
478477}
479478
480int vic6560_dma_read (int offset)
479int vic6560_dma_read (running_machine *machine, int offset)
481480{
482   const address_space *space = cputag_get_address_space(Machine, "main", ADDRESS_SPACE_PROGRAM);
481   const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
483482   /* should read real system bus between 0x9000 and 0xa000 */
484483   return memory_read_byte(space, VIC6560ADDR2VC20ADDR (offset));
485484}

Previous 15994 Revisions Next


© 1998-2018 The MESS Team