defs: Added struct def for cells
authorLukas Krickl <lukas@krickl.dev>
Sun, 16 Mar 2025 20:13:33 +0000 (21:13 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 16 Mar 2025 20:13:33 +0000 (21:13 +0100)
TODO.md
src/defs.s
src/wram.s

diff --git a/TODO.md b/TODO.md
index 5b0e7a1e0d3bc4bfe9f47461d60490bdf40af210..1aa51c4c985869b28277bd818453d293331c7994 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -21,6 +21,7 @@
 [ ] industry demand (0-3)
 [ ] total population (24 bit)
 [ ] money (24 bit)
+[ ] debt (24 bit)
 
 ### per tile
 
index 20afdc3b2143f01f32227e7d4c1370bd1dc14dc2..472bc9c60a729684e18bd60abab423b395766286 100644 (file)
@@ -12,6 +12,7 @@
 #define TILE_SIZE 8
 #define MAP_W 32
 #define MAP_H 28
+#define MAP_SIZE (MAP_W * MAP_H)
 
   ; seed for the rng
   ; 8 bit signed int
 #define SRAND_INITIAL 0x19
 
 
-  ; engine flags 
-.se 1
-  ; if set to 1, call room_goto_player_pos in next blank
-.de EG_FLOAD_ROOM, 1
-
   ; game modes
   ; this is a direct index
   ; into a pointer array
 .de GM_GAME, 1
 .de GM_PAUSE, 1
 
+  ; game state cell struct 
+  ; this holds all the information 
+  ; a cell on the map has 
+.se 0
+.de c_type, 1
+.de c_tile, 1
+.de c_flags, 2
+
+  ; power that this tile can pass on 
+  ; to adjacent tiles
+.de c_power, 1
+.de c_crime, 1
+.de c_fire, 1
+.de c_occupation, 1
+.de c_other, 2
+.de c_size, 0
index 57dfc4487f9468a1a6052097d9f476d62189765b..4fa2a5e80845495128efb2c32f2e3bf843e89fe2 100644 (file)
@@ -12,24 +12,6 @@ curr_inputs: .adv 1
 prev_inputs: .adv 1
 
 
-ui_flags: .adv 1
-draw_flags: .adv 1
-
-cursor_x: .adv 1
-cursor_y: .adv 1
-
-engine_flags: .adv 1
-
-  ; tmp can be used by routines as
-  ; they see fit
-tmp: .adv 16
-  ; itmp is the same as tmp but 
-  ; for use during an interrupt
-itmp: .adv 16
-
-  ; timer for game over. when 
-  ; it reaches 0 re-start game
-game_over_timer: .adv 1
 
 game_mode: .adv 1
 
@@ -37,4 +19,22 @@ game_mode: .adv 1
   ; seed must never be 0
 srand: .adv 2
 
+  ; game state
+  ; this region holds the entire game state
+  ; everything thats needed for a savme game should be
+  ; contained here
+state:
+
+cursor_x: .adv 1
+cursor_y: .adv 1
+
+money: .adv 3
+debt: .adv 3
+demand_house: .adv 1
+demand_shop: .adv 1
+demand_factory: .adv 1
+population: .adv 3
+
+state_map: .adv c_size * MAP_SIZE
 
+state_end: