Replace raw hex values with HRAM constants

To do: turn constants into labels and use ldh
This commit is contained in:
Rangi 2020-07-03 22:11:35 -04:00
parent 35deb77113
commit 6ef36800b0
65 changed files with 311 additions and 248 deletions

View file

@ -566,11 +566,11 @@ ShowPokedexDataInternal:
pop hl
inc hl ; hl = address of pokedex description text
coord bc, 1, 11
ld a, 2
ld [$fff4], a
ld a, %10
ld [hClearLetterPrintingDelayFlags], a
call TextCommandProcessor ; print pokedex description text
xor a
ld [$fff4], a
ld [hClearLetterPrintingDelayFlags], a
.waitForButtonPress
call JoypadLowSensitivity
ld a, [hJoy5]

View file

@ -601,9 +601,9 @@ GetMonCountsForBoxesInBank:
ret
SAVCheckRandomID:
;checks if Sav file is the same by checking player's name 1st letter ($a598)
; checks if Sav file is the same by checking player's name 1st letter
; and the two random numbers generated at game beginning
;(which are stored at wPlayerID)s
; (which are stored at wPlayerID)s
ld a, $0a
ld [MBC1SRamEnable], a
ld a, $01
@ -702,7 +702,7 @@ ClearSAV:
PadSRAM_FF:
ld [MBC1SRamBank], a
ld hl, $a000
ld bc, $2000
ld hl, $a000 ; start of SRAM
ld bc, $2000 ; size of SRAM
ld a, $ff
jp FillMemory

View file

@ -77,18 +77,18 @@ HandleItemListSwapping::
cp b
jr z, .swapSameItemType
.swapDifferentItems
ld [$ff95], a ; [$ff95] = second item ID
ld [hSwapItemID], a ; save second item ID
ld a, [hld]
ld [$ff96], a ; [$ff96] = second item quantity
ld [hSwapItemQuantity], a ; save second item quantity
ld a, [de]
ld [hli], a ; put first item ID in second item slot
inc de
ld a, [de]
ld [hl], a ; put first item quantity in second item slot
ld a, [$ff96]
ld a, [hSwapItemQuantity]
ld [de], a ; put second item quantity in first item slot
dec de
ld a, [$ff95]
ld a, [hSwapItemID]
ld [de], a ; put second item ID in first item slot
xor a
ld [wMenuItemToSwap], a ; 0 means no item is currently being swapped