ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Src/VIC_SC.cpp
(Generate patch)

Comparing Frodo4/Src/VIC_SC.cpp (file contents):
Revision 1.1 by cebix, 2003-07-01T17:09:43Z vs.
Revision 1.6 by cebix, 2010-04-21T19:53:28Z

# Line 1 | Line 1
1   /*
2   *  VIC_SC.cpp - 6569R5 emulation (cycle based)
3   *
4 < *  Frodo (C) 1994-1997,2002 Christian Bauer
4 > *  Frodo Copyright (C) Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 286 | Line 286 | MOS6569::MOS6569(C64 *c64, C64Display *d
286          display_state = false;
287          border_on = ud_border_on = vblanking = false;
288          lp_triggered = draw_this_line = false;
289 +        is_bad_line = false;
290  
291 <        spr_dma_on = spr_disp_on = 0;
291 >    spr_exp_y = spr_dma_on = spr_disp_on = 0;
292          for (i=0; i<8; i++) {
293                  mc[i] = 63;
294 +                mc_base[i] = 0;
295                  spr_ptr[i] = 0;
296          }
297  
# Line 317 | Line 319 | void MOS6569::ReInitColors(void)
319          // Build inverse color table.
320          uint8 xlate_colors[256];
321          memset(xlate_colors, 0, sizeof(xlate_colors));
322 <        for (i = 0; i < 16; i++)
322 >        for (i=0; i<16; i++)
323                  xlate_colors[colors[i]] = i;
324  
325          // Get the new colors.
326          the_display->InitColors(colors);
327  
328          // Build color translation table.
329 <        for (i = 0; i < 256; i++)
329 >        for (i=0; i<256; i++)
330                  xlate_colors[i] = colors[xlate_colors[i]];
331  
332          // Translate all the old colors variables.
# Line 335 | Line 337 | void MOS6569::ReInitColors(void)
337          b3c_color = colors[b3c];
338          mm0_color = colors[mm0];
339          mm1_color = colors[mm1];
340 <        for (i = 0; i < 8; i++)
340 >        for (i=0; i<8; i++)
341                  spr_color[i] = colors[sc[i]];
342  
343          // Translate the border color sample buffer.
# Line 344 | Line 346 | void MOS6569::ReInitColors(void)
346  
347          // Translate the chunky buffer.
348          uint8 *scanline = the_display->BitmapBase();
349 <        for (int y = 0; y < DISPLAY_Y; y++) {
350 <                for (int x = 0; x < DISPLAY_X; x++)
349 >        for (int y=0; y<DISPLAY_Y; y++) {
350 >                for (int x=0; x<DISPLAY_X; x++)
351                          scanline[x] = xlate_colors[scanline[x]];
352                  scanline += xmod;
353          }
# Line 1514 | Line 1516 | bool MOS6569::EmulateCycle(void)
1516                  // Fetch sprite pointer 3, increment raster counter, trigger raster IRQ,
1517                  // test for Bad Line, reset BA if sprites 3 and 4 off, read data of sprite 3
1518                  case 1:
1519 <                        if (raster_y == TOTAL_RASTERS-1)
1519 >                        if (raster_y == TOTAL_RASTERS-1) {
1520  
1521                                  // Trigger VBlank in cycle 2
1522                                  vblanking = true;
1523  
1524 <                        else {
1524 >                        } else {
1525  
1526                                  // Increment raster counter
1527                                  raster_y++;
# Line 1842 | Line 1844 | bool MOS6569::EmulateCycle(void)
1844                          border_on_sample[4] = border_on;
1845  
1846                          // Sample spr_disp_on and spr_data for sprite drawing
1847 <                        if ((spr_draw = spr_disp_on))
1847 >                        if ((spr_draw = spr_disp_on) != 0)
1848                                  memcpy(spr_draw_data, spr_data, 8*4);
1849  
1850                          // Turn off sprite display if DMA is off

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines