summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordannye <corrnondacqb@yahoo.com>2015-08-10 23:51:20 -0500
committerdannye <corrnondacqb@yahoo.com>2015-08-10 23:51:20 -0500
commit4aedff021786dd5c0b81d3a35f505b7aa42adddc (patch)
tree60955f4e561a16bf75d6d964dcf93a7be839b278
parent1df1e9181e2f3d95f57c98e0ea6e38ce4261fb2a (diff)
Replace hardcoded name lengths with NAME_LENGTH
-rw-r--r--constants/misc_constants.asm2
-rwxr-xr-xengine/battle/core.asm10
-rwxr-xr-xengine/cable_club.asm8
-rwxr-xr-xengine/evos_moves.asm2
-rwxr-xr-xengine/hall_of_fame.asm2
-rwxr-xr-xengine/in_game_trades.asm16
-rwxr-xr-xengine/items/items.asm20
-rwxr-xr-xengine/learn_move.asm2
-rwxr-xr-xengine/menu/league_pc.asm2
-rwxr-xr-xengine/menu/main_menu.asm2
-rwxr-xr-xengine/menu/naming_screen.asm8
-rwxr-xr-xengine/menu/start_sub_menus.asm12
-rwxr-xr-xengine/oak_speech.asm4
-rwxr-xr-xengine/oak_speech2.asm2
-rwxr-xr-xengine/save.asm4
-rwxr-xr-xengine/titlescreen.asm4
-rwxr-xr-xengine/trade.asm8
-rw-r--r--home.asm14
-rwxr-xr-xmain.asm16
-rwxr-xr-xscripts/namerater.asm4
-rw-r--r--sram.asm2
-rwxr-xr-xwram.asm26
22 files changed, 86 insertions, 84 deletions
diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm
index ef9e6ba3..00afa755 100644
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -14,6 +14,8 @@ HOF_MON EQU $10
HOF_TEAM EQU PARTY_LENGTH * HOF_MON
HOF_TEAM_CAPACITY EQU 50
+NAME_LENGTH EQU 11
+
A_BUTTON EQU %00000001
B_BUTTON EQU %00000010
SELECT EQU %00000100
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index feadcd82..9dbcf179 100755
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -1728,7 +1728,7 @@ LoadBattleMonFromParty: ; 3cba6 (f:4ba6)
ld a, [wPlayerMonNumber]
call SkipFixedLengthTextEntries
ld de, wBattleMonNick
- ld bc, $b
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wBattleMonLevel
ld de, wPlayerMonUnmodifiedLevel ; block of memory used for unmodified stats
@@ -1772,7 +1772,7 @@ LoadEnemyMonFromParty: ; 3cc13 (f:4c13)
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
ld de, wEnemyMonNick
- ld bc, $b
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wEnemyMonLevel
ld de, wEnemyMonUnmodifiedLevel ; block of memory used for unmodified stats
@@ -2099,7 +2099,7 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
; the following happens for the old man tutorial
ld hl, wPlayerName
ld de, W_GRASSRATE
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData ; temporarily save the player name in unused space,
; which is supposed to get overwritten when entering a
; map with wild Pokémon. Due to an oversight, the data
@@ -2107,7 +2107,7 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
; Missingno. glitch can show up.
ld hl, .oldManName
ld de, wPlayerName
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
; the following simulates the keystrokes by drawing menus on screen
coord hl, 9, 14
@@ -6326,7 +6326,7 @@ LoadEnemyMonData: ; 3eb01 (f:6b01)
call GetMonName
ld hl, wcd6d
ld de, wEnemyMonNick
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [wEnemyMonSpecies2]
ld [wd11e], a
diff --git a/engine/cable_club.asm b/engine/cable_club.asm
index 503f3062..0759bd11 100755
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -176,7 +176,7 @@ CableClub_DoBattleOrTradeAgain: ; 5345
jr z, .findStartOfEnemyNameLoop
dec hl
ld de, wLinkEnemyTrainerName
- ld c, 11
+ ld c, NAME_LENGTH
.copyEnemyNameLoop
ld a, [hli]
cp SERIAL_NO_DATA_BYTE
@@ -698,7 +698,7 @@ TradeCenter_Trade:
call GetMonName
ld hl, wcd6d
ld de, wNameOfPlayerMonToBeTraded
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [wTradingWhichEnemyMon]
ld hl, wEnemyPartyMons
@@ -756,7 +756,7 @@ TradeCenter_Trade:
ld hl, wPartyMonOT
call SkipFixedLengthTextEntries
ld de, wTradedPlayerMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMon1Species
ld a, [wTradingWhichPlayerMon]
@@ -772,7 +772,7 @@ TradeCenter_Trade:
ld hl, wEnemyMonOT
call SkipFixedLengthTextEntries
ld de, wTradedEnemyMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wEnemyMons
ld a, [wTradingWhichEnemyMon]
diff --git a/engine/evos_moves.asm b/engine/evos_moves.asm
index e2b1172a..056c125e 100755
--- a/engine/evos_moves.asm
+++ b/engine/evos_moves.asm
@@ -278,7 +278,7 @@ RenameEvolvedMon: ; 3aef7 (e:6ef7)
cp "@"
jr nz, .compareNamesLoop
ld a, [wWhichPokemon]
- ld bc, 11
+ ld bc, NAME_LENGTH
ld hl, wPartyMonNicks
call AddNTimes
push hl
diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm
index 293c756f..062950cf 100755
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -276,7 +276,7 @@ HoFRecordMonInfo: ; 70404 (1c:4404)
ld e, l
ld d, h
ld hl, wcd6d
- ld bc, $b
+ ld bc, NAME_LENGTH
jp CopyData
HoFFadeOutScreenAndMusic: ; 70423 (1c:4423)
diff --git a/engine/in_game_trades.asm b/engine/in_game_trades.asm
index b4a73e59..4229afd8 100755
--- a/engine/in_game_trades.asm
+++ b/engine/in_game_trades.asm
@@ -17,7 +17,7 @@ DoInGameTradeDialogue: ; 71ad9 (1c:5ad9)
ld a,[hli]
push af
ld de,wInGameTradeMonNick
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
pop af
ld l,a
@@ -81,7 +81,7 @@ InGameTrade_GetMonName: ; 71b6a (1c:5b6a)
call GetMonName
ld hl,wcd6d
pop de
- ld bc, 11
+ ld bc, NAME_LENGTH
jp CopyData
INCLUDE "data/trades.asm"
@@ -168,11 +168,11 @@ InGameTrade_PrepareTradeData: ; 71cc1 (1c:5cc1)
ld a, [wInGameTradeReceiveMonSpecies]
ld [hl], a ; wTradedEnemyMonSpecies
ld hl, wPartyMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
ld de, wTradedPlayerMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
call InGameTrade_CopyData
ld hl, InGameTrade_TrainerString
ld de, wTradedEnemyMonOT
@@ -201,16 +201,16 @@ InGameTrade_CopyData: ; 71d11 (1c:5d11)
InGameTrade_CopyDataToReceivedMon: ; 71d19 (1c:5d19)
ld hl, wPartyMonNicks
- ld bc, 11
+ ld bc, NAME_LENGTH
call InGameTrade_GetReceivedMonPointer
ld hl, wInGameTradeMonNick
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
call InGameTrade_GetReceivedMonPointer
ld hl, InGameTrade_TrainerString
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMon1OTID
ld bc, wPartyMon2 - wPartyMon1
diff --git a/engine/items/items.asm b/engine/items/items.asm
index fe53082b..4ba3c706 100755
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -142,7 +142,7 @@ ItemUseBall: ; d687 (3:5687)
.oldManBattle
ld hl,W_GRASSRATE
ld de,wPlayerName
- ld bc,11
+ ld bc,NAME_LENGTH
call CopyData ; save the player's name in the Wild Monster data (part of the Cinnabar Island Missingno glitch)
jp .BallSuccess
.notOldManBattle
@@ -2573,14 +2573,14 @@ SendNewMonToBox: ; e7a4 (3:67a4)
jr nz, .asm_e7b1
call GetMonHeader
ld hl, wBoxMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
ld a, [W_NUMINBOX]
dec a
jr z, .asm_e7ee
dec a
call AddNTimes
push hl
- ld bc, 11
+ ld bc, NAME_LENGTH
add hl, bc
ld d, h
ld e, l
@@ -2591,12 +2591,12 @@ SendNewMonToBox: ; e7a4 (3:67a4)
.asm_e7db
push bc
push hl
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
pop hl
ld d, h
ld e, l
- ld bc, -$b
+ ld bc, -NAME_LENGTH
add hl, bc
pop bc
dec b
@@ -2604,17 +2604,17 @@ SendNewMonToBox: ; e7a4 (3:67a4)
.asm_e7ee
ld hl, wPlayerName
ld de, wBoxMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [W_NUMINBOX]
dec a
jr z, .asm_e82a
ld hl, wBoxMonNicks
- ld bc, 11
+ ld bc, NAME_LENGTH
dec a
call AddNTimes
push hl
- ld bc, 11
+ ld bc, NAME_LENGTH
add hl, bc
ld d, h
ld e, l
@@ -2625,12 +2625,12 @@ SendNewMonToBox: ; e7a4 (3:67a4)
.asm_e817
push bc
push hl
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
pop hl
ld d, h
ld e, l
- ld bc, -$b
+ ld bc, -NAME_LENGTH
add hl, bc
pop bc
dec b
diff --git a/engine/learn_move.asm b/engine/learn_move.asm
index 02459b20..aeb7d23d 100755
--- a/engine/learn_move.asm
+++ b/engine/learn_move.asm
@@ -5,7 +5,7 @@ LearnMove: ; 6e43 (1:6e43)
call GetPartyMonName
ld hl, wcd6d
ld de, wd036
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
DontAbandonLearning: ; 6e5b (1:6e5b)
diff --git a/engine/menu/league_pc.asm b/engine/menu/league_pc.asm
index 21c3f9e7..e2dce785 100755
--- a/engine/menu/league_pc.asm
+++ b/engine/menu/league_pc.asm
@@ -90,7 +90,7 @@ LeaguePCShowMon: ; 76610 (1d:6610)
ld a, [hli]
ld [wHoFMonLevel], a
ld de, wcd6d
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld b, $0B
ld c, 0
diff --git a/engine/menu/main_menu.asm b/engine/menu/main_menu.asm
index b8896d79..5e853aae 100755
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -689,7 +689,7 @@ CheckForPlayerNameInSRAM: ; 609e (1:609e)
ld a, $1
ld [MBC1SRamBankingMode], a
ld [MBC1SRamBank], a
- ld b, $b
+ ld b, NAME_LENGTH
ld hl, sPlayerName
.loop
ld a, [hli]
diff --git a/engine/menu/naming_screen.asm b/engine/menu/naming_screen.asm
index e64a4bee..85111cd6 100755
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -46,7 +46,7 @@ AskName: ; 64eb (1:64eb)
ld d, h
ld e, l
ld hl, wcd6d
- ld bc, 11
+ ld bc, NAME_LENGTH
jp CopyData
DoYouWantToNicknameText: ; 0x6557
@@ -67,13 +67,13 @@ DisplayNameRaterScreen: ; 655c (1:655c)
cp "@"
jr z, .playerCancelled
ld hl, wPartyMonNicks
- ld bc, 11
+ ld bc, NAME_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
ld e, l
ld d, h
ld hl, wBuffer
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
and a
ret
@@ -158,7 +158,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
.submitNickname
pop de
ld hl, wcf4b
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
call GBPalWhiteOutWithDelay3
call ClearScreen
diff --git a/engine/menu/start_sub_menus.asm b/engine/menu/start_sub_menus.asm
index 110da50d..4dc84d06 100755
--- a/engine/menu/start_sub_menus.asm
+++ b/engine/menu/start_sub_menus.asm
@@ -813,36 +813,36 @@ SwitchPartyMon_InitVarOrSwapData: ; 13653 (4:7653)
call SkipFixedLengthTextEntries
push hl
ld de, wSwitchPartyMonTempBuffer
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMonOT
ld a, [wMenuItemToSwap]
call SkipFixedLengthTextEntries
pop de
push hl
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
pop de
ld hl, wSwitchPartyMonTempBuffer
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMonNicks
ld a, [wCurrentMenuItem]
call SkipFixedLengthTextEntries
push hl
ld de, wSwitchPartyMonTempBuffer
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wPartyMonNicks
ld a, [wMenuItemToSwap]
call SkipFixedLengthTextEntries
pop de
push hl
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
pop de
ld hl, wSwitchPartyMonTempBuffer
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [wMenuItemToSwap]
ld [wSwappedMenuItem], a
diff --git a/engine/oak_speech.asm b/engine/oak_speech.asm
index 566bd880..0de7ffad 100755
--- a/engine/oak_speech.asm
+++ b/engine/oak_speech.asm
@@ -24,11 +24,11 @@ SetDefaultNames: ; 60ca (1:60ca)
call z, InitOptions
ld hl, NintenText
ld de, wPlayerName
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, SonyText
ld de, W_RIVALNAME
- ld bc, 11
+ ld bc, NAME_LENGTH
jp CopyData
OakSpeech: ; 6115 (1:6115)
diff --git a/engine/oak_speech2.asm b/engine/oak_speech2.asm
index 50e3708c..23f39fd5 100755
--- a/engine/oak_speech2.asm
+++ b/engine/oak_speech2.asm
@@ -73,7 +73,7 @@ OakSpeechSlidePicLeft: ; 69ec (1:69ec)
call DelayFrames
pop de
ld hl, wcd6d
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
call Delay3
coord hl, 12, 4
diff --git a/engine/save.asm b/engine/save.asm
index 717b316a..26f9507f 100755
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -57,7 +57,7 @@ LoadSAV0: ; 73623 (1c:7623)
.checkSumsMatched
ld hl, sPlayerName
ld de, wPlayerName
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, sMainData
ld de, wMainDataStart
@@ -203,7 +203,7 @@ SaveSAVtoSRAM0: ; 7378c (1c:778c)
ld [MBC1SRamBank], a
ld hl, wPlayerName
ld de, sPlayerName
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wMainDataStart
ld de, sMainData
diff --git a/engine/titlescreen.asm b/engine/titlescreen.asm
index 10c3f2a0..0dbe4a4c 100755
--- a/engine/titlescreen.asm
+++ b/engine/titlescreen.asm
@@ -1,6 +1,6 @@
-; copy text of fixed length $b (like player name, rival name, mon names, ...)
+; copy text of fixed length NAME_LENGTH (like player name, rival name, mon names, ...)
CopyFixedLengthText: ; 42b1 (1:42b1)
- ld bc, 11
+ ld bc, NAME_LENGTH
jp CopyData
SetDefaultNamesBeforeTitlescreen: ; 42b7 (1:42b7)
diff --git a/engine/trade.asm b/engine/trade.asm
index 6e825fe5..b7c72520 100755
--- a/engine/trade.asm
+++ b/engine/trade.asm
@@ -190,7 +190,7 @@ LoadTradingGFXAndMonNames: ; 411a1 (10:51a1)
call GetMonName
ld hl, wcd6d
ld de, wcf4b
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [wTradedEnemyMonSpecies]
ld [wd11e], a
@@ -204,15 +204,15 @@ Trade_LoadMonPartySpriteGfx: ; 4120b (10:520b)
Trade_SwapNames: ; 41217 (10:5217)
ld hl, wPlayerName
ld de, wBuffer
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wLinkEnemyTrainerName
ld de, wPlayerName
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld hl, wBuffer
ld de, wLinkEnemyTrainerName
- ld bc, 11
+ ld bc, NAME_LENGTH
jp CopyData
Trade_Cleanup: ; 4123b (10:523b)
diff --git a/home.asm b/home.asm
index 2d64833f..e1fbc0f2 100644
--- a/home.asm
+++ b/home.asm
@@ -626,10 +626,10 @@ GetPartyMonName2:: ; 15b4 (0:15b4)
GetPartyMonName:: ; 15ba (0:15ba)
push hl
push bc
- call SkipFixedLengthTextEntries ; add 11 to hl, a times
+ call SkipFixedLengthTextEntries ; add NAME_LENGTH to hl, a times
ld de,wcd6d
push de
- ld bc,11
+ ld bc,NAME_LENGTH
call CopyData
pop de
pop bc
@@ -2238,7 +2238,7 @@ LoadGymLeaderAndCityName:: ; 317f (0:317f)
call CopyData ; load city name
pop hl
ld de, wGymLeaderName
- ld bc, $b
+ ld bc, NAME_LENGTH
jp CopyData ; load gym leader name
; reads specific information from trainer header (pointed to at W_TRAINERHEADERPTR)
@@ -3264,7 +3264,7 @@ GetName:: ; 376b (0:376b)
jr nz,.otherEntries
;1 = MON_NAMES
call GetMonName
- ld hl,11
+ ld hl,NAME_LENGTH
add hl,de
ld e,l
ld d,h
@@ -3825,12 +3825,12 @@ MoveMon:: ; 3a68 (0:3a68)
ld [MBC1RomBank], a
ret
-; skips a text entries, each of size 11 (like trainer name, OT name, rival name, ...)
-; hl: base pointer, will be incremented by $b * a
+; skips a text entries, each of size NAME_LENGTH (like trainer name, OT name, rival name, ...)
+; hl: base pointer, will be incremented by NAME_LENGTH * a
SkipFixedLengthTextEntries:: ; 3a7d (0:3a7d)
and a
ret z
- ld bc, 11
+ ld bc, NAME_LENGTH
.skipLoop
add hl, bc
dec a
diff --git a/main.asm b/main.asm
index 507d5c46..7c047dbd 100755
--- a/main.asm
+++ b/main.asm
@@ -1967,7 +1967,7 @@ _RemovePokemon: ; 7b68 (1:7b68)
.asm_7ba6
ld d, h
ld e, l
- ld bc, 11
+ ld bc, NAME_LENGTH
add hl, bc
ld bc, wPartyMonNicks
ld a, [wRemoveMonFromBox]
@@ -2007,12 +2007,12 @@ _RemovePokemon: ; 7b68 (1:7b68)
jr z, .asm_7bfa
ld hl, wBoxMonNicks
.asm_7bfa
- ld bc, 11
+ ld bc, NAME_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
ld d, h
ld e, l
- ld bc, 11
+ ld bc, NAME_LENGTH
add hl, bc
ld bc, wPokedexOwned
ld a, [wRemoveMonFromBox]
@@ -3587,7 +3587,7 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld d, h
ld e, l
ld hl, wPlayerName
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [wMonDataLocation]
and a
@@ -3858,7 +3858,7 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
ld hl, wEnemyMonOT
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData ; write new mon's OT name (from an enemy mon)
ld hl, wPartyMonNicks
ld a, [wPartyCount]
@@ -3869,7 +3869,7 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
ld hl, wEnemyMonNicks
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData ; write new mon's nickname (from an enemy mon)
ld a, [wcf91]
ld [wd11e], a
@@ -4000,7 +4000,7 @@ _MoveMon: ; f51e (3:751e)
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
.asm_f5ec
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
ld a, [wMoveMonType]
cp PARTY_TO_DAYCARE
@@ -4030,7 +4030,7 @@ _MoveMon: ; f51e (3:751e)
ld a, [wWhichPokemon]
call SkipFixedLengthTextEntries
.asm_f62a
- ld bc, 11
+ ld bc, NAME_LENGTH
call CopyData
pop hl
ld a, [wMoveMonType]
diff --git a/scripts/namerater.asm b/scripts/namerater.asm
index 0222d596..42b82b62 100755
--- a/scripts/namerater.asm
+++ b/scripts/namerater.asm
@@ -10,11 +10,11 @@ NameRaterScript_1da15: ; 1da15 (7:5a15)
NameRaterScript_1da20: ; 1da20 (7:5a20)
ld hl, wPartyMonOT
- ld bc, 11
+ ld bc, NAME_LENGTH
ld a, [wWhichPokemon]
call AddNTimes
ld de, wPlayerName
- ld c, 11
+ ld c, NAME_LENGTH
call .asm_1da47
jr c, .asm_1da52
ld hl, wPartyMon1OTID
diff --git a/sram.asm b/sram.asm
index 40312413..9f49d9ca 100644
--- a/sram.asm
+++ b/sram.asm
@@ -12,7 +12,7 @@ sHallOfFame:: ds HOF_TEAM * HOF_TEAM_CAPACITY ; a598
SECTION "Save Data", SRAM, BANK[1]
ds $598
-sPlayerName:: ds 11 ; a598
+sPlayerName:: ds NAME_LENGTH ; a598
sMainData:: ds wMainDataEnd - wMainDataStart ; a5a3
sSpriteData:: ds wSpriteDataEnd - wSpriteDataStart ; ad2c
sPartyData:: ds wPartyDataEnd - wPartyDataStart ; af2c
diff --git a/wram.asm b/wram.asm
index 901f42d4..47074b55 100755
--- a/wram.asm
+++ b/wram.asm
@@ -1302,7 +1302,7 @@ wGymCityName:: ; cf5f
ds 17
wGymLeaderName:: ; cf70
- ds 11
+ ds NAME_LENGTH
wItemList:: ; cf7b
ds 16
@@ -1441,7 +1441,7 @@ wEnemyMonSpecies2:: ; cfd8
wBattleMonSpecies2:: ; cfd9
ds 1
-wEnemyMonNick:: ds 11 ; cfda
+wEnemyMonNick:: ds NAME_LENGTH ; cfda
wEnemyMon:: ; cfe5
; The wEnemyMon struct reaches past 0xcfff,
@@ -1479,7 +1479,7 @@ wEnemyMonBaseStats:: ds 5
wEnemyMonCatchRate:: ds 1
wEnemyMonBaseExp:: ds 1
-wBattleMonNick:: ds 11 ; d009
+wBattleMonNick:: ds NAME_LENGTH ; d009
wBattleMon:: battle_struct wBattleMon ; d014
@@ -2164,7 +2164,7 @@ wSavedNPCMovementDirections2Index:: ; d157
ds 1
wPlayerName:: ; d158
- ds 11
+ ds NAME_LENGTH
wPartyDataStart::
@@ -2181,8 +2181,8 @@ wPartyMon4:: party_struct wPartyMon4 ; d1ef
wPartyMon5:: party_struct wPartyMon5 ; d21b
wPartyMon6:: party_struct wPartyMon6 ; d247
-wPartyMonOT:: ds 11 * PARTY_LENGTH ; d273
-wPartyMonNicks:: ds 11 * PARTY_LENGTH ; d2b5
+wPartyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d273
+wPartyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d2b5
wPartyDataEnd::
@@ -2209,7 +2209,7 @@ wPlayerMoney:: ; d347
ds 3 ; BCD
W_RIVALNAME:: ; d34a
- ds 11
+ ds NAME_LENGTH
W_OPTIONS:: ; d355
; bit 7 = battle animation
@@ -2962,8 +2962,8 @@ wEnemyMon4:: party_struct wEnemyMon4
wEnemyMon5:: party_struct wEnemyMon5
wEnemyMon6:: party_struct wEnemyMon6
-wEnemyMonOT:: ds 11 * PARTY_LENGTH ; d9ac
-wEnemyMonNicks:: ds 11 * PARTY_LENGTH ; d9ee
+wEnemyMonOT:: ds NAME_LENGTH * PARTY_LENGTH ; d9ac
+wEnemyMonNicks:: ds NAME_LENGTH * PARTY_LENGTH ; d9ee
W_TRAINERHEADERPTR:: ; da30
@@ -3006,8 +3006,8 @@ W_DAYCARE_IN_USE:: ; da48
; 1 if pokemon is in the daycare
ds 1
-W_DAYCAREMONNAME:: ds 11 ; da49
-W_DAYCAREMONOT:: ds 11 ; da54
+W_DAYCAREMONNAME:: ds NAME_LENGTH ; da49
+W_DAYCAREMONOT:: ds NAME_LENGTH ; da54
wDayCareMon:: box_struct wDayCareMon ; da5f
@@ -3023,8 +3023,8 @@ wBoxMons::
wBoxMon1:: box_struct wBoxMon1 ; da96
wBoxMon2:: ds box_struct_length * (MONS_PER_BOX + -1) ; dab7
-wBoxMonOT:: ds 11 * MONS_PER_BOX ; dd2a
-wBoxMonNicks:: ds 11 * MONS_PER_BOX ; de06
+wBoxMonOT:: ds NAME_LENGTH * MONS_PER_BOX ; dd2a
+wBoxMonNicks:: ds NAME_LENGTH * MONS_PER_BOX ; de06
wBoxMonNicksEnd:: ; dee2
wBoxDataEnd::