From 5a2122f456edac1a556a67ae0b6fdb48be12ec09 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 5 Oct 2024 07:51:51 +0200 Subject: [PATCH] Added atk and def icons --- src/ui.s | 28 +++++++++++++++------------- src/wram.s | 2 ++ tiles/tileset1.inc | 28 ++++++++++++++-------------- 3 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/ui.s b/src/ui.s index 76b28d4..18917c9 100644 --- a/src/ui.s +++ b/src/ui.s @@ -1,32 +1,34 @@ #define THP_ICON 0x33 #define TMP_ICON 0x37 +#define TATK_ICON 0x3B +#define TDEF_ICON 0x3C #define THP_BAR_START 0x34 ; sets up static parts of the UI ; all other parts are drawin by ui_draw ; only call during blanking ui_init: - ; draw hp string - ld hl, STR_HP - ld de, SCRN0_UI - call puts - - ; draw mp string - ld hl, STR_MP - ld de, SCRN0_UI+10 - call puts - ; 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 hl, SCRN0_UI ld a, THP_ICON ld [hl], a ; mp icon ld a, TMP_ICON + ld hl, SCRN0_UI+10 + ld [hl], a + + ; atk icon + ld hl, SCRN0_UI+SCRN_W + ld a, TATK_ICON + ld [hl], a + + ; def icon + ld a, TDEF_ICON ld hl, SCRN0_UI+SCRN_W+10 ld [hl], a @@ -53,7 +55,7 @@ ui_draw_bar: ui_draw_hp_bar: ; set up ptrs ; draw hp UI - ld hl, SCRN0_UI+SCRN_W+1 + ld hl, SCRN0_UI+1 ; player hp ptr ld de, player + player_hp ; directly jump without a return @@ -61,7 +63,7 @@ ui_draw_hp_bar: ; sets up for darwing mp bar ui_draw_mp_bar: - ld hl, SCRN0_UI+SCRN_W+11 + ld hl, SCRN0_UI+11 ld de, player + player_mp ; directly jump without a return diff --git a/src/wram.s b/src/wram.s index 1989595..ce2ba56 100644 --- a/src/wram.s +++ b/src/wram.s @@ -76,6 +76,8 @@ curr_room: .adv 2 .se 1 .de UI_REDRAW_HP, 1 .de UI_REDRAW_MP, 2 +.de UI_REDRAW_ATK, 4 +.de UI_REDRAW_DEF, 8 ui_flags: .adv 1 draw_flags: .adv 1 diff --git a/tiles/tileset1.inc b/tiles/tileset1.inc index 1ed4d69..0cd1a37 100644 --- a/tiles/tileset1.inc +++ b/tiles/tileset1.inc @@ -1683,22 +1683,22 @@ .chr 00000000 ; tile 187 .chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 +.chr 00000011 +.chr 00000112 +.chr 00001120 +.chr 00311200 +.chr 00332000 +.chr 03333000 +.chr 03300000 ; tile 188 .chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 -.chr 00000000 +.chr 03333330 +.chr 03122230 +.chr 03212230 +.chr 03211230 +.chr 03222130 +.chr 00322300 +.chr 00033000 ; tile 189 .chr 00000000 .chr 00000000 -- 2.30.2