Port homecall macro

This commit is contained in:
pikalaxalt 2016-05-27 10:41:59 -04:00
parent bfe2f6d52e
commit 789ebc7304
8 changed files with 24 additions and 77 deletions

View File

@ -386,28 +386,12 @@ CopyDataUntil:: ; 318c
; 0x3198
PrintNum:: ; 3198
ld a, [hROMBank]
push af
ld a, BANK(_PrintNum)
rst Bankswitch
call _PrintNum
pop af
rst Bankswitch
homecall _PrintNum
ret
; 31a4
MobilePrintNum:: ; 31a4
ld a, [hROMBank]
push af
ld a, BANK(_MobilePrintNum)
rst Bankswitch
call _MobilePrintNum
pop af
rst Bankswitch
homecall _MobilePrintNum
ret
; 31b0
@ -737,10 +721,10 @@ GetHPPal:: ; 3353
ld d, HP_GREEN
ld a, e
cp 24
cp (50 * 48 / 100)
ret nc
inc d ; yellow
cp 10
cp (21 * 48 / 100)
ret nc
inc d ; red
ret

View File

@ -6,13 +6,7 @@ Get2bpp_2:: ; dc9
bit 7, a
jp z, Copy2bpp
ld a, [hROMBank]
push af
ld a, BANK(_Get2bpp)
rst Bankswitch
call _Get2bpp
pop af
rst Bankswitch
homecall _Get2bpp
ret
; ddc
@ -22,13 +16,7 @@ Get1bpp_2:: ; ddc
bit 7, a
jp z, Copy1bpp
ld a, [hROMBank]
push af
ld a, BANK(_Get1bpp)
rst Bankswitch
call _Get1bpp
pop af
rst Bankswitch
homecall _Get1bpp
ret
; def

View File

@ -1,12 +1,5 @@
PrinterReceive:: ; 2057
ld a, [hROMBank]
push af
ld a, BANK(_PrinterReceive)
rst Bankswitch
call _PrinterReceive
pop af
rst Bankswitch
homecall _PrinterReceive
ret
; 2063

View File

@ -59,15 +59,7 @@ Divide:: ; 3124
push hl
push de
push bc
ld a, [hROMBank]
push af
ld a, BANK(_Divide)
rst Bankswitch
call _Divide
pop af
rst Bankswitch
homecall _Divide
pop bc
pop de
pop hl

View File

@ -341,25 +341,11 @@ Special_ReloadSpritesNoPalettes:: ; d91
FarCallSwapTextboxPalettes:: ; db1
ld a, [hROMBank]
push af
ld a, BANK(SwapTextboxPalettes)
rst Bankswitch
call SwapTextboxPalettes
pop af
rst Bankswitch
homecall SwapTextboxPalettes
ret
; dbd
FarCallScrollBGMapPalettes:: ; dbd
ld a, [hROMBank]
push af
ld a, BANK(ScrollBGMapPalettes)
rst Bankswitch
call ScrollBGMapPalettes
pop af
rst Bankswitch
homecall ScrollBGMapPalettes
ret
; dc9

View File

@ -8,14 +8,6 @@ Sine:: ; 1b11
ld e, a
ld a, [hROMBank]
push af
ld a, BANK(_Sine)
rst Bankswitch
call _Sine
pop af
rst Bankswitch
homecall _Sine
ret
; 1b1e

View File

@ -2929,7 +2929,7 @@ Play_SFX_FULL_HEAL: ; f780
ret
; f789
UseItemText ; f789
UseItemText: ; f789
ld hl, UsedItemText
call PrintText
call Play_SFX_FULL_HEAL

View File

@ -302,3 +302,15 @@ ENDC
endr
endm
homecall: MACRO
ld a, [hROMBank]
push af
ld a, BANK(\1)
rst Bankswitch
call \1
pop af
rst Bankswitch
ENDM