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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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