From 180b7b1a7e42b68621a5995ec20a6635cae2c2a8 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 4 Oct 2024 20:40:45 +0200 Subject: [PATCH] made calls to ui bar draw simpler --- src/ui.s | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/ui.s b/src/ui.s index ab79eed..76b28d4 100644 --- a/src/ui.s +++ b/src/ui.s @@ -59,6 +59,14 @@ ui_draw_hp_bar: ; directly jump without a return jp ui_draw_bar + ; sets up for darwing mp bar +ui_draw_mp_bar: + ld hl, SCRN0_UI+SCRN_W+11 + ld de, player + player_mp + + ; directly jump without a return + jp ui_draw_bar + ; update the UI ; this should only be called ; during blanking @@ -70,23 +78,12 @@ ui_draw: ; check redraw hp flag and a, UI_REDRAW_HP - call nz, ui_draw_bar + call nz, ui_draw_hp_bar ; check if we should draw mp bar ld a, [ui_flags] and a, UI_REDRAW_HP - jr z, @no_mp_draw REL - - ; draw mp UI - ld hl, SCRN0_UI+SCRN_W+11 - ld a, THP_BAR_START ; the bar - - ld [hl+], a - inc a - ld [hl+], a - inc a - ld [hl+], a -@no_mp_draw: + call nz, ui_draw_mp_bar ; set flags to 0 xor a, a -- 2.30.2