From a6ee20605ebc7010fe97542d880135a0705111bd Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 8 Nov 2025 17:32:25 +0100 Subject: [PATCH] tiles: tiles now call the update routine --- src/tiles.s | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/tiles.s b/src/tiles.s index c206aaf..0040986 100644 --- a/src/tiles.s +++ b/src/tiles.s @@ -83,13 +83,22 @@ tile_update_draw: ; 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 @@ -124,6 +133,14 @@ tile_get_actor: ; 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 -- 2.30.2