From 89011dcb556333006d7d1ed78061a5613e28121f Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 27 May 2025 19:57:06 +0200 Subject: [PATCH] map: wip get tile sub routine --- src/map.s | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/map.s b/src/map.s index 58bce1e..ea237a0 100644 --- a/src/map.s +++ b/src/map.s @@ -12,8 +12,8 @@ map_init: ; inputs: ; b/c: y/x tile position ; returns: - ; a: tile - ; b: flags + ; a: flags + ; b: tile index map_get_tile: ; current map ld hl, state_cells @@ -30,10 +30,14 @@ map_get_tile: ld e, c ; add x offset c_size times .rep i, c_size, 1, add hl, de - - ; load values + ; hl should now be the correct tile + ; load values + ld a, [hl+] ; tile index + ld b, a + ld a, [hl] ; tile flags + ret ; loads a map -- 2.30.2