map: reduced cell memory size
authorLukas Krickl <lukas@krickl.dev>
Fri, 28 Mar 2025 17:20:03 +0000 (18:20 +0100)
committerLukas Krickl <lukas@krickl.dev>
Fri, 28 Mar 2025 17:20:03 +0000 (18:20 +0100)
src/defs.s
src/map.s
src/ui.s
src/wram.s

index a8fc737fa80628d359c6cd113c962963196459f1..ea8282205360ea3c94c0a501c19fdbba10c4e521 100644 (file)
   ; 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 
index 885ab5427acf33ea5a4d2ac7f65b0032060301fe..ddcc2598b7d9c589a80fdceb1d0eef777e6576be 100644 (file)
--- 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_typ
+  ; hl = c_til
 
 @loop:
   ld a, [hl] ; load tile
index af904b5808e725b4bd3955c8c535287c98abac51..95910a5d6064ee754a05543cf90d8c89449f381e 100644 (file)
--- 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
index db32aabff1b3aaf88a38a51297729e18a58361a6..0a02205a807e9a3e2ff358b08b130cdc436a46fe 100644 (file)
@@ -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