17 Commits

Author SHA1 Message Date
9323addd1f Merge branch 'res-0-prerendered' into res-2-prerendered 2026-05-01 22:16:14 +02:00
70016dc7b7 create directional variations of ghost and robot sprites 2026-05-01 22:05:07 +02:00
f0b43f7b7c add minify flag to build script 2026-04-27 12:36:00 +02:00
cdc3a8e3a1 use decimal instead of binary representation to save space
(cherry picked from commit 54ba73c177)
2026-04-25 09:15:54 +02:00
4e03aada20 update branches description 2026-04-25 07:38:02 +02:00
3783a98f95 use prerendered screen and remove sprite rotation 2026-04-25 07:35:00 +02:00
dc43e7aa0b improve sprites 2026-04-25 06:58:04 +02:00
c7360be7fa fix scene margin values 2026-04-25 06:51:26 +02:00
356cf3fb94 add colors: light gray and brown 2026-04-25 06:50:58 +02:00
b7bc9956f9 change which 8 bit color is used for dark gray 2026-04-25 06:41:56 +02:00
5231f54c27 add way to reduce build output's size 2026-04-25 05:36:20 +02:00
aad1fa45f7 add automatic padding in build script 2026-04-25 05:35:01 +02:00
88f10f9f06 replace texture jump table with dispatch table 2026-04-24 10:25:54 +02:00
6cdb7304c2 change the way static RAM variable are declared and used 2026-04-24 10:14:21 +02:00
e6b2d8b086 remove unused colors.asm const file 2026-04-24 10:14:21 +02:00
5588d4c29a update consts to reflect the new sprite size 2026-04-24 10:14:21 +02:00
e3cf5cdfa1 scale all sprites to 17x17 pixels 2026-04-24 10:14:21 +02:00
22 changed files with 66 additions and 20 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.

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

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

View File

@@ -1,8 +1,9 @@
; given: ; given:
; - 16x12 tiles map ; -> 256x192 pixels screen
; - 5x5 pixels tile ; -> 15x11 tiles map
; => 17x17 pixels tile
pub const scene.margin_top = 2 pub const scene.margin_top = 2
pub const scene.margin_bottom = 3 pub const scene.margin_bottom = 3
pub const scene.margin_left = 2 pub const scene.margin_left = 0
pub const scene.margin_right = 3 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.mode_value = 2
pub const screen.offset_index = 1 pub const screen.offset_index = 1
pub const screen.resolution_index = 2 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.width = 256
pub const screen.height = 60 pub const screen.height = 192

View File

@@ -1,11 +1,6 @@
pub const sprites.width = 5 pub const sprites.width = 17
pub const sprites.height = 5 ; unused as sprite are all square pub const sprites.height = 17 ; unused as sprite are all square
pub const sprites.size = 25 ; height x width pub const sprites.size = 289 ; height x width
pub const sprites.rotation_0 = 0
pub const sprites.rotation_90 = 1
pub const sprites.rotation_180 = 2
pub const sprites.rotation_270 = 3
pub const sprites.empty = 0 ; must stay 0 (some code avoid addition when it knows the tile is empty) pub const sprites.empty = 0 ; must stay 0 (some code avoid addition when it knows the tile is empty)
pub const sprites.unimplemented = 1 pub const sprites.unimplemented = 1

52
src/init.asm Normal file
View File

@@ -0,0 +1,52 @@
;
; Jump table initialisation
;
; r1: sprite id
; r2: pointer address
; r3: pointer value
; sprite_empty
add r1, zr, sprites.empty
lsl r2, r1, arch.instruction_increment_shift
add r2, r2, ptr.textures_addresses
add r3, zr, sprite_empty
store_32 [r2], r3
; sprite_unimplemented
add r1, zr, sprites.unimplemented
lsl r2, r1, arch.instruction_increment_shift
add r2, r2, ptr.textures_addresses
add r3, zr, sprite_unimplemented
store_32 [r2], r3
; sprite_robot
add r1, zr, sprites.robot
lsl r2, r1, arch.instruction_increment_shift
add r2, r2, ptr.textures_addresses
add r3, zr, sprite_robot
store_32 [r2], r3
; sprite_ghost
add r1, zr, sprites.ghost
lsl r2, r1, arch.instruction_increment_shift
add r2, r2, ptr.textures_addresses
add r3, zr, sprite_ghost
store_32 [r2], r3
; sprite_coin
add r1, zr, sprites.coin
lsl r2, r1, arch.instruction_increment_shift
add r2, r2, ptr.textures_addresses
add r3, zr, sprite_coin
store_32 [r2], r3
;
; Screen initialization
;
; r1 = screen parameter value
mov r1, screen.mode_index
screen r1, screen.mode_value
mov r1, screen.offset_index
add r2, zr, screen
screen r1, r2
mov r1, screen.resolution_index
screen r1, screen.resolution_value

View File

@@ -40,7 +40,6 @@ pub drawing.clear_tile:
mov r1, r13 mov r1, r13
load_32 r2, [r9] load_32 r2, [r9]
mov r3, sprites.rotation_0
call draw_sprite call draw_sprite
pop r13 pop r13
@@ -173,7 +172,7 @@ pub drawing.draw_sprite_at_map_coord:
pop r1 pop r1
ret ret
/* Draw given sprite (by address) at given screen position (by address) with given rotation /* Draw given sprite (by address) at given screen position (by address)
Inputs: Inputs:
r1: screen address r1: screen address
r2: sprite address r2: sprite address

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. `0` | `5x5` | with a reminder of 5 pixels en width and 5 pixels in height.
`1` | `10x10` | with a reminder of 10w and 10h `1` | `10x10` | with a reminder of 10w and 10h
`2` | `17x17` | no reminder `2` | `17x17` | with a reminder of 1w and 5h