From 677019f7db86cc3a7bbf56131a55ec732ef6792d Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 24 May 2025 17:26:23 +0200 Subject: [PATCH] unit: draw now uses actor's tile and oam flags --- src/unit.s | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/unit.s b/src/unit.s index 3bb8bfd..c20d1c8 100644 --- a/src/unit.s +++ b/src/unit.s @@ -86,10 +86,15 @@ unit_demo_1_update: ; inputs ; de: actor -unit_demo_1_draw: - ld b, 0x84 ; tile - ld c, 0x00 ; flags +unit_draw: push de + ld hl, act_oam_tile + add hl, de ; hl = tile + ld a, [hl+] + + ld b, a ; tile + ld a, [hl] + ld c, a ; flags call unit_generic_draw pop de ldnull bc @@ -607,20 +612,20 @@ unit_demo_1: st_def 0x00, unit_demo_1_init, st_unit_idle act_def ACT_T_DEMO_1, 0, 1, 2, 3, 4, 6, 2, 2, 0 act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_idle - act_def_draw unit_demo_1_draw, 0x84, 0 + act_def_draw unit_draw, 0x84, 0 unit_demo_2: st_def 0x00, unit_demo_1_init, st_unit_idle act_def ACT_T_DEMO_1, 0, 1, 2, 3, 1, 5, 3, 3, 0 act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_idle - act_def_draw unit_demo_1_draw, 0x84, 0 + act_def_draw unit_draw, 0x84, 0 unit_demo_3: st_def 0x00, unit_demo_1_init, st_unit_idle act_def ACT_T_DEMO_1, 0, 1, 2, 3, 0, 5, 4, 4, 0 act_st_def NULL, NULL, st_unit_demo_1_update, st_unit_idle - act_def_draw unit_demo_1_draw, 0x84, 0 + act_def_draw unit_draw, 0x84, 0 st_unit_demo_1_update: st_def 0x00, unit_demo_1_update, st_unit_demo_1_update -- 2.30.2