1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-04-25 21:18:25 +00:00

Fix lastOffset calculations in Apple II hi-res visualizer

The calculations were wrong for certain situations, generating
answers that were useless or that caused a false-positive overflow
error.

This adds a couple of simple regression tests, modeled after layout
of the Lode Runner sprite sheet (which worked fine before) and the
Empire II EWS3 font (which failed).

This also bumps up some of the arbitrary limits in the visualizer.

(issue #94)
This commit is contained in:
Andy McFadden
2021-05-17 17:28:13 -07:00
parent b415424368
commit 33ccdd91eb
6 changed files with 198 additions and 11 deletions
+9 -4
View File
@@ -23,6 +23,8 @@ namespace CommonUtil {
/// so glyphs can be packed tightly.
/// </summary>
public static class Font8x8 {
private static List<int[]> sBitData;
/// <summary>
/// Returns an 8-byte array for the specified character. Each byte represents one
/// row. The first byte holds the top row, and the most significant bit in each
@@ -41,6 +43,11 @@ namespace CommonUtil {
return sBitData[index];
}
/// <summary>
/// Maps a character value to an index into sFontData.
/// </summary>
/// <param name="ch">Character to find.</param>
/// <returns>Index of character's glyph, or index of REPLACEMENT CHARACTER.</returns>
private static int MapChar(char ch) {
if (ch == ' ') {
return 1;
@@ -53,8 +60,6 @@ namespace CommonUtil {
}
}
private static List<int[]> sBitData;
/// <summary>
/// Converts the easy-to-edit string data into easy-to-process bitmaps.
/// </summary>
@@ -170,7 +175,7 @@ namespace CommonUtil {
"#.....#." +
".#####.." +
"........",
// ' '
// '7'
"#######." +
"......#." +
".....#.." +
@@ -179,7 +184,7 @@ namespace CommonUtil {
"..#....." +
".#......" +
"........",
// ' '
// '8'
".#####.." +
"#.....#." +
"#.....#." +