mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-22 23:22:26 +13:00
Specify the ldh instruction, don't turn ld into ldh
This commit is contained in:
parent
c480632d54
commit
772fcc7588
219 changed files with 2556 additions and 2556 deletions
|
|
@ -2,27 +2,27 @@ BankswitchHome::
|
|||
; switches to bank # in a
|
||||
; Only use this when in the home bank!
|
||||
ld [wBankswitchHomeTemp], a
|
||||
ld a, [hLoadedROMBank]
|
||||
ldh a, [hLoadedROMBank]
|
||||
ld [wBankswitchHomeSavedROMBank], a
|
||||
ld a, [wBankswitchHomeTemp]
|
||||
ld [hLoadedROMBank], a
|
||||
ldh [hLoadedROMBank], a
|
||||
ld [MBC1RomBank], a
|
||||
ret
|
||||
|
||||
BankswitchBack::
|
||||
; returns from BankswitchHome
|
||||
ld a, [wBankswitchHomeSavedROMBank]
|
||||
ld [hLoadedROMBank], a
|
||||
ldh [hLoadedROMBank], a
|
||||
ld [MBC1RomBank], a
|
||||
ret
|
||||
|
||||
Bankswitch::
|
||||
; self-contained bankswitch, use this when not in the home bank
|
||||
; switches to the bank in b
|
||||
ld a, [hLoadedROMBank]
|
||||
ldh a, [hLoadedROMBank]
|
||||
push af
|
||||
ld a, b
|
||||
ld [hLoadedROMBank], a
|
||||
ldh [hLoadedROMBank], a
|
||||
ld [MBC1RomBank], a
|
||||
ld bc, .Return
|
||||
push bc
|
||||
|
|
@ -30,6 +30,6 @@ Bankswitch::
|
|||
.Return
|
||||
pop bc
|
||||
ld a, b
|
||||
ld [hLoadedROMBank], a
|
||||
ldh [hLoadedROMBank], a
|
||||
ld [MBC1RomBank], a
|
||||
ret
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue