; inputs:
; de: tile
tile_update:
- ; TODO: for now just inc t_tile
- ld hl, t_tile
- add hl, de
+ ld a, [de] ; load tile type
+ add a, a ; * 2 offset into table
+
+ ld b, 0
+ ld c, a ; bc = offset
+
+ ld hl, tile_update_table
+ add hl, bc
+
+ ; load ptr
+ ld a, [hl+]
+ ld b, a
ld a, [hl]
- inc a
- ld [hl], a
- ret
+ ld h, a
+ ld l, b
+ jp hl
; table of update routines
; for each tile
; inputs:
; de: tile
tile_update_empty:
+
+ ; TODO: for now just inc t_tile
+ ld hl, t_tile
+ add hl, de
+ ld a, [hl]
+ inc a
+ ld [hl], a
+ ret
ret
; updates controlled tile