From: Lukas Krickl Date: Sat, 29 Mar 2025 18:05:53 +0000 (+0100) Subject: character encoding: Fixed char encoding to start at 1 for '0' X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=194d5e36bf03aa194650fbb086f7fba6f294c3f6;p=gbrg%2F.git character encoding: Fixed char encoding to start at 1 for '0' This allows NUL terminated strings to be used and still contain '0' --- diff --git a/src/strings.s b/src/strings.s index 4666901..836899d 100644 --- a/src/strings.s +++ b/src/strings.s @@ -1,11 +1,12 @@ ; map ascii values to the actual tileset here -.rep i, 10, 1, .scc i + '0' = i -.rep i, 26, 1, .scc i + 'a' = i + 10 -.rep i, 26, 1, .scc i + 'A' = i + 10 +; '0' = 0 + 1 +.rep i, 10, 1, .scc i + '0' = i + 1 +.rep i, 26, 1, .scc i + 'a' = i + 1 + 10 +.rep i, 26, 1, .scc i + 'A' = i + 1 + 10 #define EMPTY_TILE 0x30 -#define FONT_OFFSET 0xD0 +#define FONT_OFFSET (0xD0 - 1) ; map space to empty tile .scc 0x20 = EMPTY_TILE