ref: 3d36f1a83711f117274c56f3ddb285d81a869bb3
parent: d644406f61983be78339a0e9f366e8d34c209c6c
author: PikalaxALT <[email protected]>
date: Fri Dec 18 15:07:09 EST 2015
Events and some WRAM cleanup
--- a/battle/ai/items.asm
+++ b/battle/ai/items.asm
@@ -866,7 +866,7 @@
ld [wd265], a
call GetItemName
ld hl, StringBuffer1
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
ld bc, ITEM_NAME_LENGTH
call CopyBytes
ld hl, TextJump_EnemyUsedOn
--- a/battle/core.asm
+++ b/battle/core.asm
@@ -8809,7 +8809,7 @@
ld hl, wPayDayMoney + 2
ld de, Money + 2
call AddBattleMoneyToAccount
- ld hl, BattleText_PlayerPickuedUpPayDayMoney
+ ld hl, BattleText_PlayerPickedUpPayDayMoney
call StdBattleTextBox
ld a, [InBattleTowerBattle]
bit 0, a
--- a/constants/sprite_constants.asm
+++ b/constants/sprite_constants.asm
@@ -377,7 +377,7 @@
const SPRITE_ANIM_FRAMESET_07
const SPRITE_ANIM_FRAMESET_08
const SPRITE_ANIM_FRAMESET_09
- const SPRITE_ANIM_FRAMESET_0A
+ const SPRITE_ANIM_FRAMESET_GAMEFREAK_LOGO
const SPRITE_ANIM_FRAMESET_0B
const SPRITE_ANIM_FRAMESET_0C
const SPRITE_ANIM_FRAMESET_SLOT_GOLEM
@@ -384,7 +384,7 @@
const SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY
const SPRITE_ANIM_FRAMESET_0F
const SPRITE_ANIM_FRAMESET_SLOTS_EGG
- const SPRITE_ANIM_FRAMESET_11
+ const SPRITE_ANIM_FRAMESET_WALK_CYCLE
const SPRITE_ANIM_FRAMESET_12
const SPRITE_ANIM_FRAMESET_13
const SPRITE_ANIM_FRAMESET_14
@@ -396,7 +396,7 @@
const SPRITE_ANIM_FRAMESET_1A
const SPRITE_ANIM_FRAMESET_1B
const SPRITE_ANIM_FRAMESET_1C
- const SPRITE_ANIM_FRAMESET_1D
+ const SPRITE_ANIM_FRAMESET_LEAF
const SPRITE_ANIM_FRAMESET_1E
const SPRITE_ANIM_FRAMESET_1F
const SPRITE_ANIM_FRAMESET_20
@@ -435,13 +435,13 @@
const SPRITE_ANIM_FRAMESET_41
const_def
- const SPRITE_ANIM_SEQ_00
+ const SPRITE_ANIM_SEQ_NULL
const SPRITE_ANIM_SEQ_01
const SPRITE_ANIM_SEQ_02
const SPRITE_ANIM_SEQ_03
const SPRITE_ANIM_SEQ_04
const SPRITE_ANIM_SEQ_05
- const SPRITE_ANIM_SEQ_06
+ const SPRITE_ANIM_SEQ_GAMEFREAK_LOGO
const SPRITE_ANIM_SEQ_07
const SPRITE_ANIM_SEQ_08
const SPRITE_ANIM_SEQ_SLOT_GOLEM
@@ -457,9 +457,9 @@
const SPRITE_ANIM_SEQ_13
const SPRITE_ANIM_SEQ_14
const SPRITE_ANIM_SEQ_15
- const SPRITE_ANIM_SEQ_16
- const SPRITE_ANIM_SEQ_17
- const SPRITE_ANIM_SEQ_18
+ const SPRITE_ANIM_SEQ_FLY_FROM
+ const SPRITE_ANIM_SEQ_FLY_LEAF
+ const SPRITE_ANIM_SEQ_FLY_TO
const SPRITE_ANIM_SEQ_19
const SPRITE_ANIM_SEQ_1A
const SPRITE_ANIM_SEQ_1B
@@ -475,7 +475,7 @@
const SPRITE_ANIM_INDEX_00
const SPRITE_ANIM_INDEX_01
const SPRITE_ANIM_INDEX_02
- const SPRITE_ANIM_INDEX_03
+ const SPRITE_ANIM_INDEX_GAMEFREAK_LOGO
const SPRITE_ANIM_INDEX_04
const SPRITE_ANIM_INDEX_05
const SPRITE_ANIM_INDEX_SLOT_GOLEM
@@ -482,7 +482,7 @@
const SPRITE_ANIM_INDEX_SLOTS_CHANSEY
const SPRITE_ANIM_INDEX_SLOTS_EGG
const SPRITE_ANIM_INDEX_09
- const SPRITE_ANIM_INDEX_0A
+ const SPRITE_ANIM_INDEX_WALK_CYCLE
const SPRITE_ANIM_INDEX_0B
const SPRITE_ANIM_INDEX_0C
const SPRITE_ANIM_INDEX_0D
@@ -496,7 +496,7 @@
const SPRITE_ANIM_INDEX_15
const SPRITE_ANIM_INDEX_LEAF
const SPRITE_ANIM_INDEX_CUT_TREE
- const SPRITE_ANIM_INDEX_18
+ const SPRITE_ANIM_INDEX_FLY_LEAF
const SPRITE_ANIM_INDEX_19
const SPRITE_ANIM_INDEX_1A
const SPRITE_ANIM_INDEX_1B
--- a/engine/breeding/egg.asm
+++ b/engine/breeding/egg.asm
@@ -575,7 +575,7 @@
ld a, [wBreedMon2Species]
cp DITTO
jr z, .ditto2
- ld a, [wDittoInDaycare]
+ ld a, [wBreedMotherOrNonDitto]
and a
ret z
ld hl, wBreedMon1Moves
@@ -633,7 +633,7 @@
ld a, [wBreedMon2Species]
cp DITTO
jr z, .ditto
- ld a, [wDittoInDaycare]
+ ld a, [wBreedMotherOrNonDitto]
and a
ret z
--- a/engine/clock_reset.asm
+++ b/engine/clock_reset.asm
@@ -95,7 +95,7 @@
ld [StringBuffer2 + 2], a
xor a
ld [StringBuffer2 + 3], a
- call Function677
+ call InitTime
call .PrintTime
ld hl, .Text_ClockReset
call PrintText
--- a/engine/crystal_intro.asm
+++ b/engine/crystal_intro.asm
@@ -80,7 +80,7 @@
callba ClearSpriteAnims
depixel 10, 11, 4, 0
- ld a, SPRITE_ANIM_INDEX_03
+ ld a, SPRITE_ANIM_INDEX_GAMEFREAK_LOGO
call _InitSpriteAnimStruct
ld hl, $7
add hl, bc
--- a/engine/decorations.asm
+++ b/engine/decorations.asm
@@ -6,7 +6,7 @@
ret
_KrisDecorationMenu: ; 0x2675c
- ld a, [wcf76]
+ ld a, [wWhichIndexSet]
push af
ld hl, .MenuDataHeader
call LoadMenuDataHeader
@@ -30,7 +30,7 @@
.exit_menu
call ExitMenu
pop af
- ld [wcf76], a
+ ld [wWhichIndexSet], a
ld a, [Buffer5]
ld c, a
ret
@@ -74,7 +74,7 @@
.FindCategoriesWithOwnedDecos: ; 26806
xor a
- ld [wcf76], a
+ ld [wWhichIndexSet], a
call .ClearStringBuffer2
call .FindOwndDecos
ld a, 7
@@ -374,7 +374,7 @@
cp 8
jr nc, .beyond_eight
xor a
- ld [wcf76], a
+ ld [wWhichIndexSet], a
ld hl, .NonscrollingMenuDataHeader
call LoadMenuDataHeader
call DoNthMenu
--- a/engine/learn.asm
+++ b/engine/learn.asm
@@ -4,7 +4,7 @@
ld hl, PartyMonNicknames
call GetNick
ld hl, StringBuffer1
- ld de, wd050_MonNick
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -12,7 +12,7 @@
ld hl, GameTimerPause
res 0, [hl]
call Function49da4
- ld [wcf76], a
+ ld [wWhichIndexSet], a
call Function49e09
ld hl, MenuDataHeader_0x49d14
call LoadMenuDataHeader
--- a/engine/mart.asm
+++ b/engine/mart.asm
@@ -70,10 +70,10 @@
Pharmacist: ; 15aae
call FarReadMart
call LoadStandardMenuDataHeader
- ld hl, UnknownText_0x15e90
+ ld hl, Text_Pharmacist_Intro
call MartTextBox
call BuyMenu
- ld hl, UnknownText_0x15eae
+ ld hl, Text_Pharmacist_ComeAgain
call MartTextBox
ret
; 15ac4
@@ -493,7 +493,7 @@
.useless_pointer
call MartAskPurchaseQuantity
jr c, .cancel
- call Function15d97
+ call MartConfirmPurchase
jr c, .cancel
ld de, Money
ld bc, hMoneyTemp
@@ -551,7 +551,7 @@
ret
; 15d97
-Function15d97: ; 15d97
+MartConfirmPurchase: ; 15d97
predef PartyMonItemName
ld a, MARTTEXT_COSTS_THIS_MUCH
call LoadBuyMenuText
@@ -764,7 +764,7 @@
db "@"
; 0x15e90
-UnknownText_0x15e90: ; 0x15e90
+Text_Pharmacist_Intro: ; 0x15e90
; What's up? Need some medicine?
text_jump UnknownText_0x1c4e5f
db "@"
@@ -800,7 +800,7 @@
db "@"
; 0x15eae
-UnknownText_0x15eae: ; 0x15eae
+Text_Pharmacist_ComeAgain: ; 0x15eae
; All right. See you around.
text_jump UnknownText_0x1c4ef6
db "@"
@@ -810,29 +810,28 @@
SellMenu: ; 15eb3
call DisableSpriteUpdates
callba DepositSellInitPackBuffers
-.asm_15ebc
+.loop
callba DepositSellPack
ld a, [wcf66]
and a
- jp z, Function15ece
- call Function15ee0
- jr .asm_15ebc
-; 15ece
+ jp z, .quit
+ call .TryToSellItem
+ jr .loop
-Function15ece: ; 15ece
- call Function2b74
+.quit
+ call ReturnToMapWithSpeechTextbox
and a
ret
; 15ed3
-Function15ed3: ; unreferenced
- ld hl, UnknownText_0x15edb
+.NothingToSell: ; unreferenced
+ ld hl, .NothingToSellText
call MenuTextBoxBackup
and a
ret
; 15edb
-UnknownText_0x15edb: ; 0x15edb
+.NothingToSellText: ; 0x15edb
; You don't have anything to sell.
text_jump UnknownText_0x1c4f12
db "@"
@@ -839,7 +838,7 @@
; 0x15ee0
-Function15ee0: ; 15ee0
+.TryToSellItem: ; 15ee0
callba CheckItemMenu
ld a, [wItemAttributeParamBuffer]
ld hl, .jumptable
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -243,7 +243,7 @@
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld [hl], SPRITE_ANIM_SEQ_00
+ ld [hl], SPRITE_ANIM_SEQ_NULL
ret
Function8e99a: ; 8e99a (23:699a)
@@ -371,7 +371,7 @@
jr z, .next
cp d
jr z, .loadwithtwo
- ld a, SPRITE_ANIM_SEQ_00
+ ld a, SPRITE_ANIM_SEQ_NULL
jr .ok
.loadwithtwo
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -1,7 +1,7 @@
_NamingScreen: ; 0x116b7
call DisableSpriteUpdates
call NamingScreen
- call Function2b74
+ call ReturnToMapWithSpeechTextbox
ret
; 0x116c1
@@ -174,7 +174,7 @@
ld [hli], a
ld [hl], a
depixel 4, 4, 4, 0
- ld a, SPRITE_ANIM_INDEX_0A
+ ld a, SPRITE_ANIM_INDEX_WALK_CYCLE
call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_FRAMESET_ID
add hl, bc
@@ -220,7 +220,7 @@
ld [hli], a
ld [hl], a
pop de
- ld b, SPRITE_ANIM_INDEX_0A
+ ld b, SPRITE_ANIM_INDEX_WALK_CYCLE
ld a, d
cp $7a
jr nz, .asm_11873
--- a/engine/npctrade.asm
+++ b/engine/npctrade.asm
@@ -88,7 +88,7 @@
ld [wcf64], a
pop af
ld [wJumptableIndex], a
- call Function2b74
+ call ReturnToMapWithSpeechTextbox
ret
; fcc23
@@ -399,7 +399,7 @@
ld a, [hl]
call GetTradeMonName
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
call CopyTradeName
ld hl, StringBuffer1
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -633,7 +633,7 @@
push af
call GetCurNick
ld hl, StringBuffer1
- ld de, wd050_MonNick
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
call TryGiveItemToPartymon
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -8,7 +8,7 @@
call SetPalettes
call DelayFrame
call PartyMenuSelect
- call Function2b74
+ call ReturnToMapWithSpeechTextbox
ret
; 5001d
@@ -25,7 +25,7 @@
call SetPalettes
call DelayFrame
call PartyMenuSelect
- call Function2b74
+ call ReturnToMapWithSpeechTextbox
ret
; 5003f
--- a/engine/phone.asm
+++ b/engine/phone.asm
@@ -274,7 +274,7 @@
push hl
call LoadCallerScript
pop hl
- ld de, wd048
+ ld de, wPhoneScriptPointer
ld a, [hli]
ld [de], a
inc de
@@ -442,7 +442,7 @@
Script_ReceivePhoneCall: ; 0x90241
refreshscreen $0
callasm RingTwice_StartCall
- ptcall wd048
+ ptcall wPhoneScriptPointer
waitbutton
callasm HangUp
closetext
--- a/engine/pokecenter_pc.asm
+++ b/engine/pokecenter_pc.asm
@@ -12,7 +12,7 @@
xor a
ld [hBGMapMode], a
call .ChooseWhichPCListToUse
- ld [wcf76], a
+ ld [wWhichIndexSet], a
call DoNthMenu
jr c, .shutdown
ld a, [MenuSelection]
@@ -208,7 +208,7 @@
_PlayersPC: ; 15704
ld a, b
- ld [wcf76], a
+ ld [wWhichIndexSet], a
ld hl, UnknownText_0x157cc
call PC_DisplayTextWaitMenu
call Function15715
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -673,7 +673,7 @@
Function9106a: ; 9106a
push af
depixel 0, 0
- ld b, SPRITE_ANIM_INDEX_0A
+ ld b, SPRITE_ANIM_INDEX_WALK_CYCLE
ld a, [PlayerGender]
bit 0, a
jr z, .asm_91079
@@ -709,7 +709,7 @@
ld [hl], $4
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld [hl], SPRITE_ANIM_SEQ_00
+ ld [hl], SPRITE_ANIM_SEQ_NULL
pop af
push bc
call Function910d4
@@ -2781,7 +2781,7 @@
ld [hl], $8
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld [hl], SPRITE_ANIM_SEQ_00
+ ld [hl], SPRITE_ANIM_SEQ_NULL
ret
; 91fa6
@@ -2808,7 +2808,7 @@
; Animation/palette
depixel 0, 0
- ld b, SPRITE_ANIM_INDEX_0A ; Male
+ ld b, SPRITE_ANIM_INDEX_WALK_CYCLE ; Male
ld a, [PlayerGender]
bit 0, a
jr z, .got_gender
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -274,7 +274,7 @@
ld [CurPartySpecies], a
call GetPokemonName
ld hl, StringBuffer1
- ld de, wOaksPkmnTalkPkmnNameBuffer
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
; Now that we've chosen our wild Pokemon,
--- a/engine/rtc.asm
+++ b/engine/rtc.asm
@@ -163,7 +163,7 @@
ret
; 140ed
-Function140ed:: ; 140ed
+_InitTime:: ; 140ed
call GetClock
call FixDays
ld hl, hRTCSeconds
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -877,7 +877,7 @@
Script_scripttalkafter: ; 97125
; script command 0x65
- ld hl, wd04b
+ ld hl, wScriptAfterPointer
ld a, [hli]
ld h, [hl]
ld l, a
--- a/engine/sprite_anims.asm
+++ b/engine/sprite_anims.asm
@@ -16,18 +16,18 @@
.Jumptable: ; 8d25b (23:525b)
jumptable_start
- jumptable .zero ; null
+ jumptable .Null ; null
jumptable .one ; bouncing mon icon
jumptable .two ; bouncing mon icon, selected
jumptable .three ; bouncing mon icon, menu open
jumptable .four
jumptable .five
- jumptable .six ; Game Freak logo
+ jumptable .GameFreakLogo ; Game Freak logo
jumptable .seven
jumptable .eight
- jumptable .nine ; Something to do with slots
- jumptable .ten ; Something to do with slots
- jumptable .eleven ; Something to do with slots
+ jumptable .SlotsGolem ; Something to do with slots
+ jumptable .SlotsChansey ; Something to do with slots
+ jumptable .SlotsChanseyEgg ; Something to do with slots
jumptable .twelve ; blinking cursor
jumptable .thirteen
jumptable .fourteen
@@ -35,12 +35,12 @@
jumptable .sixteen
jumptable .seventeen
jumptable .eighteen
- jumptable .nineteen ; finish egg hatching animation
- jumptable .twenty ; radio tuning knob
+ jumptable .EggShell ; finish egg hatching animation
+ jumptable .RadioTuningKnob ; radio tuning knob
jumptable .twentyone ; cut grass leaves
- jumptable .twentytwo ; flying sprite
- jumptable .twentythree ; flying leaves
- jumptable .twentyfour
+ jumptable .FlyFrom ; flying sprite
+ jumptable .FlyLeaf ; flying leaves
+ jumptable .FlyTo ; fly to
jumptable .twentyfive
jumptable .twentysix
jumptable .twentyseven
@@ -53,7 +53,7 @@
jumptable .thirtyfour ; intro suicune facing away from us
-.zero: ; 8d2a1 (23:52a1)
+.Null: ; 8d2a1 (23:52a1)
ret
.one: ; 8d2a2 (23:52a2)
@@ -94,13 +94,13 @@
add hl, bc
ld a, d
and $10 ; bit 4
- jr z, .load_zero
+ jr z, .load_Null
ld a, e
and a
jr z, .load_minus_two
cp $1
jr z, .load_minus_one
-.load_zero
+.load_Null
xor a
ld [hl], a
ret
@@ -140,11 +140,11 @@
; 8d306 (23:5306)
; Anonymous jumptable (see .anonymous_jumptable)
- dw .four_zero
+ dw .four_Null
dw .four_one
; 8d30a
-.four_zero: ; 8d30a
+.four_Null: ; 8d30a
call .IncrementSpriteAnimStruct0B
ld hl, SPRITEANIMSTRUCT_INDEX
@@ -227,7 +227,7 @@
callab Function120c1
ret
-.six: ; 8d37a (23:537a)
+.GameFreakLogo: ; 8d37a (23:537a)
callab GameFreakLogoJumper
ret
@@ -359,11 +359,11 @@
call DeinitializeSprite
ret
-.nine: ; 8d422 (23:5422)
+.SlotsGolem: ; 8d422 (23:5422)
callab SlotMachine_AnimateGolem
ret
-.ten: ; 8d429 (23:5429)
+.SlotsChansey: ; 8d429 (23:5429)
callab Slots_AnimateChansey
ld hl, wcf64
ld a, [hl]
@@ -374,7 +374,7 @@
call _ReinitSpriteAnimFrame
ret
-.eleven: ; 8d43e (23:543e)
+.SlotsChanseyEgg: ; 8d43e (23:543e)
ld hl, SPRITEANIMSTRUCT_0B
add hl, bc
ld a, [hl]
@@ -425,7 +425,7 @@
; 8d487 (23:5487)
; Anonymous jumptable (see .anonymous_jumptable)
- dw .sixteen_zero
+ dw .sixteen_Null
dw .sixteen_one
dw .sixteen_two
dw .sixteen_three
@@ -433,7 +433,7 @@
dw .sixteen_five
; 8d493
-.sixteen_zero: ; 8d493
+.sixteen_Null: ; 8d493
ld a, $14
call _ReinitSpriteAnimFrame
@@ -573,12 +573,12 @@
callab Function29676
ret
-.nineteen: ; 8d54a (23:554a)
+.EggShell: ; 8d54a (23:554a)
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
cp $80
- jr nc, .finish_nineteen
+ jr nc, .finish_EggShell
ld d, a
add $8
ld [hl], a
@@ -606,11 +606,11 @@
ld [hl], a
ret
-.finish_nineteen
+.finish_EggShell
call DeinitializeSprite
ret
-.twenty: ; 8d578 (23:5578)
+.RadioTuningKnob: ; 8d578 (23:5578)
callab AnimateTuningKnob
ret
@@ -653,7 +653,7 @@
ld [hl], a
ret
-.twentytwo: ; 8d5b0 (23:55b0)
+.FlyFrom: ; 8d5b0 (23:55b0)
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
@@ -678,10 +678,10 @@
ld a, [hl]
ld d, a
cp $40
- jr nc, .asm_8d5d3
+ jr nc, .skip
add $8
ld [hl], a
-.asm_8d5d3
+.skip
ld hl, SPRITEANIMSTRUCT_0E
add hl, bc
ld a, [hl]
@@ -693,12 +693,12 @@
ld [hl], a
ret
-.twentythree: ; 8d5e2 (23:55e2)
+.FlyLeaf: ; 8d5e2 (23:55e2)
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
ld a, [hl]
- cp $b8
- jr nc, .asm_8d603
+ cp -9 * 8
+ jr nc, .delete_leaf
rept 2
inc [hl]
endr
@@ -706,8 +706,8 @@
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
dec [hl]
- ld d, $40
+ ld d, $40
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -718,15 +718,16 @@
add hl, bc
ld [hl], a
ret
-.asm_8d603
+
+.delete_leaf
call DeinitializeSprite
ret
-.twentyfour: ; 8d607 (23:5607)
+.FlyTo: ; 8d607 (23:5607)
ld hl, SPRITEANIMSTRUCT_YCOORD
add hl, bc
ld a, [hl]
- cp $54
+ cp 10 * 8 + 4
ret z
ld hl, SPRITEANIMSTRUCT_YCOORD
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -561,7 +561,7 @@
db SPRITE_ANIM_FRAMESET_01, SPRITE_ANIM_SEQ_01, $00 ; 00
db SPRITE_ANIM_FRAMESET_07, SPRITE_ANIM_SEQ_04, $00 ; 01
db SPRITE_ANIM_FRAMESET_08, SPRITE_ANIM_SEQ_05, $05 ; 02
- db SPRITE_ANIM_FRAMESET_0A, SPRITE_ANIM_SEQ_06, $00 ; 03
+ db SPRITE_ANIM_FRAMESET_GAMEFREAK_LOGO, SPRITE_ANIM_SEQ_GAMEFREAK_LOGO, $00 ; 03
db SPRITE_ANIM_FRAMESET_0B, SPRITE_ANIM_SEQ_07, $06 ; 04
db SPRITE_ANIM_FRAMESET_0C, SPRITE_ANIM_SEQ_08, $06 ; 05
db SPRITE_ANIM_FRAMESET_SLOT_GOLEM, SPRITE_ANIM_SEQ_SLOT_GOLEM, $07 ; 06 slots golem
@@ -568,34 +568,34 @@
db SPRITE_ANIM_FRAMESET_SLOTS_CHANSEY, SPRITE_ANIM_SEQ_SLOTS_CHANSEY, $07 ; 07 slots chansey
db SPRITE_ANIM_FRAMESET_SLOTS_EGG, SPRITE_ANIM_SEQ_SLOTS_EGG, $07 ; 08 slots egg
db SPRITE_ANIM_FRAMESET_08, SPRITE_ANIM_SEQ_0C, $05 ; 09
- db SPRITE_ANIM_FRAMESET_11, SPRITE_ANIM_SEQ_00, $00 ; 0a flying sprite
+ db SPRITE_ANIM_FRAMESET_WALK_CYCLE, SPRITE_ANIM_SEQ_NULL, $00 ; 0a walk cycle
db SPRITE_ANIM_FRAMESET_12, SPRITE_ANIM_SEQ_0D, $08 ; 0b
db SPRITE_ANIM_FRAMESET_12, SPRITE_ANIM_SEQ_0E, $08 ; 0c
db SPRITE_ANIM_FRAMESET_12, SPRITE_ANIM_SEQ_0F, $08 ; 0d
db SPRITE_ANIM_FRAMESET_13, SPRITE_ANIM_SEQ_10, $00 ; 0e
- db SPRITE_ANIM_FRAMESET_15, SPRITE_ANIM_SEQ_00, $00 ; 0f
+ db SPRITE_ANIM_FRAMESET_15, SPRITE_ANIM_SEQ_NULL, $00 ; 0f
db SPRITE_ANIM_FRAMESET_16, SPRITE_ANIM_SEQ_11, $00 ; 10
db SPRITE_ANIM_FRAMESET_17, SPRITE_ANIM_SEQ_12, $00 ; 11
db SPRITE_ANIM_FRAMESET_18, SPRITE_ANIM_SEQ_12, $00 ; 12
db SPRITE_ANIM_FRAMESET_19, SPRITE_ANIM_SEQ_13, $00 ; 13
db SPRITE_ANIM_FRAMESET_1A, SPRITE_ANIM_SEQ_14, $00 ; 14 radio tuning knob
- db SPRITE_ANIM_FRAMESET_1B, SPRITE_ANIM_SEQ_00, $00 ; 15
- db SPRITE_ANIM_FRAMESET_1D, SPRITE_ANIM_SEQ_15, $00 ; 16 leaves when cutting down a tree
- db SPRITE_ANIM_FRAMESET_1E, SPRITE_ANIM_SEQ_00, $00 ; 17
- db SPRITE_ANIM_FRAMESET_1D, SPRITE_ANIM_SEQ_17, $00 ; 18 flying leaves
- db SPRITE_ANIM_FRAMESET_1F, SPRITE_ANIM_SEQ_00, $00 ; 19
+ db SPRITE_ANIM_FRAMESET_1B, SPRITE_ANIM_SEQ_NULL, $00 ; 15
+ db SPRITE_ANIM_FRAMESET_LEAF, SPRITE_ANIM_SEQ_15, $00 ; 16 leaves when cutting down a tree
+ db SPRITE_ANIM_FRAMESET_1E, SPRITE_ANIM_SEQ_NULL, $00 ; 17
+ db SPRITE_ANIM_FRAMESET_LEAF, SPRITE_ANIM_SEQ_FLY_LEAF, $00 ; 18 flying leaves
+ db SPRITE_ANIM_FRAMESET_1F, SPRITE_ANIM_SEQ_NULL, $00 ; 19
db SPRITE_ANIM_FRAMESET_24, SPRITE_ANIM_SEQ_19, $00 ; 1a
- db SPRITE_ANIM_FRAMESET_25, SPRITE_ANIM_SEQ_00, $00 ; 1b headbutt
+ db SPRITE_ANIM_FRAMESET_25, SPRITE_ANIM_SEQ_NULL, $00 ; 1b headbutt
db SPRITE_ANIM_FRAMESET_20, SPRITE_ANIM_SEQ_13, $00 ; 1c
db SPRITE_ANIM_FRAMESET_26, SPRITE_ANIM_SEQ_1A, $00 ; 1d
- db SPRITE_ANIM_FRAMESET_2D, SPRITE_ANIM_SEQ_00, $00 ; 1e
- db SPRITE_ANIM_FRAMESET_2E, SPRITE_ANIM_SEQ_00, $00 ; 1f
- db SPRITE_ANIM_FRAMESET_2F, SPRITE_ANIM_SEQ_00, $00 ; 20
- db SPRITE_ANIM_FRAMESET_30, SPRITE_ANIM_SEQ_00, $00 ; 21
- db SPRITE_ANIM_FRAMESET_31, SPRITE_ANIM_SEQ_00, $00 ; 22
+ db SPRITE_ANIM_FRAMESET_2D, SPRITE_ANIM_SEQ_NULL, $00 ; 1e
+ db SPRITE_ANIM_FRAMESET_2E, SPRITE_ANIM_SEQ_NULL, $00 ; 1f
+ db SPRITE_ANIM_FRAMESET_2F, SPRITE_ANIM_SEQ_NULL, $00 ; 20
+ db SPRITE_ANIM_FRAMESET_30, SPRITE_ANIM_SEQ_NULL, $00 ; 21
+ db SPRITE_ANIM_FRAMESET_31, SPRITE_ANIM_SEQ_NULL, $00 ; 22
db SPRITE_ANIM_FRAMESET_32, SPRITE_ANIM_SEQ_1B, $00 ; 23
db SPRITE_ANIM_FRAMESET_33, SPRITE_ANIM_SEQ_1C, $00 ; 24
- db SPRITE_ANIM_FRAMESET_34, SPRITE_ANIM_SEQ_00, $00 ; 25
+ db SPRITE_ANIM_FRAMESET_34, SPRITE_ANIM_SEQ_NULL, $00 ; 25
db SPRITE_ANIM_FRAMESET_35, SPRITE_ANIM_SEQ_1D, $00 ; 26
db SPRITE_ANIM_FRAMESET_37, SPRITE_ANIM_SEQ_1E, $00 ; 27
db SPRITE_ANIM_FRAMESET_38, SPRITE_ANIM_SEQ_1E, $00 ; 28
@@ -602,7 +602,7 @@
db SPRITE_ANIM_FRAMESET_39, SPRITE_ANIM_SEQ_20, $00 ; 29 intro unown
db SPRITE_ANIM_FRAMESET_3F, SPRITE_ANIM_SEQ_21, $00 ; 2a
db SPRITE_ANIM_FRAMESET_3E, SPRITE_ANIM_SEQ_22, $00 ; 2b
- db SPRITE_ANIM_FRAMESET_40, SPRITE_ANIM_SEQ_00, $00 ; 2c
+ db SPRITE_ANIM_FRAMESET_40, SPRITE_ANIM_SEQ_NULL, $00 ; 2c
; 8d24b
INCLUDE "engine/sprite_anims.asm" ; DoAnimFrame
--- a/engine/startmenu.asm
+++ b/engine/startmenu.asm
@@ -141,7 +141,7 @@
.Clear ; 126b7
call ClearBGPalettes
call Call_ExitMenu
- call Function2bae
+ call ReloadTilesetAndPalettes
call .DrawMenuAccount_
call MenuFunc_1e7f
call .DrawBugContestStatus
@@ -283,7 +283,7 @@
.SetUpMenuItems ; 12829
xor a
- ld [wcf76], a
+ ld [wWhichIndexSet], a
call .FillMenuList
ld hl, StatusFlags
@@ -805,7 +805,7 @@
call GetCurNick
ld hl, StringBuffer1
- ld de, wd050_MonNick
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
ld a, [wMenuCursorY]
--- a/engine/timeset.asm
+++ b/engine/timeset.asm
@@ -38,7 +38,7 @@
call .ClearScreen
call WaitBGMap
call RotateFourPalettesRight
- ld hl, UnknownText_0x90874
+ ld hl, Text_WokeUpOak
call PrintText
ld hl, wc608
ld bc, 50
@@ -48,7 +48,7 @@
ld [wInitHourBuffer], a
.loop
- ld hl, UnknownText_0x90879
+ ld hl, Text_WhatTimeIsIt
call PrintText
hlcoord 3, 7
ld b, 2
@@ -71,7 +71,7 @@
ld a, [wInitHourBuffer]
ld [StringBuffer2 + 1], a
call .ClearScreen
- ld hl, UnknownText_0x90886
+ ld hl, Text_WhatHrs
call PrintText
call YesNoBox
jr nc, .HourIsSet
@@ -79,7 +79,7 @@
jr .loop
.HourIsSet
- ld hl, UnknownText_0x9089a
+ ld hl, Text_HowManyMinutes
call PrintText
hlcoord 11, 7
lb bc, 2, 7
@@ -101,7 +101,7 @@
ld a, [BattleMonNick + 5]
ld [StringBuffer2 + 2], a
call .ClearScreen
- ld hl, UnknownText_0x908a4
+ ld hl, Text_WhoaMins
call PrintText
call YesNoBox
jr nc, .MinutesAreSet
@@ -109,7 +109,7 @@
jr .HourIsSet
.MinutesAreSet
- call Function658
+ call SetTimeOfDay
ld hl, OakText_ResponseToSetTime
call PrintText
call WaitPressAorB_BlinkCursor
@@ -194,7 +194,7 @@
ret
; 907f1 (24:47f1)
-Function907f1: ; 907f1
+UnreferencedFunction907f1: ; 907f1
ld h, d
ld l, e
push hl
@@ -203,11 +203,11 @@
rept 2
inc de
endr
- ld a, $9c
+ ld a, ":"
ld [de], a
inc de
push de
- ld hl, $3
+ ld hl, 3
add hl, de
ld a, [de]
inc de
@@ -225,37 +225,39 @@
SetMinutes: ; 90810 (24:4810)
ld a, [hJoyPressed]
and A_BUTTON
- jr nz, .asm_90857
+ jr nz, .a_button
ld hl, hJoyLast
ld a, [hl]
and D_UP
- jr nz, .asm_90835
+ jr nz, .d_up
ld a, [hl]
and D_DOWN
- jr nz, .asm_90828
+ jr nz, .d_down
call DelayFrame
and a
ret
-.asm_90828
+
+.d_down
ld hl, BattleMonNick + 5
ld a, [hl]
and a
- jr nz, .asm_90831
+ jr nz, .decrease
ld a, 59 + 1
-.asm_90831
+.decrease
dec a
ld [hl], a
- jr .asm_90841
-.asm_90835
+ jr .finish_dpad
+
+.d_up
ld hl, BattleMonNick + 5
ld a, [hl]
cp 59
- jr c, .asm_9083f
+ jr c, .increase
ld a, -1
-.asm_9083f
+.increase
inc a
ld [hl], a
-.asm_90841
+.finish_dpad
hlcoord 12, 9
ld a, " "
ld bc, 7
@@ -265,7 +267,7 @@
call WaitBGMap
and a
ret
-.asm_90857
+.a_button
scf
ret
@@ -288,13 +290,13 @@
ret
; 90874 (24:4874)
-UnknownText_0x90874: ; 0x90874
+Text_WokeUpOak: ; 0x90874
; Zzz… Hm? Wha…? You woke me up! Will you check the clock for me?
text_jump UnknownText_0x1bc29c
db "@"
; 0x90879
-UnknownText_0x90879: ; 0x90879
+Text_WhatTimeIsIt: ; 0x90879
; What time is it?
text_jump UnknownText_0x1bc2eb
db "@"
@@ -304,23 +306,23 @@
db "o'clock@"
; 90886
-UnknownText_0x90886: ; 0x90886
+Text_WhatHrs: ; 0x90886
; What?@ @
text_jump UnknownText_0x1bc2fd
start_asm
hlcoord 1, 16
call DisplayHourOClock
- ld hl, UnknownText_0x90895
+ ld hl, .QuestionMark
ret
; 90895 (24:4895)
-UnknownText_0x90895: ; 0x90895
+.QuestionMark: ; 0x90895
; ?
text_jump UnknownText_0x1bc305
db "@"
; 0x9089a
-UnknownText_0x9089a: ; 0x9089a
+Text_HowManyMinutes: ; 0x9089a
; How many minutes?
text_jump UnknownText_0x1bc308
db "@"
@@ -330,7 +332,7 @@
db "min.@"
; 908a4
-UnknownText_0x908a4: ; 0x908a4
+Text_WhoaMins: ; 0x908a4
; Whoa!@ @
text_jump UnknownText_0x1bc31b
start_asm
@@ -337,11 +339,11 @@
; 0x908a9
hlcoord 7, 14
call DisplayMinutesWithMinString
- ld hl, UnknownText_0x908b3
+ ld hl, .QuestionMark
ret
; 908b3 (24:48b3)
-UnknownText_0x908b3: ; 0x908b3
+.QuestionMark: ; 0x908b3
; ?
text_jump UnknownText_0x1bc323
db "@"
@@ -418,13 +420,13 @@
lb bc, BANK(GFX_9090b), 1
call Request1bpp
xor a
- ld [wd002], a
-.asm_90936
+ ld [wTempDayOfWeek], a
+.loop
hlcoord 0, 12
lb bc, 4, 18
call TextBox
call LoadStandardMenuDataHeader
- ld hl, UnknownText_0x90a3f
+ ld hl, .WhatDayIsItText
call PrintText
hlcoord 9, 3
ld b, 2
@@ -431,27 +433,27 @@
ld c, 9
call TextBox
hlcoord 14, 3
- ld [hl], $ef
+ ld [hl], "♂" ; gets overwritten with special up arrow
hlcoord 14, 6
- ld [hl], $f5
+ ld [hl], "♀" ; gets overwritten with special down arrow
hlcoord 10, 5
- call Function909de
+ call .PlaceWeekdayString
call ApplyTilemap
ld c, 10
call DelayFrames
-.asm_9096a
+.loop2
call JoyTextDelay
- call Function90993
- jr nc, .asm_9096a
+ call .GetJoypadAction
+ jr nc, .loop2
call ExitMenu
call UpdateSprites
- ld hl, UnknownText_0x90a44
+ ld hl, .ConfirmWeekdayText
call PrintText
call YesNoBox
- jr c, .asm_90936
- ld a, [wd002]
+ jr c, .loop
+ ld a, [wTempDayOfWeek]
ld [StringBuffer2], a
- call Function663
+ call SetDayOfWeek
call LoadStandardFont
pop af
ld [hInMenu], a
@@ -458,68 +460,68 @@
ret
; 90993
-Function90993: ; 90993
+.GetJoypadAction: ; 90993
ld a, [hJoyPressed]
and A_BUTTON
- jr z, .asm_9099b
+ jr z, .not_A
scf
ret
-.asm_9099b
+.not_A
ld hl, hJoyLast
ld a, [hl]
and D_UP
- jr nz, .asm_909ba
+ jr nz, .d_up
ld a, [hl]
and D_DOWN
- jr nz, .asm_909ad
+ jr nz, .d_down
call DelayFrame
and a
ret
-.asm_909ad
- ld hl, wd002
+.d_down
+ ld hl, wTempDayOfWeek
ld a, [hl]
and a
- jr nz, .asm_909b6
+ jr nz, .decrease
ld a, 6 + 1
-.asm_909b6
+.decrease
dec a
ld [hl], a
- jr .asm_909c6
+ jr .finish_dpad
-.asm_909ba
- ld hl, wd002
+.d_up
+ ld hl, wTempDayOfWeek
ld a, [hl]
cp 6
- jr c, .asm_909c4
- ld a, -1
+ jr c, .increase
+ ld a, 0 - 1
-.asm_909c4
+.increase
inc a
ld [hl], a
-.asm_909c6
+.finish_dpad
xor a
ld [hBGMapMode], a
hlcoord 10, 4
- ld b, $2
- ld c, $9
+ ld b, 2
+ ld c, 9
call ClearBox
hlcoord 10, 5
- call Function909de
+ call .PlaceWeekdayString
call WaitBGMap
and a
ret
; 909de
-Function909de: ; 909de
+.PlaceWeekdayString: ; 909de
push hl
- ld a, [wd002]
+ ld a, [wTempDayOfWeek]
ld e, a
ld d, 0
- ld hl, WeekdaysStrings
+ ld hl, .WeekdayStrings
rept 2
add hl, de
endr
@@ -531,40 +533,40 @@
ret
; 909f2
-WeekdaysStrings: ; 909f2
- dw Sunday
- dw Monday
- dw Tuesday
- dw Wednesday
- dw Thursday
- dw Friday
- dw Saturday
- dw Sunday
+.WeekdayStrings: ; 909f2
+ dw .Sunday
+ dw .Monday
+ dw .Tuesday
+ dw .Wednesday
+ dw .Thursday
+ dw .Friday
+ dw .Saturday
+ dw .Sunday
-Sunday: db " SUNDAY@"
-Monday: db " MONDAY@"
-Tuesday: db " TUESDAY@"
-Wednesday: db "WEDNESDAY@"
-Thursday: db "THURSDAY@"
-Friday: db " FRIDAY@"
-Saturday: db "SATURDAY@"
+.Sunday: db " SUNDAY@"
+.Monday: db " MONDAY@"
+.Tuesday: db " TUESDAY@"
+.Wednesday: db "WEDNESDAY@"
+.Thursday: db "THURSDAY@"
+.Friday: db " FRIDAY@"
+.Saturday: db "SATURDAY@"
-UnknownText_0x90a3f: ; 0x90a3f
+.WhatDayIsItText: ; 0x90a3f
; What day is it?
text_jump UnknownText_0x1bc369
db "@"
; 0x90a44
-UnknownText_0x90a44: ; 0x90a44
+.ConfirmWeekdayText: ; 0x90a44
start_asm
hlcoord 1, 14
- call Function909de
- ld hl, UnknownText_0x90a4f
+ call .PlaceWeekdayString
+ ld hl, .IsIt
ret
; 90a4f (24:4a4f)
-UnknownText_0x90a4f: ; 0x90a4f
+.IsIt: ; 0x90a4f
; , is it?
text_jump UnknownText_0x1bc37a
db "@"
@@ -577,12 +579,12 @@
hlcoord 1, 14
lb bc, 3, 18
call ClearBox
- ld hl, UnknownText_0x90a6c
+ ld hl, .Text
call PlaceWholeStringInBoxAtOnce
ret
; 90a6c
-UnknownText_0x90a6c: ; 90a6c
+.Text: ; 90a6c
start_asm
call UpdateTime
ld a, [hHours]
@@ -591,11 +593,11 @@
ld c, a
decoord 1, 14
callba PrintHoursMins
- ld hl, TextJump_DSTIsThatOK
+ ld hl, .DSTIsThatOK
ret
; 90a83 (24:4a83)
-TextJump_DSTIsThatOK: ; 0x90a83
+.DSTIsThatOK: ; 0x90a83
; DST, is that OK?
text_jump Text_DSTIsThatOK
db "@"
@@ -608,12 +610,12 @@
hlcoord 1, 14
lb bc, 3, 18
call ClearBox
- ld hl, UnknownText_0x90aa0
+ ld hl, .Text
call PlaceWholeStringInBoxAtOnce
ret
; 90aa0
-UnknownText_0x90aa0: ; 90aa0
+.Text: ; 90aa0
start_asm
call UpdateTime
ld a, [hHours]
@@ -622,26 +624,26 @@
ld c, a
decoord 1, 14
callba PrintHoursMins
- ld hl, UnknownText_0x90ab7
+ ld hl, .IsThatOK
ret
; 90ab7
-UnknownText_0x90ab7: ; 0x90ab7
+.IsThatOK: ; 0x90ab7
; , is that OK?
text_jump UnknownText_0x1c5ff1
db "@"
; 0x90abc
-Function90abc: ; 90abc
+DebugDisplayTime: ; 90abc
hlcoord 1, 14
lb bc, 3, SCREEN_WIDTH - 2
call ClearBox
- ld hl, UnknownText_0x90acc
+ ld hl, .Text
call PlaceWholeStringInBoxAtOnce
ret
; 90acc
-UnknownText_0x90acc: ; 0x90acc
+.Text: ; 0x90acc
start_asm
call UpdateTime
@@ -655,7 +657,7 @@
inc hl
ld de, hRTCDayLo
- call Function90b23
+ call .PrintTime
hlcoord 1, 16
ld [hl], "D"
@@ -666,7 +668,7 @@
inc hl
ld de, StartDay
- call Function90b23
+ call .PrintTime
ld [hl], " "
inc hl
@@ -690,16 +692,16 @@
inc hl
.done
- ld hl, UnknownText_0x90b13
+ ld hl, .NowOnDebug
ret
; 90b13
-UnknownText_0x90b13: ; 0x90b13
+.NowOnDebug: ; 0x90b13
text "<PARA>Now on DEBUG…"
prompt
; 0x90b23
-Function90b23: ; 90b23
+.PrintTime: ; 90b23
lb bc, 1, 3
call PrintNum
ld [hl], "."
--- a/engine/tmhm2.asm
+++ b/engine/tmhm2.asm
@@ -72,7 +72,7 @@
ChooseMonToLearnTMHM: ; 2c7fb
ld hl, StringBuffer2
- ld de, wd066
+ ld de, wTMHMMoveNameBackup
ld bc, 12
call CopyBytes
call ClearBGPalettes
@@ -95,7 +95,7 @@
pop bc ; now contains the former contents of af
jr z, .egg
push bc
- ld hl, wd066
+ ld hl, wTMHMMoveNameBackup
ld de, StringBuffer2
ld bc, 12
call CopyBytes
--- a/event/buena.asm
+++ b/event/buena.asm
@@ -1,6 +1,6 @@
SpecialBuenasPassword: ; 8af6b
xor a
- ld [wcf76], a
+ ld [wWhichIndexSet], a
ld hl, .MenuDataHeader
call CopyMenuDataHeader
ld a, [wBuenasPassword]
@@ -69,8 +69,8 @@
ld [wMenuScrollPosition], a
ld a, $1
ld [MenuSelection], a
- call Function8b0d6
- call Function8b090
+ call Buena_PlacePrizeMenuBox
+ call Buena_DisplayBlueCardBalance
ld hl, .Text_AskWhichPrize
call PrintText
jr .okay
@@ -83,12 +83,12 @@
call DelayFrame
call UpdateSprites
call PrintBlueCardBalance
- call Function8b0e2
+ call Buena_PrizeMenu
jr z, .done
ld [MenuSelectionQuantity], a
call Buena_getprize
ld a, [hl]
- ld [wd265], a
+ ld [wNamedObjectIndexBuffer], a
call GetItemName
ld hl, .Text_IsThatRight
call BuenaPrintText
@@ -183,7 +183,7 @@
db "@"
; 0x8b090
-Function8b090: ; 8b090
+Buena_DisplayBlueCardBalance: ; 8b090
ld hl, BlueCardBalanceMenuDataHeader
call LoadMenuDataHeader
ret
@@ -230,7 +230,7 @@
db 13, 11 ; end coords
; 8b0d6
-Function8b0d6: ; 8b0d6
+Buena_PlacePrizeMenuBox: ; 8b0d6
ld hl, .menudataheader
call LoadMenuDataHeader
ret
@@ -242,13 +242,13 @@
db 11, 17 ; end coords
; 8b0e2
-Function8b0e2: ; 8b0e2
+Buena_PrizeMenu: ; 8b0e2
ld hl, .MenuDataHeader
call CopyMenuDataHeader
ld a, [MenuSelection]
ld [wMenuCursorBuffer], a
xor a
- ld [wcf76], a
+ ld [wWhichIndexSet], a
ld [hBGMapMode], a
call InitScrollingMenu
call UpdateSprites
--- a/event/bug_contest_2.asm
+++ b/event/bug_contest_2.asm
@@ -27,9 +27,9 @@
.next
; Choose a flag at uniform random to be set.
call Random
- cp $fa ; 250
+ cp 250
jr nc, .next
- ld c, $19 ; 25
+ ld c, 25
call SimpleDivide
ld e, b
ld d, 0
@@ -124,7 +124,7 @@
ld b, $1
.loop
ld a, [hli]
- cp $ff
+ cp -1
jr z, .done
inc b
jr .loop
--- a/event/bug_contest_judging.asm
+++ b/event/bug_contest_judging.asm
@@ -1,7 +1,7 @@
_BugContestJudging: ; 1369d
call ContestScore
callba MobileFn_105f79
- call Function13819
+ call BugContest_JudgeContestants
ld a, [wBugContestThirdPlacePersonID]
call LoadContestantName
ld a, [wBugContestThirdPlaceMon]
@@ -23,13 +23,12 @@
call GetPokemonName
ld hl, BugContest_FirstPlaceText
call PrintText
- jp Function13807
+ jp BugContest_GetPlayersResult
; 136eb
BugContest_FirstPlaceText: ; 0x136eb
text_jump ContestJudging_FirstPlaceText
start_asm
-BugContest_FirstPlace: ; 136f0
ld de, SFX_1ST_PLACE
call PlaySFX
call WaitSFX
@@ -47,7 +46,6 @@
; Placing second was @ , who caught a @ !@ @
text_jump ContestJudging_SecondPlaceText
start_asm
-BugContest_SecondPlace: ; 13707
ld de, SFX_2ND_PLACE
call PlaySFX
call WaitSFX
@@ -215,13 +213,13 @@
dbw KAKUNA, 259
; 13807
-Function13807: ; 13807
+BugContest_GetPlayersResult: ; 13807
ld hl, wBugContestThirdPlacePersonID
ld de, -4
ld b, 3
.loop
ld a, [hl]
- cp 1
+ cp 1 ; Player
jr z, .done
add hl, de
dec b
@@ -231,17 +229,17 @@
ret
; 13819
-Function13819: ; 13819
+BugContest_JudgeContestants: ; 13819
call ClearContestResults
call ComputeAIContestantScores
ld hl, wBugContestTempPersonID
- ld a, 1
+ ld a, 1 ; Player
ld [hli], a
ld a, [wContestMon]
ld [hli], a
ld a, [hProduct]
ld [hli], a
- ld a, [hMultiplicand]
+ ld a, [hProduct + 1]
ld [hl], a
call DetermineContestWinners
ret
@@ -248,8 +246,8 @@
; 13833
ClearContestResults: ; 13833
- ld hl, wBugContestFirstPlacePersonID
- ld b, 12
+ ld hl, wBugContestResults
+ ld b, wBugContestWinnersEnd - wBugContestResults
xor a
.loop
ld [hli], a
--- a/event/card_key.asm
+++ b/event/card_key.asm
@@ -9,7 +9,7 @@
jr nz, .nope
; Are we facing the slot?
ld a, [PlayerDirection]
- and $c
+ and %1100
cp OW_UP
jr nz, .nope
@@ -23,12 +23,12 @@
; Let's use the Card Key.
ld hl, .CardKeyScript
call QueueScript
- ld a, $1
+ ld a, TRUE
ld [wItemEffectSucceeded], a
ret
.nope
- ld a, $0
+ ld a, FALSE
ld [wItemEffectSucceeded], a
ret
; 507af
--- a/event/celebi.asm
+++ b/event/celebi.asm
@@ -114,7 +114,7 @@
add $40
ld d, a
ld e, $0
- ld a, SPRITE_ANIM_INDEX_18 ; fly land
+ ld a, SPRITE_ANIM_INDEX_FLY_LEAF ; fly land
call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
--- a/event/daycare.asm
+++ b/event/daycare.asm
@@ -1,39 +1,61 @@
+ const_def
+ const DAYCARETEXT_00
+ const DAYCARETEXT_01
+ const DAYCARETEXT_02
+ const DAYCARETEXT_03
+ const DAYCARETEXT_04
+ const DAYCARETEXT_05
+ const DAYCARETEXT_06
+ const DAYCARETEXT_07
+ const DAYCARETEXT_08
+ const DAYCARETEXT_09
+ const DAYCARETEXT_0A
+ const DAYCARETEXT_0B
+ const DAYCARETEXT_0C
+ const DAYCARETEXT_0D
+ const DAYCARETEXT_0E
+ const DAYCARETEXT_0F
+ const DAYCARETEXT_10
+ const DAYCARETEXT_11
+ const DAYCARETEXT_12
+ const DAYCARETEXT_13
+
Special_DayCareMan: ; 166d6
ld hl, wDaycareMan
bit 0, [hl]
- jr nz, .asm_166fe
+ jr nz, .AskWithdrawMon
ld hl, wDaycareMan
- ld a, $0
- call Function1678f
- jr c, .asm_16724
- call Function16798
- jr c, .asm_16721
+ ld a, DAYCARETEXT_00
+ call DayCareManIntroText
+ jr c, .cancel
+ call DayCareAskDepositPokemon
+ jr c, .print_text
callba Functionde2a
ld hl, wDaycareMan
set 0, [hl]
- call Function167f6
- call Function16a3b
+ call DayCare_DepositPokemonText
+ call DayCare_InitBreeding
ret
-.asm_166fe
+.AskWithdrawMon
callba Functione698
ld hl, wBreedMon1Nick
call Function1686d
call Function16807
- jr c, .asm_16721
+ jr c, .print_text
callba Functiondd21
call Function16850
ld hl, wDaycareMan
res 0, [hl]
res 5, [hl]
- jr .asm_16724
+ jr .cancel
-.asm_16721
- call Function1689b
+.print_text
+ call PrintDayCareText
-.asm_16724
- ld a, $13
- call Function1689b
+.cancel
+ ld a, DAYCARETEXT_13
+ call PrintDayCareText
ret
; 1672a
@@ -40,26 +62,26 @@
Special_DayCareLady: ; 1672a
ld hl, wDaycareLady
bit 0, [hl]
- jr nz, .asm_16752
+ jr nz, .AskWithdrawMon
ld hl, wDaycareLady
- ld a, $2
- call Function16781
- jr c, .asm_1677b
- call Function16798
- jr c, .asm_16778
+ ld a, DAYCARETEXT_02
+ call DayCareLadyIntroText
+ jr c, .cancel
+ call DayCareAskDepositPokemon
+ jr c, .print_text
callba Functionde37
ld hl, wDaycareLady
set 0, [hl]
- call Function167f6
- call Function16a3b
+ call DayCare_DepositPokemonText
+ call DayCare_InitBreeding
ret
-.asm_16752
+.AskWithdrawMon
callba Functione6b3
ld hl, wBreedMon2Nick
call Function1686d
call Function16807
- jr c, .asm_16778
+ jr c, .print_text
callba Functiondd42
call Function16850
ld hl, wDaycareLady
@@ -66,50 +88,49 @@
res 0, [hl]
ld hl, wDaycareMan
res 5, [hl]
- jr .asm_1677b
+ jr .cancel
-.asm_16778
- call Function1689b
+.print_text
+ call PrintDayCareText
-.asm_1677b
- ld a, $13
- call Function1689b
+.cancel
+ ld a, DAYCARETEXT_13
+ call PrintDayCareText
ret
; 16781
-Function16781: ; 16781
+DayCareLadyIntroText: ; 16781
bit 7, [hl]
- jr nz, .asm_16788
+ jr nz, .okay
set 7, [hl]
inc a
-
-.asm_16788
- call Function1689b
+.okay
+ call PrintDayCareText
call YesNoBox
ret
; 1678f
-Function1678f: ; 1678f
+DayCareManIntroText: ; 1678f
set 7, [hl]
- call Function1689b
+ call PrintDayCareText
call YesNoBox
ret
; 16798
-Function16798: ; 16798
+DayCareAskDepositPokemon: ; 16798
ld a, [PartyCount]
cp 2
- jr c, .asm_167e5
- ld a, 4
- call Function1689b
+ jr c, .OnlyOneMon
+ ld a, DAYCARETEXT_04
+ call PrintDayCareText
ld b, 6
callba SelectTradeOrDaycareMon
- jr c, .asm_167dd
+ jr c, .Declined
ld a, [CurPartySpecies]
cp EGG
- jr z, .asm_167e1
+ jr z, .Egg
callba CheckCurPartyMonFainted
- jr c, .asm_167e9
+ jr c, .OutOfUsableMons
ld hl, PartyMon1Item
ld bc, PARTYMON_STRUCT_LENGTH
ld a, [CurPartyMon]
@@ -116,7 +137,7 @@
call AddNTimes
ld d, [hl]
callba ItemIsMail
- jr c, .asm_167ed
+ jr c, .HoldingMail
ld hl, PartyMonNicknames
ld a, [CurPartyMon]
call GetNick
@@ -123,45 +144,45 @@
and a
ret
-.asm_167dd
- ld a, $12
+.Declined
+ ld a, DAYCARETEXT_12
scf
ret
-.asm_167e1
- ld a, $6
+.Egg
+ ld a, DAYCARETEXT_06
scf
ret
-.asm_167e5
- ld a, $7
+.OnlyOneMon
+ ld a, DAYCARETEXT_07
scf
ret
-.asm_167e9
- ld a, $8
+.OutOfUsableMons
+ ld a, DAYCARETEXT_08
scf
ret
-.asm_167ed
- ld a, $a
+.HoldingMail
+ ld a, DAYCARETEXT_0A
scf
ret
; 167f1
-UnknownText_0x167f1: ; 0x167f1
+.DummyText: ; 0x167f1
;
text_jump UnknownText_0x1bdaa7
db "@"
; 0x167f6
-Function167f6: ; 167f6
- ld a, $5
- call Function1689b
+DayCare_DepositPokemonText: ; 167f6
+ ld a, DAYCARETEXT_05
+ call PrintDayCareText
ld a, [CurPartySpecies]
call PlayCry
- ld a, $9
- call Function1689b
+ ld a, DAYCARETEXT_09
+ call PrintDayCareText
ret
; 16807
@@ -170,7 +191,7 @@
and a
jr nz, .asm_16819
ld a, $f
- call Function1689b
+ call PrintDayCareText
call YesNoBox
jr c, .asm_16844
jr .asm_1682d
@@ -177,11 +198,11 @@
.asm_16819
ld a, $b
- call Function1689b
+ call PrintDayCareText
call YesNoBox
jr c, .asm_16844
ld a, $c
- call Function1689b
+ call PrintDayCareText
call YesNoBox
jr c, .asm_16844
@@ -217,11 +238,11 @@
ld de, Money
callba TakeMoney
ld a, $d
- call Function1689b
+ call PrintDayCareText
ld a, [CurPartySpecies]
call PlayCry
ld a, $e
- call Function1689b
+ call PrintDayCareText
ret
; 1686d
@@ -248,7 +269,7 @@
ret
; 1689b
-Function1689b: ; 1689b
+PrintDayCareText: ; 1689b
ld e, a
ld d, 0
ld hl, TextTable_168aa
@@ -263,143 +284,143 @@
; 168aa
TextTable_168aa: ; 168aa
- dw UnknownText_0x168d2
- dw UnknownText_0x168d7
- dw UnknownText_0x168dc
- dw UnknownText_0x168e1
- dw UnknownText_0x168e6
- dw UnknownText_0x168ff
- dw UnknownText_0x168f0
- dw UnknownText_0x168eb
- dw UnknownText_0x168fa
- dw UnknownText_0x16904
- dw UnknownText_0x168f5
- dw UnknownText_0x16909
- dw UnknownText_0x1690e
- dw UnknownText_0x16913
- dw UnknownText_0x16918
- dw UnknownText_0x1691d
- dw UnknownText_0x16922
- dw UnknownText_0x16927
- dw UnknownText_0x1692c
- dw UnknownText_0x16931
+ dw .DayCareManIntro ; 00
+ dw .DayCareManOddEgg ; 01
+ dw .DayCareLadyIntro ; 02
+ dw .DayCareLadyOddEgg ; 03
+ dw .WhichOne ; 04
+ dw .OkayIllRaiseYourMon ; 05
+ dw .CantAcceptEgg ; 06
+ dw .JustOneMon ; 07
+ dw .LastHealthyMon ; 08
+ dw .ComeBackForItLater ; 09
+ dw .RemoveMail ; 0a
+ dw .AreWeGeniusesOrWhat ; 0b
+ dw .AskRetrieveMon ; 0c
+ dw .PerfectHeresYourMon ; 0d
+ dw .GotBackMon ; 0e
+ dw .ImmediatelyWithdrawMon ; 0f
+ dw .PartyFull ; 10
+ dw .NotEnoughMoney ; 11
+ dw .OhFineThen ; 12
+ dw .ComeAgain ; 13
; 168d2
-UnknownText_0x168d2: ; 0x168d2
+.DayCareManIntro: ; 0x168d2
; I'm the DAY-CARE MAN. Want me to raise a #MON?
text_jump UnknownText_0x1bdaa9
db "@"
; 0x168d7
-UnknownText_0x168d7: ; 0x168d7
+.DayCareManOddEgg: ; 0x168d7
; I'm the DAY-CARE MAN. Do you know about EGGS? I was raising #MON with my wife, you see. We were shocked to find an EGG! How incredible is that? So, want me to raise a #MON?
text_jump UnknownText_0x1bdad8
db "@"
; 0x168dc
-UnknownText_0x168dc: ; 0x168dc
+.DayCareLadyIntro: ; 0x168dc
; I'm the DAY-CARE LADY. Should I raise a #MON for you?
text_jump UnknownText_0x1bdb85
db "@"
; 0x168e1
-UnknownText_0x168e1: ; 0x168e1
+.DayCareLadyOddEgg: ; 0x168e1
; I'm the DAY-CARE LADY. Do you know about EGGS? My husband and I were raising some #MON, you see. We were shocked to find an EGG! How incredible could that be? Should I raise a #MON for you?
text_jump UnknownText_0x1bdbbb
db "@"
; 0x168e6
-UnknownText_0x168e6: ; 0x168e6
+.WhichOne: ; 0x168e6
; What should I raise for you?
text_jump UnknownText_0x1bdc79
db "@"
; 0x168eb
-UnknownText_0x168eb: ; 0x168eb
+.JustOneMon: ; 0x168eb
; Oh? But you have just one #MON.
text_jump UnknownText_0x1bdc97
db "@"
; 0x168f0
-UnknownText_0x168f0: ; 0x168f0
+.CantAcceptEgg: ; 0x168f0
; Sorry, but I can't accept an EGG.
text_jump UnknownText_0x1bdcb8
db "@"
; 0x168f5
-UnknownText_0x168f5: ; 0x168f5
+.RemoveMail: ; 0x168f5
; Remove MAIL before you come see me.
text_jump UnknownText_0x1bdcda
db "@"
; 0x168fa
-UnknownText_0x168fa: ; 0x168fa
+.LastHealthyMon: ; 0x168fa
; If you give me that, what will you battle with?
text_jump UnknownText_0x1bdcff
db "@"
; 0x168ff
-UnknownText_0x168ff: ; 0x168ff
+.OkayIllRaiseYourMon: ; 0x168ff
; OK. I'll raise your @ .
text_jump UnknownText_0x1bdd30
db "@"
; 0x16904
-UnknownText_0x16904: ; 0x16904
+.ComeBackForItLater: ; 0x16904
; Come back for it later.
text_jump UnknownText_0x1bdd4b
db "@"
; 0x16909
-UnknownText_0x16909: ; 0x16909
+.AreWeGeniusesOrWhat: ; 0x16909
; Are we geniuses or what? Want to see your @ ?
text_jump UnknownText_0x1bdd64
db "@"
; 0x1690e
-UnknownText_0x1690e: ; 0x1690e
+.AskRetrieveMon: ; 0x1690e
; Your @ has grown a lot. By level, it's grown by @ . If you want your #MON back, it will cost ¥@ .
text_jump UnknownText_0x1bdd96
db "@"
; 0x16913
-UnknownText_0x16913: ; 0x16913
+.PerfectHeresYourMon: ; 0x16913
; Perfect! Here's your #MON.
text_jump UnknownText_0x1bde04
db "@"
; 0x16918
-UnknownText_0x16918: ; 0x16918
+.GotBackMon: ; 0x16918
; got back @ .
text_jump UnknownText_0x1bde1f
db "@"
; 0x1691d
-UnknownText_0x1691d: ; 0x1691d
+.ImmediatelyWithdrawMon: ; 0x1691d
; Huh? Back already? Your @ needs a little more time with us. If you want your #MON back, it will cost ¥100.
text_jump UnknownText_0x1bde32
db "@"
; 0x16922
-UnknownText_0x16922: ; 0x16922
+.PartyFull: ; 0x16922
; You have no room for it.
text_jump UnknownText_0x1bdea2
db "@"
; 0x16927
-UnknownText_0x16927: ; 0x16927
+.NotEnoughMoney: ; 0x16927
; You don't have enough money.
text_jump UnknownText_0x1bdebc
db "@"
; 0x1692c
-UnknownText_0x1692c: ; 0x1692c
+.OhFineThen: ; 0x1692c
; Oh, fine then.
text_jump UnknownText_0x1bded9
db "@"
; 0x16931
-UnknownText_0x16931: ; 0x16931
+.ComeAgain: ; 0x16931
; Come again.
text_jump UnknownText_0x1bdee9
db "@"
@@ -408,49 +429,49 @@
Special_DayCareManOutside: ; 16936
ld hl, wDaycareMan
bit 6, [hl]
- jr nz, Function16949
- ld hl, UnknownText_0x16944
+ jr nz, .AskGiveEgg
+ ld hl, .NotYet
call PrintText
ret
-UnknownText_0x16944: ; 0x16944
+.NotYet: ; 0x16944
; Not yet…
text_jump UnknownText_0x1bdef6
db "@"
; 0x16949
-Function16949: ; 16949
- ld hl, UnknownText_0x16993
+.AskGiveEgg: ; 16949
+ ld hl, .IntroText
call PrintText
call YesNoBox
- jr c, .asm_1697c
+ jr c, .Declined
ld a, [PartyCount]
cp PARTY_LENGTH
- jr nc, .asm_16987
- call Function169ac
+ jr nc, .PartyFull
+ call DayCare_GiveEgg
ld hl, wDaycareMan
res 6, [hl]
- call Function16a3b
- ld hl, UnknownText_0x16998
+ call DayCare_InitBreeding
+ ld hl, .GotEggText
call PrintText
ld de, SFX_GET_EGG_FROM_DAYCARE_LADY
call PlaySFX
ld c, 120
call DelayFrames
- ld hl, UnknownText_0x1699d
- jr .asm_1697f
+ ld hl, .TakeGoodCareOfItText
+ jr .Load0
-.asm_1697c
- ld hl, UnknownText_0x169a2
+.Declined
+ ld hl, .IllKeepItThanksText
-.asm_1697f
+.Load0
call PrintText
xor a
ld [ScriptVar], a
ret
-.asm_16987
- ld hl, UnknownText_0x169a7
+.PartyFull
+ ld hl, .PartyFullText
call PrintText
ld a, $1
ld [ScriptVar], a
@@ -457,45 +478,46 @@
ret
; 16993
-UnknownText_0x16993: ; 0x16993
+.IntroText: ; 0x16993
; Ah, it's you! We were raising your #MON, and my goodness, were we surprised! Your #MON had an EGG! We don't know how it got there, but your #MON had it. You want it?
text_jump UnknownText_0x1bdf00
db "@"
; 0x16998
-UnknownText_0x16998: ; 0x16998
+.GotEggText: ; 0x16998
; received the EGG!
text_jump UnknownText_0x1bdfa5
db "@"
; 0x1699d
-UnknownText_0x1699d: ; 0x1699d
+.TakeGoodCareOfItText: ; 0x1699d
; Take good care of it.
text_jump UnknownText_0x1bdfba
db "@"
; 0x169a2
-UnknownText_0x169a2: ; 0x169a2
+.IllKeepItThanksText: ; 0x169a2
; Well then, I'll keep it. Thanks!
text_jump UnknownText_0x1bdfd1
db "@"
; 0x169a7
-UnknownText_0x169a7: ; 0x169a7
+.PartyFullText: ; 0x169a7
; You have no room in your party. Come back later.
text_jump UnknownText_0x1bdff2
db "@"
; 0x169ac
-Function169ac: ; 169ac
+DayCare_GiveEgg: ; 169ac
ld a, [wEggMonLevel]
ld [CurPartyLevel], a
ld hl, PartyCount
ld a, [hl]
cp PARTY_LENGTH
- jr nc, .asm_16a2f
+ jr nc, .PartyFull
inc a
ld [hl], a
+
ld c, a
ld b, 0
add hl, bc
@@ -504,24 +526,28 @@
ld a, [wEggMonSpecies]
ld [CurSpecies], a
ld [CurPartySpecies], a
- ld a, $ff
+ ld a, -1
ld [hl], a
+
ld hl, PartyMonNicknames
ld bc, PKMN_NAME_LENGTH
- call Function16a31
+ call DayCare_GetCurrentPartyMember
ld hl, wEggNick
call CopyBytes
+
ld hl, PartyMonOT
ld bc, NAME_LENGTH
- call Function16a31
+ call DayCare_GetCurrentPartyMember
ld hl, wEggOT
call CopyBytes
+
ld hl, PartyMon1
ld bc, PARTYMON_STRUCT_LENGTH
- call Function16a31
+ call DayCare_GetCurrentPartyMember
ld hl, wEggMon
ld bc, wEggMonEnd - wEggMon
call CopyBytes
+
call GetBaseData
ld a, [PartyCount]
dec a
@@ -550,12 +576,12 @@
and a
ret
-.asm_16a2f
+.PartyFull
scf
ret
; 16a31
-Function16a31: ; 16a31
+DayCare_GetCurrentPartyMember: ; 16a31
ld a, [PartyCount]
dec a
call AddNTimes
@@ -564,7 +590,7 @@
ret
; 16a3b
-Function16a3b: ; 16a3b
+DayCare_InitBreeding: ; 16a3b
ld a, [wDaycareLady]
bit 0, a
ret z
@@ -579,15 +605,15 @@
ret z
ld hl, wDaycareMan
set 5, [hl]
-.asm_16a59
+.loop
call Random
cp 150
- jr c, .asm_16a59
+ jr c, .loop
ld [wStepsToEgg], a
- jp Function16a66
+ jp .UselessJump
; 16a66
-Function16a66: ; 16a66
+.UselessJump: ; 16a66
xor a
ld hl, wEggMon
ld bc, wEggMonEnd - wEggMon
@@ -609,24 +635,24 @@
ld a, [wBreedMon1Species]
cp DITTO
ld a, $1
- jr z, .asm_16ab6
+ jr z, .LoadWhichBreedmonIsTheMother
ld a, [wBreedMon2Species]
cp DITTO
ld a, $0
- jr z, .asm_16ab6
+ jr z, .LoadWhichBreedmonIsTheMother
callba GetGender
ld a, $0
- jr z, .asm_16ab6
+ jr z, .LoadWhichBreedmonIsTheMother
inc a
-.asm_16ab6
- ld [wDittoInDaycare], a
+.LoadWhichBreedmonIsTheMother
+ ld [wBreedMotherOrNonDitto], a
and a
ld a, [wBreedMon1Species]
- jr z, .asm_16ac2
+ jr z, .GotMother
ld a, [wBreedMon2Species]
-.asm_16ac2
+.GotMother
ld [CurPartySpecies], a
callab GetPreEvolution
callab GetPreEvolution
@@ -635,13 +661,13 @@
ld a, [CurPartySpecies]
cp NIDORAN_F
- jr nz, .asm_16ae8
+ jr nz, .GotEggSpecies
call Random
- cp $80
+ cp 1 + 50 percent
ld a, NIDORAN_F
- jr c, .asm_16ae8
+ jr c, .GotEggSpecies
ld a, NIDORAN_M
-.asm_16ae8
+.GotEggSpecies
ld [CurPartySpecies], a
ld [CurSpecies], a
ld [wEggMonSpecies], a
@@ -648,7 +674,7 @@
call GetBaseData
ld hl, wEggNick
- ld de, String_16be0
+ ld de, .String_EGG
call CopyName2
ld hl, PlayerName
ld de, wEggOT
@@ -672,17 +698,17 @@
ld hl, wEggMonExp
ld a, [hMultiplicand]
ld [hli], a
- ld a, [$ffb5]
+ ld a, [hMultiplicand + 1]
ld [hli], a
- ld a, [$ffb6]
+ ld a, [hMultiplicand + 2]
ld [hl], a
xor a
- ld b, $a
+ ld b, wEggMonDVs - wEggMonStatExp
ld hl, wEggMonStatExp
-.asm_16b46
+.loop2
ld [hli], a
dec b
- jr nz, .asm_16b46
+ jr nz, .loop2
ld hl, wEggMonDVs
call Random
ld [hli], a
@@ -693,12 +719,12 @@
ld de, wBreedMon1DVs
ld a, [wBreedMon1Species]
cp DITTO
- jr z, .asm_16b98
+ jr z, .GotDVs
ld de, wBreedMon2DVs
ld a, [wBreedMon2Species]
cp DITTO
- jr z, .asm_16b98
- ld a, $3
+ jr z, .GotDVs
+ ld a, BREEDMON
ld [MonType], a
push hl
callba GetGender
@@ -705,23 +731,23 @@
pop hl
ld de, wBreedMon1DVs
ld bc, wBreedMon2DVs
- jr c, .asm_16bab
- jr z, .asm_16b90
- ld a, [wDittoInDaycare]
+ jr c, .SkipDVs
+ jr z, .ParentCheck2
+ ld a, [wBreedMotherOrNonDitto]
and a
- jr z, .asm_16b98
+ jr z, .GotDVs
ld d, b
ld e, c
- jr .asm_16b98
+ jr .GotDVs
-.asm_16b90
- ld a, [wDittoInDaycare]
+.ParentCheck2
+ ld a, [wBreedMotherOrNonDitto]
and a
- jr nz, .asm_16b98
+ jr nz, .GotDVs
ld d, b
ld e, c
-.asm_16b98
+.GotDVs
ld a, [de]
inc de
and $f
@@ -738,15 +764,15 @@
add b
ld [hl], a
-.asm_16bab
+.SkipDVs
ld hl, StringBuffer1
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
ld bc, NAME_LENGTH
call CopyBytes
ld hl, wEggMonMoves
ld de, wEggMonPP
predef FillPP
- ld hl, wd050
+ ld hl, wMonOrItemNameBuffer
ld de, StringBuffer1
ld bc, NAME_LENGTH
call CopyBytes
@@ -763,6 +789,6 @@
ret
; 16be0
-String_16be0: ; 16be0
+.String_EGG: ; 16be0
db "EGG@"
; 16be4
--- a/event/dratini.asm
+++ b/event/dratini.asm
@@ -8,8 +8,8 @@
ret nc
ld bc, PartyCount
ld a, [bc]
- ld hl, 0
- call GetNthPartyMon
+ ld hl, MON_SPECIES
+ call .GetNthPartyMon
ld a, [bc]
ld c, a
ld de, PARTYMON_STRUCT_LENGTH
@@ -85,7 +85,7 @@
db TWISTER
db 0
-GetNthPartyMon: ; 0x8b1ce
+.GetNthPartyMon: ; 0x8b1ce
; inputs:
; hl must be set to 0 before calling this function.
; a must be set to the number of Pokémon in the party.
@@ -106,6 +106,7 @@
dec a
jr nz, .loop
ret
+
.EmptyParty
scf
ret
--- a/event/field_moves.asm
+++ b/event/field_moves.asm
@@ -330,7 +330,7 @@
ld [VramState], a
call FlyFunction_InitGFX
depixel 10, 10, 4, 0
- ld a, SPRITE_ANIM_INDEX_0A
+ ld a, SPRITE_ANIM_INDEX_WALK_CYCLE
call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
@@ -337,8 +337,8 @@
ld [hl], $84
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld [hl], SPRITE_ANIM_SEQ_16
- ld a, $80
+ ld [hl], SPRITE_ANIM_SEQ_FLY_FROM
+ ld a, 128
ld [wcf64], a
.loop
ld a, [wJumptableIndex]
@@ -347,7 +347,7 @@
ld a, 0 * 4
ld [wCurrSpriteOAMAddr], a
callab DoNextFrameForAllSprites
- call Function8cbc8
+ call FlyFunction_FrameTimer
call DelayFrame
jr .loop
@@ -365,7 +365,7 @@
ld [VramState], a
call FlyFunction_InitGFX
depixel 31, 10, 4, 0
- ld a, SPRITE_ANIM_INDEX_0A
+ ld a, SPRITE_ANIM_INDEX_WALK_CYCLE
call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
@@ -372,11 +372,11 @@
ld [hl], $84
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld [hl], $18
+ ld [hl], SPRITE_ANIM_SEQ_FLY_TO
ld hl, SPRITEANIMSTRUCT_0F
add hl, bc
- ld [hl], $58
- ld a, $40
+ ld [hl], 11 * 8
+ ld a, 64
ld [wcf64], a
.loop
ld a, [wJumptableIndex]
@@ -385,7 +385,7 @@
ld a, 0 * 4
ld [wCurrSpriteOAMAddr], a
callab DoNextFrameForAllSprites
- call Function8cbc8
+ call FlyFunction_FrameTimer
call DelayFrame
jr .loop
@@ -392,14 +392,14 @@
.exit
pop af
ld [VramState], a
- call Function8cb82
+ call .RestorePlayerSprite_DespawnLeaves
ret
-Function8cb82: ; 8cb82 (23:4b82)
+.RestorePlayerSprite_DespawnLeaves: ; 8cb82 (23:4b82)
ld hl, Sprites + 2 ; Tile ID
xor a
ld c, $4
-.loop
+.loop2
ld [hli], a
rept 3
inc hl
@@ -406,7 +406,7 @@
endr
inc a
dec c
- jr nz, .loop
+ jr nz, .loop2
ld hl, Sprites + 4 * 4
ld bc, SpritesEnd - (Sprites + 4 * 4)
xor a
@@ -432,8 +432,8 @@
ld [wJumptableIndex], a
ret
-Function8cbc8: ; 8cbc8 (23:4bc8)
- call Function8cbe6
+FlyFunction_FrameTimer: ; 8cbc8 (23:4bc8)
+ call .SpawnLeaf
ld hl, wcf64
ld a, [hl]
and a
@@ -452,7 +452,7 @@
set 7, [hl]
ret
-Function8cbe6: ; 8cbe6 (23:4be6)
+.SpawnLeaf: ; 8cbe6 (23:4be6)
ld hl, wcf65
ld a, [hl]
inc [hl]
@@ -459,12 +459,12 @@
and $7
ret nz
ld a, [hl]
- and $18
+ and (6 * 8) >> 1
sla a
- add $40
+ add 8 * 8 ; gives a number in [$40, $50, $60, $70]
ld d, a
ld e, $0
- ld a, SPRITE_ANIM_INDEX_18 ; fly land
+ ld a, SPRITE_ANIM_INDEX_FLY_LEAF ; fly land
call _InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
--- a/event/itemball.asm
+++ b/event/itemball.asm
@@ -37,7 +37,7 @@
xor a
ld [ScriptVar], a
ld a, [EngineBuffer1]
- ld [wd265], a
+ ld [wNamedObjectIndexBuffer], a
call GetItemName
ld hl, StringBuffer3
call CopyName2
--- a/event/itemfinder.asm
+++ b/event/itemfinder.asm
@@ -15,7 +15,7 @@
; 12599
.ItemfinderSound: ; 12599
- ld c, $4
+ ld c, 4
.sfx_loop
push bc
ld de, SFX_SECOND_PART_OF_ITEMFINDER
--- a/event/kurt.asm
+++ b/event/kurt.asm
@@ -1,10 +1,10 @@
Kurt_PrintTextWhichApricorn: ; 88000
- ld hl, UnknownText_0x88007
+ ld hl, .Text
call PrintText
ret
; 88007
-UnknownText_0x88007: ; 0x88007
+.Text: ; 0x88007
; Which APRICORN should I use?
text_jump UnknownText_0x1bc06b
db "@"
@@ -11,12 +11,12 @@
; 0x8800c
Kurt_PrintTextHowMany: ; 8800c
- ld hl, UnknownText_0x88013
+ ld hl, .Text
call PrintText
ret
; 88013
-UnknownText_0x88013: ; 0x88013
+.Text: ; 0x88013
; How many should I make?
text_jump UnknownText_0x1bc089
db "@"
@@ -69,7 +69,7 @@
call UpdateSprites
call ScrollingMenu
ld a, [wMenuJoypad]
- cp $2
+ cp B_BUTTON
jr z, .nope
ld a, [MenuSelection]
cp -1
@@ -167,7 +167,7 @@
.PlaceApricornName: ; 88116
call MenuBoxCoord2Tile
- ld de, $0015
+ ld de, SCREEN_WIDTH + 1
add hl, de
ld d, h
ld e, l
@@ -177,7 +177,7 @@
PlaceApricornQuantity: ; 88126
call MenuBoxCoord2Tile
- ld de, $0032
+ ld de, 2 * SCREEN_WIDTH + 10
add hl, de
ld [hl], "×"
inc hl
@@ -233,7 +233,7 @@
xor a
ld [CurItemQuantity], a
ld a, -1
- ld [wd002], a
+ ld [wApricorns], a
; Search for [CurItem] in the bag.
.loop1
@@ -253,7 +253,7 @@
; Increment the result counter and store the bag index of the match.
ld d, $0
push hl
- ld hl, wd002
+ ld hl, wApricorns
add hl, de
inc e
ld a, [CurItemQuantity]
@@ -271,7 +271,7 @@
jr z, .done
dec a
jr z, .OnlyOne
- ld hl, wd002
+ ld hl, wApricorns
.loop2
ld a, [hl]
@@ -316,7 +316,7 @@
jr nz, .loop2
.OnlyOne
- ld hl, wd002
+ ld hl, wApricorns
.loop4
ld a, [hl]
cp -1
--- a/event/magikarp.asm
+++ b/event/magikarp.asm
@@ -1,5 +1,3 @@
-
-
Special_CheckMagikarpLength: ; fbb32
; Returns 3 if you select a Magikarp that beats the previous record.
; Returns 2 if you select a Magikarp, but the current record is longer.
@@ -81,7 +79,7 @@
; 0xfbbae
Magikarp_LoadFeetInchesChars: ; fbbae
- ld hl, VTiles2 + "′" * $10
+ ld hl, VTiles2 tile "′"
ld de, .feetinchchars
lb bc, BANK(.feetinchchars), 2
call Request2bpp
--- a/event/magnet_train.asm
+++ b/event/magnet_train.asm
@@ -3,14 +3,14 @@
and a
jr nz, .ToGoldenrod
ld a, 1 ; forwards
- lb bc, $40, $60
- ld de, $fca0
+ lb bc, $40, $60
+ lb de, (11 * 8) - (11 * 8 + 4), -$60
jr .continue
.ToGoldenrod
ld a, -1 ; backwards
- lb bc, $c0, $a0
- ld de, $b460
+ lb bc, -$40, -$60
+ lb de, (11 * 8) + (11 * 8 + 4), $60
.continue
ld h, a
@@ -18,21 +18,23 @@
push af
ld a, $5
ld [rSVBK], a
+
ld a, h
- ld [w5_d191], a
+ ld [wMagnetTrainDirection], a
ld a, c
- ld [w5_d192], a
+ ld [wMagnetTrainInitPosition], a
ld a, b
- ld [w5_d193], a
+ ld [wMagnetTrainHoldPosition], a
ld a, e
- ld [w5_d194], a
+ ld [wMagnetTrainFinalPosition], a
ld a, d
- ld [w5_d195], a
+ ld [wMagnetTrainPlayerSpriteInitX], a
+
ld a, [hSCX]
push af
ld a, [hSCY]
push af
- call Function8ccc9
+ call MagntTrain_LoadGFX_PlayMusic
ld hl, hVBlank
ld a, [hl]
push af
@@ -44,14 +46,14 @@
bit 7, a
jr nz, .done
callab PlaySpriteAnimations
- call Function8cdf7
- call Function8cc99
+ call MagnetTrain_Jumptable
+ call MagnetTrain_UpdateLYOverrides
call Function3b0c
call DelayFrame
jr .loop
.initialize
- call Function8ceae
+ call MagnetTrain_Jumptable_FirstRunThrough
jr .loop
.done
@@ -69,6 +71,7 @@
ld [Requested2bppDest + 1], a
ld [Requested2bpp], a
call ClearTileMap
+
pop af
ld [hSCY], a
pop af
@@ -80,21 +83,21 @@
ret
; 8cc99
-Function8cc99: ; 8cc99
+MagnetTrain_UpdateLYOverrides: ; 8cc99
ld hl, LYOverridesBackup
ld c, $2f
ld a, [wcf64]
add a
ld [hSCX], a
- call Function8ccc4
+ call .loadloop
ld c, $30
ld a, [wcf65]
- call Function8ccc4
+ call .loadloop
ld c, $31
ld a, [wcf64]
add a
- call Function8ccc4
- ld a, [wd191]
+ call .loadloop
+ ld a, [wMagnetTrainDirection]
ld d, a
ld hl, wcf64
ld a, [hl]
@@ -103,17 +106,15 @@
endr
ld [hl], a
ret
-; 8ccc4
-Function8ccc4: ; 8ccc4
-.asm_8ccc4
+.loadloop
ld [hli], a
dec c
- jr nz, .asm_8ccc4
+ jr nz, .loadloop
ret
; 8ccc9
-Function8ccc9: ; 8ccc9
+MagntTrain_LoadGFX_PlayMusic: ; 8ccc9
call ClearBGPalettes
call ClearSprites
call DisableLCD
@@ -135,20 +136,20 @@
pop af
ld [rSVBK], a
ld hl, VTiles0
- ld c, $4
+ ld c, 4
call Request2bpp
- ld hl, $c0
+ ld hl, 12 tiles
add hl, de
ld d, h
ld e, l
ld hl, VTiles0 tile $04
- ld c, $4
+ ld c, 4
call Request2bpp
- call Function8cda6
+ call MagnetTrain_InitLYOverrides
ld hl, wJumptableIndex
xor a
ld [hli], a
- ld a, [wd192]
+ ld a, [wMagnetTrainInitPosition]
rept 3
ld [hli], a
endr
@@ -160,13 +161,13 @@
DrawMagnetTrain: ; 8cd27
hlbgcoord 0, 0
xor a
-.asm_8cd2b
+.loop
call GetMagnetTrainBGTiles
ld b, 32 / 2
call .FillAlt
inc a
cp $12
- jr c, .asm_8cd2b
+ jr c, .loop
hlbgcoord 0, 6
ld de, MagnetTrainTilemap1
ld c, 20
@@ -243,14 +244,14 @@
db $5c, $5d ; bush
; 8cda6
-Function8cda6: ; 8cda6
+MagnetTrain_InitLYOverrides: ; 8cda6
ld hl, LYOverrides
- ld bc, $90
- ld a, [wd192]
+ ld bc, LYOverridesEnd - LYOverrides
+ ld a, [wMagnetTrainInitPosition]
call ByteFill
ld hl, LYOverridesBackup
- ld bc, $90
- ld a, [wd192]
+ ld bc, LYOverridesBackupEnd - LYOverridesBackup
+ ld a, [wMagnetTrainInitPosition]
call ByteFill
ld a, $43
ld [hLCDStatCustom], a
@@ -290,11 +291,11 @@
ret
; 8cdf7
-Function8cdf7: ; 8cdf7
+MagnetTrain_Jumptable: ; 8cdf7
ld a, [wJumptableIndex]
ld e, a
ld d, 0
- ld hl, Jumptable_8ce06
+ ld hl, .Jumptable
rept 2
add hl, de
endr
@@ -304,25 +305,26 @@
jp [hl]
; 8ce06
-Jumptable_8ce06: ; 8ce06
- dw Function8ce19
- dw Function8ce6d
- dw Function8ce47
- dw Function8ce6d
- dw Function8ce7a
- dw Function8ce6d
- dw Function8cea2
+.Jumptable: ; 8ce06
+ jumptable_start
+ jumptable .InitPlayerSpriteAnim
+ jumptable .WaitScene
+ jumptable .MoveTrain1
+ jumptable .WaitScene
+ jumptable .MoveTrain2
+ jumptable .WaitScene
+ jumptable .TrainArrived
; 8ce14
-Function8ce14: ; 8ce14
+.Next: ; 8ce14
ld hl, wJumptableIndex
inc [hl]
ret
; 8ce19
-Function8ce19: ; 8ce19
- ld d, $55
- ld a, [wOverworldMapAnchor + 1]
+.InitPlayerSpriteAnim: ; 8ce19
+ ld d, 10 * 8 + 5
+ ld a, [wMagnetTrainPlayerSpriteInitX]
ld e, a
ld b, SPRITE_ANIM_INDEX_15
ld a, [rSVBK]
@@ -331,67 +333,67 @@
ld [rSVBK], a
ld a, [PlayerGender]
bit 0, a
- jr z, .asm_8ce31
+ jr z, .got_gender
ld b, SPRITE_ANIM_INDEX_1F
-.asm_8ce31
+.got_gender
pop af
ld [rSVBK], a
ld a, b
call _InitSpriteAnimStruct
- ld hl, $3
+ ld hl, SPRITEANIMSTRUCT_TILE_ID
add hl, bc
ld [hl], $0
- call Function8ce14
+ call .Next
ld a, $80
ld [wcf66], a
ret
; 8ce47
-Function8ce47: ; 8ce47
- ld hl, wd193
+.MoveTrain1: ; 8ce47
+ ld hl, wMagnetTrainHoldPosition
ld a, [wcf65]
cp [hl]
- jr z, .asm_8ce64
+ jr z, .PrepareToHoldTrain
ld e, a
- ld a, [wd191]
+ ld a, [wMagnetTrainDirection]
xor $ff
inc a
add e
ld [wcf65], a
ld hl, wGlobalAnimXOffset
- ld a, [wd191]
+ ld a, [wMagnetTrainDirection]
add [hl]
ld [hl], a
ret
-.asm_8ce64
- call Function8ce14
+.PrepareToHoldTrain
+ call .Next
ld a, $80
ld [wcf66], a
ret
; 8ce6d
-Function8ce6d: ; 8ce6d
+.WaitScene: ; 8ce6d
ld hl, wcf66
ld a, [hl]
and a
- jr z, .asm_8ce76
+ jr z, .DoneWaiting
dec [hl]
ret
-.asm_8ce76
- call Function8ce14
+.DoneWaiting
+ call .Next
ret
; 8ce7a
-Function8ce7a: ; 8ce7a
- ld hl, wOverworldMapAnchor
+.MoveTrain2: ; 8ce7a
+ ld hl, wMagnetTrainFinalPosition
ld a, [wcf65]
cp [hl]
- jr z, .asm_8ce9e
+ jr z, .PrepareToFinishAnim
ld e, a
- ld a, [wd191]
+ ld a, [wMagnetTrainDirection]
xor $ff
inc a
ld d, a
@@ -401,7 +403,7 @@
endr
ld [wcf65], a
ld hl, wGlobalAnimXOffset
- ld a, [wd191]
+ ld a, [wMagnetTrainDirection]
ld d, a
ld a, [hl]
rept 2
@@ -412,12 +414,12 @@
ret
-.asm_8ce9e
- call Function8ce14
+.PrepareToFinishAnim
+ call .Next
ret
; 8cea2
-Function8cea2: ; 8cea2
+.TrainArrived: ; 8cea2
ld a, $80
ld [wJumptableIndex], a
ld de, SFX_TRAIN_ARRIVED
@@ -425,10 +427,10 @@
ret
; 8ceae
-Function8ceae: ; 8ceae
+MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae
callba PlaySpriteAnimations
- call Function8cdf7
- call Function8cc99
+ call MagnetTrain_Jumptable
+ call MagnetTrain_UpdateLYOverrides
call Function3b0c
call DelayFrame
ld a, [rSVBK]
--- a/event/mom.asm
+++ b/event/mom.asm
@@ -5,20 +5,20 @@
ld [hInMenu], a
xor a
ld [wJumptableIndex], a
-.asm_16223
+.loop
ld a, [wJumptableIndex]
bit 7, a
- jr nz, .asm_1622f
- call Function16233
- jr .asm_16223
+ jr nz, .done
+ call .RunJumptable
+ jr .loop
-.asm_1622f
+.done
pop af
ld [hInMenu], a
ret
; 16233
-Function16233: ; 16233
+.RunJumptable: ; 16233
ld a, [wJumptableIndex]
ld e, a
ld d, 0
@@ -33,15 +33,16 @@
; 16242
.jumptable: ; 16242
- dw .CheckIfBankInitialized
- dw .InitializeBank
- dw .IsThisAboutYourMoney
- dw .AccessBankOfMom
- dw .StoreMoney
- dw .TakeMoney
- dw .StopOrStartSavingMoney
- dw .AskDST
- dw .JustDoWhatYouCan
+ jumptable_start
+ jumptable .CheckIfBankInitialized
+ jumptable .InitializeBank
+ jumptable .IsThisAboutYourMoney
+ jumptable .AccessBankOfMom
+ jumptable .StoreMoney
+ jumptable .TakeMoney
+ jumptable .StopOrStartSavingMoney
+ jumptable .AskDST
+ jumptable .JustDoWhatYouCan
; 16254
.CheckIfBankInitialized: ; 16254
@@ -309,36 +310,36 @@
ld a, [wDST]
bit 7, a
ld a, [hHours]
- jr z, .asm_16447
+ jr z, .NotDST
and a ; within one hour of 00:00?
jr z, .LostBooklet
jr .loop
-.asm_16447
+.NotDST
cp 23 ; within one hour of 23:00?
jr nz, .loop
; fallthrough
.LostBooklet
- call Function164ea
+ call .ClearBox
bccoord 1, 14
- ld hl, UnknownText_0x164f4
+ ld hl, .Text_AdjustClock
call PlaceWholeStringInBoxAtOnce
call YesNoBox
ret c
- call Function164ea
+ call .ClearBox
bccoord 1, 14
- ld hl, LostInstructionBookletText
+ ld hl, .Text_LostInstructionBooklet
call PlaceWholeStringInBoxAtOnce
ret
.loop
- call Function164ea
+ call .ClearBox
bccoord 1, 14
ld a, [wDST]
bit 7, a
- jr z, .asm_16497
- ld hl, UnknownText_0x16508
+ jr z, .SetDST
+ ld hl, .Text_IsDSTOver
call PlaceWholeStringInBoxAtOnce
call YesNoBox
ret c
@@ -345,15 +346,15 @@
ld a, [wDST]
res 7, a
ld [wDST], a
- call Function164d1
- call Function164ea
+ call .SetClockBack
+ call .ClearBox
bccoord 1, 14
- ld hl, UnknownText_0x1650d
+ ld hl, .Text_SetClockBack
call PlaceWholeStringInBoxAtOnce
ret
-.asm_16497
- ld hl, UnknownText_0x164fe
+.SetDST
+ ld hl, .Text_SwitchToDST
call PlaceWholeStringInBoxAtOnce
call YesNoBox
ret c
@@ -360,21 +361,21 @@
ld a, [wDST]
set 7, a
ld [wDST], a
- call Function164b9
- call Function164ea
+ call .SetClockForward
+ call .ClearBox
bccoord 1, 14
- ld hl, UnknownText_0x16503
+ ld hl, .Text_SetClockForward
call PlaceWholeStringInBoxAtOnce
ret
; 164b9
-Function164b9: ; 164b9
+.SetClockForward: ; 164b9
ld a, [StartHour]
add 1
sub 24
- jr nc, .asm_164c4
+ jr nc, .DontLoopHourForward
add 24
-.asm_164c4
+.DontLoopHourForward
ld [StartHour], a
ccf
ld a, [StartDay]
@@ -383,23 +384,23 @@
ret
; 164d1
-Function164d1: ; 164d1
+.SetClockBack: ; 164d1
ld a, [StartHour]
sub 1
- jr nc, .asm_164da
+ jr nc, .DontLoopHourBack
add 24
-.asm_164da
+.DontLoopHourBack
ld [StartHour], a
ld a, [StartDay]
sbc 0
- jr nc, .asm_164e6
+ jr nc, .DontLoopDayBack
add 7
-.asm_164e6
+.DontLoopDayBack
ld [StartDay], a
ret
; 164ea
-Function164ea: ; 164ea
+.ClearBox: ; 164ea
hlcoord 1, 14
lb bc, 3, 18
call ClearBox
@@ -406,13 +407,13 @@
ret
; 164f4
-UnknownText_0x164f4: ; 0x164f4
+.Text_AdjustClock: ; 0x164f4
; Do you want to adjust your clock for Daylight Saving Time?
text_jump UnknownText_0x1c6095
db "@"
; 0x164f9
-LostInstructionBookletText: ; 0x164f9
+.Text_LostInstructionBooklet: ; 0x164f9
; I lost the instruction booklet for the POKéGEAR.
; Come back again in a while.
text_jump UnknownText_0x1c60d1
@@ -419,25 +420,25 @@
db "@"
; 0x164fe
-UnknownText_0x164fe: ; 0x164fe
+.Text_SwitchToDST: ; 0x164fe
; Do you want to switch to Daylight Saving Time?
text_jump UnknownText_0x1c6000
db "@"
; 0x16503
-UnknownText_0x16503: ; 0x16503
+.Text_SetClockForward: ; 0x16503
; I set the clock forward by one hour.
text_jump UnknownText_0x1c6030
db "@"
; 0x16508
-UnknownText_0x16508: ; 0x16508
+.Text_IsDSTOver: ; 0x16508
; Is Daylight Saving Time over?
text_jump UnknownText_0x1c6056
db "@"
; 0x1650d
-UnknownText_0x1650d: ; 0x1650d
+.Text_SetClockBack: ; 0x1650d
; I put the clock back one hour.
text_jump UnknownText_0x1c6075
db "@"
--- a/event/mom_phone.asm
+++ b/event/mom_phone.asm
@@ -9,23 +9,23 @@
ld [wdc18], a
call CheckBalance_MomItem2
ret nc
- call Functionfd0c3
+ call Mom_GiveItemOrDoll
ret nc
- ld b, BANK(UnknownScript_0xfd00f)
- ld de, UnknownScript_0xfd00f
+ ld b, BANK(.Script)
+ ld de, .Script
callba LoadScriptBDE
scf
ret
; fd00f
-UnknownScript_0xfd00f: ; 0xfd00f
- callasm Functionfd017
+.Script: ; 0xfd00f
+ callasm .ASMFunction
farjump Script_ReceivePhoneCall
; 0xfd017
-Functionfd017: ; fd017
+.ASMFunction: ; fd017
call MomBuysItem_DeductFunds
- call Functionfd0eb
+ call Mom_GetScriptPointer
ld a, [wdc18]
and a
jr nz, .ok
@@ -32,17 +32,17 @@
ld hl, wdc17
inc [hl]
.ok
- ld a, 1
+ ld a, PHONE_MOM
ld [wCurrentCaller], a
- ld bc, wd03f
+ ld bc, EngineBuffer2
ld hl, 0
add hl, bc
ld [hl], 0
inc hl
ld [hl], 1
- ld hl, 9
+ ld hl, wPhoneScriptPointer - EngineBuffer2
add hl, bc
- ld a, $3f
+ ld a, BANK(Mom_GetScriptPointer)
ld [hli], a
ld a, e
ld [hli], a
@@ -114,7 +114,7 @@
MomBuysItem_DeductFunds: ; fd0a6 (3f:50a6)
call GetItemFromMom
- ld de, 3
+ ld de, 3 ; cost
add hl, de
ld a, [hli]
ld [hMoneyTemp], a
@@ -128,12 +128,12 @@
ret
-Functionfd0c3: ; fd0c3
+Mom_GiveItemOrDoll: ; fd0c3
call GetItemFromMom
- ld de, 6
+ ld de, 6 ; item type
add hl, de
ld a, [hli]
- cp 1
+ cp MOM_ITEM
jr z, .not_doll
ld a, [hl]
ld c, a
@@ -145,7 +145,7 @@
.not_doll
ld a, [hl]
ld [CurItem], a
- ld a, $1
+ ld a, 1
ld [wItemQuantityChangeBuffer], a
ld hl, PCItems
call ReceiveItem
@@ -153,19 +153,19 @@
; fd0eb
-Functionfd0eb: ; fd0eb (3f:50eb)
+Mom_GetScriptPointer: ; fd0eb (3f:50eb)
call GetItemFromMom
- ld de, 6 ; field
+ ld de, 6 ; item type
add hl, de
ld a, [hli]
- ld de, Script_MomBoughtItem
- cp 1
+ ld de, .ItemScript
+ cp MOM_ITEM
ret z
- ld de, Script_MomBoughtDoll
+ ld de, .DollScript
ret
; fd0fd (3f:50fd)
-Script_MomBoughtItem: ; 0xfd0fd
+.ItemScript: ; 0xfd0fd
writetext _MomText_HiHowAreYou
writetext _MomText_FoundAnItem
writetext _MomText_BoughtWithYourMoney
@@ -173,7 +173,7 @@
end
; 0xfd10a
-Script_MomBoughtDoll: ; 0xfd10a
+.DollScript: ; 0xfd10a
writetext _MomText_HiHowAreYou
writetext _MomText_FoundADoll
writetext _MomText_BoughtWithYourMoney
@@ -188,7 +188,7 @@
jr z, .zero
dec a
ld de, MomItems_1
- jr .incave
+ jr .GetFromList1
.zero
ld a, [wdc17]
@@ -199,7 +199,7 @@
.ok
ld de, MomItems_2
-.incave
+.GetFromList1
ld l, a
ld h, 0
rept 3 ; multiply hl by 8
@@ -223,8 +223,6 @@
momitem 0, 180, MOM_ITEM, POKE_BALL
momitem 0, 450, MOM_ITEM, ESCAPE_ROPE
momitem 0, 500, MOM_ITEM, GREAT_BALL
-; fd15e
-
MomItems_2: ; fd15e
momitem 900, 600, MOM_ITEM, SUPER_POTION
momitem 4000, 270, MOM_ITEM, REPEL
--- a/event/move_deleter.asm
+++ b/event/move_deleter.asm
@@ -22,7 +22,7 @@
call LoadStandardMenuDataHeader
callba ChooseMoveToDelete
push af
- call Function2b74
+ call ReturnToMapWithSpeechTextbox
pop af
jr c, .asm_2c5c3
ld a, [wMenuCursorY]
--- a/event/photo.asm
+++ b/event/photo.asm
@@ -249,7 +249,7 @@
call PrintText
call DisableSpriteUpdates
callba PrintPartymon
- call Function2b74
+ call ReturnToMapWithSpeechTextbox
ld a, [hPrinter]
and a
jr nz, .cancel
--- a/gfx/mail.asm
+++ b/gfx/mail.asm
@@ -694,22 +694,22 @@
MailGFX_PlaceMessage: ; b9803
ld bc, MAIL_STRUCT_LENGTH
- ld de, wd002
- ld a, $0
+ ld de, wTempMail
+ ld a, BANK(sPartyMail)
call GetSRAMBank
call CopyBytes
call CloseSRAM
- ld hl, wd002 + sPartyMon1MailAuthor - sPartyMon1Mail
- ld de, wd050
+ ld hl, wTempMailAuthor
+ ld de, wMonOrItemNameBuffer
ld bc, NAME_LENGTH - 1
call CopyBytes
ld a, "@"
- ld [wd002 + sPartyMon1MailAuthor - sPartyMon1Mail], a
- ld [wd050 + NAME_LENGTH - 1], a
- ld de, wd002
+ ld [wTempMailAuthor], a
+ ld [wMonOrItemNameBuffer + NAME_LENGTH - 1], a
+ ld de, wTempMailMessage
hlcoord 2, 7
call PlaceString
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
ld a, [de]
and a
ret z
--- a/home/map.asm
+++ b/home/map.asm
@@ -1988,7 +1988,7 @@
CloseSubmenu:: ; 2b3c
call ClearBGPalettes
- call Function2bae
+ call ReloadTilesetAndPalettes
call UpdateSprites
call Call_ExitMenu
call ret_d90
@@ -1998,7 +1998,7 @@
ExitAllMenus:: ; 2b4d
call ClearBGPalettes
call Call_ExitMenu
- call Function2bae
+ call ReloadTilesetAndPalettes
call UpdateSprites
call ret_d90
Function2b5c:: ; 2b5c
@@ -2011,13 +2011,13 @@
ret
; 2b74
-Function2b74:: ; 0x2b74
+ReturnToMapWithSpeechTextbox:: ; 0x2b74
push af
ld a, $1
ld [wSpriteUpdatesEnabled], a
call ClearBGPalettes
call ClearSprites
- call Function2bae
+ call ReloadTilesetAndPalettes
hlcoord 0, 12
lb bc, 4, 18
call TextBox
@@ -2036,7 +2036,7 @@
ret
; 0x2bae
-Function2bae:: ; 2bae
+ReloadTilesetAndPalettes:: ; 2bae
call DisableLCD
call ClearSprites
callba RefreshSprites
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -249,7 +249,7 @@
MenuFunc_1e7f::
call CopyMenuData2
- call Function1ebd
+ call GetMenuIndexSet
call Function1ea6
call MenuBox
ret
@@ -257,7 +257,7 @@
MenuWriteText::
xor a
ld [hBGMapMode], a
- call Function1ebd ; sort out the text
+ call GetMenuIndexSet ; sort out the text
call Function1eda ; actually write it
call Function2e31
ld a, [hOAMUpdate]
@@ -286,12 +286,12 @@
ret
; 1ebd
-Function1ebd:: ; 1ebd
+GetMenuIndexSet:: ; 1ebd
ld hl, wMenuData2IndicesPointer
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [wcf76]
+ ld a, [wWhichIndexSet]
and a
jr z, .skip
ld b, a
@@ -404,7 +404,7 @@
ld [wMenuJoypad], a
.asm_1f57
- call Function1ebd
+ call GetMenuIndexSet
ld a, [wMenuCursorY]
ld l, a
ld h, $0
--- a/home/time.asm
+++ b/home/time.asm
@@ -187,14 +187,14 @@
ret
; 658
-Function658:: ; 658
+SetTimeOfDay:: ; 658
xor a
ld [StringBuffer2], a
ld a, $0 ; useless
ld [StringBuffer2 + 3], a
- jr Function677
+ jr InitTime
-Function663:: ; 663
+SetDayOfWeek:: ; 663
call UpdateTime
ld a, [hHours]
ld [StringBuffer2 + 1], a
@@ -202,10 +202,10 @@
ld [StringBuffer2 + 2], a
ld a, [hSeconds]
ld [StringBuffer2 + 3], a
- jr Function677 ; useless
+ jr InitTime ; useless
-Function677:: ; 677
- callba Function140ed
+InitTime:: ; 677
+ callba _InitTime
ret
; 67e
--- a/items/item_effects.asm
+++ b/items/item_effects.asm
@@ -654,7 +654,7 @@
ld [CurPartyMon], a
ld a, BOXMON
ld [MonType], a
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
ld b, $0
callba NamingScreen
@@ -661,7 +661,7 @@
ld a, BANK(sBoxMonNicknames)
call GetSRAMBank
- ld hl, wd050
+ ld hl, wMonOrItemNameBuffer
ld de, sBoxMonNicknames
ld bc, PKMN_NAME_LENGTH
call CopyBytes
@@ -677,7 +677,7 @@
call GetSRAMBank
ld hl, sBoxMonNicknames
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
--- a/macros.asm
+++ b/macros.asm
@@ -92,11 +92,11 @@
ENDM
lb: MACRO ; r, hi, lo
- ld \1, (\2) << 8 + (\3)
+ ld \1, (\2 & $ff) << 8 + (\3 & $ff)
ENDM
ln: MACRO ; r, hi, lo
- ld \1, (\2) << 4 + (\3)
+ ld \1, (\2 & $f) << 4 + (\3 & $f)
ENDM
bccoord equs "coord bc,"
--- a/main.asm
+++ b/main.asm
@@ -6737,7 +6737,7 @@
ld [MonType], a
xor a
ld [CurPartyMon], a
- ld de, wd050_MonNick
+ ld de, wMonOrItemNameBuffer
pop bc
ld a, b
ld b, 1
@@ -6756,7 +6756,7 @@
ld [TempEnemyMonSpecies], a
call GetPokemonName
ld hl, StringBuffer1
- ld de, wd050_MonNick
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
pop af
@@ -6868,7 +6868,7 @@
call PrintText
ld a, BANK(sBoxMonNicknames)
call GetSRAMBank
- ld hl, wd050
+ ld hl, wMonOrItemNameBuffer
ld de, sBoxMonNicknames
ld bc, PKMN_NAME_LENGTH
call CopyBytes
@@ -6965,7 +6965,7 @@
ld [wMenuCursorBuffer], a
call SetPalettes
xor a
- ld [wcf76], a
+ ld [wWhichIndexSet], a
ld [hBGMapMode], a
call DoNthMenu
jr c, .cancel
@@ -11097,7 +11097,7 @@
ld [wd265], a
call GetPokemonName
ld hl, StringBuffer1
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
ld bc, PKMN_NAME_LENGTH
call CopyBytes
call GiveANickname_YesNo
@@ -11107,7 +11107,7 @@
ld [CurPartyMon], a
xor a
ld [MonType], a
- ld de, wd050
+ ld de, wMonOrItemNameBuffer
callab InitNickname
.Party_SkipNickname
@@ -11117,7 +11117,7 @@
call SkipNames
ld d, h
ld e, l
- ld hl, wd050
+ ld hl, wMonOrItemNameBuffer
call CopyBytes
ld a, [PartyCount]
dec a
@@ -11169,9 +11169,9 @@
jr c, .Box_SkipNickname
ld a, BOXMON
ld [MonType], a
- ld de, wd050_MonNick
+ ld de, wMonOrItemNameBuffer
callab InitNickname
- ld hl, wd050_MonNick
+ ld hl, wMonOrItemNameBuffer
.Box_SkipNickname
ld a, BANK(sBoxMonNicknames)
--- a/misc/mobile_22.asm
+++ b/misc/mobile_22.asm
@@ -3390,16 +3390,16 @@
ld a, $5
ld [rSVBK], a
ld hl, Palette_8a5e5
- ld de, wd020
- ld bc, $18
+ ld de, UnknBGPals + 4 palettes
+ ld bc, 3 palettes
call CopyBytes
ld hl, Palette_8a5fd
ld de, UnknOBPals
- ld bc, $8
+ ld bc, 1 palettes
call CopyBytes
ld hl, Palette_8a605
- ld de, wd048
- ld bc, $8
+ ld de, UnknOBPals + 1 palettes
+ ld bc, 1 palettes
call CopyBytes
pop af
ld [rSVBK], a
@@ -3411,10 +3411,12 @@
RGB 27, 19, 00
RGB 07, 11, 22
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 16, 16, 31
RGB 27, 19, 00
RGB 00, 00, 00
+
RGB 31, 31, 31
RGB 31, 00, 00
RGB 27, 19, 00
@@ -3442,7 +3444,7 @@
ld [rSVBK], a
ld hl, Palette_8a624
ld de, UnknOBPals
- ld bc, $0008
+ ld bc, 1 palettes
call CopyBytes
pop af
ld [rSVBK], a
--- a/misc/mobile_40.asm
+++ b/misc/mobile_40.asm
@@ -3059,7 +3059,7 @@
Function1013aa: ; 1013aa
call ClearBGPalettes
call Call_ExitMenu
- call Function2bae
+ call ReloadTilesetAndPalettes
callba Function106464
call UpdateSprites
call Function2b5c
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -5781,13 +5781,13 @@
push af
ld a, $5
ld [rSVBK], a
- ld hl, wd030
+ ld hl, UnknBGPals + 8 * 6
ld de, wc314 + 12
- ld bc, $0010
+ ld bc, 2 palettes
call CopyBytes
ld hl, Palette_11734e
ld de, UnknBGPals + 8 * 7
- ld bc, $0008
+ ld bc, 1 palettes
call CopyBytes
call SetPalettes
pop af
@@ -5807,8 +5807,8 @@
ld a, $5
ld [rSVBK], a
ld hl, Palette_11730e
- ld de, wd050
- ld bc, $0030
+ ld de, UnknOBPals + 2 palettes
+ ld bc, 6 palettes
call CopyBytes
call SetPalettes
pop af
@@ -5821,7 +5821,7 @@
call Function116758
call Function1167a6
ld a, [wc310]
- cp $fd
+ cp EGG
ret z
sla a
ld c, a
--- a/misc/mobile_46.asm
+++ b/misc/mobile_46.asm
@@ -5690,7 +5690,7 @@
Function11a9ce: ; 11a9ce
call ClearBGPalettes
- call Function2bae
+ call ReloadTilesetAndPalettes
call Call_ExitMenu
callba MobileFunc_106462
callba Function106464
--- a/misc/mobile_5b.asm
+++ b/misc/mobile_5b.asm
@@ -711,11 +711,11 @@
ld hl, Unknown_16cbfb
add hl, bc
ld a, [hl]
- ld bc, $0002
+ ld bc, 2
ld hl, Unknown_16cfa3
call AddNTimes
- ld de, wd00c
- ld bc, $0002
+ ld de, UnknBGPals + 1 palettes + 4
+ ld bc, 2
ld a, $5
call FarCopyWRAM
callba ApplyPals
@@ -749,19 +749,19 @@
Function16cc25: ; 16cc25
ld hl, Unknown_16cfa9
- ld de, wd008
- call Function16cc41
+ ld de, UnknBGPals + 1 palettes
+ call .CopyPal
ld hl, Unknown_16cfb1
ld de, UnknOBPals
- call Function16cc41
+ call .CopyPal
ld hl, Unknown_16cfb9
- ld de, wd048
- call Function16cc41
+ ld de, UnknOBPals + 1 palettes
+ call .CopyPal
ret
; 16cc41
-Function16cc41: ; 16cc41
- ld bc, $0008
+.CopyPal: ; 16cc41
+ ld bc, 1 palettes
ld a, $5
jp FarCopyWRAM
; 16cc49
--- a/text/battle.asm
+++ b/text/battle.asm
@@ -1,4 +1,4 @@
-BattleText_PlayerPickuedUpPayDayMoney: ; 0x80730
+BattleText_PlayerPickedUpPayDayMoney: ; 0x80730
text "<PLAYER> picked up"
line "¥@"
deciram wPayDayMoney, 3, 6
--- a/text/common_2.asm
+++ b/text/common_2.asm
@@ -600,7 +600,7 @@
UnknownText_0x1bc84b: ; 0x1bc84b
text ""
line "OAK: @"
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
db "@"
; 0x1bc857
@@ -1307,7 +1307,7 @@
Text_EnemyUsedOn: ; 0x1bcfaf
text "<ENEMY>"
line "used @"
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text ""
cont "on @"
text_from_ram EnemyMonNick
@@ -1604,7 +1604,7 @@
UnknownText_0x1bd429: ; 0x1bd429
text "<PLAYER> traded"
line "@"
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text " for"
cont "@"
text_from_ram StringBuffer2
@@ -1714,7 +1714,7 @@
UnknownText_0x1bd5f4: ; 0x1bd5f4
text "Hi! The @"
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text ""
line "you traded me is"
cont "doing great!"
@@ -1722,7 +1722,7 @@
; 0x1bd621
UnknownText_0x1bd621: ; 0x1bd621
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text "'s cute,"
line "but I don't have"
@@ -1759,7 +1759,7 @@
text "Wow! Thank you!"
line "I always wanted"
cont "@"
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text "!"
done
; 0x1bd6f5
@@ -1772,7 +1772,7 @@
cont "traded you doing?"
para "Your @"
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text "'s"
line "so cute!"
done
--- a/text/common_3.asm
+++ b/text/common_3.asm
@@ -1641,7 +1641,7 @@
UnknownText_0x1c1b2c: ; 1c1b2c
text "Took @"
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text "'s"
line "@"
text_from_ram StringBuffer1
@@ -1656,7 +1656,7 @@
UnknownText_0x1c1b57: ; 1c1b57
text "Made @"
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text ""
line "hold @"
text_from_ram StringBuffer2
@@ -1671,7 +1671,7 @@
; 1c1b8e
UnknownText_0x1c1b8e: ; 1c1b8e
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text " isn't"
line "holding anything."
prompt
@@ -1688,13 +1688,13 @@
text_from_ram StringBuffer1
text ""
line "from @"
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text "."
prompt
; 1c1bdc
UnknownText_0x1c1bdc: ; 1c1bdc
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text " is"
line "already holding"
--- a/text/common_4.asm
+++ b/text/common_4.asm
@@ -1045,7 +1045,7 @@
; 0x1c5660
UnknownText_0x1c5660: ; 0x1c5660
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text " learned"
line "@"
text_from_ram StringBuffer2
@@ -1074,7 +1074,7 @@
; 0x1c56af
UnknownText_0x1c56af: ; 0x1c56af
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text ""
line "did not learn"
cont "@"
@@ -1084,7 +1084,7 @@
; 0x1c56c9
UnknownText_0x1c56c9: ; 0x1c56c9
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text " is"
line "trying to learn"
cont "@"
@@ -1092,7 +1092,7 @@
text "."
para "But @"
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text ""
line "can't learn more"
cont "than four moves."
@@ -1120,7 +1120,7 @@
interpret_data
text ""
para "@"
- text_from_ram wd050_MonNick
+ text_from_ram wMonOrItemNameBuffer
text " forgot"
line "@"
text_from_ram StringBuffer1
@@ -1385,7 +1385,7 @@
; 0x1c5b38
UnknownText_0x1c5b38: ; 0x1c5b38
- text_from_ram wd050
+ text_from_ram wMonOrItemNameBuffer
text " was"
line "sent to BILL's PC."
prompt
--- a/wram.asm
+++ b/wram.asm
@@ -1493,7 +1493,7 @@
wMenuJoypad:: ds 1 ; cf73
MenuSelection:: ds 1 ; cf74
MenuSelectionQuantity:: ds 1 ; cf75
-wcf76:: ds 1
+wWhichIndexSet:: ds 1
wScrollingMenuCursorPosition:: ds 1
wWindowStackSize:: ds 9
@@ -1691,16 +1691,34 @@
wBufferMonNick:: ds PKMN_NAME_LENGTH
wBufferMonOT:: ds NAME_LENGTH
wBufferMon:: party_struct wBufferMon
+ ds 8
+wMonOrItemNameBuffer::
ds wBufferMonNick - @
-wd002::
+bugcontestwinner: macro
+\1PersonID:: ds 1
+\1Mon:: ds 1
+\1Score:: ds 2
+endm
+wBugContestResults::
+ bugcontestwinner wBugContestFirstPlace
+ bugcontestwinner wBugContestSecondPlace
+ bugcontestwinner wBugContestThirdPlace
+wBugContestWinnersEnd::
+ bugcontestwinner wBugContestTemp
+ ds 4
+wBugContestWinnerName:: ds NAME_LENGTH
+ ds wBugContestResults - @
+
+wd002::
+wTempDayOfWeek::
+wApricorns::
PhoneScriptBank::
LuckyNumberDigit1Buffer::
wCurrentRadioLine::
wMovementBufferCount::
wMartItem1BCD::
-wBugContestFirstPlacePersonID::
ds 1
wd003::
LuckyNumberDigit2Buffer::
@@ -1707,13 +1725,11 @@
PhoneCallerLo::
wNextRadioLine::
wMovementBufferPerson::
-wBugContestFirstPlaceMon::
ds 1
wd004::
LuckyNumberDigit3Buffer::
PhoneCallerHi::
wRadioTextDelay::
-wBugContestFirstPlaceScore::
ds 1
wd005::
LuckyNumberDigit4Buffer::
@@ -1726,20 +1742,15 @@
LuckyNumberDigit5Buffer::
EndFlypoint:: ; d006
wOaksPkmnTalkSegmentCounter::
-wBugContestSecondPlacePersonID::
ds 1
wd007::
MovementBuffer:: ; d007
-wBugContestSecondPlaceMon::
ds 1
wMartItem3BCD::
-wBugContestSecondPlaceScore::
wd008:: ds 2
-wBugContestThirdPlacePersonID::
wd00a:: ds 1
-wBugContestThirdPlaceMon::
wMartItem4BCD::
wd00b:: ds 1
@@ -1748,15 +1759,11 @@
ds wRadioText - @
wMobileParticipant2Nickname::
-wBugContestThirdPlaceScore::
wd00c:: ds 1
wd00d:: ds 1
wMartItem5BCD::
-wBugContestTempPersonID::
wd00e:: ds 1
-wBugContestTempMon::
wd00f:: ds 1
-wBugContestTempScore::
wd010:: ds 1
wMartItem6BCD::
wd011:: ds 1
@@ -1765,7 +1772,6 @@
wd013:: ds 1
wMartItem7BCD::
wd014:: ds 2
-wBugContestWinnerName::
wd016:: ds 1
wMartItem8BCD::
wd017:: ds 1
@@ -1846,20 +1852,14 @@
wWinTextPointer::
ds 1
-wd048:: ds 1
+wPhoneScriptPointer:: ds 1
wLossTextPointer:: ds 2
-wScriptAfterPointer::
-wd04b:: ds 2
+wScriptAfterPointer:: ds 2
wRunningTrainerBattleScript:: ds 1
MenuItemsListEnd::
wTempTrainerHeaderEnd::
-wd04e:: ds 2
-wOaksPkmnTalkPkmnNameBuffer::
-wd050_MonNick::
-wd050:: ds PKMN_NAME_LENGTH +- 1
-wd05a:: ds 12
-wd066:: ds 10
-wd070:: ds 3
+wd04e:: ds 24
+wTMHMMoveNameBackup:: ds MOVE_NAME_LENGTH
StringBuffer1:: ; d073
ds 19
@@ -3059,7 +3059,7 @@
wStepsToEgg:: ; df2d
ds 1
-wDittoInDaycare:: ; df2e
+wBreedMotherOrNonDitto:: ; df2e
; z: yes
; nz: no
ds 1
@@ -3195,11 +3195,11 @@
LYOverridesEnd:: ; d190
ds 1
-w5_d191:: ds 1
-w5_d192:: ds 1
-w5_d193:: ds 1
-w5_d194:: ds 1
-w5_d195:: ds 1
+wMagnetTrainDirection:: ds 1
+wMagnetTrainInitPosition:: ds 1
+wMagnetTrainHoldPosition:: ds 1
+wMagnetTrainFinalPosition:: ds 1
+wMagnetTrainPlayerSpriteInitX:: ds 1
ds 106
LYOverridesBackup:: ; d200