Identify remaining uses of wd0b5 and wd11e (#463)

This commit is contained in:
Sylvie 2024-09-18 21:41:58 -04:00 committed by GitHub
parent 613d34678b
commit 5a622f628d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 243 additions and 237 deletions

View file

@ -701,7 +701,7 @@ DoBallTossSpecialEffects:
ld a, [wIsInBattle] ld a, [wIsInBattle]
cp 2 ; is it a trainer battle? cp 2 ; is it a trainer battle?
jr z, .isTrainerBattle jr z, .isTrainerBattle
ld a, [wd11e] ld a, [wPokeBallAnimData]
cp $10 ; is the enemy pokemon the Ghost Marowak? cp $10 ; is the enemy pokemon the Ghost Marowak?
ret nz ret nz
; if the enemy pokemon is the Ghost Marowak, make it dodge during the last 3 frames ; if the enemy pokemon is the Ghost Marowak, make it dodge during the last 3 frames
@ -2032,7 +2032,7 @@ ChangeMonPic:
jr z, .playerTurn jr z, .playerTurn
ld a, [wChangeMonPicEnemyTurnSpecies] ld a, [wChangeMonPicEnemyTurnSpecies]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
xor a xor a
ld [wSpriteFlipped], a ld [wSpriteFlipped], a
call GetMonHeader call GetMonHeader
@ -2044,7 +2044,7 @@ ChangeMonPic:
push af push af
ld a, [wChangeMonPicPlayerTurnSpecies] ld a, [wChangeMonPicPlayerTurnSpecies]
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
predef LoadMonBackPic predef LoadMonBackPic
xor a ; TILEMAP_MON_PIC xor a ; TILEMAP_MON_PIC

View file

@ -1421,7 +1421,7 @@ EnemySendOutFirstMon:
call PrintText call PrintText
ld a, [wEnemyMonSpecies2] ld a, [wEnemyMonSpecies2]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld de, vFrontPic ld de, vFrontPic
call LoadMonFrontSprite call LoadMonFrontSprite
@ -1642,7 +1642,7 @@ LoadBattleMonFromParty:
ld bc, wBattleMonPP - wBattleMonLevel ld bc, wBattleMonPP - wBattleMonLevel
call CopyData call CopyData
ld a, [wBattleMonSpecies2] ld a, [wBattleMonSpecies2]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld hl, wPartyMonNicks ld hl, wPartyMonNicks
ld a, [wPlayerMonNumber] ld a, [wPlayerMonNumber]
@ -1686,7 +1686,7 @@ LoadEnemyMonFromParty:
ld bc, wEnemyMonPP - wEnemyMonLevel ld bc, wEnemyMonPP - wEnemyMonLevel
call CopyData call CopyData
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld hl, wEnemyMonNicks ld hl, wEnemyMonNicks
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
@ -2237,7 +2237,7 @@ DisplayBagMenu:
UseBagItem: UseBagItem:
; either use an item from the bag or use a safari zone item ; either use an item from the bag or use a safari zone item
ld a, [wCurItem] ld a, [wCurItem]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
call CopyToStringBuffer call CopyToStringBuffer
xor a xor a
@ -2380,7 +2380,7 @@ PartyMenuOrRockOrRun:
; enemy mon is not minimised ; enemy mon is not minimised
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld de, vFrontPic ld de, vFrontPic
call LoadMonFrontSprite call LoadMonFrontSprite
@ -3564,7 +3564,7 @@ CheckPlayerStatusConditions:
bit USING_RAGE, a ; is mon using rage? bit USING_RAGE, a ; is mon using rage?
jp z, .checkPlayerStatusConditionsDone ; if we made it this far, mon can move normally this turn jp z, .checkPlayerStatusConditionsDone ; if we made it this far, mon can move normally this turn
ld a, RAGE ld a, RAGE
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
call CopyToStringBuffer call CopyToStringBuffer
xor a xor a
@ -3654,7 +3654,7 @@ PrintMoveIsDisabledText:
res CHARGING_UP, a ; end the pokemon's res CHARGING_UP, a ; end the pokemon's
ld [de], a ld [de], a
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
ld hl, MoveIsDisabledText ld hl, MoveIsDisabledText
jp PrintText jp PrintText
@ -3728,13 +3728,13 @@ MonName1Text:
ld hl, wEnemyUsedMove ld hl, wEnemyUsedMove
.playerTurn .playerTurn
ld [hl], a ld [hl], a
ld [wd11e], a ld [wMoveGrammar], a
call DetermineExclamationPointTextNum call DetermineExclamationPointTextNum
ld a, [wMonIsDisobedient] ld a, [wMonIsDisobedient]
and a and a
ld hl, Used2Text ld hl, Used2Text
ret nz ret nz
ld a, [wd11e] ld a, [wMoveGrammar]
cp 3 cp 3
ld hl, Used2Text ld hl, Used2Text
ret c ret c
@ -3771,7 +3771,7 @@ _PrintMoveName:
text_far _MoveNameText text_far _MoveNameText
text_asm text_asm
ld hl, ExclamationPointPointerTable ld hl, ExclamationPointPointerTable
ld a, [wd11e] ; exclamation point num ld a, [wMoveGrammar]
add a add a
push bc push bc
ld b, $0 ld b, $0
@ -3819,7 +3819,7 @@ ExclamationPoint5Text:
; but the functionality didn't get removed ; but the functionality didn't get removed
DetermineExclamationPointTextNum: DetermineExclamationPointTextNum:
push bc push bc
ld a, [wd11e] ; move ID ld a, [wMoveGrammar] ; move ID
ld c, a ld c, a
ld b, $0 ld b, $0
ld hl, ExclamationPointMoveSets ld hl, ExclamationPointMoveSets
@ -3835,7 +3835,7 @@ DetermineExclamationPointTextNum:
jr .loop jr .loop
.done .done
ld a, b ld a, b
ld [wd11e], a ; exclamation point num ld [wMoveGrammar], a
pop bc pop bc
ret ret
@ -4406,7 +4406,7 @@ GetEnemyMonStat:
ld a, [wEnemyMonLevel] ld a, [wEnemyMonLevel]
ld [wCurEnemyLevel], a ld [wCurEnemyLevel], a
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld hl, wEnemyMonDVs ld hl, wEnemyMonDVs
ld de, wLoadedMonSpeedExp ld de, wLoadedMonSpeedExp
@ -4610,7 +4610,7 @@ CriticalHitTest:
jr nz, .handleEnemy jr nz, .handleEnemy
ld a, [wBattleMonSpecies] ld a, [wBattleMonSpecies]
.handleEnemy .handleEnemy
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld a, [wMonHBaseSpeed] ld a, [wMonHBaseSpeed]
ld b, a ld b, a
@ -5120,7 +5120,7 @@ MirrorMoveFailedText:
; function used to reload move data for moves like Mirror Move and Metronome ; function used to reload move data for moves like Mirror Move and Metronome
ReloadMoveData: ReloadMoveData:
ld [wd11e], a ld [wNamedObjectIndex], a
dec a dec a
ld hl, Moves ld hl, Moves
ld bc, MOVE_LENGTH ld bc, MOVE_LENGTH
@ -5625,7 +5625,7 @@ EnemyCanExecuteChargingMove:
res CHARGING_UP, [hl] ; no longer charging up for attack res CHARGING_UP, [hl] ; no longer charging up for attack
res INVULNERABLE, [hl] ; no longer invulnerable to typical attacks res INVULNERABLE, [hl] ; no longer invulnerable to typical attacks
ld a, [wEnemyMoveNum] ld a, [wEnemyMoveNum]
ld [wd0b5], a ld [wNameListIndex], a
ld a, BANK(MoveNames) ld a, BANK(MoveNames)
ld [wPredefBank], a ld [wPredefBank], a
ld a, MOVE_NAME ld a, MOVE_NAME
@ -6067,7 +6067,7 @@ CheckEnemyStatusConditions:
bit USING_RAGE, a ; is mon using rage? bit USING_RAGE, a ; is mon using rage?
jp z, .checkEnemyStatusConditionsDone ; if we made it this far, mon can move normally this turn jp z, .checkEnemyStatusConditionsDone ; if we made it this far, mon can move normally this turn
ld a, RAGE ld a, RAGE
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
call CopyToStringBuffer call CopyToStringBuffer
xor a xor a
@ -6098,7 +6098,7 @@ GetCurrentMove:
jr nz, .selected jr nz, .selected
ld a, [wPlayerSelectedMove] ld a, [wPlayerSelectedMove]
.selected .selected
ld [wd0b5], a ld [wNameListIndex], a
dec a dec a
ld hl, Moves ld hl, Moves
ld bc, MOVE_LENGTH ld bc, MOVE_LENGTH
@ -6120,7 +6120,7 @@ LoadEnemyMonData:
jp z, LoadEnemyMonFromParty jp z, LoadEnemyMonFromParty
ld a, [wEnemyMonSpecies2] ld a, [wEnemyMonSpecies2]
ld [wEnemyMonSpecies], a ld [wEnemyMonSpecies], a
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld a, [wEnemyBattleStatus3] ld a, [wEnemyBattleStatus3]
bit TRANSFORMED, a ; is enemy mon transformed? bit TRANSFORMED, a ; is enemy mon transformed?
@ -6245,16 +6245,16 @@ LoadEnemyMonData:
ld a, [hl] ; base exp ld a, [hl] ; base exp
ld [de], a ld [de], a
ld a, [wEnemyMonSpecies2] ld a, [wEnemyMonSpecies2]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, wNameBuffer ld hl, wNameBuffer
ld de, wEnemyMonNick ld de, wEnemyMonNick
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData call CopyData
ld a, [wEnemyMonSpecies2] ld a, [wEnemyMonSpecies2]
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_SET ld b, FLAG_SET

View file

@ -1262,7 +1262,7 @@ MimicEffect:
add hl, bc add hl, bc
ld a, d ld a, d
ld [hl], a ld [hl], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
call PlayCurrentMoveAnimation call PlayCurrentMoveAnimation
ld hl, MimicLearnedMoveText ld hl, MimicLearnedMoveText
@ -1309,7 +1309,7 @@ DisableEffect:
pop hl pop hl
and a and a
jr z, .pickMoveToDisable ; loop until a non-00 move slot is found jr z, .pickMoveToDisable ; loop until a non-00 move slot is found
ld [wd11e], a ; store move number ld [wNamedObjectIndex], a ; store move number
push hl push hl
ldh a, [hWhoseTurn] ldh a, [hWhoseTurn]
and a and a
@ -1354,7 +1354,7 @@ DisableEffect:
jr nz, .printDisableText jr nz, .printDisableText
inc hl ; wEnemyDisabledMoveNumber inc hl ; wEnemyDisabledMoveNumber
.printDisableText .printDisableText
ld a, [wd11e] ; move number ld a, [wNamedObjectIndex] ; move number
ld [hl], a ld [hl], a
call GetMoveName call GetMoveName
ld hl, MoveWasDisabledText ld hl, MoveWasDisabledText

View file

@ -113,8 +113,8 @@ GainExperience:
ld b, 0 ld b, 0
ld hl, wPartySpecies ld hl, wPartySpecies
add hl, bc add hl, bc
ld a, [hl] ; species ld a, [hl]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld d, MAX_LEVEL ld d, MAX_LEVEL
callfar CalcExperience ; get max exp callfar CalcExperience ; get max exp
@ -168,9 +168,9 @@ GainExperience:
ld [hl], a ld [hl], a
ld bc, wPartyMon1Species - wPartyMon1Level ld bc, wPartyMon1Species - wPartyMon1Level
add hl, bc add hl, bc
ld a, [hl] ; species ld a, [hl]
ld [wd0b5], a ld [wCurSpecies], a
ld [wd11e], a ld [wPokedexNum], a
call GetMonHeader call GetMonHeader
ld bc, (wPartyMon1MaxHP + 1) - wPartyMon1Species ld bc, (wPartyMon1MaxHP + 1) - wPartyMon1Species
add hl, bc add hl, bc
@ -251,8 +251,8 @@ GainExperience:
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
xor a ; PLAYER_PARTY_DATA xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a ld [wMonDataLocation], a
ld a, [wd0b5] ld a, [wCurSpecies]
ld [wd11e], a ld [wPokedexNum], a
predef LearnMoveFromLevelUp predef LearnMoveFromLevelUp
ld hl, wCanEvolveFlags ld hl, wCanEvolveFlags
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
@ -306,7 +306,7 @@ DivideExpDataByNumMonsGainingExp:
jr nz, .countSetBitsLoop jr nz, .countSetBitsLoop
cp $2 cp $2
ret c ; return if only one mon is gaining exp ret c ; return if only one mon is gaining exp
ld [wd11e], a ; store number of mons gaining exp ld [wTempByteValue], a ; store number of mons gaining exp
ld hl, wEnemyMonBaseStats ld hl, wEnemyMonBaseStats
ld c, wEnemyMonBaseExp + 1 - wEnemyMonBaseStats ld c, wEnemyMonBaseExp + 1 - wEnemyMonBaseStats
.divideLoop .divideLoop
@ -314,7 +314,7 @@ DivideExpDataByNumMonsGainingExp:
ldh [hDividend], a ldh [hDividend], a
ld a, [hl] ld a, [hl]
ldh [hDividend + 1], a ldh [hDividend + 1], a
ld a, [wd11e] ld a, [wTempByteValue]
ldh [hDivisor], a ldh [hDivisor], a
ld b, $2 ld b, $2
call Divide ; divide value by number of mons gaining exp call Divide ; divide value by number of mons gaining exp

View file

@ -11,7 +11,7 @@ GetTrainerName_::
jr z, .foundName jr z, .foundName
cp RIVAL3 cp RIVAL3
jr z, .foundName jr z, .foundName
ld [wd0b5], a ld [wNameListIndex], a
ld a, TRAINER_NAME ld a, TRAINER_NAME
ld [wNameListType], a ld [wNameListType], a
ld a, BANK(TrainerNames) ld a, BANK(TrainerNames)

View file

@ -8,7 +8,7 @@ FormatMovesString:
and a ; end of move list? and a ; end of move list?
jr z, .printDashLoop ; print dashes when no moves are left jr z, .printDashLoop ; print dashes when no moves are left
push hl push hl
ld [wd0b5], a ld [wNameListIndex], a
ld a, BANK(MoveNames) ld a, BANK(MoveNames)
ld [wPredefBank], a ld [wPredefBank], a
ld a, MOVE_NAME ld a, MOVE_NAME

View file

@ -116,7 +116,7 @@ TransformEffect_:
; original (unmodified) stats and stat mods ; original (unmodified) stats and stat mods
pop hl pop hl
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, wEnemyMonUnmodifiedAttack ld hl, wEnemyMonUnmodifiedAttack
ld de, wPlayerMonUnmodifiedAttack ld de, wPlayerMonUnmodifiedAttack

View file

@ -1,4 +1,4 @@
; [wd0b5] = pokemon ID ; [wCurSpecies] = pokemon ID
; hl = dest addr ; hl = dest addr
PrintMonType: PrintMonType:
call GetPredefRegisters call GetPredefRegisters

View file

@ -16,7 +16,7 @@ PrintSafariZoneBattleText:
jr nz, .done jr nz, .done
push hl push hl
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld a, [wMonHCatchRate] ld a, [wMonHCatchRate]
ld [wEnemyMonActualCatchRate], a ld [wEnemyMonActualCatchRate], a

View file

@ -732,7 +732,7 @@ AIPrintItemUse:
AIPrintItemUse_: AIPrintItemUse_:
; print "x used [wAIItem] on z!" ; print "x used [wAIItem] on z!"
ld a, [wAIItem] ld a, [wAIItem]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
ld hl, AIBattleUseItemText ld hl, AIBattleUseItemText
jp PrintText jp PrintText

View file

@ -98,7 +98,7 @@ PrintFossilsInBag:
cp $ff cp $ff
ret z ret z
push hl push hl
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
hlcoord 2, 2 hlcoord 2, 2
ldh a, [hItemCounter] ldh a, [hItemCounter]
@ -114,10 +114,10 @@ PrintFossilsInBag:
; loads the names of the fossil item and the resulting mon ; loads the names of the fossil item and the resulting mon
LoadFossilItemAndMonName:: LoadFossilItemAndMonName::
ld a, [wFossilMon] ld a, [wFossilMon]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
call CopyToStringBuffer call CopyToStringBuffer
ld a, [wFossilItem] ld a, [wFossilItem]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
ret ret

View file

@ -8,7 +8,7 @@ _DisplayPokedex::
ld c, 10 ld c, 10
call DelayFrames call DelayFrames
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_SET ld b, FLAG_SET

View file

@ -54,16 +54,16 @@ _GivePokemon::
SetPokedexOwnedFlag: SetPokedexOwnedFlag:
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
push af push af
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld hl, wPokedexOwned ld hl, wPokedexOwned
ld b, FLAG_SET ld b, FLAG_SET
predef FlagActionPredef predef FlagActionPredef
pop af pop af
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, GotMonText ld hl, GotMonText
jp PrintText jp PrintText

View file

@ -84,7 +84,7 @@ HealParty:
.done .done
xor a xor a
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld [wd11e], a ld [wUsingPPUp], a
ld a, [wPartyCount] ld a, [wPartyCount]
ld b, a ld b, a

View file

@ -14,7 +14,7 @@ HiddenItems:
ld a, 1 ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld a, [wHiddenObjectFunctionArgument] ; item ID ld a, [wHiddenObjectFunctionArgument] ; item ID
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
tx_pre_jump FoundHiddenItemText tx_pre_jump FoundHiddenItemText

View file

@ -35,7 +35,7 @@ DisplayMonFrontSpriteInBox:
call DisplayTextBoxID call DisplayTextBoxID
call UpdateSprites call UpdateSprites
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld de, vChars1 tile $31 ld de, vChars1 tile $31
call LoadMonFrontSprite call LoadMonFrontSprite

View file

@ -77,7 +77,7 @@ DoInGameTradeDialogue:
; copies name of species a to hl ; copies name of species a to hl
InGameTrade_GetMonName: InGameTrade_GetMonName:
push de push de
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, wNameBuffer ld hl, wNameBuffer
pop de pop de

View file

@ -44,7 +44,7 @@ ApplyOutOfBattlePoisonDamage:
inc hl inc hl
ld [hl], a ld [hl], a
ld a, [de] ld a, [de]
ld [wd11e], a ld [wPokedexNum], a
push de push de
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld hl, wPartyMonNicks ld hl, wPartyMonNicks

View file

@ -157,7 +157,7 @@ DisplayPokemartDialogue_::
inc a inc a
jr z, .buyMenuLoop ; if the player closed the choose quantity menu with the B button jr z, .buyMenuLoop ; if the player closed the choose quantity menu with the B button
ld a, [wCurItem] ld a, [wCurItem]
ld [wd11e], a ; store item ID for GetItemName ld [wNamedObjectIndex], a
call GetItemName call GetItemName
call CopyToStringBuffer call CopyToStringBuffer
ld hl, PokemartTellBuyPriceText ld hl, PokemartTellBuyPriceText

View file

@ -88,34 +88,34 @@ GetPrizeMenuId:
cp 2 ; is TM_menu? cp 2 ; is TM_menu?
jr nz, .putMonName jr nz, .putMonName
ld a, [wPrize1] ld a, [wPrize1]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
hlcoord 2, 4 hlcoord 2, 4
call PlaceString call PlaceString
ld a, [wPrize2] ld a, [wPrize2]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
hlcoord 2, 6 hlcoord 2, 6
call PlaceString call PlaceString
ld a, [wPrize3] ld a, [wPrize3]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
hlcoord 2, 8 hlcoord 2, 8
call PlaceString call PlaceString
jr .putNoThanksText jr .putNoThanksText
.putMonName .putMonName
ld a, [wPrize1] ld a, [wPrize1]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
hlcoord 2, 4 hlcoord 2, 4
call PlaceString call PlaceString
ld a, [wPrize2] ld a, [wPrize2]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
hlcoord 2, 6 hlcoord 2, 6
call PlaceString call PlaceString
ld a, [wPrize3] ld a, [wPrize3]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
hlcoord 2, 8 hlcoord 2, 8
call PlaceString call PlaceString
@ -189,7 +189,7 @@ HandlePrizeChoice:
ld hl, wPrize1 ld hl, wPrize1
add hl, de add hl, de
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wNamedObjectIndex], a
ld a, [wWhichPrizeWindow] ld a, [wWhichPrizeWindow]
cp 2 ; is prize a TM? cp 2 ; is prize a TM?
jr nz, .getMonName jr nz, .getMonName
@ -208,9 +208,9 @@ HandlePrizeChoice:
call HasEnoughCoins call HasEnoughCoins
jr c, .notEnoughCoins jr c, .notEnoughCoins
ld a, [wWhichPrizeWindow] ld a, [wWhichPrizeWindow]
cp $02 cp 2 ; is prize a TM?
jr nz, .giveMon jr nz, .giveMon
ld a, [wd11e] ld a, [wNamedObjectIndex]
ld b, a ld b, a
ld a, 1 ld a, 1
ld c, a ld c, a
@ -218,7 +218,7 @@ HandlePrizeChoice:
jr nc, .bagFull jr nc, .bagFull
jr .subtractCoins jr .subtractCoins
.giveMon .giveMon
ld a, [wd11e] ld a, [wNamedObjectIndex]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
push af push af
call GetPrizeMonLevel call GetPrizeMonLevel

View file

@ -258,9 +258,9 @@ WriteMonPartySpriteOAM:
jp CopyData jp CopyData
GetPartyMonSpriteID: GetPartyMonSpriteID:
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
ld c, a ld c, a
dec a dec a
srl a srl a

View file

@ -275,13 +275,13 @@ DeterminePaletteID:
ret nz ret nz
ld a, [hl] ld a, [hl]
DeterminePaletteIDOutOfBattle: DeterminePaletteIDOutOfBattle:
ld [wd11e], a ld [wPokedexNum], a
and a ; is the mon index 0? and a ; is the mon index 0?
jr z, .skipDexNumConversion jr z, .skipDexNumConversion
push bc push bc
predef IndexToPokedex predef IndexToPokedex
pop bc pop bc
ld a, [wd11e] ld a, [wPokedexNum]
.skipDexNumConversion .skipDexNumConversion
ld e, a ld e, a
ld d, 0 ld d, 0

View file

@ -510,7 +510,7 @@ ItemUseBall:
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
ld [wCapturedMonSpecies], a ld [wCapturedMonSpecies], a
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd11e], a ld [wPokedexNum], a
ld a, [wBattleType] ld a, [wBattleType]
dec a ; is this the old man battle? dec a ; is this the old man battle?
jr z, .oldManCaughtMon ; if so, don't give the player the caught Pokémon jr z, .oldManCaughtMon ; if so, don't give the player the caught Pokémon
@ -520,7 +520,7 @@ ItemUseBall:
; Add the caught Pokémon to the Pokédex. ; Add the caught Pokémon to the Pokédex.
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_TEST ld b, FLAG_TEST
@ -528,7 +528,7 @@ ItemUseBall:
predef FlagActionPredef predef FlagActionPredef
ld a, c ld a, c
push af push af
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_SET ld b, FLAG_SET
@ -542,7 +542,7 @@ ItemUseBall:
call PrintText call PrintText
call ClearSprites call ClearSprites
ld a, [wEnemyMonSpecies] ld a, [wEnemyMonSpecies]
ld [wd11e], a ld [wPokedexNum], a
predef ShowPokedexData predef ShowPokedexData
.skipShowingPokedexData .skipShowingPokedexData
@ -842,7 +842,7 @@ ItemUseMedicine:
ld d, a ld d, a
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld e, a ld e, a
ld [wd0b5], a ld [wCurSpecies], a
pop af pop af
ld [wCurItem], a ld [wCurItem], a
pop af pop af
@ -1254,8 +1254,8 @@ ItemUseMedicine:
.useVitamin .useVitamin
push hl push hl
ld a, [hl] ld a, [hl]
ld [wd0b5], a ld [wCurSpecies], a
ld [wd11e], a ld [wPokedexNum], a
ld bc, wPartyMon1Level - wPartyMon1 ld bc, wPartyMon1Level - wPartyMon1
add hl, bc ; hl now points to level add hl, bc ; hl now points to level
ld a, [hl] ; a = level ld a, [hl] ; a = level
@ -1396,7 +1396,7 @@ ItemUseMedicine:
ld a, d ld a, d
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld a, e ld a, e
ld [wd11e], a ld [wPokedexNum], a
xor a ; PLAYER_PARTY_DATA xor a ; PLAYER_PARTY_DATA
ld [wMonDataLocation], a ld [wMonDataLocation], a
call LoadMonData call LoadMonData
@ -1988,7 +1988,7 @@ ItemUsePPRestore:
call GetSelectedMoveOffset call GetSelectedMoveOffset
push hl push hl
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
call CopyToStringBuffer call CopyToStringBuffer
pop hl pop hl
@ -2009,7 +2009,7 @@ ItemUsePPRestore:
add 1 << 6 ; increase PP Up count by 1 add 1 << 6 ; increase PP Up count by 1
ld [hl], a ld [hl], a
ld a, 1 ; 1 PP Up used ld a, 1 ; 1 PP Up used
ld [wd11e], a ld [wUsingPPUp], a
call RestoreBonusPP ; add the bonus PP to current PP call RestoreBonusPP ; add the bonus PP to current PP
ld hl, PPIncreasedText ld hl, PPIncreasedText
call PrintText call PrintText
@ -2162,9 +2162,9 @@ ItemUseTMHM:
add NUM_TMS + NUM_HMS ; adjust HM IDs to come after TM IDs add NUM_TMS + NUM_HMS ; adjust HM IDs to come after TM IDs
.skipAdding .skipAdding
inc a inc a
ld [wd11e], a ld [wTempTMHM], a
predef TMToMove ; get move ID from TM/HM ID predef TMToMove ; get move ID from TM/HM ID
ld a, [wd11e] ld a, [wTempTMHM]
ld [wMoveNum], a ld [wMoveNum], a
call GetMoveName call GetMoveName
call CopyToStringBuffer call CopyToStringBuffer
@ -2558,7 +2558,7 @@ TossItem_::
jr nz, .tooImportantToToss jr nz, .tooImportantToToss
push hl push hl
ld a, [wCurItem] ld a, [wCurItem]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
call CopyToStringBuffer call CopyToStringBuffer
ld hl, IsItOKToTossItemText ld hl, IsItOKToTossItemText
@ -2578,7 +2578,7 @@ TossItem_::
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call RemoveItemFromInventory call RemoveItemFromInventory
ld a, [wCurItem] ld a, [wCurItem]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
call CopyToStringBuffer call CopyToStringBuffer
ld hl, ThrewAwayItemText ld hl, ThrewAwayItemText
@ -2651,7 +2651,7 @@ SendNewMonToBox:
inc a inc a
ld [de], a ld [de], a
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd0b5], a ld [wCurSpecies], a
ld c, a ld c, a
.loop .loop
inc de inc de
@ -2893,7 +2893,7 @@ ItemUseReloadOverworldData:
call LoadCurrentMapView call LoadCurrentMapView
jp UpdateSprites jp UpdateSprites
; creates a list at wBuffer of maps where the mon in [wd11e] can be found. ; creates a list at wBuffer of maps where the mon in [wPokedexNum] can be found.
; this is used by the pokedex to display locations the mon can be found on the map. ; this is used by the pokedex to display locations the mon can be found on the map.
FindWildLocationsOfMon: FindWildLocationsOfMon:
ld hl, WildDataPointers ld hl, WildDataPointers
@ -2928,7 +2928,7 @@ CheckMapForMon:
inc hl inc hl
ld b, NUM_WILDMONS ld b, NUM_WILDMONS
.loop .loop
ld a, [wd11e] ld a, [wPokedexNum]
cp [hl] cp [hl]
jr nz, .nextEntry jr nz, .nextEntry
ld a, c ld a, c

View file

@ -1,7 +1,7 @@
; tests if mon [wCurPartySpecies] can learn move [wMoveNum] ; tests if mon [wCurPartySpecies] can learn move [wMoveNum]
CanLearnTM: CanLearnTM:
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld hl, wMonHLearnset ld hl, wMonHLearnset
push hl push hl
@ -20,17 +20,17 @@ CanLearnTM:
ld b, FLAG_TEST ld b, FLAG_TEST
predef_jump FlagActionPredef predef_jump FlagActionPredef
; converts TM/HM number in wd11e into move number ; converts TM/HM number in [wTempTMHM] into move number
; HMs start at 51 ; HMs start at 51
TMToMove: TMToMove:
ld a, [wd11e] ld a, [wTempTMHM]
dec a dec a
ld hl, TechnicalMachines ld hl, TechnicalMachines
ld b, $0 ld b, $0
ld c, a ld c, a
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wTempTMHM], a
ret ret
INCLUDE "data/moves/tmhm_moves.asm" INCLUDE "data/moves/tmhm_moves.asm"

View file

@ -660,7 +660,7 @@ TradeCenter_PrintPartyListNames:
ld a, [de] ld a, [de]
cp $ff cp $ff
ret z ret z
ld [wd11e], a ld [wNamedObjectIndex], a
push bc push bc
push hl push hl
push de push de
@ -697,7 +697,7 @@ TradeCenter_Trade:
ld b, 0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, wNameBuffer ld hl, wNameBuffer
ld de, wNameOfPlayerMonToBeTraded ld de, wNameOfPlayerMonToBeTraded
@ -709,7 +709,7 @@ TradeCenter_Trade:
ld b, 0 ld b, 0
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, WillBeTradedText ld hl, WillBeTradedText
bccoord 1, 14 bccoord 1, 14

View file

@ -84,7 +84,7 @@ LeaguePCShowMon:
ld a, [hli] ld a, [hli]
ld [wHoFMonSpecies], a ld [wHoFMonSpecies], a
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
ld [wWholeScreenPaletteMonSpecies], a ld [wWholeScreenPaletteMonSpecies], a
ld a, [hli] ld a, [hli]

View file

@ -9,7 +9,7 @@ AskName:
ld c, 11 ld c, 11
call z, ClearScreenArea ; only if in wild battle call z, ClearScreenArea ; only if in wild battle
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, DoYouWantToNicknameText ld hl, DoYouWantToNicknameText
call PrintText call PrintText
@ -462,7 +462,7 @@ PrintNamingText:
push af push af
farcall WriteMonPartySpriteOAMBySpecies farcall WriteMonPartySpriteOAMBySpecies
pop af pop af
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
hlcoord 4, 1 hlcoord 4, 1
call PlaceString call PlaceString

View file

@ -9,7 +9,7 @@ ShowPokedexMenu:
ld [wListScrollOffset], a ld [wListScrollOffset], a
ld [wLastMenuItem], a ld [wLastMenuItem], a
inc a inc a
ld [wd11e], a ld [wPokedexNum], a
ldh [hJoy7], a ldh [hJoy7], a
.setUpGraphics .setUpGraphics
ld b, SET_PAL_GENERIC ld b, SET_PAL_GENERIC
@ -68,8 +68,8 @@ HandlePokedexSideMenu:
push af push af
add b add b
inc a inc a
ld [wd11e], a ld [wPokedexNum], a
ld a, [wd11e] ld a, [wPokedexNum]
push af push af
ld a, [wDexMaxSeenMon] ld a, [wDexMaxSeenMon]
push af ; this doesn't need to be preserved push af ; this doesn't need to be preserved
@ -111,7 +111,7 @@ HandlePokedexSideMenu:
pop af pop af
ld [wDexMaxSeenMon], a ld [wDexMaxSeenMon], a
pop af pop af
ld [wd11e], a ld [wPokedexNum], a
pop af pop af
ld [wListScrollOffset], a ld [wListScrollOffset], a
pop af pop af
@ -142,7 +142,7 @@ HandlePokedexSideMenu:
; play pokemon cry ; play pokemon cry
.choseCry .choseCry
ld a, [wd11e] ld a, [wPokedexNum]
call GetCryData call GetCryData
call PlaySound call PlaySound
jr .handleMenuInput jr .handleMenuInput
@ -222,7 +222,7 @@ HandlePokedexListMenu:
call ClearScreenArea call ClearScreenArea
hlcoord 1, 3 hlcoord 1, 3
ld a, [wListScrollOffset] ld a, [wListScrollOffset]
ld [wd11e], a ld [wPokedexNum], a
ld d, 7 ld d, 7
ld a, [wDexMaxSeenMon] ld a, [wDexMaxSeenMon]
cp 7 cp 7
@ -233,17 +233,17 @@ HandlePokedexListMenu:
; loop to print pokemon pokedex numbers and names ; loop to print pokemon pokedex numbers and names
; if the player has owned the pokemon, it puts a pokeball beside the name ; if the player has owned the pokemon, it puts a pokeball beside the name
.printPokemonLoop .printPokemonLoop
ld a, [wd11e] ld a, [wPokedexNum]
inc a inc a
ld [wd11e], a ld [wPokedexNum], a
push af push af
push de push de
push hl push hl
ld de, -SCREEN_WIDTH ld de, -SCREEN_WIDTH
add hl, de add hl, de
ld de, wd11e ld de, wPokedexNum
lb bc, LEADING_ZEROES | 1, 3 lb bc, LEADING_ZEROES | 1, 3
call PrintNumber ; print the pokedex number call PrintNumber
ld de, SCREEN_WIDTH ld de, SCREEN_WIDTH
add hl, de add hl, de
dec hl dec hl
@ -276,7 +276,7 @@ HandlePokedexListMenu:
add hl, bc add hl, bc
pop de pop de
pop af pop af
ld [wd11e], a ld [wPokedexNum], a
dec d dec d
jr nz, .printPokemonLoop jr nz, .printPokemonLoop
ld a, 01 ld a, 01
@ -376,10 +376,10 @@ PokedexMenuItemsText:
; tests if a pokemon's bit is set in the seen or owned pokemon bit fields ; tests if a pokemon's bit is set in the seen or owned pokemon bit fields
; INPUT: ; INPUT:
; [wd11e] = pokedex number ; [wPokedexNum] = pokedex number
; hl = address of bit field ; hl = address of bit field
IsPokemonBitSet: IsPokemonBitSet:
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_TEST ld b, FLAG_TEST
@ -403,13 +403,13 @@ ShowPokedexDataInternal:
ldh [rNR50], a ldh [rNR50], a
call GBPalWhiteOut ; zero all palettes call GBPalWhiteOut ; zero all palettes
call ClearScreen call ClearScreen
ld a, [wd11e] ; pokemon ID ld a, [wPokedexNum]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
push af push af
ld b, SET_PAL_POKEDEX ld b, SET_PAL_POKEDEX
call RunPaletteCommand call RunPaletteCommand
pop af pop af
ld [wd11e], a ld [wPokedexNum], a
ldh a, [hTileAnimations] ldh a, [hTileAnimations]
push af push af
xor a xor a
@ -455,7 +455,7 @@ ShowPokedexDataInternal:
call PlaceString call PlaceString
ld hl, PokedexEntryPointers ld hl, PokedexEntryPointers
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld e, a ld e, a
ld d, 0 ld d, 0
@ -471,7 +471,7 @@ ShowPokedexDataInternal:
ld h, b ld h, b
ld l, c ld l, c
push de push de
ld a, [wd11e] ld a, [wPokedexNum]
push af push af
call IndexToPokedex call IndexToPokedex
@ -480,16 +480,16 @@ ShowPokedexDataInternal:
ld [hli], a ld [hli], a
ld a, "<DOT>" ld a, "<DOT>"
ld [hli], a ld [hli], a
ld de, wd11e ld de, wPokedexNum
lb bc, LEADING_ZEROES | 1, 3 lb bc, LEADING_ZEROES | 1, 3
call PrintNumber ; print pokedex number call PrintNumber ; print pokedex number
ld hl, wPokedexOwned ld hl, wPokedexOwned
call IsPokemonBitSet call IsPokemonBitSet
pop af pop af
ld [wd11e], a ld [wPokedexNum], a
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd0b5], a ld [wCurSpecies], a
pop de pop de
push af push af
@ -624,10 +624,10 @@ DrawTileLine:
INCLUDE "data/pokemon/dex_entries.asm" INCLUDE "data/pokemon/dex_entries.asm"
PokedexToIndex: PokedexToIndex:
; converts the Pokédex number at wd11e to an index ; converts the Pokédex number at [wPokedexNum] to an index
push bc push bc
push hl push hl
ld a, [wd11e] ld a, [wPokedexNum]
ld b, a ld b, a
ld c, 0 ld c, 0
ld hl, PokedexOrder ld hl, PokedexOrder
@ -639,23 +639,23 @@ PokedexToIndex:
jr nz, .loop jr nz, .loop
ld a, c ld a, c
ld [wd11e], a ld [wPokedexNum], a
pop hl pop hl
pop bc pop bc
ret ret
IndexToPokedex: IndexToPokedex:
; converts the index number at wd11e to a Pokédex number ; converts the index number at [wPokedexNum] to a Pokédex number
push bc push bc
push hl push hl
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld hl, PokedexOrder ld hl, PokedexOrder
ld b, 0 ld b, 0
ld c, a ld c, a
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
ld [wd11e], a ld [wPokedexNum], a
pop hl pop hl
pop bc pop bc
ret ret

View file

@ -365,7 +365,7 @@ StartMenu_Item::
jp ItemMenuLoop jp ItemMenuLoop
.useOrTossItem ; if the player made the choice to use or toss the item .useOrTossItem ; if the player made the choice to use or toss the item
ld a, [wCurItem] ld a, [wCurItem]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
call CopyToStringBuffer call CopyToStringBuffer
ld a, [wCurItem] ld a, [wCurItem]

View file

@ -60,7 +60,7 @@ DisplayCreditsMon:
add hl, bc ; go that far in the list of monsters and get the next one add hl, bc ; go that far in the list of monsters and get the next one
ld a, [hl] ld a, [hl]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
hlcoord 8, 6 hlcoord 8, 6
call GetMonHeader call GetMonHeader
call LoadFrontSpriteByMonIndex call LoadFrontSpriteByMonIndex

View file

@ -4,7 +4,7 @@ EvolveMon:
push bc push bc
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
push af push af
ld a, [wd0b5] ld a, [wCurSpecies]
push af push af
xor a xor a
ld [wLowHealthAlarm], a ld [wLowHealthAlarm], a
@ -26,7 +26,7 @@ EvolveMon:
call EvolutionSetWholeScreenPalette call EvolutionSetWholeScreenPalette
ld a, [wEvoNewSpecies] ld a, [wEvoNewSpecies]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
call Evolution_LoadPic call Evolution_LoadPic
ld de, vFrontPic ld de, vFrontPic
ld hl, vBackPic ld hl, vBackPic
@ -34,7 +34,7 @@ EvolveMon:
call CopyVideoData call CopyVideoData
ld a, [wEvoOldSpecies] ld a, [wEvoOldSpecies]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
call Evolution_LoadPic call Evolution_LoadPic
ld a, $1 ld a, $1
ldh [hAutoBGTransferEnabled], a ldh [hAutoBGTransferEnabled], a
@ -75,7 +75,7 @@ EvolveMon:
ld c, 0 ld c, 0
call EvolutionSetWholeScreenPalette call EvolutionSetWholeScreenPalette
pop af pop af
ld [wd0b5], a ld [wCurSpecies], a
pop af pop af
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
pop bc pop bc

View file

@ -102,7 +102,7 @@ HoFShowMonOrPlayer:
ldh [hSCX], a ldh [hSCX], a
ld a, [wHoFMonSpecies] ld a, [wHoFMonSpecies]
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
ld [wBattleMonSpecies2], a ld [wBattleMonSpecies2], a
ld [wWholeScreenPaletteMonSpecies], a ld [wWholeScreenPaletteMonSpecies], a
ld a, [wHoFMonOrPlayer] ld a, [wHoFMonOrPlayer]
@ -171,7 +171,7 @@ HoFDisplayMonInfo:
hlcoord 8, 7 hlcoord 8, 7
call PrintLevelCommon call PrintLevelCommon
ld a, [wHoFMonSpecies] ld a, [wHoFMonSpecies]
ld [wd0b5], a ld [wCurSpecies], a
hlcoord 3, 9 hlcoord 3, 9
predef PrintMonType predef PrintMonType
ld a, [wHoFMonSpecies] ld a, [wHoFMonSpecies]

View file

@ -73,7 +73,7 @@ OakSpeech:
call GBFadeOutToWhite call GBFadeOutToWhite
call ClearScreen call ClearScreen
ld a, NIDORINO ld a, NIDORINO
ld [wd0b5], a ld [wCurSpecies], a
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
call GetMonHeader call GetMonHeader
hlcoord 6, 4 hlcoord 6, 4

View file

@ -362,7 +362,7 @@ ClearBothBGMaps:
LoadTitleMonSprite: LoadTitleMonSprite:
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
hlcoord 5, 10 hlcoord 5, 10
call GetMonHeader call GetMonHeader
jp LoadFrontSpriteByMonIndex jp LoadFrontSpriteByMonIndex

View file

@ -186,14 +186,14 @@ LoadTradingGFXAndMonNames:
xor a xor a
ldh [hAutoBGTransferEnabled], a ldh [hAutoBGTransferEnabled], a
ld a, [wTradedPlayerMonSpecies] ld a, [wTradedPlayerMonSpecies]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, wNameBuffer ld hl, wNameBuffer
ld de, wStringBuffer ld de, wStringBuffer
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData call CopyData
ld a, [wTradedEnemyMonSpecies] ld a, [wTradedEnemyMonSpecies]
ld [wd11e], a ld [wNamedObjectIndex], a
jp GetMonName jp GetMonName
Trade_LoadMonPartySpriteGfx: Trade_LoadMonPartySpriteGfx:
@ -728,7 +728,7 @@ Trade_CircleOAM3:
; a = species ; a = species
Trade_LoadMonSprite: Trade_LoadMonSprite:
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd0b5], a ld [wCurSpecies], a
ld [wWholeScreenPaletteMonSpecies], a ld [wWholeScreenPaletteMonSpecies], a
ld b, SET_PAL_POKEMON_WHOLE_SCREEN ld b, SET_PAL_POKEMON_WHOLE_SCREEN
ld c, 0 ld c, 0

View file

@ -3,10 +3,10 @@ Trade_PrintPlayerMonInfoText:
ld de, Trade_MonInfoText ld de, Trade_MonInfoText
call PlaceString call PlaceString
ld a, [wTradedPlayerMonSpecies] ld a, [wTradedPlayerMonSpecies]
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
hlcoord 9, 0 hlcoord 9, 0
ld de, wd11e ld de, wPokedexNum
lb bc, LEADING_ZEROES | 1, 3 lb bc, LEADING_ZEROES | 1, 3
call PrintNumber call PrintNumber
hlcoord 5, 2 hlcoord 5, 2
@ -25,10 +25,10 @@ Trade_PrintEnemyMonInfoText:
ld de, Trade_MonInfoText ld de, Trade_MonInfoText
call PlaceString call PlaceString
ld a, [wTradedEnemyMonSpecies] ld a, [wTradedEnemyMonSpecies]
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
hlcoord 9, 10 hlcoord 9, 10
ld de, wd11e ld de, wPokedexNum
lb bc, LEADING_ZEROES | 1, 3 lb bc, LEADING_ZEROES | 1, 3
call PrintNumber call PrintNumber
hlcoord 5, 12 hlcoord 5, 12

View file

@ -65,7 +65,7 @@ _AddPartyMon::
ld d, h ld d, h
push hl push hl
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld hl, wMonHeader ld hl, wMonHeader
ld a, [hli] ld a, [hli]
@ -81,11 +81,11 @@ _AddPartyMon::
; If the mon is being added to the player's party, update the pokedex. ; If the mon is being added to the player's party, update the pokedex.
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd11e], a ld [wPokedexNum], a
push de push de
predef IndexToPokedex predef IndexToPokedex
pop de pop de
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_TEST ld b, FLAG_TEST
@ -93,7 +93,7 @@ _AddPartyMon::
call FlagAction call FlagAction
ld a, c ; whether the mon was already flagged as owned ld a, c ; whether the mon was already flagged as owned
ld [wUnusedAlreadyOwnedFlag], a ld [wUnusedAlreadyOwnedFlag], a
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_SET ld b, FLAG_SET
@ -323,9 +323,9 @@ _AddEnemyMonToPlayerParty::
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyData ; write new mon's nickname (from an enemy mon) call CopyData ; write new mon's nickname (from an enemy mon)
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_SET ld b, FLAG_SET

View file

@ -135,7 +135,7 @@ Evolution_PartyMonLoop: ; loop over party mons
call PrintText call PrintText
pop hl pop hl
ld a, [hl] ld a, [hl]
ld [wd0b5], a ld [wCurSpecies], a
ld [wLoadedMonSpecies], a ld [wLoadedMonSpecies], a
ld [wEvoNewSpecies], a ld [wEvoNewSpecies], a
ld a, MONSTER_NAME ld a, MONSTER_NAME
@ -153,22 +153,22 @@ Evolution_PartyMonLoop: ; loop over party mons
call DelayFrames call DelayFrames
call ClearScreen call ClearScreen
call RenameEvolvedMon call RenameEvolvedMon
ld a, [wd11e] ld a, [wPokedexNum]
push af push af
ld a, [wd0b5] ld a, [wCurSpecies]
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld hl, BaseStats ld hl, BaseStats
ld bc, BASE_DATA_SIZE ld bc, BASE_DATA_SIZE
call AddNTimes call AddNTimes
ld de, wMonHeader ld de, wMonHeader
call CopyData call CopyData
ld a, [wd0b5] ld a, [wCurSpecies]
ld [wMonHIndex], a ld [wMonHIndex], a
pop af pop af
ld [wd11e], a ld [wPokedexNum], a
ld hl, wLoadedMonHPExp - 1 ld hl, wLoadedMonHPExp - 1
ld de, wLoadedMonStats ld de, wLoadedMonStats
ld b, $1 ld b, $1
@ -203,8 +203,8 @@ Evolution_PartyMonLoop: ; loop over party mons
dec hl dec hl
pop bc pop bc
call CopyData call CopyData
ld a, [wd0b5] ld a, [wCurSpecies]
ld [wd11e], a ld [wPokedexNum], a
xor a xor a
ld [wMonDataLocation], a ld [wMonDataLocation], a
call LearnMoveFromLevelUp call LearnMoveFromLevelUp
@ -214,7 +214,7 @@ Evolution_PartyMonLoop: ; loop over party mons
and a and a
call z, Evolution_ReloadTilesetTilePatterns call z, Evolution_ReloadTilesetTilePatterns
predef IndexToPokedex predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld c, a ld c, a
ld b, FLAG_SET ld b, FLAG_SET
@ -260,13 +260,14 @@ Evolution_PartyMonLoop: ; loop over party mons
RenameEvolvedMon: RenameEvolvedMon:
; Renames the mon to its new, evolved form's standard name unless it had a ; Renames the mon to its new, evolved form's standard name unless it had a
; nickname, in which case the nickname is kept. ; nickname, in which case the nickname is kept.
ld a, [wd0b5] assert wCurSpecies == wNameListIndex ; save+restore wCurSpecies while using wNameListIndex
ld a, [wCurSpecies]
push af push af
ld a, [wMonHIndex] ld a, [wMonHIndex]
ld [wd0b5], a ld [wNameListIndex], a
call GetName call GetName
pop af pop af
ld [wd0b5], a ld [wCurSpecies], a
ld hl, wNameBuffer ld hl, wNameBuffer
ld de, wStringBuffer ld de, wStringBuffer
.compareNamesLoop .compareNamesLoop
@ -319,7 +320,7 @@ Evolution_ReloadTilesetTilePatterns:
LearnMoveFromLevelUp: LearnMoveFromLevelUp:
ld hl, EvosMovesPointerTable ld hl, EvosMovesPointerTable
ld a, [wd11e] ; species ld a, [wPokedexNum] ; species
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
dec a dec a
ld bc, 0 ld bc, 0
@ -366,13 +367,13 @@ LearnMoveFromLevelUp:
jr nz, .checkCurrentMovesLoop jr nz, .checkCurrentMovesLoop
ld a, d ld a, d
ld [wMoveNum], a ld [wMoveNum], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
call CopyToStringBuffer call CopyToStringBuffer
predef LearnMove predef LearnMove
.done .done
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd11e], a ld [wPokedexNum], a
ret ret
; writes the moves a mon has at level [wCurEnemyLevel] to [de] ; writes the moves a mon has at level [wCurEnemyLevel] to [de]

View file

@ -1,7 +1,7 @@
; calculates the level a mon should be based on its current exp ; calculates the level a mon should be based on its current exp
CalcLevelFromExperience:: CalcLevelFromExperience::
ld a, [wLoadedMonSpecies] ld a, [wLoadedMonSpecies]
ld [wd0b5], a ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld d, $1 ; init level to 1 ld d, $1 ; init level to 1
.loop .loop

View file

@ -29,7 +29,7 @@ DontAbandonLearning:
jp c, AbandonLearning jp c, AbandonLearning
push hl push hl
push de push de
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMoveName call GetMoveName
ld hl, OneTwoAndText ld hl, OneTwoAndText
call PrintText call PrintText

View file

@ -19,7 +19,7 @@ LoadMonData_::
.GetMonHeader .GetMonHeader
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd0b5], a ; input for GetMonHeader ld [wCurSpecies], a
call GetMonHeader call GetMonHeader
ld hl, wPartyMons ld hl, wPartyMons

View file

@ -1,10 +1,10 @@
; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in wd11e ; updates the types of a party mon (pointed to in hl) to the ones of the mon specified in [wPokedexNum]
SetPartyMonTypes: SetPartyMonTypes:
call GetPredefRegisters call GetPredefRegisters
ld bc, wPartyMon1Type - wPartyMon1 ; $5 ld bc, wPartyMon1Type - wPartyMon1 ; $5
add hl, bc add hl, bc
ld a, [wd11e] ld a, [wPokedexNum]
ld [wd0b5], a ld [wCurSpecies], a
push hl push hl
call GetMonHeader call GetMonHeader
pop hl pop hl

View file

@ -139,11 +139,11 @@ StatusScreen:
hlcoord 14, 2 hlcoord 14, 2
call PrintLevel ; Pokémon level call PrintLevel ; Pokémon level
ld a, [wMonHIndex] ld a, [wMonHIndex]
ld [wd11e], a ld [wPokedexNum], a
ld [wd0b5], a ld [wCurSpecies], a
predef IndexToPokedex predef IndexToPokedex
hlcoord 3, 7 hlcoord 3, 7
ld de, wd11e ld de, wPokedexNum
lb bc, LEADING_ZEROES | 1, 3 lb bc, LEADING_ZEROES | 1, 3
call PrintNumber ; Pokémon no. call PrintNumber ; Pokémon no.
hlcoord 11, 10 hlcoord 11, 10
@ -420,7 +420,7 @@ StatusScreen2:
hlcoord 9, 1 hlcoord 9, 1
call StatusScreen_ClearName call StatusScreen_ClearName
ld a, [wMonHIndex] ld a, [wMonHIndex]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
hlcoord 9, 1 hlcoord 9, 1
call PlaceString call PlaceString

View file

@ -3,7 +3,7 @@ GiveItem::
; and copy the item's name to wStringBuffer. ; and copy the item's name to wStringBuffer.
; Return carry on success. ; Return carry on success.
ld a, b ld a, b
ld [wd11e], a ld [wNamedObjectIndex], a
ld [wCurItem], a ld [wCurItem], a
ld a, c ld a, c
ld [wItemQuantity], a ld [wItemQuantity], a

View file

@ -141,7 +141,7 @@ DisplayListMenuIDLoop::
ld [wMaxItemQuantity], a ld [wMaxItemQuantity], a
.skipGettingQuantity .skipGettingQuantity
ld a, [wCurItem] ld a, [wCurItem]
ld [wd0b5], a ld [wNameListIndex], a
ld a, BANK(ItemNames) ld a, BANK(ItemNames)
ld [wPredefBank], a ld [wPredefBank], a
call GetName call GetName
@ -367,7 +367,7 @@ PrintListMenuEntries::
ld a, b ld a, b
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld a, [de] ld a, [de]
ld [wd11e], a ld [wNamedObjectIndex], a
cp $ff cp $ff
jp z, .printCancelMenuItem jp z, .printCancelMenuItem
push bc push bc
@ -427,7 +427,7 @@ PrintListMenuEntries::
and a ; PCPOKEMONLISTMENU? and a ; PCPOKEMONLISTMENU?
jr nz, .skipPrintingPokemonLevel jr nz, .skipPrintingPokemonLevel
.printPokemonLevel .printPokemonLevel
ld a, [wd11e] ld a, [wNamedObjectIndex]
push af push af
push hl push hl
ld hl, wPartyCount ld hl, wPartyCount
@ -460,7 +460,7 @@ PrintListMenuEntries::
add hl, bc add hl, bc
call PrintLevel call PrintLevel
pop af pop af
ld [wd11e], a ld [wNamedObjectIndex], a
.skipPrintingPokemonLevel .skipPrintingPokemonLevel
pop hl pop hl
pop de pop de
@ -469,7 +469,7 @@ PrintListMenuEntries::
cp ITEMLISTMENU cp ITEMLISTMENU
jr nz, .nextListEntry jr nz, .nextListEntry
.printItemQuantity .printItemQuantity
ld a, [wd11e] ld a, [wNamedObjectIndex]
ld [wCurItem], a ld [wCurItem], a
call IsKeyItem ; check if item is unsellable call IsKeyItem ; check if item is unsellable
ld a, [wIsKeyItem] ld a, [wIsKeyItem]
@ -480,18 +480,18 @@ PrintListMenuEntries::
add hl, bc add hl, bc
ld a, "×" ld a, "×"
ld [hli], a ld [hli], a
ld a, [wd11e] ld a, [wNamedObjectIndex]
push af push af
ld a, [de] ld a, [de]
ld [wMaxItemQuantity], a ld [wMaxItemQuantity], a
push de push de
ld de, wd11e ld de, wTempByteValue
ld [de], a ld [de], a
lb bc, 1, 2 lb bc, 1, 2
call PrintNumber call PrintNumber
pop de pop de
pop af pop af
ld [wd11e], a ld [wNamedObjectIndex], a
pop hl pop hl
.skipPrintingItemQuantity .skipPrintingItemQuantity
inc de inc de

View file

@ -71,7 +71,7 @@ IsItemInBag::
ret ret
DisplayPokedex:: DisplayPokedex::
ld [wd11e], a ld [wPokedexNum], a
farjp _DisplayPokedex farjp _DisplayPokedex
SetSpriteFacingDirectionAndDelay:: SetSpriteFacingDirectionAndDelay::

View file

@ -5,7 +5,7 @@ GetMonName::
ld a, BANK(MonsterNames) ld a, BANK(MonsterNames)
ldh [hLoadedROMBank], a ldh [hLoadedROMBank], a
ld [MBC1RomBank], a ld [MBC1RomBank], a
ld a, [wd11e] ld a, [wNamedObjectIndex]
dec a dec a
ld hl, MonsterNames ld hl, MonsterNames
ld c, NAME_LENGTH - 1 ld c, NAME_LENGTH - 1
@ -25,14 +25,14 @@ GetMonName::
ret ret
GetItemName:: GetItemName::
; given an item ID at [wd11e], store the name of the item in wNameBuffer ; given an item ID at [wNamedObjectIndex], store the name of the item in wNameBuffer
push hl push hl
push bc push bc
ld a, [wd11e] ld a, [wNamedObjectIndex]
cp HM01 ; is this a TM/HM? cp HM01 ; is this a TM/HM?
jr nc, .Machine jr nc, .Machine
ld [wd0b5], a ld [wNameListIndex], a
ld a, ITEM_NAME ld a, ITEM_NAME
ld [wNameListType], a ld [wNameListType], a
ld a, BANK(ItemNames) ld a, BANK(ItemNames)
@ -49,18 +49,18 @@ GetItemName::
ret ret
GetMachineName:: GetMachineName::
; copies the name of the TM/HM in [wd11e] to wNameBuffer ; copies the name of the TM/HM in [wNamedObjectIndex] to wNameBuffer
push hl push hl
push de push de
push bc push bc
ld a, [wd11e] ld a, [wNamedObjectIndex]
push af push af
cp TM01 ; is this a TM? [not HM] cp TM01 ; is this a TM? [not HM]
jr nc, .WriteTM jr nc, .WriteTM
; if HM, then write "HM" and add NUM_HMS to the item ID, so we can reuse the ; if HM, then write "HM" and add NUM_HMS to the item ID, so we can reuse the
; TM printing code ; TM printing code
add NUM_HMS add NUM_HMS
ld [wd11e], a ld [wNamedObjectIndex], a
ld hl, HiddenPrefix ; points to "HM" ld hl, HiddenPrefix ; points to "HM"
ld bc, 2 ld bc, 2
jr .WriteMachinePrefix jr .WriteMachinePrefix
@ -72,7 +72,7 @@ GetMachineName::
call CopyData call CopyData
; now get the machine number and convert it to text ; now get the machine number and convert it to text
ld a, [wd11e] ld a, [wNamedObjectIndex]
sub TM01 - 1 sub TM01 - 1
ld b, "0" ld b, "0"
.FirstDigit .FirstDigit
@ -94,7 +94,7 @@ GetMachineName::
ld a, "@" ld a, "@"
ld [de], a ld [de], a
pop af pop af
ld [wd11e], a ld [wNamedObjectIndex], a
pop bc pop bc
pop de pop de
pop hl pop hl
@ -130,8 +130,8 @@ GetMoveName::
push hl push hl
ld a, MOVE_NAME ld a, MOVE_NAME
ld [wNameListType], a ld [wNameListType], a
ld a, [wd11e] ld a, [wNamedObjectIndex]
ld [wd0b5], a ld [wNameListIndex], a
ld a, BANK(MoveNames) ld a, BANK(MoveNames)
ld [wPredefBank], a ld [wPredefBank], a
call GetName call GetName

View file

@ -10,13 +10,13 @@ NamePointers::
GetName:: GetName::
; arguments: ; arguments:
; [wd0b5] = which name ; [wNameListIndex] = which name
; [wNameListType] = which list ; [wNameListType] = which list
; [wPredefBank] = bank of list ; [wPredefBank] = bank of list
; ;
; returns pointer to name in de ; returns pointer to name in de
ld a, [wd0b5] ld a, [wNameListIndex]
ld [wd11e], a ld [wNamedObjectIndex], a
; TM names are separate from item names. ; TM names are separate from item names.
; BUG: This applies to all names instead of just items. ; BUG: This applies to all names instead of just items.
@ -67,7 +67,7 @@ GetName::
ld h, a ld h, a
ldh a, [hSwapTemp + 1] ldh a, [hSwapTemp + 1]
ld l, a ld l, a
ld a, [wd0b5] ld a, [wNameListIndex]
ld b, a ; wanted entry ld b, a ; wanted entry
ld c, 0 ; entry counter ld c, 0 ; entry counter
.nextName .nextName

View file

@ -99,12 +99,12 @@ LoadFlippedFrontSpriteByMonIndex::
LoadFrontSpriteByMonIndex:: LoadFrontSpriteByMonIndex::
push hl push hl
ld a, [wd11e] ld a, [wPokedexNum]
push af push af
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd11e], a ld [wPokedexNum], a
predef IndexToPokedex predef IndexToPokedex
ld hl, wd11e ld hl, wPokedexNum
ld a, [hl] ld a, [hl]
pop bc pop bc
ld [hl], b ld [hl], b
@ -355,8 +355,8 @@ PrintLevelFull::
ld a, [wLoadedMonLevel] ; level ld a, [wLoadedMonLevel] ; level
PrintLevelCommon:: PrintLevelCommon::
ld [wd11e], a ld [wTempByteValue], a
ld de, wd11e ld de, wTempByteValue
ld b, LEFT_ALIGN | 1 ; 1 byte ld b, LEFT_ALIGN | 1 ; 1 byte
jp PrintNumber jp PrintNumber
@ -371,7 +371,7 @@ GetwMoves::
; copies the base stat data of a pokemon to wMonHeader ; copies the base stat data of a pokemon to wMonHeader
; INPUT: ; INPUT:
; [wd0b5] = pokemon ID ; [wCurSpecies] = pokemon ID
GetMonHeader:: GetMonHeader::
ldh a, [hLoadedROMBank] ldh a, [hLoadedROMBank]
push af push af
@ -381,10 +381,10 @@ GetMonHeader::
push bc push bc
push de push de
push hl push hl
ld a, [wd11e] ld a, [wPokedexNum]
push af push af
ld a, [wd0b5] ld a, [wCurSpecies]
ld [wd11e], a ld [wPokedexNum], a
ld de, FossilKabutopsPic ld de, FossilKabutopsPic
ld b, $66 ; size of Kabutops fossil and Ghost sprites ld b, $66 ; size of Kabutops fossil and Ghost sprites
cp FOSSIL_KABUTOPS ; Kabutops fossil cp FOSSIL_KABUTOPS ; Kabutops fossil
@ -398,8 +398,8 @@ GetMonHeader::
jr z, .specialID jr z, .specialID
cp MEW cp MEW
jr z, .mew jr z, .mew
predef IndexToPokedex ; convert pokemon ID in [wd11e] to pokedex number predef IndexToPokedex
ld a, [wd11e] ld a, [wPokedexNum]
dec a dec a
ld bc, BASE_DATA_SIZE ld bc, BASE_DATA_SIZE
ld hl, BaseStats ld hl, BaseStats
@ -423,10 +423,10 @@ GetMonHeader::
ld a, BANK(MewBaseStats) ld a, BANK(MewBaseStats)
call FarCopyData call FarCopyData
.done .done
ld a, [wd0b5] ld a, [wCurSpecies]
ld [wMonHIndex], a ld [wMonHIndex], a
pop af pop af
ld [wd11e], a ld [wPokedexNum], a
pop hl pop hl
pop de pop de
pop bc pop bc

View file

@ -1490,8 +1490,10 @@ wSpriteDecodeTable0Ptr:: dw
; pointer to differential decoding table (assuming initial value 1) ; pointer to differential decoding table (assuming initial value 1)
wSpriteDecodeTable1Ptr:: dw wSpriteDecodeTable1Ptr:: dw
wd0b5:: db ; used as a temp storage area for Pokemon Species, and other Pokemon/Battle related things ; input for GetMonHeader
wCurSpecies::
; input for GetName
wNameListIndex:: db
wNameListType:: db wNameListType:: db
wPredefBank:: db wPredefBank:: db
@ -1556,19 +1558,22 @@ wCapturedMonSpecies:: db
; which will be the first mon sent out. ; which will be the first mon sent out.
wFirstMonsNotOutYet:: db wFirstMonsNotOutYet:: db
wNamedObjectIndex::
wTempByteValue::
wNumSetBits::
wTypeEffectiveness::
wMoveType::
wPokedexNum::
wTempTMHM::
wUsingPPUp::
wMaxPP::
wMoveGrammar::
; 0 for player, non-zero for enemy
wCalculateWhoseStats::
wPokeBallCaptureCalcTemp:: wPokeBallCaptureCalcTemp::
; lower nybble: number of shakes ; lower nybble: number of shakes
; upper nybble: number of animations to play ; upper nybble: number of animations to play
wPokeBallAnimData:: wPokeBallAnimData::
wUsingPPUp::
wMaxPP::
; 0 for player, non-zero for enemy
wCalculateWhoseStats::
wTypeEffectiveness::
wMoveType::
wNumSetBits::
; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
wd11e::
db db
; When this value is non-zero, the player isn't allowed to exit the party menu ; When this value is non-zero, the player isn't allowed to exit the party menu

View file

@ -13,15 +13,16 @@ CeladonMartRoofScript_GetDrinksInBag:
jr z, .done jr z, .done
push hl push hl
push de push de
ld [wd11e], a ld [wTempByteValue], a
ld b, a ld b, a
predef GetQuantityOfItemInBag predef GetQuantityOfItemInBag
pop de pop de
pop hl pop hl
ld a, b ld a, b
and a and a
jr z, .loop ; if the item isn't in the bag jr z, .loop
ld a, [wd11e] ; A drink is in the bag
ld a, [wTempByteValue]
ld [de], a ld [de], a
inc de inc de
push hl push hl
@ -192,7 +193,7 @@ CeladonMartRoofScript_PrintDrinksInBag:
cp $ff cp $ff
ret z ret z
push hl push hl
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
hlcoord 2, 2 hlcoord 2, 2
ldh a, [hItemCounter] ldh a, [hItemCounter]

View file

@ -281,7 +281,7 @@ ChampionsRoomOakText:
ChampionsRoomOakCongratulatesPlayerText: ChampionsRoomOakCongratulatesPlayerText:
text_asm text_asm
ld a, [wPlayerStarter] ld a, [wPlayerStarter]
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld hl, .Text ld hl, .Text
call PrintText call PrintText

View file

@ -18,7 +18,7 @@ Lab4Script_GetFossilsInBag:
jr z, .done jr z, .done
push hl push hl
push de push de
ld [wd11e], a ld [wTempByteValue], a
ld b, a ld b, a
predef GetQuantityOfItemInBag predef GetQuantityOfItemInBag
pop de pop de
@ -26,9 +26,8 @@ Lab4Script_GetFossilsInBag:
ld a, b ld a, b
and a and a
jr z, .loop jr z, .loop
; A fossil is in the bag
; A fossil's in the bag ld a, [wTempByteValue]
ld a, [wd11e]
ld [de], a ld [de], a
inc de inc de
push hl push hl

View file

@ -322,7 +322,7 @@ OaksLabRivalChoosesStarterScript:
ld a, [wRivalStarterTemp] ld a, [wRivalStarterTemp]
ld [wRivalStarter], a ld [wRivalStarter], a
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld a, OAKSLAB_RIVAL ld a, OAKSLAB_RIVAL
ldh [hSpriteIndex], a ldh [hSpriteIndex], a
@ -825,7 +825,7 @@ OaksLabBulbasaurPokeBallText:
OaksLabSelectedPokeBallScript: OaksLabSelectedPokeBallScript:
ld [wCurPartySpecies], a ld [wCurPartySpecies], a
ld [wd11e], a ld [wPokedexNum], a
ld a, b ld a, b
ld [wSpriteIndex], a ld [wSpriteIndex], a
CheckEvent EVENT_GOT_STARTER CheckEvent EVENT_GOT_STARTER
@ -899,7 +899,7 @@ OaksLabMonChoiceMenu:
jr nz, OaksLabMonChoiceEnd jr nz, OaksLabMonChoiceEnd
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wPlayerStarter], a ld [wPlayerStarter], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetMonName call GetMonName
ld a, [wSpriteIndex] ld a, [wSpriteIndex]
cp OAKSLAB_CHARMANDER_POKE_BALL cp OAKSLAB_CHARMANDER_POKE_BALL
@ -927,7 +927,7 @@ OaksLabMonChoiceMenu:
ld a, 5 ld a, 5
ld [wCurEnemyLevel], a ld [wCurEnemyLevel], a
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
ld [wd11e], a ld [wPokedexNum], a
call AddPartyMon call AddPartyMon
ld hl, wStatusFlags4 ld hl, wStatusFlags4
set BIT_GOT_STARTER, [hl] set BIT_GOT_STARTER, [hl]

View file

@ -24,7 +24,7 @@ Route11Gate2FOaksAideText:
ldh [hOaksAideRequirement], a ldh [hOaksAideRequirement], a
ld a, ITEMFINDER ld a, ITEMFINDER
ldh [hOaksAideRewardItem], a ldh [hOaksAideRewardItem], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
ld h, d ld h, d
ld l, e ld l, e

View file

@ -14,7 +14,7 @@ Route15Gate2FOaksAideText:
ldh [hOaksAideRequirement], a ldh [hOaksAideRequirement], a
ld a, EXP_ALL ld a, EXP_ALL
ldh [hOaksAideRewardItem], a ldh [hOaksAideRewardItem], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
ld hl, wNameBuffer ld hl, wNameBuffer
ld de, wOaksAideRewardItemName ld de, wOaksAideRewardItemName

View file

@ -14,7 +14,7 @@ Route2GateOaksAideText:
ldh [hOaksAideRequirement], a ldh [hOaksAideRequirement], a
ld a, HM_FLASH ld a, HM_FLASH
ldh [hOaksAideRewardItem], a ldh [hOaksAideRewardItem], a
ld [wd11e], a ld [wNamedObjectIndex], a
call GetItemName call GetItemName
ld hl, wNameBuffer ld hl, wNameBuffer
ld de, wOaksAideRewardItemName ld de, wOaksAideRewardItemName