1 |
|
/* |
2 |
|
* VIC_SC.cpp - 6569R5 emulation (cycle based) |
3 |
|
* |
4 |
< |
* Frodo (C) 1994-1997,2002-2003 Christian Bauer |
4 |
> |
* Frodo (C) 1994-1997,2002-2004 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 |
317 |
|
// Build inverse color table. |
318 |
|
uint8 xlate_colors[256]; |
319 |
|
memset(xlate_colors, 0, sizeof(xlate_colors)); |
320 |
< |
for (i = 0; i < 16; i++) |
320 |
> |
for (i=0; i<16; i++) |
321 |
|
xlate_colors[colors[i]] = i; |
322 |
|
|
323 |
|
// Get the new colors. |
324 |
|
the_display->InitColors(colors); |
325 |
|
|
326 |
|
// Build color translation table. |
327 |
< |
for (i = 0; i < 256; i++) |
327 |
> |
for (i=0; i<256; i++) |
328 |
|
xlate_colors[i] = colors[xlate_colors[i]]; |
329 |
|
|
330 |
|
// Translate all the old colors variables. |
335 |
|
b3c_color = colors[b3c]; |
336 |
|
mm0_color = colors[mm0]; |
337 |
|
mm1_color = colors[mm1]; |
338 |
< |
for (i = 0; i < 8; i++) |
338 |
> |
for (i=0; i<8; i++) |
339 |
|
spr_color[i] = colors[sc[i]]; |
340 |
|
|
341 |
|
// Translate the border color sample buffer. |
344 |
|
|
345 |
|
// Translate the chunky buffer. |
346 |
|
uint8 *scanline = the_display->BitmapBase(); |
347 |
< |
for (int y = 0; y < DISPLAY_Y; y++) { |
348 |
< |
for (int x = 0; x < DISPLAY_X; x++) |
347 |
> |
for (int y=0; y<DISPLAY_Y; y++) { |
348 |
> |
for (int x=0; x<DISPLAY_X; x++) |
349 |
|
scanline[x] = xlate_colors[scanline[x]]; |
350 |
|
scanline += xmod; |
351 |
|
} |
1842 |
|
border_on_sample[4] = border_on; |
1843 |
|
|
1844 |
|
// Sample spr_disp_on and spr_data for sprite drawing |
1845 |
< |
if ((spr_draw = spr_disp_on)) |
1845 |
> |
if ((spr_draw = spr_disp_on) != 0) |
1846 |
|
memcpy(spr_draw_data, spr_data, 8*4); |
1847 |
|
|
1848 |
|
// Turn off sprite display if DMA is off |