From 26281c989a3a33dcbc4a6e8f7847be26fbfc1fdb Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Tue, 21 Oct 2025 16:54:45 +0200 Subject: [PATCH] ui: wip hp draw --- src/ui.s | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/ui.s b/src/ui.s index 6003c44..4d69e14 100644 --- a/src/ui.s +++ b/src/ui.s @@ -45,9 +45,27 @@ ui_draw_player_hp: ; hl: address to draw to ; b: current hp ui_draw_hp: + ld a, b + cp a, 4 + jr c, @skip_full REL + +@full_loop: ld a, UI_TILE_HP_4 ld [hl+], a + ld a, b + sub a, 4 + ld b, a + jp c, @done ; no more hp to draw + jr @full_loop REL + +@skip_full: + + ld a, UI_TILE_HP_1 + sub a, b + ld [hl+], a + +@done: ret ; draws boss hp -- 2.30.2