mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
hBuffer -> hStackBank and hFarByte
This commit is contained in:
parent
9076d63d62
commit
1ec60810b8
@ -54,31 +54,31 @@ ByteFill::
|
||||
GetFarByte::
|
||||
; retrieve a single byte from a:hl, and return it in a.
|
||||
; bankswitch to new bank
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
; get byte from new bank
|
||||
ld a, [hl]
|
||||
ldh [hBuffer], a
|
||||
ldh [hFarByte], a
|
||||
|
||||
; bankswitch to previous bank
|
||||
pop af
|
||||
rst Bankswitch
|
||||
|
||||
; return retrieved value in a
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hFarByte]
|
||||
ret
|
||||
|
||||
GetFarHalfword::
|
||||
; retrieve a halfword from a:hl, and return it in hl.
|
||||
; bankswitch to new bank
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
; get halfword from new bank, put it in hl
|
||||
@ -92,10 +92,10 @@ GetFarHalfword::
|
||||
ret
|
||||
|
||||
FarCopyWRAM::
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [rSVBK]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
ldh [rSVBK], a
|
||||
|
||||
call CopyBytes
|
||||
@ -105,23 +105,23 @@ FarCopyWRAM::
|
||||
ret
|
||||
|
||||
GetFarWRAMByte::
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [rSVBK]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
ldh [rSVBK], a
|
||||
ld a, [hl]
|
||||
ldh [hBuffer], a
|
||||
ldh [hFarByte], a
|
||||
pop af
|
||||
ldh [rSVBK], a
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hFarByte]
|
||||
ret
|
||||
|
||||
GetFarWRAMWord::
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [rSVBK]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
ldh [rSVBK], a
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
|
@ -2,10 +2,10 @@ FarCall_de::
|
||||
; Call a:de.
|
||||
; Preserves other registers.
|
||||
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
call .de
|
||||
jr ReturnFarCall
|
||||
@ -18,10 +18,10 @@ FarCall_hl::
|
||||
; Call a:hl.
|
||||
; Preserves other registers.
|
||||
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
call FarCall_JumpToHL
|
||||
|
||||
|
12
home/gfx.asm
12
home/gfx.asm
@ -19,10 +19,10 @@ Get1bpp_2::
|
||||
ret
|
||||
|
||||
FarCopyBytesDouble_DoubleBankSwitch::
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
call FarCopyBytesDouble
|
||||
@ -135,10 +135,10 @@ DecompressRequest2bpp::
|
||||
FarCopyBytes::
|
||||
; copy bc bytes from a:hl to de
|
||||
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
call CopyBytes
|
||||
@ -151,10 +151,10 @@ FarCopyBytesDouble:
|
||||
; Copy bc bytes from a:hl to bc*2 bytes at de,
|
||||
; doubling each byte in the process.
|
||||
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
; switcheroo, de <> hl
|
||||
|
@ -1043,10 +1043,10 @@ MapTextbox::
|
||||
Call_a_de::
|
||||
; Call a:de.
|
||||
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
call .de
|
||||
|
@ -809,10 +809,10 @@ MenuTextboxWaitButton::
|
||||
ret
|
||||
|
||||
Place2DMenuItemName::
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
call PlaceString
|
||||
|
@ -107,10 +107,10 @@ MobilePrintNum::
|
||||
ret
|
||||
|
||||
FarPrintText::
|
||||
ldh [hBuffer], a
|
||||
ldh [hStackBank], a
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
ldh a, [hBuffer]
|
||||
ldh a, [hStackBank]
|
||||
rst Bankswitch
|
||||
|
||||
call PrintText
|
||||
|
Loading…
Reference in New Issue
Block a user