use decimal instead of binary representation to save space

(cherry picked from commit 54ba73c177)
This commit is contained in:
2026-04-25 09:13:05 +02:00
parent c378dc95fa
commit 2b2e2a6d02
2 changed files with 13 additions and 13 deletions

View File

@@ -38,17 +38,17 @@ const mapMatchingStrings = {
}; };
const spritesMatchingStrings = { const spritesMatchingStrings = {
0x00_00_00: '0b000_000_00', 0x00_00_00: ' 0', // 0b000_000_00
0x00_00_FF: '0b000_000_11', 0x00_00_FF: ' 3', // 0b000_000_11
0x00_FF_00: '0b000_111_00', 0x00_FF_00: ' 28', // 0b000_111_00
0x99_50_00: `0b010_001_00`, 0x99_50_00: ' 68', // 0b010_001_00
0x77_77_77: '0b011_011_10', 0x77_77_77: '110', // 0b011_011_10
0xB3_B3_B3: '0b100_100_10', 0xB3_B3_B3: '146', // 0b100_100_10
0xFF_00_00: '0b111_000_00', 0xFF_00_00: '224', // 0b111_000_00
0xFF_00_FF: '0b111_000_11', 0xFF_00_FF: '227', // 0b111_000_11
0xFF_80_00: '0b111_100_00', 0xFF_80_00: '240', // 0b111_100_00
0xFF_FF_00: '0b111_110_00', 0xFF_FF_00: '248', // 0b111_110_00
0xFF_FF_FF: '0b111_111_11', 0xFF_FF_FF: '255', // 0b111_111_11
}; };
const mapPath = 'assets/map.ppm'; const mapPath = 'assets/map.ppm';

View File

@@ -33,8 +33,8 @@ Usage example:
```sh ```sh
./build.ts > /path/to/the/game/schematics/architecture/Symfony/sandbox/main.asm ./build.ts > /path/to/the/game/schematics/architecture/Symfony/sandbox/main.asm
# script output can easily be piped to strip it off all comments, leading whitespace and empty lines: # script output can easily be piped to strip it off all comments, leading whitespace, double spaces and empty lines:
./build.ts | sed 's/\s*;.*//' | sed 's/^\s*//' | sed '/^\d*$/d' > result.asm ./build.ts | sed -r 's/\s*;.*//' | sed -r 's/^\s+//' | sed -r 's/ +/ /' | sed -r '/^\s*$/d' > result.asm
``` ```
The script is build over Deno's API, so you'll need to have a `deno` binary in your PATH to use it that way. The script is build over Deno's API, so you'll need to have a `deno` binary in your PATH to use it that way.