Compare commits
17 Commits
res-0-prer
...
res-2-prer
| Author | SHA1 | Date | |
|---|---|---|---|
| 9323addd1f | |||
| 70016dc7b7 | |||
| f0b43f7b7c | |||
| cdc3a8e3a1 | |||
| 4e03aada20 | |||
| 3783a98f95 | |||
| dc43e7aa0b | |||
| c7360be7fa | |||
| 356cf3fb94 | |||
| b7bc9956f9 | |||
| 5231f54c27 | |||
| aad1fa45f7 | |||
| 88f10f9f06 | |||
| 6cdb7304c2 | |||
| e6b2d8b086 | |||
| 5588d4c29a | |||
| e3cf5cdfa1 |
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.
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -1,11 +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.rotation_0 = 0
|
||||
pub const sprites.rotation_90 = 1
|
||||
pub const sprites.rotation_180 = 2
|
||||
pub const sprites.rotation_270 = 3
|
||||
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.empty = 0 ; must stay 0 (some code avoid addition when it knows the tile is empty)
|
||||
pub const sprites.unimplemented = 1
|
||||
@@ -23,4 +18,4 @@ pub const sprites.ghost_down = 8
|
||||
pub const sprites.ghost_left = 9
|
||||
|
||||
pub const sprites.coin = 10
|
||||
pub const sprites.max = 10 ; for lookup table
|
||||
pub const sprites.max = 10 ; for lookup table
|
||||
|
||||
52
src/init.asm
Normal file
52
src/init.asm
Normal 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
|
||||
@@ -40,7 +40,6 @@ pub drawing.clear_tile:
|
||||
|
||||
mov r1, r13
|
||||
load_32 r2, [r9]
|
||||
mov r3, sprites.rotation_0
|
||||
call draw_sprite
|
||||
|
||||
pop r13
|
||||
@@ -173,7 +172,7 @@ pub drawing.draw_sprite_at_map_coord:
|
||||
pop r1
|
||||
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:
|
||||
r1: screen address
|
||||
r2: sprite address
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user