Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
This commit is contained in:
@@ -28,7 +28,7 @@ ClearTileMap::
|
||||
call ByteFill
|
||||
|
||||
; Update the BG Map.
|
||||
ld a, [rLCDC]
|
||||
ldh a, [rLCDC]
|
||||
bit rLCDC_ENABLE, a
|
||||
ret z
|
||||
jp WaitBGMap
|
||||
@@ -309,12 +309,12 @@ PlaceWatashi: print_name PlaceWatashiText
|
||||
PlaceKokoWa: print_name PlaceKokoWaText
|
||||
|
||||
PlaceMoveTargetsName::
|
||||
ld a, [hBattleTurn]
|
||||
ldh a, [hBattleTurn]
|
||||
xor 1
|
||||
jr PlaceMoveUsersName.place
|
||||
|
||||
PlaceMoveUsersName::
|
||||
ld a, [hBattleTurn]
|
||||
ldh a, [hBattleTurn]
|
||||
|
||||
.place:
|
||||
push de
|
||||
@@ -599,15 +599,15 @@ TextScroll::
|
||||
|
||||
Text_WaitBGMap::
|
||||
push bc
|
||||
ld a, [hOAMUpdate]
|
||||
ldh a, [hOAMUpdate]
|
||||
push af
|
||||
ld a, 1
|
||||
ld [hOAMUpdate], a
|
||||
ldh [hOAMUpdate], a
|
||||
|
||||
call WaitBGMap
|
||||
|
||||
pop af
|
||||
ld [hOAMUpdate], a
|
||||
ldh [hOAMUpdate], a
|
||||
pop bc
|
||||
ret
|
||||
|
||||
@@ -626,7 +626,7 @@ UnloadBlinkingCursor::
|
||||
|
||||
FarString::
|
||||
ld b, a
|
||||
ld a, [hROMBank]
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
|
||||
ld a, b
|
||||
@@ -744,7 +744,7 @@ TextCommand_FAR::
|
||||
; little endian
|
||||
; [$16][addr][bank]
|
||||
|
||||
ld a, [hROMBank]
|
||||
ldh a, [hROMBank]
|
||||
push af
|
||||
|
||||
ld a, [hli]
|
||||
@@ -753,7 +753,7 @@ TextCommand_FAR::
|
||||
ld d, a
|
||||
ld a, [hli]
|
||||
|
||||
ld [hROMBank], a
|
||||
ldh [hROMBank], a
|
||||
ld [MBC3RomBank], a
|
||||
|
||||
push hl
|
||||
@@ -763,7 +763,7 @@ TextCommand_FAR::
|
||||
pop hl
|
||||
|
||||
pop af
|
||||
ld [hROMBank], a
|
||||
ldh [hROMBank], a
|
||||
ld [MBC3RomBank], a
|
||||
ret
|
||||
|
||||
@@ -905,7 +905,7 @@ TextCommand_EXIT::
|
||||
push hl
|
||||
push bc
|
||||
call GetJoypad
|
||||
ld a, [hJoyDown]
|
||||
ldh a, [hJoyDown]
|
||||
and A_BUTTON | B_BUTTON
|
||||
jr nz, .done
|
||||
ld c, 30
|
||||
@@ -986,7 +986,7 @@ TextCommand_DOTS::
|
||||
ld a, "…"
|
||||
ld [hli], a
|
||||
call GetJoypad
|
||||
ld a, [hJoyDown]
|
||||
ldh a, [hJoyDown]
|
||||
and A_BUTTON | B_BUTTON
|
||||
jr nz, .next
|
||||
ld c, 10
|
||||
|
Reference in New Issue
Block a user