use decimal instead of binary representation to save space
This commit is contained in:
22
build.ts
22
build.ts
@@ -38,17 +38,17 @@ const mapMatchingStrings = {
|
||||
};
|
||||
|
||||
const spritesMatchingStrings = {
|
||||
0x00_00_00: '0b000_000_00',
|
||||
0x00_00_FF: '0b000_000_11',
|
||||
0x00_FF_00: '0b000_111_00',
|
||||
0x99_50_00: `0b010_001_00`,
|
||||
0x77_77_77: '0b011_011_10',
|
||||
0xB3_B3_B3: '0b100_100_10',
|
||||
0xFF_00_00: '0b111_000_00',
|
||||
0xFF_00_FF: '0b111_000_11',
|
||||
0xFF_80_00: '0b111_100_00',
|
||||
0xFF_FF_00: '0b111_110_00',
|
||||
0xFF_FF_FF: '0b111_111_11',
|
||||
0x00_00_00: ' 0', // 0b000_000_00
|
||||
0x00_00_FF: ' 3', // 0b000_000_11
|
||||
0x00_FF_00: ' 28', // 0b000_111_00
|
||||
0x99_50_00: ' 68', // 0b010_001_00
|
||||
0x77_77_77: '110', // 0b011_011_10
|
||||
0xB3_B3_B3: '146', // 0b100_100_10
|
||||
0xFF_00_00: '224', // 0b111_000_00
|
||||
0xFF_00_FF: '227', // 0b111_000_11
|
||||
0xFF_80_00: '240', // 0b111_100_00
|
||||
0xFF_FF_00: '248', // 0b111_110_00
|
||||
0xFF_FF_FF: '255', // 0b111_111_11
|
||||
};
|
||||
|
||||
const mapPath = 'assets/map.ppm';
|
||||
|
||||
@@ -28,8 +28,8 @@ Usage example:
|
||||
```sh
|
||||
./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:
|
||||
./build.ts | sed 's/\s*;.*//' | sed 's/^\s*//' | sed '/^\d*$/d' > result.asm
|
||||
# script output can easily be piped to strip it off all comments, leading whitespace, double spaces and empty lines:
|
||||
./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.
|
||||
|
||||
Reference in New Issue
Block a user