Identify more uses of wBuffer1-6

This commit is contained in:
Rangi
2020-11-03 19:53:07 -05:00
parent 826e070f04
commit c88c4a8340
29 changed files with 327 additions and 264 deletions

View File

@@ -616,8 +616,8 @@ DayCare_InitBreeding:
xor a
ld [wEggMonItem], a
ld de, wEggMonMoves
xor a
ld [wBuffer1], a
xor a ; FALSE
ld [wSkipMovesBeforeLevelUp], a
predef FillMoves
farcall InitEggMoves
ld hl, wEggMonID

View File

@@ -17,19 +17,19 @@ HealMachineAnim:
; 1: Left (Elm's Lab)
; 2: Up (Hall of Fame)
ld a, [wScriptVar]
ld [wBuffer1], a
ld [wHealMachineAnimType], a
ldh a, [rOBP1]
ld [wBuffer2], a
ld [wHealMachineTempOBP1], a
call .DoJumptableFunctions
ld a, [wBuffer2]
ld a, [wHealMachineTempOBP1]
call DmgToCgbObjPal1
ret
.DoJumptableFunctions:
xor a
ld [wBuffer3], a
.jumpable_loop
ld a, [wBuffer1]
ld [wHealMachineAnimState], a
.jumptable_loop
ld a, [wHealMachineAnimType]
ld e, a
ld d, 0
ld hl, .Pointers
@@ -38,17 +38,17 @@ HealMachineAnim:
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wBuffer3]
ld a, [wHealMachineAnimState]
ld e, a
inc a
ld [wBuffer3], a
ld [wHealMachineAnimState], a
add hl, de
ld a, [hl]
cp HEALMACHINESTATE_FINISH
jr z, .finish
ld hl, .Jumptable
rst JumpTable
jr .jumpable_loop
jr .jumptable_loop
.finish
ret
@@ -237,7 +237,7 @@ INCLUDE "gfx/overworld/heal_machine.pal"
.PlaceHealingMachineTile:
push bc
ld a, [wBuffer1]
ld a, [wHealMachineAnimType]
bcpixel 2, 4
cp HEALMACHINE_ELMS_LAB
jr z, .okay

View File

@@ -125,7 +125,7 @@ CheckForLuckyNumberWinners:
push hl
ld d, h
ld e, l
ld hl, wBuffer1
ld hl, wMonIDDigitsBuffer
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
call PrintNum
ld hl, wLuckyNumberDigitsBuffer
@@ -135,7 +135,7 @@ CheckForLuckyNumberWinners:
ld b, 5
ld c, 0
ld hl, wLuckyNumberDigitsBuffer + 4
ld de, wBuffer1 + 4
ld de, wMonIDDigitsBuffer + 4
.loop
ld a, [de]
cp [hl]

View File

@@ -361,15 +361,15 @@ PlayerWithdrawItemMenu:
.withdraw
ld a, [wItemQuantityChangeBuffer]
ld [wBuffer1], a ; quantity
ld [wPCItemQuantityChangeBuffer], a
ld a, [wCurItemQuantity]
ld [wBuffer2], a
ld [wPCItemQuantity], a
ld hl, wNumItems
call ReceiveItem
jr nc, .PackFull
ld a, [wBuffer1]
ld a, [wPCItemQuantityChangeBuffer]
ld [wItemQuantityChangeBuffer], a
ld a, [wBuffer2]
ld a, [wPCItemQuantity]
ld [wCurItemQuantity], a
ld hl, wNumPCItems
call TossItem
@@ -490,15 +490,15 @@ PlayerDepositItemMenu:
ret
.tossable
ld a, [wBuffer1]
ld a, [wPCItemQuantityChangeBuffer]
push af
ld a, [wBuffer2]
ld a, [wPCItemQuantity]
push af
call .DepositItem
pop af
ld [wBuffer2], a
ld [wPCItemQuantity], a
pop af
ld [wBuffer1], a
ld [wPCItemQuantityChangeBuffer], a
ret
.DepositItem:
@@ -522,15 +522,15 @@ PlayerDepositItemMenu:
.ContinueDeposit:
ld a, [wItemQuantityChangeBuffer]
ld [wBuffer1], a
ld [wPCItemQuantityChangeBuffer], a
ld a, [wCurItemQuantity]
ld [wBuffer2], a
ld [wPCItemQuantity], a
ld hl, wNumPCItems
call ReceiveItem
jr nc, .NoRoomInPC
ld a, [wBuffer1]
ld a, [wPCItemQuantityChangeBuffer]
ld [wItemQuantityChangeBuffer], a
ld a, [wBuffer2]
ld a, [wPCItemQuantity]
ld [wCurItemQuantity], a
ld hl, wNumItems
call TossItem

View File

@@ -197,11 +197,11 @@ NoTreeMon:
GetTreeScore:
call .CoordScore
ld [wBuffer1], a
ld [wTreeMonCoordScore], a
call .OTIDScore
ld [wBuffer2], a
ld [wTreeMonOTIDScore], a
ld c, a
ld a, [wBuffer1]
ld a, [wTreeMonCoordScore]
sub c
jr z, .rare
jr nc, .ok