#define THP_ICON 0x33
#define TMP_ICON 0x37
+#define THP_BAR_START 0x34
; sets up static parts of the UI
; all other parts are drawin by ui_draw
; darw mp and hp on first frame
ld a, UI_REDRAW_HP | UI_REDRAW_MP
ld [ui_flags], a
+
+ ; hp icon
+ ld hl, SCRN0_UI+SCRN_W
+ ld a, THP_ICON
+ ld [hl], a
+
+ ; mp icon
+ ld a, TMP_ICON
+ ld hl, SCRN0_UI+SCRN_W+10
+ ld [hl], a
ret
; draws a UI bar
; inputs:
; hl: screen location
- ; [de]: amount of bars to draw
+ ; [de]: ptr to hp/mp where hp/mp max is [de+1]
ui_draw_bar:
- ld a, THP_ICON
- ld [hl+], a
- inc a
+ ld a, THP_BAR_START
ld [hl+], a
inc a
ld [hl+], a
jr z, @skip REL
; draw hp UI
- ld hl, SCRN0_UI+SCRN_W
+ ld hl, SCRN0_UI+SCRN_W+1
; player hp ptr
ld de, player + player_hp
; check redraw hp flag
jr z, @no_mp_draw REL
; draw mp UI
- ld a, TMP_ICON
- ld hl, SCRN0_UI+SCRN_W+10
- ld [hl+], a
-
- ld a, THP_ICON+1 ; the bar
+ ld hl, SCRN0_UI+SCRN_W+11
+ ld a, THP_BAR_START ; the bar
ld [hl+], a
inc a