summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rwxr-xr-xengine/anim_hp_bar.asm66
-rw-r--r--engine/battle_start.asm12
-rwxr-xr-xengine/init_gender.asm2
-rwxr-xr-xengine/main_menu.asm2
-rwxr-xr-xengine/mon_icons.asm25
-rw-r--r--engine/movement.asm8
-rwxr-xr-xengine/namingscreen.asm6
-rw-r--r--engine/party_menu.asm8
-rwxr-xr-xengine/player_movement.asm4
-rwxr-xr-xengine/pokecenter_pc.asm247
-rwxr-xr-xengine/scrolling_menu.asm6
-rwxr-xr-xengine/startmenu.asm88
-rwxr-xr-xengine/tile_events.asm10
-rwxr-xr-xengine/time.asm2
-rwxr-xr-xengine/trade/animation.asm2
15 files changed, 228 insertions, 260 deletions
diff --git a/engine/anim_hp_bar.asm b/engine/anim_hp_bar.asm
index c00a97921..c88c73145 100755
--- a/engine/anim_hp_bar.asm
+++ b/engine/anim_hp_bar.asm
@@ -1,8 +1,8 @@
_AnimateHPBar: ; d627
- call Functiond65f
- jr c, .do_player
- call Functiond670
-.enemy_loop
+ call .IsMaximumMoreThan48Pixels
+ jr c, .MoreThan48Pixels
+ call .ComputePixels
+.ShortAnimLoop
push bc
push hl
call Functiond6e2
@@ -16,12 +16,12 @@ _AnimateHPBar: ; d627
pop hl
pop bc
pop af
- jr nc, .enemy_loop
+ jr nc, .ShortAnimLoop
ret
-.do_player
- call Functiond670
-.player_loop
+.MoreThan48Pixels
+ call .ComputePixels
+.LongAnimLoop
push bc
push hl
call Functiond6f5
@@ -36,11 +36,11 @@ _AnimateHPBar: ; d627
pop hl
pop bc
pop af
- jr nc, .player_loop
+ jr nc, .LongAnimLoop
ret
; d65f
-Functiond65f: ; d65f
+.IsMaximumMoreThan48Pixels: ; d65f
ld a, [Buffer2]
and a
jr nz, .player
@@ -55,7 +55,7 @@ Functiond65f: ; d65f
ret
; d670
-Functiond670: ; d670
+.ComputePixels: ; d670
; Buffer1-2: Max HP
; Buffer3-4: Old HP
; Buffer5-6: New HP
@@ -72,7 +72,7 @@ Functiond670: ; d670
pop hl
call ComputeHPBarPixels
ld a, e
- ld [wd1f1], a
+ ld [wCurHPBarPixels], a
ld a, [Buffer5]
ld c, a
@@ -84,7 +84,7 @@ Functiond670: ; d670
ld d, a
call ComputeHPBarPixels
ld a, e
- ld [wd1f2], a
+ ld [wNewHPBarPixels], a
push hl
ld hl, Buffer3
@@ -103,15 +103,15 @@ Functiond670: ; d670
ld a, d
sbc b
ld d, a
- jr c, .asm_d6c1
+ jr c, .negative
ld a, [Buffer3]
ld [wd1f5], a
ld a, [Buffer5]
ld [wd1f6], a
ld bc, 1
- jr .asm_d6d9
+ jr .got_direction
-.asm_d6c1
+.negative
ld a, [Buffer3]
ld [wd1f6], a
ld a, [Buffer5]
@@ -123,8 +123,8 @@ Functiond670: ; d670
ld a, d
xor $ff
ld d, a
- ld bc, rIE
-.asm_d6d9
+ ld bc, -1
+.got_direction
ld a, d
ld [wd1f3], a
ld a, e
@@ -133,14 +133,14 @@ Functiond670: ; d670
; d6e2
Functiond6e2: ; d6e2
- ld hl, wd1f1
- ld a, [wd1f2]
+ ld hl, wCurHPBarPixels
+ ld a, [wNewHPBarPixels]
cp [hl]
- jr nz, .asm_d6ed
+ jr nz, .not_finished
scf
ret
-.asm_d6ed
+.not_finished
ld a, c
add [hl]
ld [hl], a
@@ -150,7 +150,7 @@ Functiond6e2: ; d6e2
; d6f5
Functiond6f5: ; d6f5
-.asm_d6f5
+.loop
ld hl, Buffer3
ld a, [hli]
ld e, a
@@ -158,22 +158,22 @@ Functiond6f5: ; d6f5
ld d, a
ld a, e
cp [hl]
- jr nz, .asm_d707
+ jr nz, .next
inc hl
ld a, d
cp [hl]
- jr nz, .asm_d707
+ jr nz, .next
scf
ret
-.asm_d707
+.next
ld l, e
ld h, d
add hl, bc
ld a, l
ld [Buffer3], a
ld a, h
- ld [wd1ed], a
+ ld [Buffer4], a
push hl
push de
push bc
@@ -191,9 +191,9 @@ Functiond6f5: ; d6f5
pop de
pop hl
ld a, e
- ld hl, wd1f1
+ ld hl, wCurHPBarPixels
cp [hl]
- jr z, .asm_d6f5
+ jr z, .loop
ld [hl], a
and a
ret
@@ -205,7 +205,7 @@ Functiond730: ; d730
ld a, [wWhichHPBar]
and $1
ld b, a
- ld a, [wd1f1]
+ ld a, [wCurHPBarPixels]
ld e, a
ld c, a
push de
@@ -219,7 +219,7 @@ Functiond749: ; d749
call Functiond784
ld a, [Buffer3]
ld c, a
- ld a, [wd1ed]
+ ld a, [Buffer4]
ld b, a
ld a, [Buffer1]
ld e, a
@@ -275,7 +275,7 @@ endr
dec hl
ld a, [Buffer3]
ld [StringBuffer2 + 1], a
- ld a, [wd1ed]
+ ld a, [Buffer4]
ld [StringBuffer2], a
ld de, StringBuffer2
lb bc, 2, 3
@@ -375,7 +375,7 @@ Functiond839: ; d839
ld c, a
ld b, 0
ld hl, 0
- ld a, [wd1f1]
+ ld a, [wCurHPBarPixels]
cp 6 * 8
jr nc, .coppy_buffer
and a
diff --git a/engine/battle_start.asm b/engine/battle_start.asm
index 6fb64e9b1..083469b0d 100644
--- a/engine/battle_start.asm
+++ b/engine/battle_start.asm
@@ -1,5 +1,5 @@
Predef_StartBattle: ; 8c20f
- call Function8c26d
+ call .InitGFX
ld a, [rBGP]
ld [wBGP], a
ld a, [rOBP0]
@@ -52,15 +52,15 @@ Predef_StartBattle: ; 8c20f
ret
; 8c26d
-Function8c26d: ; 8c26d
+.InitGFX: ; 8c26d
ld a, [wLinkMode]
cp LINK_MOBILE
jr z, .mobile
callba Function6454
call UpdateSprites
call DelayFrame
- call Function8c2a0
- call Function8cf4f
+ call .NonMobile_LoadPokeballTiles
+ call BattleStart_LoadEDTile
jr .resume
.mobile
@@ -81,7 +81,7 @@ Function8c26d: ; 8c26d
ret
; 8c2a0
-Function8c2a0: ; 8c2a0
+.NonMobile_LoadPokeballTiles: ; 8c2a0
call LoadTrainerBattlePokeballTiles
hlbgcoord 0, 0
call Function8c2cf
@@ -663,7 +663,7 @@ StartTrainerBattle_LoadPokeBallGraphics: ; 8c5dc (23:45dc)
ld a, $1
ld [hCGBPalUpdate], a
call DelayFrame
- call Function8cf4f
+ call BattleStart_LoadEDTile
.nextscene: ; 8c673 (23:4673)
call StartTrainerBattle_NextScene
diff --git a/engine/init_gender.asm b/engine/init_gender.asm
index 5de576c2a..ff5babdf9 100755
--- a/engine/init_gender.asm
+++ b/engine/init_gender.asm
@@ -67,7 +67,7 @@ TextJump_AreYouABoyOrAreYouAGirl: ; 0x48e0f
InitGenderScreen: ; 48e14 (12:4e14)
ld a, $10
ld [MusicFade], a
- ld a, $0
+ ld a, MUSIC_NONE
ld [MusicFadeIDLo], a
ld a, $0
ld [MusicFadeIDHi], a
diff --git a/engine/main_menu.asm b/engine/main_menu.asm
index 637253c12..2c9afcc07 100755
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -202,7 +202,7 @@ MainMenuJoypadLoop: ; 49de4
ld a, [w2DMenuFlags1]
set 5, a
ld [w2DMenuFlags1], a
- call Function1f1a
+ call GetScrollingMenuJoypad
ld a, [wMenuJoypad]
cp B_BUTTON
jr z, .b_button
diff --git a/engine/mon_icons.asm b/engine/mon_icons.asm
index 5e41cd4a1..6a5c7484f 100755
--- a/engine/mon_icons.asm
+++ b/engine/mon_icons.asm
@@ -14,7 +14,7 @@ LoadOverworldMonIcon: ; 8e82b
ret
; 8e83f
-Function8e83f: ; 8e83f
+LoadMenuMonIcon: ; 8e83f
push hl
push de
push bc
@@ -28,9 +28,8 @@ Function8e83f: ; 8e83f
.LoadIcon: ; 8e849
ld d, 0
ld hl, .Jumptable
-rept 2
add hl, de
-endr
+ add hl, de
ld a, [hli]
ld h, [hl]
ld l, a
@@ -39,13 +38,13 @@ endr
.Jumptable: ; 8e854 (23:6854)
- dw Function8e8d5 ; init
- dw Function8e961
- dw Function8e97d
- dw Trade_LoadMonIconGFX
- dw Function8e898
- dw Mobile_InitPartyMenuBGPal71
- dw .GetPartyMenuMonIcon
+ dw Function8e8d5 ; party menu
+ dw Function8e961 ; naming screen
+ dw Function8e97d ; moves (?)
+ dw Trade_LoadMonIconGFX ; trade
+ dw Function8e898 ; mobile
+ dw Mobile_InitPartyMenuBGPal71 ; mobile
+ dw .GetPartyMenuMonIcon ; unused
.GetPartyMenuMonIcon: ; 8e862 (23:6862)
@@ -89,7 +88,7 @@ Function8e898: ; 8e898 (23:6898)
call Function8e8d5
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld a, $0
+ ld a, SPRITE_ANIM_SEQ_NULL
ld [hl], a
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
@@ -106,7 +105,7 @@ Mobile_InitPartyMenuBGPal71: ; 8e8b1 (23:68b1)
call SetPartyMonIconAnimSpeed
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld a, $0
+ ld a, SPRITE_ANIM_SEQ_NULL
ld [hl], a
ld hl, SPRITEANIMSTRUCT_XCOORD
add hl, bc
@@ -229,7 +228,7 @@ Function8e961: ; 8e961 (23:6961)
call InitSpriteAnimStruct
ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID
add hl, bc
- ld [hl], $0
+ ld [hl], SPRITE_ANIM_SEQ_NULL
ret
Function8e97d: ; 8e97d (23:697d)
diff --git a/engine/movement.asm b/engine/movement.asm
index ca3ac55b5..04f3f5208 100644
--- a/engine/movement.asm
+++ b/engine/movement.asm
@@ -55,8 +55,8 @@ MovementPointers: ; 5075
dw Movement_fast_jump_step_up ; 35
dw Movement_fast_jump_step_left ; 36
dw Movement_fast_jump_step_right ; 37
- dw Movement_38 ; 38
- dw Movement_39 ; 39
+ dw Movement_remove_sliding ; 38
+ dw Movement_set_sliding ; 39
dw Movement_remove_fixed_facing ; 3a
dw Movement_fix_facing ; 3b
dw Movement_show_person ; 3c
@@ -373,14 +373,14 @@ Movement_56: ; 5279
ret
; 5293
-Movement_38: ; 5293
+Movement_remove_sliding: ; 5293
ld hl, OBJECT_FLAGS1
add hl, bc
res SLIDING, [hl]
jp ContinueReadingMovement
; 529c
-Movement_39: ; 529c
+Movement_set_sliding: ; 529c
ld hl, OBJECT_FLAGS1
add hl, bc
set SLIDING, [hl]
diff --git a/engine/namingscreen.asm b/engine/namingscreen.asm
index ac56ec250..e65a2d54f 100755
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -88,10 +88,10 @@ endr
.Pokemon: ; 1173e (4:573e)
ld a, [CurPartySpecies]
ld [wd265], a
- ld hl, Function8e83f
- ld a, BANK(Function8e83f)
+ ld hl, LoadMenuMonIcon
+ ld a, BANK(LoadMenuMonIcon)
ld e, $1
- rst FarCall ; ; indirect jump to Function8e83f (8e83f (23:683f))
+ rst FarCall ; ; indirect jump to LoadMenuMonIcon (8e83f (23:683f))
ld a, [CurPartySpecies]
ld [wd265], a
call GetPokemonName
diff --git a/engine/party_menu.asm b/engine/party_menu.asm
index b9048da10..9bf02351e 100644
--- a/engine/party_menu.asm
+++ b/engine/party_menu.asm
@@ -658,8 +658,8 @@ InitPartyMenuGFX: ; 503e0
.loop
push bc
push hl
- ld hl, Function8e83f
- ld a, BANK(Function8e83f)
+ ld hl, LoadMenuMonIcon
+ ld a, BANK(LoadMenuMonIcon)
ld e, $0
rst FarCall
ld a, [hObjectStructIndexBuffer]
@@ -752,8 +752,8 @@ PartyMenuSelect: ; 0x50457
ld [wPartyMenuCursor], a
ld a, [hJoyLast]
ld b, a
- bit 1, b
- jr nz, .exitmenu ; B button?
+ bit B_BUTTON_F, b
+ jr nz, .exitmenu ; B button
ld a, [wMenuCursorY]
dec a
ld [CurPartyMon], a
diff --git a/engine/player_movement.asm b/engine/player_movement.asm
index 80c5e6edc..6ab121f61 100755
--- a/engine/player_movement.asm
+++ b/engine/player_movement.asm
@@ -121,12 +121,12 @@ DoPlayerMovement:: ; 80000
ld a, [PlayerStandingTile]
ld c, a
call CheckWhirlpoolTile
- jr c, .asm_800c4
+ jr c, .not_whirlpool
ld a, 3
scf
ret
-.asm_800c4
+.not_whirlpool
and $f0
cp $30 ; moving water
jr z, .water
diff --git a/engine/pokecenter_pc.asm b/engine/pokecenter_pc.asm
index a75798709..4c4effb6b 100755
--- a/engine/pokecenter_pc.asm
+++ b/engine/pokecenter_pc.asm
@@ -2,9 +2,9 @@ PokemonCenterPC: ; 1559a
call PC_CheckPartyForPokemon
ret c
call PC_PlayBootSound
- ld hl, UnknownText_0x15a27
+ ld hl, PokeCenterPCText_BootedUpPC
call PC_DisplayText
- ld hl, UnknownText_0x15a2c
+ ld hl, PokeCenterPCText_AccessWhosePC
call PC_DisplayTextWaitMenu
ld hl, .TopMenu
call LoadMenuDataHeader
@@ -25,40 +25,35 @@ PokemonCenterPC: ; 1559a
call ExitMenu
call CloseWindow
ret
-; 155d6
-.TopMenu: ; 0x155d6
+.TopMenu
db $48 ; flags
db 00, 00 ; start coords
db 12, 15 ; end coords
dw .MenuData2
db 1 ; default option
-; 0x155de
-.MenuData2: ; 0x155de
+.MenuData2
db $a0 ; flags
db 0 ; items
dw .WhichPC
dw PlaceNthMenuStrings
dw .JumpTable
-; 0x155e6
-.JumpTable: ; 155e6
+.JumpTable
dw PlayersPC, .String_PlayersPC
dw BillsPC, .String_BillsPC
dw OaksPC, .String_OaksPC
dw HallOfFamePC, .String_HallOfFame
dw TurnOffPC, .String_TurnOff
-; 155fa
-.String_PlayersPC: db "<PLAYER>'s PC@"
-.String_BillsPC: db "BILL's PC@"
-.String_OaksPC: db "PROF.OAK's PC@"
-.String_HallOfFame: db "HALL OF FAME@"
-.String_TurnOff: db "TURN OFF@"
-; 1562c
+.String_PlayersPC: db "<PLAYER>'s PC@"
+.String_BillsPC: db "BILL's PC@"
+.String_OaksPC: db "PROF.OAK's PC@"
+.String_HallOfFame: db "HALL OF FAME@"
+.String_TurnOff: db "TURN OFF@"
-.WhichPC: ; 1562c
+.WhichPC
; before pokedex
db 3 ; items
db 1, 0, 4 ; bill's, player's, turn off
@@ -73,9 +68,8 @@ PokemonCenterPC: ; 1559a
db 5 ; items
db 1, 0, 2, 3, 4 ; bill's, player's, oak's, hall of fame, turn off
db -1
-; 1563e
-.ChooseWhichPCListToUse: ; 1563e
+.ChooseWhichPCListToUse
call CheckReceivedDex
jr nz, .got_dex
ld a, $0
@@ -96,13 +90,12 @@ PC_CheckPartyForPokemon: ; 15650
ret nz
ld de, SFX_CHOOSE_PC_OPTION
call PlaySFX
- ld hl, UnknownText_0x15663
+ ld hl, .MustHavePokemonToUse
call PC_DisplayText
scf
ret
-; 15663
-UnknownText_0x15663: ; 0x15663
+.MustHavePokemonToUse
; Bzzzzt! You must have a #MON to use this!
text_jump UnknownText_0x1c1328
db "@"
@@ -110,7 +103,7 @@ UnknownText_0x15663: ; 0x15663
BillsPC: ; 15668
call PC_PlayChoosePCSound
- ld hl, UnknownText_0x15a31
+ ld hl, PokeCenterPCText_AccessedBillsPC
call PC_DisplayText
callba _BillsPC
and a
@@ -119,7 +112,7 @@ BillsPC: ; 15668
PlayersPC: ; 15679
call PC_PlayChoosePCSound
- ld hl, UnknownText_0x15a36
+ ld hl, PokeCenterPCText_AccessedOwnPC
call PC_DisplayText
ld b, $0
call _PlayersPC
@@ -129,7 +122,7 @@ PlayersPC: ; 15679
OaksPC: ; 15689
call PC_PlayChoosePCSound
- ld hl, UnknownText_0x15a3b
+ ld hl, PokeCenterPCText_AccessedOaksPC
call PC_DisplayText
callba ProfOaksPC
and a
@@ -146,7 +139,7 @@ HallOfFamePC: ; 1569a
; 156ab
TurnOffPC: ; 156ab
- ld hl, UnknownText_0x15a40
+ ld hl, PokeCenterPCText_LinkClosed
call PrintText
scf
ret
@@ -166,7 +159,7 @@ PC_PlayChoosePCSound: ; 156c2
ld de, SFX_CHOOSE_PC_OPTION
jr PC_WaitPlaySFX
-Function156c7: ; 156c7
+PC_PlaySwapItemsSound: ; 156c7
ld de, SFX_SWITCH_POKEMON
call PC_WaitPlaySFX
ld de, SFX_SWITCH_POKEMON
@@ -218,8 +211,8 @@ _PlayersPC: ; 15704
Function15715: ; 15715
xor a
- ld [wd0d7], a
- ld [wd0dd], a
+ ld [wPCItemsCursor], a
+ ld [wPCItemsScrollPosition], a
ld hl, KrissPCMenuData
call LoadMenuDataHeader
.asm_15722
@@ -316,19 +309,18 @@ UnknownText_0x157cc: ; 0x157cc
KrisWithdrawItemMenu: ; 0x157d1
call LoadStandardMenuDataHeader
callba ClearPCItemScreen
-.asm_157da
- call Function15985
- jr c, .asm_157e4
- call Function157e9
- jr .asm_157da
+.loop
+ call PCItemsJoypad
+ jr c, .quit
+ call .Submenu
+ jr .loop
-.asm_157e4
+.quit
call CloseSubmenu
xor a
ret
-; 0x157e9
-Function157e9: ; 0x157e9
+.Submenu
; check if the item has a quantity
callba _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
@@ -351,7 +343,7 @@ Function157e9: ; 0x157e9
.withdraw
ld a, [wItemQuantityChangeBuffer]
ld [Buffer1], a ; quantity
- ld a, [wd107]
+ ld a, [CurItemQuantity]
ld [Buffer2], a
ld hl, NumItems
call ReceiveItem
@@ -359,7 +351,7 @@ Function157e9: ; 0x157e9
ld a, [Buffer1]
ld [wItemQuantityChangeBuffer], a
ld a, [Buffer2]
- ld [wd107], a
+ ld [CurItemQuantity], a
ld hl, PCItems
call TossItem
predef PartyMonItemName
@@ -377,7 +369,6 @@ Function157e9: ; 0x157e9
.done
ret
-; 0x15850
.HowManyText ; 0x15850
text_jump _KrissPCHowManyWithdrawText
@@ -391,24 +382,22 @@ Function157e9: ; 0x157e9
text_jump _KrissPCNoRoomWithdrawText
db "@"
-
KrisTossItemMenu: ; 0x1585f
call LoadStandardMenuDataHeader
callba ClearPCItemScreen
-.asm_15868
- call Function15985
- jr c, .asm_15878
+.loop
+ call PCItemsJoypad
+ jr c, .quit
ld de, PCItems
- callba Function129f4
- jr .asm_15868
+ callba TossItemFromPC
+ jr .loop
-.asm_15878
+.quit
call CloseSubmenu
xor a
ret
; 0x1587d
-
KrisDecorationMenu: ; 0x1587d
callba _KrisDecorationMenu
ld a, c
@@ -418,54 +407,48 @@ KrisDecorationMenu: ; 0x1587d
ret
; 0x15888
-
KrisLogOffMenu: ; 0x15888
xor a
scf
ret
; 0x1588b
-
KrisDepositItemMenu: ; 0x1588b
- call Function158b8
- jr c, .asm_158b6
+ call .CheckItemsInBag
+ jr c, .nope
call DisableSpriteUpdates
call LoadStandardMenuDataHeader
callba DepositSellInitPackBuffers
-.asm_1589c
+.loop
callba DepositSellPack
ld a, [wcf66]
and a
- jr z, .asm_158b3
- call Function158cc
+ jr z, .close
+ call .TryDepositItem
callba CheckRegisteredItem
- jr .asm_1589c
+ jr .loop
-.asm_158b3
+.close
call CloseSubmenu
-.asm_158b6
+.nope
xor a
ret
-; 0x158b8
-Function158b8: ; 0x158b8
+.CheckItemsInBag
callba HasNoItems
ret nc
- ld hl, UnknownText_0x158c7
+ ld hl, .NoItemsInBag
call MenuTextBoxBackup
scf
ret
-; 0x158c7
-UnknownText_0x158c7: ; 0x158c7
+.NoItemsInBag
; No items here!
text_jump UnknownText_0x1c13df
db "@"
-; 0x158cc
-
-Function158cc: ; 0x158cc
+.TryDepositItem
ld a, [wSpriteUpdatesEnabled]
push af
ld a, $0
@@ -477,9 +460,8 @@ Function158cc: ; 0x158cc
pop af
ld [wSpriteUpdatesEnabled], a
ret
-; 0x158e7
-.dw: ; 0x158e7
+.dw
dw .tossable
dw .no_toss
dw .no_toss
@@ -488,32 +470,31 @@ Function158cc: ; 0x158cc
dw .tossable
dw .tossable
-.no_toss:
+.no_toss
ret
-.tossable:
+.tossable
ld a, [Buffer1]
push af
ld a, [Buffer2]
push af
- call Function1590a
+ call .DepositItem_
pop af
ld [Buffer2], a
pop af
ld [Buffer1], a
ret
-; 0x1590a
-Function1590a: ; 0x1590a
+.DepositItem_
callba _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
and a
- jr z, .asm_1591d
+ jr z, .AskQuantity
ld a, $1
ld [wItemQuantityChangeBuffer], a
- jr .asm_15933
+ jr .DepositItem
-.asm_1591d
+.AskQuantity
ld hl, .HowManyText
call MenuTextBox
callba SelectQuantityToToss
@@ -521,20 +502,20 @@ Function1590a: ; 0x1590a
call ExitMenu
call ExitMenu
pop af
- jr c, .asm_1596c
+ jr c, .DeclinedToDeposit
-.asm_15933
+.DepositItem
ld a, [wItemQuantityChangeBuffer]
ld [Buffer1], a
- ld a, [wd107]
+ ld a, [CurItemQuantity]
ld [Buffer2], a
ld hl, PCItems
call ReceiveItem
- jr nc, .asm_15965
+ jr nc, .NoRoomInPC
ld a, [Buffer1]
ld [wItemQuantityChangeBuffer], a
ld a, [Buffer2]
- ld [wd107], a
+ ld [CurItemQuantity], a
ld hl, NumItems
call TossItem
predef PartyMonItemName
@@ -542,16 +523,14 @@ Function1590a: ; 0x1590a
call PrintText
ret
-.asm_15965
+.NoRoomInPC
ld hl, .NoRoomText
call PrintText
ret
-.asm_1596c
+.DeclinedToDeposit
and a
ret
-; 0x1596e
-
.HowManyText ; 0x1596e
text_jump _KrissPCHowManyDepositText
@@ -565,87 +544,82 @@ Function1590a: ; 0x1590a
text_jump _KrissPCNoRoomDepositText
db "@"
-
KrisMailBoxMenu: ; 0x1597d
callba _KrisMailBoxMenu
xor a
ret
; 0x15985
-
-Function15985: ; 0x15985
+PCItemsJoypad: ; 0x15985
xor a
- ld [wd0e3], a
-.asm_15989
+ ld [wSwitchItem], a
+.loop
ld a, [wSpriteUpdatesEnabled]
push af
ld a, $0
ld [wSpriteUpdatesEnabled], a
- ld hl, MenuData15a08
+ ld hl, .PCItemsMenuData
call CopyMenuDataHeader
hlcoord 0, 0
- ld b, $a
- ld c, $12
+ ld b, 10
+ ld c, 18
call TextBox
- ld a, [wd0d7]
+ ld a, [wPCItemsCursor]
ld [wMenuCursorBuffer], a
- ld a, [wd0dd]
+ ld a, [wPCItemsScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
ld a, [wMenuScrollPosition]
- ld [wd0dd], a
+ ld [wPCItemsScrollPosition], a
ld a, [wMenuCursorY]
- ld [wd0d7], a
+ ld [wPCItemsCursor], a
pop af
ld [wSpriteUpdatesEnabled], a
- ld a, [wd0e3]
+ ld a, [wSwitchItem]
and a
- jr nz, .asm_159d8
+ jr nz, .moving_stuff_around
ld a, [wMenuJoypad]
- cp $2
- jr z, .asm_15a06
- cp $1
- jr z, .asm_159fb
- cp $4
- jr z, .asm_159f2
- jr .asm_159f8
-
-.asm_159d8
+ cp B_BUTTON
+ jr z, .b_1
+ cp A_BUTTON
+ jr z, .a_1
+ cp SELECT
+ jr z, .select_1
+ jr .next
+
+.moving_stuff_around
ld a, [wMenuJoypad]
- cp $2
- jr z, .asm_159e9
- cp $1
- jr z, .asm_159ef
- cp $4
- jr z, .asm_159ef
- jr .asm_159f8
-
-.asm_159e9
+ cp B_BUTTON
+ jr z, .b_2
+ cp A_BUTTON
+ jr z, .a_select_2
+ cp SELECT
+ jr z, .a_select_2
+ jr .next
+
+.b_2
xor a
- ld [wd0e3], a
- jr .asm_159f8
-
-.asm_159ef
- call Function156c7
+ ld [wSwitchItem], a
+ jr .next
-.asm_159f2
+.a_select_2
+ call PC_PlaySwapItemsSound
+.select_1
callba SwitchItemsInBag
+.next
+ jp .loop
-.asm_159f8
- jp .asm_15989
-
-.asm_159fb
- callba Function24706
+.a_1
+ callba ScrollingMenu_ClearLeftColumn
call PlaceHollowCursor
and a
ret
-.asm_15a06
+.b_1
scf
ret
-; 0x15a08
-MenuData15a08: ; 0x15a08
+.PCItemsMenuData
db %01000000
db 1, 4 ; start coords
db 10, 18 ; end coords
@@ -667,38 +641,37 @@ PC_DisplayText: ; 15a20
ret
; 15a27
-
-UnknownText_0x15a27: ; 0x15a27
+PokeCenterPCText_BootedUpPC: ; 0x15a27
; turned on the PC.
text_jump UnknownText_0x1c144d
db "@"
; 0x15a2c
-UnknownText_0x15a2c: ; 0x15a2c
+PokeCenterPCText_AccessWhosePC: ; 0x15a2c
; Access whose PC?
text_jump UnknownText_0x1c1462
db "@"
; 0x15a31
-UnknownText_0x15a31: ; 0x15a31
+PokeCenterPCText_AccessedBillsPC: ; 0x15a31
; BILL's PC accessed. #MON Storage System opened.
text_jump UnknownText_0x1c1474
db "@"
; 0x15a36
-UnknownText_0x15a36: ; 0x15a36
+PokeCenterPCText_AccessedOwnPC: ; 0x15a36
; Accessed own PC. Item Storage System opened.
text_jump UnknownText_0x1c14a4
db "@"
; 0x15a3b
-UnknownText_0x15a3b: ; 0x15a3b
+PokeCenterPCText_AccessedOaksPC: ; 0x15a3b
; PROF.OAK's PC accessed. #DEX Rating System opened.
text_jump UnknownText_0x1c14d2
db "@"
; 0x15a40
-UnknownText_0x15a40: ; 0x15a40
+PokeCenterPCText_LinkClosed: ; 0x15a40
; … Link closed…
text_jump UnknownText_0x1c1505
db "@"
diff --git a/engine/scrolling_menu.asm b/engine/scrolling_menu.asm
index b09453239..001beb71b 100755
--- a/engine/scrolling_menu.asm
+++ b/engine/scrolling_menu.asm
@@ -210,17 +210,17 @@ ScrollingMenu_GetCursorPosition: ; 246fc
ret
; 24706
-Function24706: ; 24706 (9:4706)
+ScrollingMenu_ClearLeftColumn: ; 24706 (9:4706)
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH
add hl, de
ld de, 2 * SCREEN_WIDTH
ld a, [wMenuData2_ScrollingMenuHeight]
-.asm_24713
+.loop
ld [hl], " "
add hl, de
dec a
- jr nz, .asm_24713
+ jr nz, .loop
ret
InitScrollingMenuCursor: ; 2471a
diff --git a/engine/startmenu.asm b/engine/startmenu.asm
index 25a3eee39..acad9bb88 100755
--- a/engine/startmenu.asm
+++ b/engine/startmenu.asm
@@ -91,7 +91,7 @@ StartMenu:: ; 125cd
ld [MenuSelection], a
.loop
call .PrintMenuAccount
- call Function1f1a
+ call GetScrollingMenuJoypad
ld a, [wMenuJoypad]
cp B_BUTTON
jr z, .b
@@ -591,70 +591,66 @@ HasNoItems: ; 129d5
and a
ret
-Function129f4: ; 129f4
+TossItemFromPC: ; 129f4
push de
call PartyMonItemName
callba _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
and a
- jr nz, .asm_12a3f
- ld hl, UnknownText_0x12a45
+ jr nz, .key_item
+ ld hl, .TossHowMany
call MenuTextBox
callba SelectQuantityToToss
push af
call CloseWindow
call ExitMenu
pop af
- jr c, .asm_12a42
- ld hl, UnknownText_0x12a4a
+ jr c, .quit
+ ld hl, .ConfirmToss
call MenuTextBox
call YesNoBox
push af
call ExitMenu
pop af
- jr c, .asm_12a42
+ jr c, .quit
pop hl
ld a, [wd107]
call TossItem
call PartyMonItemName
- ld hl, UnknownText_0x12a4f
+ ld hl, .TossedThisMany
call MenuTextBox
call ExitMenu
and a
ret
-.asm_12a3f
- call Function12a54
-.asm_12a42
+
+.key_item
+ call .CantToss
+.quit
pop hl
scf
ret
-; 12a45 (4:6a45)
-UnknownText_0x12a45: ; 0x12a45
+.TossHowMany
; Toss out how many @ (S)?
text_jump UnknownText_0x1c1a90
db "@"
-; 0x12a4a
-UnknownText_0x12a4a: ; 0x12a4a
+.ConfirmToss
; Throw away @ @ (S)?
text_jump UnknownText_0x1c1aad
db "@"
-; 0x12a4f
-UnknownText_0x12a4f: ; 0x12a4f
+.TossedThisMany
; Discarded @ (S).
text_jump UnknownText_0x1c1aca
db "@"
-; 0x12a54
-Function12a54: ; 12a54 (4:6a54)
- ld hl, UnknownText_0x12a5b
+.CantToss
+ ld hl, .TooImportantToToss
call MenuTextBoxBackup
ret
-; 12a5b (4:6a5b)
-UnknownText_0x12a5b: ; 0x12a5b
+.TooImportantToToss
; That's too impor- tant to toss out!
text_jump UnknownText_0x1c1adf
db "@"
@@ -830,7 +826,7 @@ GiveTakePartyMonItem: ; 12b60
; 12ba9
-.GiveItem: ; 12ba9
+.GiveItem
callba DepositSellInitPackBuffers
@@ -1168,7 +1164,7 @@ MonMailAction: ; 12d45
; 12dc9
-.MenuDataHeader: ; 0x12dc9
+.MenuDataHeader
db $40 ; flags
db 10, 12 ; start coords
db 17, 19 ; end coords
@@ -1176,7 +1172,7 @@ MonMailAction: ; 12d45
db 1 ; default option
; 0x12dd1
-.MenuData2: ; 0x12dd1
+.MenuData2
db $80 ; flags
db 3 ; items
db "READ@"
@@ -1185,37 +1181,37 @@ MonMailAction: ; 12d45
; 0x12de2
-.mailwilllosemessagetext: ; 0x12de2
+.mailwilllosemessagetext
; The MAIL will lose its message. OK?
text_jump UnknownText_0x1c1c22
db "@"
; 0x12de7
-.tookmailfrommontext: ; 0x12de7
+.tookmailfrommontext
; MAIL detached from <POKEMON>.
text_jump UnknownText_0x1c1c47
db "@"
; 0x12dec
-.bagfulltext: ; 0x12dec
+.bagfulltext
; There's no space for removing MAIL.
text_jump UnknownText_0x1c1c62
db "@"
; 0x12df1
-.sendmailtopctext: ; 0x12df1
+.sendmailtopctext
; Send the removed MAIL to your PC?
text_jump UnknownText_0x1c1c86
db "@"
; 0x12df6
-.mailboxfulltext: ; 0x12df6
+.mailboxfulltext
; Your PC's MAILBOX is full.
text_jump UnknownText_0x1c1ca9
db "@"
; 0x12dfb
-.sentmailtopctext: ; 0x12dfb
+.sentmailtopctext
; The MAIL was sent to your PC.
text_jump UnknownText_0x1c1cc4
db "@"
@@ -1392,13 +1388,13 @@ MonMenu_Softboiled_MilkDrink: ; 12ee6
ret
; 12f00
-.Text_NotEnoughHP: ; 0x12f00
+.Text_NotEnoughHP
; Not enough HP!
text_jump UnknownText_0x1c1ce3
db "@"
; 0x12f05
-.CheckMonHasEnoughHP: ; 12f05
+.CheckMonHasEnoughHP
; Need to have at least (MaxHP / 5) HP left.
ld a, MON_MAXHP
call GetPartyParamLocation
@@ -1471,7 +1467,7 @@ ChooseMoveToDelete: ; 12f5b
ret
; 12f73
-.asm_12f73: ; 12f73
+.asm_12f73
call SetUpMoveScreenBG
ld de, DeleteMoveScreenAttrs
call SetMenuAttributes
@@ -1480,27 +1476,27 @@ ChooseMoveToDelete: ; 12f5b
set 6, [hl]
jr .asm_12f93
-.asm_12f86: ; 12f86
+.asm_12f86
call ScrollingMenuJoypad
bit 1, a
jp nz, .asm_12f9f
bit 0, a
jp nz, .asm_12f9c
-.asm_12f93: ; 12f93
+.asm_12f93
call PrepareToPlaceMoveData
call PlaceMoveData
jp .asm_12f86
; 12f9c
-.asm_12f9c: ; 12f9c
+.asm_12f9c
and a
jr .asm_12fa0
-.asm_12f9f: ; 12f9f
+.asm_12f9f
scf
-.asm_12fa0: ; 12fa0
+.asm_12fa0
push af
xor a
ld [wSwitchMon], a
@@ -1583,7 +1579,7 @@ MoveScreenLoop: ; 12fd5
ld de, String_1316b
call PlaceString
jp .joy_loop
-.b_button: ; 13038
+.b_button
call PlayClickSFX
call WaitSFX
ld a, [wMoveSwapBuffer]
@@ -1600,7 +1596,7 @@ MoveScreenLoop: ; 12fd5
jp .loop
; 1305b
-.d_right: ; 1305b
+.d_right
ld a, [wMoveSwapBuffer]
and a
jp nz, .joy_loop
@@ -1615,7 +1611,7 @@ MoveScreenLoop: ; 12fd5
jp z, .joy_loop
jp MoveScreenLoop
-.d_left: ; 13075
+.d_left
ld a, [wMoveSwapBuffer]
and a
jp nz, .joy_loop
@@ -1665,7 +1661,7 @@ MoveScreenLoop: ; 12fd5
jr .cycle_left_loop
; 130c6
-.a_button: ; 130c6
+.a_button
call PlayClickSFX
call WaitSFX
ld a, [wMoveSwapBuffer]
@@ -1716,7 +1712,7 @@ MoveScreenLoop: ; 12fd5
jp .loop
; 1313a
-.copy_move: ; 1313a
+.copy_move
push hl
ld a, [wMenuCursorY]
dec a
@@ -1739,7 +1735,7 @@ MoveScreenLoop: ; 12fd5
ret
; 13154
-.exit: ; 13154
+.exit
xor a
ld [wMoveSwapBuffer], a
ld hl, w2DMenuFlags1
@@ -1776,7 +1772,7 @@ SetUpMoveScreenBG: ; 13172
ld a, [hl]
ld [wd265], a
ld e, $2
- callba Function8e83f
+ callba LoadMenuMonIcon
hlcoord 0, 1
ld b, 9
ld c, 18
diff --git a/engine/tile_events.asm b/engine/tile_events.asm
index a6794e817..77f267b4f 100755
--- a/engine/tile_events.asm
+++ b/engine/tile_events.asm
@@ -21,17 +21,17 @@ CheckDirectionalWarp:: ; 149af
; Else, set carry (immediate warp).
ld a, [PlayerStandingTile]
cp $70 ; Warp on down
- jr z, .not_warp
+ jr z, .directional
cp $76 ; Warp on left
- jr z, .not_warp
+ jr z, .directional
cp $78 ; Warp on up
- jr z, .not_warp
+ jr z, .directional
cp $7e ; Warp on right
- jr z, .not_warp
+ jr z, .directional
scf
ret
-.not_warp
+.directional
xor a
ret
; 149c6
diff --git a/engine/time.asm b/engine/time.asm
index 4240522c2..235645966 100755
--- a/engine/time.asm
+++ b/engine/time.asm
@@ -133,7 +133,7 @@ endr
; 11485
Special_SampleKenjiBreakCountdown: ; 11485
-; Generate a random number between 3 and 5
+; Generate a random number between 3 and 6
call Random
and 3
add 3
diff --git a/engine/trade/animation.asm b/engine/trade/animation.asm
index 719a230ff..be5318b2e 100755
--- a/engine/trade/animation.asm
+++ b/engine/trade/animation.asm
@@ -1440,7 +1440,7 @@ LoadTradeBallAndCableGFX: ; 2982b
LoadTradeBubbleGFX: ; 2985a
call DelayFrame
ld e, $3
- callab Function8e83f
+ callab LoadMenuMonIcon
ld de, TradeBubbleGFX
ld hl, VTiles0 tile $72
lb bc, BANK(TradeBubbleGFX), $4