From ac1dc19583c791ebd33c141435226f790d6d3adc Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 4 Oct 2024 20:22:10 +0200 Subject: [PATCH] Made ui code a bit faster --- src/ui.s | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ui.s b/src/ui.s index eb1beab..ab79eed 100644 --- a/src/ui.s +++ b/src/ui.s @@ -49,6 +49,16 @@ ui_draw_bar: ld [hl+], a ret + ; sets up for drawing hp bar +ui_draw_hp_bar: + ; set up ptrs + ; draw hp UI + ld hl, SCRN0_UI+SCRN_W+1 + ; player hp ptr + ld de, player + player_hp + ; directly jump without a return + jp ui_draw_bar + ; update the UI ; this should only be called ; during blanking @@ -58,10 +68,6 @@ ui_draw: cp a, 0 jr z, @skip REL - ; draw hp UI - ld hl, SCRN0_UI+SCRN_W+1 - ; player hp ptr - ld de, player + player_hp ; check redraw hp flag and a, UI_REDRAW_HP call nz, ui_draw_bar -- 2.30.2