diff options
Diffstat (limited to 'home')
-rwxr-xr-x | home/hp_pals.asm | 17 | ||||
-rw-r--r-- | home/item.asm | 24 |
2 files changed, 32 insertions, 9 deletions
diff --git a/home/hp_pals.asm b/home/hp_pals.asm new file mode 100755 index 00000000..f8c51b4f --- /dev/null +++ b/home/hp_pals.asm @@ -0,0 +1,17 @@ +SetHPPal:: +; Set palette for hp bar pixel length e at hl. + call GetHPPal + ld [hl], d + ret + +GetHPPal:: +; Get palette for hp bar pixel length e in d. + ld d, HP_GREEN + ld a, e + cp (HP_BAR_LENGTH_PX * 50 / 100) ; 24 + ret nc + inc d ; HP_YELLOW + cp (HP_BAR_LENGTH_PX * 21 / 100) ; 10 + ret nc + inc d ; HP_RED + ret
\ No newline at end of file diff --git a/home/item.asm b/home/item.asm index d443c281..3c1d3357 100644 --- a/home/item.asm +++ b/home/item.asm @@ -1,12 +1,12 @@ DoItemEffect:: - farcall DoItemEffect_ + farcall _DoItemEffect ret CheckTossableItem:: push hl push de push bc - farcall CheckTossableItem_ + farcall _CheckTossableItem pop bc pop de pop hl @@ -18,9 +18,11 @@ TossItem:: push bc ldh a, [hROMBank] push af - ld a, BANK(TossItem_) + ld a, BANK(_TossItem) rst Bankswitch - call TossItem_ + + call _TossItem + pop bc ld a, b rst Bankswitch @@ -33,11 +35,13 @@ ReceiveItem:: push bc ldh a, [hROMBank] push af - ld a, BANK(ReceiveItem_) + ld a, BANK(_ReceiveItem) rst Bankswitch push hl push de - call ReceiveItem_ + + call _ReceiveItem + pop de pop hl pop bc @@ -52,13 +56,15 @@ CheckItem:: push bc ldh a, [hROMBank] push af - ld a, BANK(CheckItem_) + ld a, BANK(_CheckItem) rst Bankswitch - call CheckItem_ + + call _CheckItem + pop bc ld a, b rst Bankswitch pop bc pop de pop hl - ret + ret
\ No newline at end of file |