aboutsummaryrefslogtreecommitdiffstats
path: root/macros/farcall.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2020-07-04 16:19:15 -0400
committerGitHub <noreply@github.com>2020-07-04 16:19:15 -0400
commit2718c36065e7eb201a149938bcdd51987c4e56b6 (patch)
tree4a1c0294193a497e15ec8e6be59390eb1f84b5d3 /macros/farcall.asm
parentMerge pull request #256 from Rangi42/master (diff)
parentUPDATE_PARTY_MENU_BLK_PACKET -> SET_PAL_PARTY_MENU_HP_BARS, and introduce SET... (diff)
downloadpokeyellow-2718c36065e7eb201a149938bcdd51987c4e56b6.tar.gz
pokeyellow-2718c36065e7eb201a149938bcdd51987c4e56b6.tar.xz
pokeyellow-2718c36065e7eb201a149938bcdd51987c4e56b6.zip
Merge pull request #257 from Rangi42/master
More reorganization
Diffstat (limited to 'macros/farcall.asm')
-rw-r--r--macros/farcall.asm37
1 files changed, 37 insertions, 0 deletions
diff --git a/macros/farcall.asm b/macros/farcall.asm
new file mode 100644
index 00000000..885f8c66
--- /dev/null
+++ b/macros/farcall.asm
@@ -0,0 +1,37 @@
+farcall EQUS "callba"
+
+callba: MACRO
+ ld b, BANK(\1)
+ ld hl, \1
+ call Bankswitch
+ENDM
+
+callab: MACRO
+ ld hl, \1
+ ld b, BANK(\1)
+ call Bankswitch
+ENDM
+
+jpba: MACRO
+ ld b, BANK(\1)
+ ld hl, \1
+ jp Bankswitch
+ENDM
+
+jpab: MACRO
+ ld hl, \1
+ ld b, BANK(\1)
+ jp Bankswitch
+ENDM
+
+homecall: MACRO
+ ld a, [hLoadedROMBank]
+ push af
+ ld a, BANK(\1)
+ ld [hLoadedROMBank], a
+ ld [MBC1RomBank], a
+ call \1
+ pop af
+ ld [hLoadedROMBank], a
+ ld [MBC1RomBank], a
+ENDM