Add meaningful aliases for wd265

Introduce MONICON_* constants
Introduce BATTLEPLAYERACTION_* constants
This commit is contained in:
Rangi
2018-07-28 19:27:34 -04:00
parent 2ec900d96c
commit 9dec80b07e
83 changed files with 436 additions and 404 deletions

View File

@@ -1035,7 +1035,7 @@ PCMonInfo:
cp -1
ret z
ld [wd265], a
ld [wTempSpecies], a
hlcoord 1, 4
xor a
ld b, 7
@@ -1057,7 +1057,7 @@ PCMonInfo:
jr nz, .row
call BillsPC_LoadMonStats
ld a, [wd265]
ld a, [wTempSpecies]
ld [wCurPartySpecies], a
ld [wCurSpecies], a
ld hl, wTempMonDVs
@@ -1068,7 +1068,7 @@ PCMonInfo:
xor a
ld [wBillsPC_MonHasMail], a
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wTempSpecies], a
cp EGG
ret z
@@ -1676,9 +1676,9 @@ StatsScreenDPad:
and a
jr z, .did_nothing
call BillsPC_GetSelectedPokemonSpecies
ld [wd265], a
ld [wTempSpecies], a
call BillsPC_LoadMonStats
ld a, [wd265]
ld a, [wTempSpecies]
ld [wCurPartySpecies], a
ld [wCurSpecies], a
ld hl, wTempMonDVs
@@ -1893,7 +1893,7 @@ ReleasePKMN_ByePKMN:
.skip_cry
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wTempSpecies], a
call GetPokemonName
hlcoord 1, 16
ld de, PCString_ReleasedPKMN
@@ -2314,9 +2314,9 @@ BillsPC_PrintBoxCountAndCapacity:
ld de, .Pokemon
call PlaceString
call GetBoxCount
ld [wd265], a
ld [wDeciramBuffer], a
hlcoord 13, 11
ld de, wd265
ld de, wDeciramBuffer
lb bc, 1, 2
call PrintNum
ld de, .out_of_20

View File

@@ -81,7 +81,7 @@ CheckBreedmonCompatibility:
.done
ld a, c
ld [wd265], a
ld [wBreedingCompatibility], a
ret
.CheckDVs:
@@ -250,7 +250,7 @@ HatchEggs:
ld a, [wCurPartySpecies]
dec de
ld [de], a
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
ld [wCurSpecies], a
call GetPokemonName
xor a
@@ -676,7 +676,7 @@ EggHatch_DoAnimFrame:
ret
EggHatch_AnimationSequence:
ld a, [wd265]
ld a, [wNamedObjectIndexBuffer]
ld [wJumptableIndex], a
ld a, [wCurSpecies]
push af
@@ -910,7 +910,7 @@ DayCareMonCompatibilityText:
call CopyBytes
call CheckBreedmonCompatibility
pop bc
ld a, [wd265]
ld a, [wBreedingCompatibility]
ld hl, .AllAlone
cp -1
jr z, .done

View File

@@ -38,7 +38,7 @@ CheckPartyFullAfterContest:
ld hl, wPlayerName
call CopyBytes
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, wStringBuffer1
ld de, wMonOrItemNameBuffer
@@ -105,7 +105,7 @@ CheckPartyFullAfterContest:
call CopyBytes
callfar InsertPokemonIntoBox
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
call GiveANickname_YesNo
ld hl, wStringBuffer1

View File

@@ -123,7 +123,7 @@ Unreferenced_CorrectPartyErrors:
cp EGG
ld hl, .TAMAGO
jr z, .got_nickname
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, wStringBuffer1
.got_nickname

View File

@@ -236,7 +236,7 @@ EvolveAfterBattle_MasterLoop:
ld [wCurSpecies], a
ld [wTempMonSpecies], a
ld [wEvolutionNewSpecies], a
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
push hl
@@ -293,15 +293,15 @@ EvolveAfterBattle_MasterLoop:
call CopyBytes
ld a, [wCurSpecies]
ld [wd265], a
ld [wTempSpecies], a
xor a
ld [wMonType], a
call LearnLevelMoves
ld a, [wd265]
ld a, [wTempSpecies]
dec a
call SetSeenAndCaughtMon
ld a, [wd265]
ld a, [wTempSpecies]
cp UNOWN
jr nz, .skip_unown
@@ -348,7 +348,7 @@ UpdateSpeciesNameIfNotNicknamed:
ld a, [wCurSpecies]
push af
ld a, [wBaseDexNo]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
pop af
ld [wCurSpecies], a
@@ -369,7 +369,7 @@ UpdateSpeciesNameIfNotNicknamed:
call AddNTimes
push hl
ld a, [wCurSpecies]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, wStringBuffer1
pop de
@@ -415,7 +415,7 @@ Text_WhatEvolving:
db "@"
LearnLevelMoves:
ld a, [wd265]
ld a, [wTempSpecies]
ld [wCurPartySpecies], a
dec a
ld b, 0
@@ -466,7 +466,7 @@ LearnLevelMoves:
.learn
ld a, d
ld [wPutativeTMHMMove], a
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetMoveName
call CopyName1
predef LearnMove
@@ -475,7 +475,7 @@ LearnLevelMoves:
.done
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wTempSpecies], a
ret
FillMoves:

View File

@@ -36,7 +36,7 @@ LearnMove:
push hl
push de
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
ld b, a
ld a, [wBattleMode]

View File

@@ -149,7 +149,7 @@ CheckPokeMail::
; Compare the mail message, byte for byte, with the expected message.
ld a, MAIL_MSG_LENGTH
ld [wd265], a
ld [wTempByteValue], a
.loop
ld a, [de]
ld c, a
@@ -162,9 +162,9 @@ CheckPokeMail::
jr nz, .close_sram_return
inc hl
inc de
ld a, [wd265]
ld a, [wTempByteValue]
dec a
ld [wd265], a
ld [wTempByteValue], a
jr nz, .loop
.done

View File

@@ -100,7 +100,7 @@ GetMonMenuString:
jr z, .NotMove
inc hl
ld a, [hl]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetMoveName
ret

View File

@@ -295,7 +295,7 @@ ListMovePP:
call PrintNum
ld a, "/"
ld [hli], a
ld de, wd265
ld de, wTempPP
lb bc, 1, 2
call PrintNum
pop hl

View File

@@ -52,7 +52,7 @@ TryAddMonToParty:
and a
jr nz, .skipnickname
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld hl, wPartyMonNicknames
ld a, [hMoveMon]
@@ -185,11 +185,11 @@ endr
.registerpokedex
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wTempSpecies], a
dec a
push de
call CheckCaughtMon
ld a, [wd265]
ld a, [wTempSpecies]
dec a
call SetSeenAndCaughtMon
pop de
@@ -750,7 +750,7 @@ RestorePPofDepositedPokemon:
farcall GetMaxPPOfMove
pop de
pop hl
ld a, [wd265]
ld a, [wTempPP]
ld b, a
ld a, [de]
and %11000000
@@ -970,7 +970,7 @@ SendMonIntoBox:
call CopyBytes
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
ld de, sBoxMonNicknames
@@ -1669,7 +1669,7 @@ GivePoke::
.done
ld a, [wCurPartySpecies]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
ld [wTempEnemyMonSpecies], a
call GetPokemonName
ld hl, wStringBuffer1

View File

@@ -5,21 +5,21 @@ InsertPokemonIntoBox:
call InsertSpeciesIntoBoxOrParty
ld a, [sBoxCount]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
ld hl, sBoxMonNicknames
ld bc, MON_NAME_LENGTH
ld de, wBufferMonNick
call InsertDataIntoBoxOrParty
ld a, [sBoxCount]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
ld hl, sBoxMonOT
ld bc, NAME_LENGTH
ld de, wBufferMonOT
call InsertDataIntoBoxOrParty
ld a, [sBoxCount]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
ld hl, sBoxMons
ld bc, BOXMON_STRUCT_LENGTH
ld de, wBufferMon
@@ -42,21 +42,21 @@ InsertPokemonIntoParty:
call InsertSpeciesIntoBoxOrParty
ld a, [wPartyCount]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
ld hl, wPartyMonNicknames
ld bc, MON_NAME_LENGTH
ld de, wBufferMonNick
call InsertDataIntoBoxOrParty
ld a, [wPartyCount]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
ld hl, wPartyMonOT
ld bc, NAME_LENGTH
ld de, wBufferMonOT
call InsertDataIntoBoxOrParty
ld a, [wPartyCount]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
ld hl, wPartyMons
ld bc, PARTYMON_STRUCT_LENGTH
ld de, wBufferMon
@@ -85,7 +85,7 @@ InsertDataIntoBoxOrParty:
push de
push hl
push bc
ld a, [wd265]
ld a, [wNextBoxOrPartyIndex]
dec a
call AddNTimes
push hl
@@ -95,7 +95,7 @@ InsertDataIntoBoxOrParty:
pop hl
.loop
push bc
ld a, [wd265]
ld a, [wNextBoxOrPartyIndex]
ld b, a
ld a, [wCurPartyMon]
cp b
@@ -116,9 +116,9 @@ InsertDataIntoBoxOrParty:
sbc b
ld h, a
pop de
ld a, [wd265]
ld a, [wNextBoxOrPartyIndex]
dec a
ld [wd265], a
ld [wNextBoxOrPartyIndex], a
jr .loop
.insert

View File

@@ -596,7 +596,7 @@ InitPartyMenuGFX:
push hl
ld hl, LoadMenuMonIcon
ld a, BANK(LoadMenuMonIcon)
ld e, $0
ld e, MONICON_PARTYMENU
rst FarCall
ld a, [hObjectStructIndexBuffer]
inc a

View File

@@ -377,7 +377,7 @@ StatsScreen_InitUpperHalf:
xor a
ld [hBGMapMode], a
ld a, [wBaseDexNo]
ld [wd265], a
ld [wDeciramBuffer], a
ld [wCurSpecies], a
hlcoord 8, 0
ld [hl], "№"
@@ -386,7 +386,7 @@ StatsScreen_InitUpperHalf:
inc hl
hlcoord 10, 0
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
ld de, wd265
ld de, wDeciramBuffer
call PrintNum
hlcoord 14, 0
call PrintLevel
@@ -401,7 +401,7 @@ StatsScreen_InitUpperHalf:
ld a, "/"
ld [hli], a
ld a, [wBaseDexNo]
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetPokemonName
call PlaceString
call StatsScreen_PlaceHorizontalDivider
@@ -483,7 +483,7 @@ StatsScreen_PlaceShinyIcon:
StatsScreen_LoadGFX:
ld a, [wBaseDexNo]
ld [wd265], a
ld [wTempSpecies], a
ld [wCurSpecies], a
xor a
ld [hBGMapMode], a
@@ -708,7 +708,7 @@ StatsScreen_LoadGFX:
ld b, a
farcall TimeCapsule_ReplaceTeruSama
ld a, b
ld [wd265], a
ld [wNamedObjectIndexBuffer], a
call GetItemName
ret

View File

@@ -74,9 +74,9 @@ PrintType:
jp PlaceString
GetTypeName:
; Copy the name of type [wd265] to wStringBuffer1.
; Copy the name of type [wNamedObjectIndexBuffer] to wStringBuffer1.
ld a, [wd265]
ld a, [wNamedObjectIndexBuffer]
ld hl, TypeNames
ld e, a
ld d, 0