From: Lukas Krickl Date: Tue, 27 May 2025 17:57:06 +0000 (+0200) Subject: map: wip get tile sub routine X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=89011dcb556333006d7d1ed78061a5613e28121f;p=gbrg%2F.git map: wip get tile sub routine --- 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