ld bc, st_ui_building_selector
ret
@not_select:
+
+ input_just BTNA
+ jr z, @not_a REL
+
+ ; place tile at cursor position
+ call cursor_place_tile
+
+ ldnull bc
+ ret
+@not_a:
@done:
ldnull bc
ret
ld a, [hl]
cp a, b
ret
+
+ ; places the current selection
+ ; at cursor_y/x
+ ; aborts if the tiel will not fit
+cursor_place_tile:
+
+ ret
; increments cell_idx every iteration
; resets cell_idx to 0 when end of cells is reached
sim_update:
- ld a, 0 ; max loop counter
-
- ; load back cell ptr from last iteration
- ld a, [cell_ptr]
- ld e, a
- ld a, [cell_ptr+1]
- ld d, a
-
; TODO
; for now we just iterate all
; cells in a single go
ld a, state_cells_end HI
cp a, d
jp nz, @loop
-
- ; finally store cell ptr
- ld e, a
- ld [cell_ptr], a
- ld d, a
- ld [cell_ptr+1], a
ret