From: Lukas Krickl Date: Fri, 28 Mar 2025 17:20:03 +0000 (+0100) Subject: map: reduced cell memory size X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=2acb1df94214c7c4a1d2febfa146f038421f9224;p=gbrg%2F.git map: reduced cell memory size --- diff --git a/src/defs.s b/src/defs.s index a8fc737..ea82822 100644 --- a/src/defs.s +++ b/src/defs.s @@ -26,10 +26,8 @@ ; this holds all the information ; a cell on the map has .se 0 - ; cell type + ; cell type/cell gfx .de c_type, 1 - ; cell gfx -.de c_tile, 1 .de c_flags, 1 ; power that this tile can pass on @@ -39,7 +37,6 @@ ; LO: crime rate .de c_fire_crime, 1 .de c_occupation, 1 -.de c_other, 1 ; offset to head tile for thsi tile ; if offset is 0000 this is the head tile ; head tiles are tiles that manage the state of a diff --git a/src/map.s b/src/map.s index 885ab54..ddcc259 100644 --- a/src/map.s +++ b/src/map.s @@ -30,7 +30,7 @@ tile_map_load: ld de, MAP_SIZE ; bc = destination ld hl, state_cells - inc hl ; bc = c_tile + ; hl = c_tile @loop: ld a, [bc] @@ -62,7 +62,7 @@ cells_draw_all: ld bc, SCRN0 ld hl, state_cells - inc hl ; hl = c_type + ; hl = c_tile @loop: ld a, [hl] ; load tile diff --git a/src/ui.s b/src/ui.s index af904b5..95910a5 100644 --- a/src/ui.s +++ b/src/ui.s @@ -1,11 +1,15 @@ ; inits UI ui_init: + call ui_draw ret ; update the UI ; this should only be called ; during blanking ui_draw: + ld hl, SCRN1 + ld a, 128 + ld [hl], a ret diff --git a/src/wram.s b/src/wram.s index db32aab..0a02205 100644 --- a/src/wram.s +++ b/src/wram.s @@ -11,14 +11,11 @@ curr_inputs: .adv 1 ; previous frame's inputs prev_inputs: .adv 1 - + ; ui index +ui_cursor_pos: .adv 1 game_mode: .adv st_size - ; 16 bit srand seed - ; seed must never be 0 -srand: .adv 2 - ; actors ; actors are state machines ; they get updated once a frame @@ -30,6 +27,10 @@ actor_player: .adv act_size ; contained here state: + ; 16 bit srand seed + ; seed must never be 0 +srand: .adv 2 + cursor: cursor_y: .adv 1 cursor_x: .adv 1