11 Commits

15 changed files with 27 additions and 39 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -29,7 +29,7 @@ const reservedSpacePath = 'src/reserved_space.asm';
const instructionLength = 4; // in bytes
const mapWidth = 15;
const spriteWidth = 5;
const spriteWidth = 17;
const mapMatchingStrings = {
0x00_00_00: '0', // Empty
@@ -38,17 +38,17 @@ const mapMatchingStrings = {
};
const spritesMatchingStrings = {
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
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',
};
const mapPath = 'assets/map.ppm';

View File

@@ -9,19 +9,7 @@ It thus should be able to run on the architecture and ISA the players have built
The `main` branch contains a minimal implementation of the game.
The following branches contains variations, allowing comparisons of performances, visuals, gameplay, ...
- `res-0-prerendered`:
- `80x60` screen resolution
- `5x5` tile resolution
- initial screen prerendered
- no sprite rotation
- `res-2`:
- `256x192` screen resolution
- `17x17` tile resolution
- `res-2-prerendered`:
- `256x192` screen resolution
- `17x17` tile resolution
- initial screen prerendered
- no sprite rotation
- `res-2`: 256x192 screen resolution, 17x17 tile
## Build script
@@ -33,8 +21,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, double spaces and empty lines:
./build.ts | sed -r 's/\s*;.*//' | sed -r 's/^\s+//' | sed -r 's/ +/ /' | sed -r '/^\s*$/d' > result.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
```
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.

View File

@@ -1,4 +1,3 @@
; map size 16x12 (or 15x11 with margins)
pub const map.width = 15
pub const map.height = 11
pub const map.size = 165 ; 11*15

View File

@@ -1,8 +1,9 @@
; given:
; - 16x12 tiles map
; - 5x5 pixels tile
; -> 256x192 pixels screen
; -> 15x11 tiles map
; => 17x17 pixels tile
pub const scene.margin_top = 2
pub const scene.margin_bottom = 3
pub const scene.margin_left = 2
pub const scene.margin_right = 3
pub const scene.margin_left = 0
pub const scene.margin_right = 1

View File

@@ -20,7 +20,7 @@ pub const screen.mode_index = 0
pub const screen.mode_value = 2
pub const screen.offset_index = 1
pub const screen.resolution_index = 2
pub const screen.resolution_value = 0
pub const screen.resolution_value = 2
pub const screen.width = 80
pub const screen.height = 60
pub const screen.width = 256
pub const screen.height = 192

View File

@@ -1,6 +1,6 @@
pub const sprites.width = 5
pub const sprites.height = 5 ; unused as sprite are all square
pub const sprites.size = 25 ; height x width
pub const sprites.width = 17
pub const sprites.height = 17 ; unused as sprite are all square
pub const sprites.size = 289 ; height x width
pub const sprites.rotation_0 = 0
pub const sprites.rotation_90 = 1

View File

@@ -23,4 +23,4 @@ Resolution ID | Tile size (in pixels) | Comment
-- | -- | --
`0` | `5x5` | with a reminder of 5 pixels en width and 5 pixels in height.
`1` | `10x10` | with a reminder of 10w and 10h
`2` | `17x17` | no reminder
`2` | `17x17` | with a reminder of 1w and 5h