Disambiguate some uses of wcf64/5/6

This commit is contained in:
Remy Oukaour 2018-01-11 15:36:11 -05:00
parent fd0a78d708
commit 17f34cb29c
17 changed files with 181 additions and 153 deletions

View File

@ -110,3 +110,4 @@ EVENT_LOCATION EQU $7f
const_def const_def
const JOHTO_REGION ; 0 const JOHTO_REGION ; 0
const KANTO_REGION ; 1 const KANTO_REGION ; 1
NUM_REGIONS EQU const_value

View File

@ -726,11 +726,11 @@ EggHatch_AnimationSequence: ; 1728f (5:728f)
ld c, 80 ld c, 80
call DelayFrames call DelayFrames
xor a xor a
ld [wcf64], a ld [wFrameCounter], a
ld a, [hSCX] ld a, [hSCX]
ld b, a ld b, a
.outerloop .outerloop
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
inc [hl] inc [hl]
cp 8 cp 8
@ -791,7 +791,7 @@ Hatch_LoadFrontpicPal: ; 17363 (5:7363)
jp GetSGBLayout jp GetSGBLayout
EggHatch_CrackShell: ; 1736d (5:736d) EggHatch_CrackShell: ; 1736d (5:736d)
ld a, [wcf64] ld a, [wFrameCounter]
dec a dec a
and $7 and $7
cp $7 cp $7

View File

@ -94,7 +94,7 @@ Copyright_GFPresents: ; e4579
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
ld [hSCX], a ld [hSCX], a
ld [hSCY], a ld [hSCY], a
ld a, $1 ld a, $1
@ -146,7 +146,7 @@ PlaceGameFreakPresents_0: ; e468c
; e468d ; e468d
PlaceGameFreakPresents_1: ; e468d PlaceGameFreakPresents_1: ; e468d
ld hl, wcf65 ld hl, wIntroSceneTimer
ld a, [hl] ld a, [hl]
cp $20 cp $20
jr nc, .PlaceGameFreak jr nc, .PlaceGameFreak
@ -173,7 +173,7 @@ PlaceGameFreakPresents_1: ; e468d
; e46ba ; e46ba
PlaceGameFreakPresents_2: ; e46ba PlaceGameFreakPresents_2: ; e46ba
ld hl, wcf65 ld hl, wIntroSceneTimer
ld a, [hl] ld a, [hl]
cp $40 cp $40
jr nc, .place_presents jr nc, .place_presents
@ -197,7 +197,7 @@ PlaceGameFreakPresents_2: ; e46ba
; e46dd ; e46dd
PlaceGameFreakPresents_3: ; e46dd PlaceGameFreakPresents_3: ; e46dd
ld hl, wcf65 ld hl, wIntroSceneTimer
ld a, [hl] ld a, [hl]
cp $80 cp $80
jr nc, .finish jr nc, .finish
@ -503,7 +503,7 @@ IntroScene1: ; e495b (39:495b)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -523,7 +523,7 @@ IntroScene2: ; e49d6 (39:49d6)
call PlaySFX call PlaySFX
pop af pop af
.DontPlaySound: .DontPlaySound:
ld [wcf65], a ld [wIntroSceneTimer], a
xor a xor a
call CrystalIntro_UnownFade call CrystalIntro_UnownFade
ret ret
@ -642,7 +642,7 @@ IntroScene5: ; e4a7a (39:4a7a)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -669,7 +669,7 @@ IntroScene6: ; e4af7 (39:4af7)
call PlaySFX call PlaySFX
pop af pop af
.NoUnown: .NoUnown:
ld [wcf65], a ld [wIntroSceneTimer], a
xor a xor a
call CrystalIntro_UnownFade call CrystalIntro_UnownFade
ret ret
@ -682,7 +682,7 @@ IntroScene6: ; e4af7 (39:4af7)
call PlaySFX call PlaySFX
pop af pop af
.StopUnown: .StopUnown:
ld [wcf65], a ld [wIntroSceneTimer], a
ld a, $1 ld a, $1
call CrystalIntro_UnownFade call CrystalIntro_UnownFade
ret ret
@ -758,7 +758,7 @@ IntroScene7: ; e4b3f (39:4b3f)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -907,7 +907,7 @@ IntroScene11: ; e4c86 (39:4c86)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -925,7 +925,7 @@ IntroScene12: ; e4cfa (39:4cfa)
ld c, a ld c, a
and $1f and $1f
sla a sla a
ld [wcf65], a ld [wIntroSceneTimer], a
ld a, c ld a, c
and $e0 and $e0
srl a srl a
@ -939,7 +939,7 @@ IntroScene12: ; e4cfa (39:4cfa)
and $f and $f
sla a sla a
sla a sla a
ld [wcf65], a ld [wIntroSceneTimer], a
ld a, c ld a, c
and $70 and $70
or $40 or $40
@ -1041,7 +1041,7 @@ IntroScene13: ; e4d6d (39:4d6d)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -1068,7 +1068,7 @@ IntroScene14: ; e4dfa (39:4dfa)
.asm_e4e1a .asm_e4e1a
ld a, $1 ld a, $1
ld [wcf65], a ld [wIntroSceneTimer], a
ld a, [wGlobalAnimXOffset] ld a, [wGlobalAnimXOffset]
cp $88 cp $88
jr c, .asm_e4e2c jr c, .asm_e4e2c
@ -1150,7 +1150,7 @@ IntroScene15: ; e4e40 (39:4e40)
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -1217,7 +1217,7 @@ IntroScene17: ; e4ef5 (39:4ef5)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -1299,7 +1299,7 @@ IntroScene19: ; e4f7e (39:4f7e)
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -1331,7 +1331,7 @@ IntroScene20: ; e5019 (39:5019)
and $1c and $1c
srl a srl a
srl a srl a
ld [wcf65], a ld [wIntroSceneTimer], a
xor a xor a
call Intro_Scene20_AppearUnown call Intro_Scene20_AppearUnown
ret ret
@ -1341,7 +1341,7 @@ IntroScene20: ; e5019 (39:5019)
and $1c and $1c
srl a srl a
srl a srl a
ld [wcf65], a ld [wIntroSceneTimer], a
ld a, 1 ld a, 1
call Intro_Scene20_AppearUnown call Intro_Scene20_AppearUnown
ret ret
@ -1358,7 +1358,7 @@ IntroScene21: ; e505d (39:505d)
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
@ -1461,13 +1461,13 @@ IntroScene26: ; e50bb (39:50bb)
call Intro_SetCGBPalUpdate call Intro_SetCGBPalUpdate
xor a xor a
ld [wIntroSceneFrameCounter], a ld [wIntroSceneFrameCounter], a
ld [wcf65], a ld [wIntroSceneTimer], a
call NextIntroScene call NextIntroScene
ret ret
IntroScene27: ; e512d (39:512d) IntroScene27: ; e512d (39:512d)
; Spell out C R Y S T A L with Unown. ; Spell out C R Y S T A L with Unown.
ld hl, wcf65 ld hl, wIntroSceneTimer
inc [hl] inc [hl]
ld hl, wIntroSceneFrameCounter ld hl, wIntroSceneFrameCounter
ld a, [hl] ld a, [hl]
@ -1477,7 +1477,7 @@ IntroScene27: ; e512d (39:512d)
ld c, a ld c, a
and $f and $f
ld [wcf65], a ld [wIntroSceneTimer], a
ld a, c ld a, c
and $70 and $70
swap a swap a
@ -1603,7 +1603,7 @@ CrystalIntro_UnownFade: ; e5223 (39:5223)
add hl, de add hl, de
inc hl inc hl
inc hl inc hl
ld a, [wcf65] ld a, [wIntroSceneTimer]
and %111111 and %111111
cp %011111 cp %011111
jr z, .okay jr z, .okay
@ -1714,7 +1714,7 @@ Intro_Scene20_AppearUnown: ; e5348 (39:5348)
ld hl, .pal2 ld hl, .pal2
.got_pointer .got_pointer
ld a, [wcf65] ld a, [wIntroSceneTimer]
and $7 and $7
add a add a
add a add a
@ -1784,7 +1784,7 @@ Intro_FadeUnownWordPals: ; e539d (39:539d)
rept 4 rept 4
inc hl inc hl
endr endr
ld a, [wcf65] ld a, [wIntroSceneTimer]
add a add a
ld c, a ld c, a
ld b, $0 ld b, $0

View File

@ -19,7 +19,7 @@ Special_CelebiShrineEvent: ; 4989a
ld a, $80 ld a, $80
ld [hl], a ld [hl], a
ld a, 160 ; frame count ld a, 160 ; frame count
ld [wcf64], a ld [wFrameCounter], a
ld d, $0 ld d, $0
.loop .loop
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
@ -86,7 +86,7 @@ LoadCelebiGFX: ; 49912
; 49935 ; 49935
CelebiEvent_CountDown: ; 49935 CelebiEvent_CountDown: ; 49935
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done

View File

@ -39,13 +39,13 @@ ShakeHeadbuttTree: ; 8c80a
ld [wCurrSpriteOAMAddr], a ld [wCurrSpriteOAMAddr], a
farcall DoNextFrameForAllSprites farcall DoNextFrameForAllSprites
call HideHeadbuttTree call HideHeadbuttTree
ld a, $20 ld a, 32
ld [wcf64], a ld [wFrameCounter], a
call WaitSFX call WaitSFX
ld de, SFX_SANDSTORM ld de, SFX_SANDSTORM
call PlaySFX call PlaySFX
.loop .loop
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done
@ -188,7 +188,7 @@ Cut_SpawnAnimateTree: ; 8ca23 (23:4a23)
add hl, bc add hl, bc
ld [hl], $84 ld [hl], $84
ld a, 32 ld a, 32
ld [wcf64], a ld [wFrameCounter], a
; Cut_StartWaiting ; Cut_StartWaiting
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
@ -206,7 +206,7 @@ Cut_SpawnAnimateLeaves: ; 8ca3c (23:4a3c)
ld a, $30 ld a, $30
call Cut_SpawnLeaf call Cut_SpawnLeaf
ld a, 32 ; frames ld a, 32 ; frames
ld [wcf64], a ld [wFrameCounter], a
; Cut_StartWaiting ; Cut_StartWaiting
ld hl, wJumptableIndex ld hl, wJumptableIndex
inc [hl] inc [hl]
@ -220,7 +220,7 @@ Cut_StartWaiting: ; 8ca5c (23:4a5c)
inc [hl] inc [hl]
Cut_WaitAnimSFX: ; 8ca64 (23:4a64) Cut_WaitAnimSFX: ; 8ca64 (23:4a64)
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .finished jr z, .finished
@ -336,7 +336,7 @@ FlyFromAnim: ; 8caed
add hl, bc add hl, bc
ld [hl], SPRITE_ANIM_SEQ_FLY_FROM ld [hl], SPRITE_ANIM_SEQ_FLY_FROM
ld a, 128 ld a, 128
ld [wcf64], a ld [wFrameCounter], a
.loop .loop
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
@ -374,7 +374,7 @@ FlyToAnim: ; 8cb33
add hl, bc add hl, bc
ld [hl], 11 * 8 ld [hl], 11 * 8
ld a, 64 ld a, 64
ld [wcf64], a ld [wFrameCounter], a
.loop .loop
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
@ -431,7 +431,7 @@ FlyFunction_InitGFX: ; 8cb9b (23:4b9b)
FlyFunction_FrameTimer: ; 8cbc8 (23:4bc8) FlyFunction_FrameTimer: ; 8cbc8 (23:4bc8)
call .SpawnLeaf call .SpawnLeaf
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .exit jr z, .exit

View File

@ -92,9 +92,9 @@ AnimateHallOfFame: ; 864c3
ld de, MUSIC_HALL_OF_FAME ld de, MUSIC_HALL_OF_FAME
call HallOfFame_PlayMusicDE call HallOfFame_PlayMusicDE
xor a xor a
ld [wcf64], a ld [wHallOfFameMonCounter], a
.loop .loop
ld a, [wcf64] ld a, [wHallOfFameMonCounter]
cp PARTY_LENGTH cp PARTY_LENGTH
jr nc, .done jr nc, .done
ld hl, wHallOfFameTempMon1 ld hl, wHallOfFameTempMon1
@ -108,7 +108,7 @@ AnimateHallOfFame: ; 864c3
pop hl pop hl
call .DisplayNewHallOfFamer call .DisplayNewHallOfFamer
jr c, .done jr c, .done
ld hl, wcf64 ld hl, wHallOfFameMonCounter
inc [hl] inc [hl]
jr .loop jr .loop
@ -321,7 +321,7 @@ _HallOfFamePC: ; 86650
.DisplayTeam: .DisplayTeam:
xor a xor a
ld [wcf64], a ld [wHallOfFameMonCounter], a
.next .next
call .DisplayMonAndStrings call .DisplayMonAndStrings
jr c, .start_button jr c, .start_button
@ -341,7 +341,7 @@ _HallOfFamePC: ; 86650
jr .loop jr .loop
.a_button .a_button
ld hl, wcf64 ld hl, wHallOfFameMonCounter
inc [hl] inc [hl]
jr .next jr .next
@ -356,7 +356,7 @@ _HallOfFamePC: ; 86650
.DisplayMonAndStrings: .DisplayMonAndStrings:
; Print the number of times the player has entered the Hall of Fame. ; Print the number of times the player has entered the Hall of Fame.
; If that number is above 200, print "HOF Master!" instead. ; If that number is above 200, print "HOF Master!" instead.
ld a, [wcf64] ld a, [wHallOfFameMonCounter]
cp PARTY_LENGTH cp PARTY_LENGTH
jr nc, .fail jr nc, .fail
ld hl, wHallOfFameTempMon1 ld hl, wHallOfFameTempMon1

View File

@ -86,20 +86,20 @@ Special_MagnetTrain: ; 8cc04
MagnetTrain_UpdateLYOverrides: ; 8cc99 MagnetTrain_UpdateLYOverrides: ; 8cc99
ld hl, LYOverridesBackup ld hl, LYOverridesBackup
ld c, $2f ld c, $2f
ld a, [wcf64] ld a, [wMagnetTrainOffset]
add a add a
ld [hSCX], a ld [hSCX], a
call .loadloop call .loadloop
ld c, $30 ld c, $30
ld a, [wcf65] ld a, [wMagnetTrainPosition]
call .loadloop call .loadloop
ld c, $31 ld c, $31
ld a, [wcf64] ld a, [wMagnetTrainOffset]
add a add a
call .loadloop call .loadloop
ld a, [wMagnetTrainDirection] ld a, [wMagnetTrainDirection]
ld d, a ld d, a
ld hl, wcf64 ld hl, wMagnetTrainOffset
ld a, [hl] ld a, [hl]
add d add d
add d add d
@ -147,11 +147,11 @@ MagntTrain_LoadGFX_PlayMusic: ; 8ccc9
call MagnetTrain_InitLYOverrides call MagnetTrain_InitLYOverrides
ld hl, wJumptableIndex ld hl, wJumptableIndex
xor a xor a
ld [hli], a ld [hli], a ; wJumptableIndex
ld a, [wMagnetTrainInitPosition] ld a, [wMagnetTrainInitPosition]
ld [hli], a ld [hli], a ; wMagnetTrainOffset
ld [hli], a ld [hli], a ; wMagnetTrainPosition
ld [hli], a ld [hli], a ; wMagnetTrainWaitCounter
ld de, MUSIC_MAGNET_TRAIN ld de, MUSIC_MAGNET_TRAIN
call PlayMusic2 call PlayMusic2
ret ret
@ -341,13 +341,13 @@ MagnetTrain_Jumptable: ; 8cdf7
ld [hl], $0 ld [hl], $0
call .Next call .Next
ld a, $80 ld a, $80
ld [wcf66], a ld [wMagnetTrainWaitCounter], a
ret ret
; 8ce47 ; 8ce47
.MoveTrain1: ; 8ce47 .MoveTrain1: ; 8ce47
ld hl, wMagnetTrainHoldPosition ld hl, wMagnetTrainHoldPosition
ld a, [wcf65] ld a, [wMagnetTrainPosition]
cp [hl] cp [hl]
jr z, .PrepareToHoldTrain jr z, .PrepareToHoldTrain
ld e, a ld e, a
@ -355,7 +355,7 @@ MagnetTrain_Jumptable: ; 8cdf7
xor $ff xor $ff
inc a inc a
add e add e
ld [wcf65], a ld [wMagnetTrainPosition], a
ld hl, wGlobalAnimXOffset ld hl, wGlobalAnimXOffset
ld a, [wMagnetTrainDirection] ld a, [wMagnetTrainDirection]
add [hl] add [hl]
@ -365,12 +365,12 @@ MagnetTrain_Jumptable: ; 8cdf7
.PrepareToHoldTrain: .PrepareToHoldTrain:
call .Next call .Next
ld a, $80 ld a, $80
ld [wcf66], a ld [wMagnetTrainWaitCounter], a
ret ret
; 8ce6d ; 8ce6d
.WaitScene: ; 8ce6d .WaitScene: ; 8ce6d
ld hl, wcf66 ld hl, wMagnetTrainWaitCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .DoneWaiting jr z, .DoneWaiting
@ -384,7 +384,7 @@ MagnetTrain_Jumptable: ; 8cdf7
.MoveTrain2: ; 8ce7a .MoveTrain2: ; 8ce7a
ld hl, wMagnetTrainFinalPosition ld hl, wMagnetTrainFinalPosition
ld a, [wcf65] ld a, [wMagnetTrainPosition]
cp [hl] cp [hl]
jr z, .PrepareToFinishAnim jr z, .PrepareToFinishAnim
ld e, a ld e, a
@ -395,7 +395,7 @@ MagnetTrain_Jumptable: ; 8cdf7
ld a, e ld a, e
add d add d
add d add d
ld [wcf65], a ld [wMagnetTrainPosition], a
ld hl, wGlobalAnimXOffset ld hl, wGlobalAnimXOffset
ld a, [wMagnetTrainDirection] ld a, [wMagnetTrainDirection]
ld d, a ld d, a

View File

@ -146,7 +146,7 @@ Special_BankOfMom: ; 16218
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld a, $5 ld a, $5
ld [wcf64], a ld [wMomBankDigitCursorPosition], a
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
call Mom_SetUpDepositMenu call Mom_SetUpDepositMenu
call Mom_Wait10Frames call Mom_Wait10Frames
@ -213,7 +213,7 @@ Special_BankOfMom: ; 16218
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld a, $5 ld a, $5
ld [wcf64], a ld [wMomBankDigitCursorPosition], a
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
call Mom_SetUpWithdrawMenu call Mom_SetUpWithdrawMenu
call Mom_Wait10Frames call Mom_Wait10Frames

View File

@ -421,7 +421,7 @@ KrisDepositItemMenu: ; 0x1588b
farcall DepositSellInitPackBuffers farcall DepositSellInitPackBuffers
.loop .loop
farcall DepositSellPack farcall DepositSellPack
ld a, [wcf66] ld a, [wPackUsedItem]
and a and a
jr z, .close jr z, .close
call .TryDepositItem call .TryDepositItem

View File

@ -785,7 +785,7 @@ SellMenu: ; 15eb3
farcall DepositSellInitPackBuffers farcall DepositSellInitPackBuffers
.loop .loop
farcall DepositSellPack farcall DepositSellPack
ld a, [wcf66] ld a, [wPackUsedItem]
and a and a
jp z, .quit jp z, .quit
call .TryToSellItem call .TryToSellItem

View File

@ -490,7 +490,7 @@ NamingScreenJoypadLoop: ; 11915
ret ret
.select .select
ld hl, wcf64 ld hl, wNamingScreenLetterCase
ld a, [hl] ld a, [hl]
xor 1 xor 1
ld [hl], a ld [hl], a
@ -922,7 +922,7 @@ LoadNamingScreenGFX: ; 11c51
ld [hSCX], a ld [hSCX], a
ld [wGlobalAnimXOffset], a ld [wGlobalAnimXOffset], a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wcf64], a ld [wNamingScreenLetterCase], a
ld [hBGMapMode], a ld [hBGMapMode], a
ld [wNamingScreenCurrNameLength], a ld [wNamingScreenCurrNameLength], a
ld a, $7 ld a, $7
@ -1218,9 +1218,9 @@ INCBIN "gfx/icons/mail2.2bpp"
ret ret
.select .select
ld hl, wcf64 ld hl, wNamingScreenLetterCase
ld a, [hl] ld a, [hl]
xor $1 xor 1
ld [hl], a ld [hl], a
jr nz, .switch_to_lowercase jr nz, .switch_to_lowercase
ld de, MailEntry_Uppercase ld de, MailEntry_Uppercase

View File

@ -59,7 +59,7 @@ Pack: ; 10000
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call Pack_InitGFX call Pack_InitGFX
ld a, [wcf64] ld a, [wPackJumptableIndex]
ld [wJumptableIndex], a ld [wJumptableIndex], a
call Pack_InitColors call Pack_InitColors
ret ret
@ -634,7 +634,7 @@ GiveItem: ; 103fd
.give .give
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
push af push af
ld a, [wcf64] ld a, [wPackJumptableIndex]
push af push af
call GetCurNick call GetCurNick
ld hl, StringBuffer1 ld hl, StringBuffer1
@ -643,7 +643,7 @@ GiveItem: ; 103fd
call CopyBytes call CopyBytes
call TryGiveItemToPartymon call TryGiveItemToPartymon
pop af pop af
ld [wcf64], a ld [wPackJumptableIndex], a
pop af pop af
ld [wJumptableIndex], a ld [wJumptableIndex], a
.finish .finish
@ -718,7 +718,7 @@ BattlePack: ; 10493
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call Pack_InitGFX call Pack_InitGFX
ld a, [wcf64] ld a, [wPackJumptableIndex]
ld [wJumptableIndex], a ld [wJumptableIndex], a
call Pack_InitColors call Pack_InitColors
ret ret
@ -963,15 +963,16 @@ TMHMSubmenu: ; 105dc (4:45dc)
InitPackBuffers: ; 1068a InitPackBuffers: ; 1068a
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
; pocket id -> jumptable index
ld a, [wLastPocket] ld a, [wLastPocket]
maskbits NUM_POCKETS +- 1 maskbits NUM_POCKETS +- 1
ld [wCurrPocket], a ld [wCurrPocket], a
inc a inc a
add a add a
dec a dec a
ld [wcf64], a ld [wPackJumptableIndex], a
xor a xor a ; FALSE
ld [wcf66], a ld [wPackUsedItem], a
xor a xor a
ld [wSwitchItem], a ld [wSwitchItem], a
ret ret
@ -980,10 +981,10 @@ InitPackBuffers: ; 1068a
DepositSellInitPackBuffers: ; 106a5 DepositSellInitPackBuffers: ; 106a5
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld [wJumptableIndex], a ld [wJumptableIndex], a ; PACKSTATE_INITGFX
ld [wcf64], a ld [wPackJumptableIndex], a ; PACKSTATE_INITGFX
ld [wCurrPocket], a ld [wCurrPocket], a ; ITEM_POCKET
ld [wcf66], a ld [wPackUsedItem], a
ld [wSwitchItem], a ld [wSwitchItem], a
call Pack_InitGFX call Pack_InitGFX
call Pack_InitColors call Pack_InitColors
@ -1096,13 +1097,13 @@ DepositSellTutorial_InterpretJoypad: ; 1076f
.a_button .a_button
ld a, TRUE ld a, TRUE
ld [wcf66], a ld [wPackUsedItem], a
and a and a
ret ret
.b_button .b_button
xor a xor a ; FALSE
ld [wcf66], a ld [wPackUsedItem], a
and a and a
ret ret
@ -1141,8 +1142,8 @@ TutorialPack: ; 107bb
call .RunJumptable call .RunJumptable
call DepositSellTutorial_InterpretJoypad call DepositSellTutorial_InterpretJoypad
jr c, .loop jr c, .loop
xor a xor a ; FALSE
ld [wcf66], a ld [wPackUsedItem], a
ret ret
; 107d7 ; 107d7
@ -1269,15 +1270,15 @@ Pack_GetJumptablePointer: ; 1086b
Pack_QuitNoScript: ; 10874 (4:4874) Pack_QuitNoScript: ; 10874 (4:4874)
ld hl, wJumptableIndex ld hl, wJumptableIndex
set 7, [hl] set 7, [hl]
xor a xor a ; FALSE
ld [wcf66], a ld [wPackUsedItem], a
ret ret
Pack_QuitRunScript: ; 1087e (4:487e) Pack_QuitRunScript: ; 1087e (4:487e)
ld hl, wJumptableIndex ld hl, wJumptableIndex
set 7, [hl] set 7, [hl]
ld a, TRUE ld a, TRUE
ld [wcf66], a ld [wPackUsedItem], a
ret ret
Pack_PrintTextNoScroll: ; 10889 (4:4889) Pack_PrintTextNoScroll: ; 10889 (4:4889)
@ -1363,7 +1364,7 @@ Pack_InterpretJoypad: ; 108d4 (4:48d4)
.d_left .d_left
ld a, b ld a, b
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wcf64], a ld [wPackJumptableIndex], a
push de push de
ld de, SFX_SWITCH_POCKETS ld de, SFX_SWITCH_POCKETS
call PlaySFX call PlaySFX
@ -1374,7 +1375,7 @@ Pack_InterpretJoypad: ; 108d4 (4:48d4)
.d_right .d_right
ld a, c ld a, c
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wcf64], a ld [wPackJumptableIndex], a
push de push de
ld de, SFX_SWITCH_POCKETS ld de, SFX_SWITCH_POCKETS
call PlaySFX call PlaySFX

View File

@ -87,8 +87,8 @@ InitPokedex: ; 40063
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld [wDexEntryPrevJumptableIndex], a ld [wPrevDexEntryJumptableIndex], a
ld [wcf65], a ld [wPrevDexEntryBackup], a
ld [wcf66], a ld [wcf66], a
call Pokedex_CheckUnlockedUnownMode call Pokedex_CheckUnlockedUnownMode
@ -119,7 +119,7 @@ Pokedex_CheckUnlockedUnownMode: ; 400a2
Pokedex_InitCursorPosition: ; 400b4 Pokedex_InitCursorPosition: ; 400b4
ld hl, wPokedexOrder ld hl, wPokedexOrder
ld a, [wLastDexEntry] ld a, [wPrevDexEntry]
and a and a
jr z, .done jr z, .done
cp NUM_POKEMON + 1 cp NUM_POKEMON + 1
@ -291,7 +291,7 @@ Pokedex_UpdateMainScreen: ; 401ae (10:41ae)
ld a, DEXSTATE_DEX_ENTRY_SCR ld a, DEXSTATE_DEX_ENTRY_SCR
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld a, DEXSTATE_MAIN_SCR ld a, DEXSTATE_MAIN_SCR
ld [wDexEntryPrevJumptableIndex], a ld [wPrevDexEntryJumptableIndex], a
ret ret
.select .select
@ -332,7 +332,7 @@ Pokedex_InitDexEntryScreen: ; 40217 (10:4217)
call Pokedex_DrawDexEntryScreenBG call Pokedex_DrawDexEntryScreenBG
call Pokedex_InitArrowCursor call Pokedex_InitArrowCursor
call Pokedex_GetSelectedMon call Pokedex_GetSelectedMon
ld [wLastDexEntry], a ld [wPrevDexEntry], a
farcall DisplayDexEntry farcall DisplayDexEntry
call Pokedex_DrawFootprint call Pokedex_DrawFootprint
call WaitBGMap call WaitBGMap
@ -377,7 +377,7 @@ Pokedex_UpdateDexEntryScreen: ; 40258 (10:4258)
.max_volume .max_volume
call MaxVolume call MaxVolume
ld a, [wDexEntryPrevJumptableIndex] ld a, [wPrevDexEntryJumptableIndex]
ld [wJumptableIndex], a ld [wJumptableIndex], a
ret ret
@ -386,7 +386,7 @@ Pokedex_Page: ; 40292
xor $1 xor $1
ld [wPokedexStatus], a ld [wPokedexStatus], a
call Pokedex_GetSelectedMon call Pokedex_GetSelectedMon
ld [wLastDexEntry], a ld [wPrevDexEntry], a
farcall DisplayDexEntry farcall DisplayDexEntry
call WaitBGMap call WaitBGMap
ret ret
@ -402,7 +402,7 @@ Pokedex_ReinitDexEntryScreen: ; 402aa (10:42aa)
call Pokedex_InitArrowCursor call Pokedex_InitArrowCursor
call Pokedex_LoadCurrentFootprint call Pokedex_LoadCurrentFootprint
call Pokedex_GetSelectedMon call Pokedex_GetSelectedMon
ld [wLastDexEntry], a ld [wPrevDexEntry], a
farcall DisplayDexEntry farcall DisplayDexEntry
call Pokedex_DrawFootprint call Pokedex_DrawFootprint
call Pokedex_LoadSelectedMonTiles call Pokedex_LoadSelectedMonTiles
@ -475,9 +475,9 @@ DexEntryScreen_MenuActionJumptable: ; 402f2
call Pokedex_ApplyPrintPals call Pokedex_ApplyPrintPals
xor a xor a
ld [hSCX], a ld [hSCX], a
ld a, [wcf65] ld a, [wPrevDexEntryBackup]
push af push af
ld a, [wDexEntryPrevJumptableIndex] ld a, [wPrevDexEntryJumptableIndex]
push af push af
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
push af push af
@ -485,9 +485,9 @@ DexEntryScreen_MenuActionJumptable: ; 402f2
pop af pop af
ld [wJumptableIndex], a ld [wJumptableIndex], a
pop af pop af
ld [wDexEntryPrevJumptableIndex], a ld [wPrevDexEntryJumptableIndex], a
pop af pop af
ld [wcf65], a ld [wPrevDexEntryBackup], a
call ClearBGPalettes call ClearBGPalettes
call DisableLCD call DisableLCD
call Pokedex_LoadInvertedFont call Pokedex_LoadInvertedFont
@ -697,8 +697,8 @@ Pokedex_UpdateSearchScreen: ; 40471 (10:4471)
ld [wDexListingScrollOffsetBackup], a ld [wDexListingScrollOffsetBackup], a
ld a, [wDexListingCursor] ld a, [wDexListingCursor]
ld [wDexListingCursorBackup], a ld [wDexListingCursorBackup], a
ld a, [wLastDexEntry] ld a, [wPrevDexEntry]
ld [wcf65], a ld [wPrevDexEntryBackup], a
xor a xor a
ld [wDexListingScrollOffset], a ld [wDexListingScrollOffset], a
ld [wDexListingCursor], a ld [wDexListingCursor], a
@ -773,7 +773,7 @@ Pokedex_UpdateSearchResultsScreen: ; 40562 (10:4562)
ld a, DEXSTATE_DEX_ENTRY_SCR ld a, DEXSTATE_DEX_ENTRY_SCR
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld a, DEXSTATE_SEARCH_RESULTS_SCR ld a, DEXSTATE_SEARCH_RESULTS_SCR
ld [wDexEntryPrevJumptableIndex], a ld [wPrevDexEntryJumptableIndex], a
ret ret
.return_to_search_screen .return_to_search_screen
@ -781,8 +781,8 @@ Pokedex_UpdateSearchResultsScreen: ; 40562 (10:4562)
ld [wDexListingScrollOffset], a ld [wDexListingScrollOffset], a
ld a, [wDexListingCursorBackup] ld a, [wDexListingCursorBackup]
ld [wDexListingCursor], a ld [wDexListingCursor], a
ld a, [wcf65] ld a, [wPrevDexEntryBackup]
ld [wLastDexEntry], a ld [wPrevDexEntry], a
call Pokedex_BlackOutBG call Pokedex_BlackOutBG
call ClearSprites call ClearSprites
call Pokedex_OrderMonsByMode call Pokedex_OrderMonsByMode

View File

@ -87,9 +87,9 @@ PokeGear: ; 90b8d (24:4b8d)
ld [rLCDC], a ld [rLCDC], a
call TownMap_InitCursorAndPlayerIconPositions call TownMap_InitCursorAndPlayerIconPositions
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a ; POKEGEARSTATE_CLOCKINIT
ld [wcf64], a ld [wPokegearCard], a ; POKEGEARCARD_CLOCK
ld [wcf65], a ld [wPokegearMapRegion], a ; JOHTO_REGION
ld [wcf66], a ld [wcf66], a
ld [wPokegearPhoneScrollPosition], a ld [wPokegearPhoneScrollPosition], a
ld [wPokegearPhoneCursorPosition], a ld [wPokegearPhoneCursorPosition], a
@ -173,7 +173,7 @@ InitPokegearModeIndicatorArrow: ; 90d32 (24:4d32)
ret ret
AnimatePokegearModeIndicatorArrow: ; 90d41 (24:4d41) AnimatePokegearModeIndicatorArrow: ; 90d41 (24:4d41)
ld hl, wcf64 ld hl, wPokegearCard
ld e, [hl] ld e, [hl]
ld d, 0 ld d, 0
ld hl, .XCoords ld hl, .XCoords
@ -239,8 +239,8 @@ TownMap_InitCursorAndPlayerIconPositions: ; 90d70 (24:4d70)
Pokegear_InitJumptableIndices: ; 90d9e (24:4d9e) Pokegear_InitJumptableIndices: ; 90d9e (24:4d9e)
ld a, POKEGEARSTATE_CLOCKINIT ld a, POKEGEARSTATE_CLOCKINIT
ld [wJumptableIndex], a ld [wJumptableIndex], a
xor a xor a ; POKEGEARCARD_CLOCK
ld [wcf64], a ld [wPokegearCard], a
ret ret
InitPokegearTilemap: ; 90da8 (24:4da8) InitPokegearTilemap: ; 90da8 (24:4da8)
@ -250,7 +250,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
ld bc, TileMapEnd - TileMap ld bc, TileMapEnd - TileMap
ld a, $4f ld a, $4f
call ByteFill call ByteFill
ld a, [wcf64] ld a, [wPokegearCard]
maskbits NUM_POKEGEAR_CARDS +- 1 maskbits NUM_POKEGEAR_CARDS +- 1
add a add a
ld e, a ld e, a
@ -267,7 +267,7 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
.return_from_jumptable .return_from_jumptable
call Pokegear_FinishTilemap call Pokegear_FinishTilemap
farcall TownMapPals farcall TownMapPals
ld a, [wcf65] ld a, [wPokegearMapRegion]
and a and a
jr nz, .kanto_0 jr nz, .kanto_0
xor a ; LOW(vBGMap0) xor a ; LOW(vBGMap0)
@ -288,10 +288,10 @@ InitPokegearTilemap: ; 90da8 (24:4da8)
.finish .finish
ld [hWY], a ld [hWY], a
; swap region maps ; swap region maps
ld a, [wcf65] ld a, [wPokegearMapRegion]
and 1 maskbits NUM_REGIONS +- 1
xor 1 xor 1
ld [wcf65], a ld [wPokegearMapRegion], a
ret ret
.UpdateBGMap: ; 90e00 (24:4e00) .UpdateBGMap: ; 90e00 (24:4e00)
@ -1361,7 +1361,7 @@ Pokegear_SwitchPage: ; 91480 (24:5480)
ld a, c ld a, c
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld a, b ld a, b
ld [wcf64], a ld [wPokegearCard], a
call DeleteSpriteAnimStruct2ToEnd call DeleteSpriteAnimStruct2ToEnd
ret ret

View File

@ -503,7 +503,7 @@ StartMenu_Pack: ; 1295b
call FadeToMenu call FadeToMenu
farcall Pack farcall Pack
ld a, [wcf66] ld a, [wPackUsedItem]
and a and a
jr nz, .used_item jr nz, .used_item
call CloseSubmenu call CloseSubmenu

View File

@ -398,8 +398,8 @@ TradeAnim_InitTubeAnim: ; 2914e
call DmgToCgbObjPal0 call DmgToCgbObjPal0
call TradeAnim_IncrementJumptableIndex call TradeAnim_IncrementJumptableIndex
ld a, $5c ld a, 92
ld [wcf64], a ld [wFrameCounter], a
ret ret
; 291af ; 291af
@ -486,8 +486,8 @@ TradeAnim_TubeToPlayer5: ; 29211
TradeAnim_TubeToOT6: TradeAnim_TubeToOT6:
TradeAnim_TubeToPlayer6: ; 29220 TradeAnim_TubeToPlayer6: ; 29220
ld a, $80 ld a, 128
ld [wcf64], a ld [wFrameCounter], a
call TradeAnim_IncrementJumptableIndex call TradeAnim_IncrementJumptableIndex
ret ret
@ -522,7 +522,7 @@ TradeAnim_TubeToOT7:
TradeAnim_TubeToPlayer2: TradeAnim_TubeToPlayer2:
TradeAnim_TubeToPlayer7: ; 2925d TradeAnim_TubeToPlayer7: ; 2925d
call TradeAnim_FlashBGPals call TradeAnim_FlashBGPals
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done
@ -1126,8 +1126,8 @@ TradeAnim_RockingBall: ; 2961b
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
call TradeAnim_AdvanceScriptPointer call TradeAnim_AdvanceScriptPointer
ld a, $20 ld a, 32
ld [wcf64], a ld [wFrameCounter], a
ret ret
; 2962c ; 2962c
@ -1143,8 +1143,8 @@ TradeAnim_DropBall: ; 2962c
add hl, bc add hl, bc
ld [hl], $dc ld [hl], $dc
call TradeAnim_AdvanceScriptPointer call TradeAnim_AdvanceScriptPointer
ld a, $38 ld a, 56
ld [wcf64], a ld [wFrameCounter], a
ret ret
; 29649 ; 29649
@ -1154,8 +1154,8 @@ TradeAnim_Poof: ; 29649
ld a, SPRITE_ANIM_INDEX_TRADE_POOF ld a, SPRITE_ANIM_INDEX_TRADE_POOF
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
call TradeAnim_AdvanceScriptPointer call TradeAnim_AdvanceScriptPointer
ld a, $10 ld a, 16
ld [wcf64], a ld [wFrameCounter], a
ld de, SFX_BALL_POOF ld de, SFX_BALL_POOF
call PlaySFX call PlaySFX
ret ret
@ -1169,8 +1169,8 @@ TradeAnim_BulgeThroughTube: ; 29660
ld a, SPRITE_ANIM_INDEX_TRADE_TUBE_BULGE ld a, SPRITE_ANIM_INDEX_TRADE_TUBE_BULGE
call _InitSpriteAnimStruct call _InitSpriteAnimStruct
call TradeAnim_AdvanceScriptPointer call TradeAnim_AdvanceScriptPointer
ld a, $40 ld a, 64
ld [wcf64], a ld [wFrameCounter], a
ret ret
; 29676 ; 29676
@ -1547,7 +1547,7 @@ LoadTradeBubbleGFX: ; 2985a
; 29879 ; 29879
TradeAnim_WaitAnim: ; 29879 TradeAnim_WaitAnim: ; 29879
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done
@ -1561,7 +1561,7 @@ TradeAnim_WaitAnim: ; 29879
; 29886 ; 29886
TradeAnim_WaitAnim2: ; 29886 TradeAnim_WaitAnim2: ; 29886
ld hl, wcf64 ld hl, wFrameCounter
ld a, [hl] ld a, [hl]
and a and a
jr z, .done jr z, .done

View File

@ -152,7 +152,7 @@ wMapTimeOfDay:: db
wPrinterConnectionOpen:: db wPrinterConnectionOpen:: db
wPrinterOpcode:: db wPrinterOpcode:: db
wLastDexEntry:: db wPrevDexEntry:: db
wDisableTextAcceleration:: db wDisableTextAcceleration:: db
wPreviousLandmark:: db wPreviousLandmark:: db
wCurrentLandmark:: db wCurrentLandmark:: db
@ -1302,8 +1302,8 @@ wNamedObjectTypeBuffer:: db
ds 1 ds 1
wBattleTowerBattleEnded::
wJumptableIndex:: wJumptableIndex::
wBattleTowerBattleEnded::
db db
UNION ; cf64 UNION ; cf64
@ -1315,7 +1315,11 @@ wcf66:: db
NEXTU ; cf64 NEXTU ; cf64
; intro and title data ; intro and title data
wIntroSceneFrameCounter:: db wIntroSceneFrameCounter:: db
UNION ; cf65
wIntroSceneTimer:: db
NEXTU ; cf65
wTitleScreenTimer:: dw wTitleScreenTimer:: dw
ENDU
NEXTU ; cf64 NEXTU ; cf64
; credits data ; credits data
@ -1323,38 +1327,60 @@ wCreditsBorderFrame:: db
wCreditsBorderMon:: db wCreditsBorderMon:: db
wCreditsLYOverride:: db wCreditsLYOverride:: db
NEXTU ; cf64
; unown puzzle data
wHoldingUnownPuzzlePiece:: db
wUnownPuzzleCursorPosition:: db
wUnownPuzzleHeldPiece:: db
NEXTU ; cf64
; card flip data
wCardFlipCursorY:: db
wCardFlipCursorX:: db
wCardFlipWhichCard:: db
NEXTU ; cf64 NEXTU ; cf64
; pokedex ; pokedex
wDexEntryPrevJumptableIndex:: db wPrevDexEntryJumptableIndex:: db
if !DEF(_CRYSTAL11) if DEF(_CRYSTAL11)
wPrevDexEntryBackup:: db
else
wPrevDexEntryBackup::
wPokedexStatus:: db wPokedexStatus:: db
endc endc
NEXTU ; cf64
; pokegear
wPokegearCard:: db
wPokegearMapRegion:: db
NEXTU ; cf64
; pack
wPackJumptableIndex:: db
wCurrPocket:: db
wPackUsedItem:: db
NEXTU ; cf64 NEXTU ; cf64
; trainer card badges ; trainer card badges
wTrainerCardBadgeFrameCounter:: db wTrainerCardBadgeFrameCounter:: db
wTrainerCardBadgeTileID:: db wTrainerCardBadgeTileID:: db
wTrainerCardBadgeAttributes:: db wTrainerCardBadgeAttributes:: db
NEXTU ; cf64
; card flip data
wCardFlipCursorY:: db
wCardFlipCursorX:: db
wCardFlipWhichCard:: db
NEXTU ; cf64
; magnet train
wMagnetTrainOffset:: db
wMagnetTrainPosition:: db
wMagnetTrainWaitCounter:: db
NEXTU ; cf64
; unown puzzle data
wHoldingUnownPuzzlePiece:: db
wUnownPuzzleCursorPosition:: db
wUnownPuzzleHeldPiece:: db
NEXTU ; cf64 NEXTU ; cf64
; miscellaneous ; miscellaneous
wFrameCounter::
wNrOfBeatenBattleTowerTrainers:: wNrOfBeatenBattleTowerTrainers::
wMomBankDigitCursorPosition:: wMomBankDigitCursorPosition::
wNamingScreenLetterCase::
wHallOfFameMonCounter::
wSlotsDelay:: wSlotsDelay::
db db
wCurrPocket::
wPrinterQueueLength:: wPrinterQueueLength::
db db
ENDU ; cf67 ENDU ; cf67