1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-11-29 10:50:28 +00:00

Fix Atari 2600 sprite visualizer

Should be solid/transparent not white/black.  Added a blue color
to the palette to use for sprites, as white + transparent disappears
completely on web pages with a white background.

Black + white + grey seems fine for playfields.
This commit is contained in:
Andy McFadden 2019-12-29 18:15:40 -08:00
parent 1373ffd8e3
commit 676ab2554d

View File

@ -126,9 +126,9 @@ namespace RuntimeData.Atari {
byte val = mFileData[offset + row]; byte val = mFileData[offset + row];
for (int col = 0; col < 8; col++) { for (int col = 0; col < 8; col++) {
if ((val & 0x80) != 0) { if ((val & 0x80) != 0) {
vb.SetPixelIndex(col, row, (byte)Color.White); vb.SetPixelIndex(col, row, (byte)Color.Solid);
} else { } else {
vb.SetPixelIndex(col, row, (byte)Color.Black); vb.SetPixelIndex(col, row, (byte)Color.Transparent);
} }
val <<= 1; val <<= 1;
} }
@ -212,16 +212,18 @@ namespace RuntimeData.Atari {
private enum Color : byte { private enum Color : byte {
Transparent = 0, Transparent = 0,
Black = 1, Solid = 1,
White = 2, Black = 2,
Grey = 3 White = 3,
Grey = 4
} }
private void SetPalette(VisBitmap8 vb) { private void SetPalette(VisBitmap8 vb) {
vb.AddColor(0, 0, 0, 0); // 0=transparent vb.AddColor(0, 0, 0, 0); // 0=transparent
vb.AddColor(0xff, 0x00, 0x00, 0x00); // 1=black vb.AddColor(0xff, 0x20, 0x20, 0xe0); // 1=solid (mostly blue)
vb.AddColor(0xff, 0xff, 0xff, 0xff); // 2=white vb.AddColor(0xff, 0x00, 0x00, 0x00); // 2=black
vb.AddColor(0xff, 0xd0, 0xd0, 0xd0); // 3=grey vb.AddColor(0xff, 0xff, 0xff, 0xff); // 3=white
vb.AddColor(0xff, 0xd0, 0xd0, 0xd0); // 4=grey
} }
} }
} }