+ ; updates all cells
+ ; eihter until the end of the
+ ; end of the cell list is reached
+ ; or CELLS_MAX_FRAME is reached
+ ; only head cells count towards the cell update limit
+ ; increments cell_idx every iteration
+ ; resets cell_idx to 0 when end of cells is reached
+cells_update:
+ ret
+
+ ; updates a cell
+ ; does not call c_st_routine if c_head_offset != 0
+ ; inputs:
+ ; de: cell ptr
+ ; returns:
+ ; de: next cell ptr
+cell_update:
+ ret
+
; default road update state
-cell_road_head:
+cell_road_update:
ldnull bc
ret
+ ; sets up a road cell
+ ; updates the tiles
+ ; by pushing tile updates
+cell_road_init:
+ ld bc, cell_road_update
+ ret
+
cell_template_road:
- c_def C_ROAD, cell_road_head, 0, 0
+ c_def C_ROAD, cell_road_init, 0, 0
.se 0
; cell type/cell gfx
.de c_type, 1
+
+ ; if c_st_rotuine
+ ; is unsued (true for all non-head cells)
+ ; this space can be used by the head cell
+ ; to store data
+.de c_st_data, 0
; this is the same as st routine,
; but tiles do not have a timer or
; a next flag
+ ; only head cells have an update routine
+ ; if a c_st_rotuine returns a non-zero value in bc
+ ; the rotuine pointed to will be used during the next
+ ; cell update
.de c_st_routine, 2
+
.de c_flags, 1
; offset to head tile for thsi tile
; if offset is 0000 this is the head tile
+ ; updates all cells
+ ; eihter until the end of the
+ ; end of the cell list is reached
+ ; or CELLS_MAX_FRAME is reached
+ ; only head cells count towards the cell update limit
+ ; increments cell_idx every iteration
+ ; resets cell_idx to 0 when end of cells is reached
sim_update:
ret
r_food: .adv 2
r_population: .adv 2
+ ; current cell index
+ ; for cell update loop
+cell_idx: .adv 2
+
state_cells: .adv c_size * MAP_SIZE
state_cells_end: