link and seer labels

This commit is contained in:
PikalaxALT 2015-11-23 16:04:53 -05:00
parent 0dc5ae04b8
commit d972564175
24 changed files with 705 additions and 643 deletions

View File

@ -7,7 +7,7 @@ SendOutFirstMons: ; 3c000
xor a xor a
ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsNotFainted], a
ld [wc6fc], a ld [wc6fc], a
ld [wd0ec], a ld [wPlayerAction], a
ld [BattleEnded], a ld [BattleEnded], a
inc a inc a
ld [wd264], a ld [wd264], a
@ -302,7 +302,7 @@ HandleBetweenTurnEffects: ; 3c1d6
call HandleHealingItems call HandleHealingItems
call UpdateBattleMonInParty call UpdateBattleMonInParty
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
jp Function3c4df jp HandleEncore
; 3c23c ; 3c23c
CheckFaint_PlayerThenEnemy: ; 3c23c CheckFaint_PlayerThenEnemy: ; 3c23c
@ -461,7 +461,7 @@ DetermineMoveOrder: ; 3c314
jr z, .use_move jr z, .use_move
sub BATTLEACTION_SWITCH1 sub BATTLEACTION_SWITCH1
jr c, .use_move jr c, .use_move
ld a, [wd0ec] ld a, [wPlayerAction]
cp $2 cp $2
jr nz, .switch jr nz, .switch
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]
@ -486,7 +486,7 @@ DetermineMoveOrder: ; 3c314
jp .enemy_first jp .enemy_first
.use_move .use_move
ld a, [wd0ec] ld a, [wPlayerAction]
and a and a
jp nz, .player_first jp nz, .player_first
call CompareMovePriority call CompareMovePriority
@ -629,7 +629,7 @@ ParsePlayerAction: ; 3c434
jr .encored jr .encored
.not_encored .not_encored
ld a, [wd0ec] ld a, [wPlayerAction]
cp $2 cp $2
jr z, .reset_rage jr z, .reset_rage
and a and a
@ -638,7 +638,7 @@ ParsePlayerAction: ; 3c434
and 1 << SUBSTATUS_BIDE and 1 << SUBSTATUS_BIDE
jr nz, .locked_in jr nz, .locked_in
xor a xor a
ld [wd235], a ld [wMoveSelectionMenuType], a
inc a ; POUND inc a ; POUND
ld [FXAnimIDLo], a ld [FXAnimIDLo], a
call MoveSelectionScreen call MoveSelectionScreen
@ -714,23 +714,23 @@ ParsePlayerAction: ; 3c434
ret ret
; 3c4df ; 3c4df
Function3c4df: ; 3c4df HandleEncore: ; 3c4df
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]
cp $1 cp $1
jr z, .asm_3c4ea jr z, .player_1
call .asm_3c4ed call .do_player
jr .asm_3c518 jr .do_enemy
.asm_3c4ea .player_1
call .asm_3c518 call .do_enemy
.asm_3c4ed .do_player
ld hl, PlayerSubStatus5 ld hl, PlayerSubStatus5
bit SUBSTATUS_ENCORED, [hl] bit SUBSTATUS_ENCORED, [hl]
ret z ret z
ld a, [PlayerEncoreCount] ld a, [PlayerEncoreCount]
dec a dec a
ld [PlayerEncoreCount], a ld [PlayerEncoreCount], a
jr z, .asm_3c50a jr z, .end_player_encore
ld hl, BattleMonPP ld hl, BattleMonPP
ld a, [CurMoveNum] ld a, [CurMoveNum]
ld c, a ld c, a
@ -740,21 +740,21 @@ Function3c4df: ; 3c4df
and $3f and $3f
ret nz ret nz
.asm_3c50a .end_player_encore
ld hl, PlayerSubStatus5 ld hl, PlayerSubStatus5
res SUBSTATUS_ENCORED, [hl] res SUBSTATUS_ENCORED, [hl]
call SetEnemyTurn call SetEnemyTurn
ld hl, BattleText_TargetsEncoreEnded ld hl, BattleText_TargetsEncoreEnded
jp StdBattleTextBox jp StdBattleTextBox
.asm_3c518 .do_enemy
ld hl, EnemySubStatus5 ld hl, EnemySubStatus5
bit SUBSTATUS_ENCORED, [hl] bit SUBSTATUS_ENCORED, [hl]
ret z ret z
ld a, [EnemyEncoreCount] ld a, [EnemyEncoreCount]
dec a dec a
ld [EnemyEncoreCount], a ld [EnemyEncoreCount], a
jr z, .asm_3c535 jr z, .end_enemy_encore
ld hl, EnemyMonPP ld hl, EnemyMonPP
ld a, [CurEnemyMoveNum] ld a, [CurEnemyMoveNum]
ld c, a ld c, a
@ -764,7 +764,7 @@ Function3c4df: ; 3c4df
and $3f and $3f
ret nz ret nz
.asm_3c535 .end_enemy_encore
ld hl, EnemySubStatus5 ld hl, EnemySubStatus5
res SUBSTATUS_ENCORED, [hl] res SUBSTATUS_ENCORED, [hl]
call SetPlayerTurn call SetPlayerTurn
@ -972,7 +972,7 @@ Battle_EnemyFirst: ; 3c5fe
jp z, HandlePlayerMonFaint jp z, HandlePlayerMonFaint
call RefreshBattleHuds call RefreshBattleHuds
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; 3c664 ; 3c664
@ -1022,7 +1022,7 @@ Battle_PlayerFirst: ; 3c664
jp z, HandleEnemyMonFaint jp z, HandleEnemyMonFaint
call RefreshBattleHuds call RefreshBattleHuds
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; 3c6cf ; 3c6cf
@ -2004,7 +2004,8 @@ GetMaxHP: ; 3ccac
ret ret
; 3ccc2 ; 3ccc2
Function3ccc2: ; 3ccc2 GetHalfHP: ; 3ccc2
; unreferenced
ld hl, BattleMonHP ld hl, BattleMonHP
ld a, [hBattleTurn] ld a, [hBattleTurn]
and a and a
@ -2160,22 +2161,22 @@ HandleEnemyMonFaint: ; 3cd55
jp c, WildFled_EnemyFled_LinkBattleCanceled jp c, WildFled_EnemyFled_LinkBattleCanceled
ld a, $1 ld a, $1
ld [wd0ec], a ld [wPlayerAction], a
call Function3cf4a call Function3cf4a
jp z, WildFled_EnemyFled_LinkBattleCanceled jp z, WildFled_EnemyFled_LinkBattleCanceled
jr Function3cdca jr DoubleSwitch
.player_mon_not_fainted .player_mon_not_fainted
ld a, $1 ld a, $1
ld [wd0ec], a ld [wPlayerAction], a
call Function3cf4a call Function3cf4a
jp z, WildFled_EnemyFled_LinkBattleCanceled jp z, WildFled_EnemyFled_LinkBattleCanceled
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; 3cdca ; 3cdca
Function3cdca: ; 3cdca DoubleSwitch: ; 3cdca
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]
cp $1 cp $1
jr z, .player_1 jr z, .player_1
@ -2201,7 +2202,7 @@ Function3cdca: ; 3cdca
.done .done
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; 3ce01 ; 3ce01
@ -2412,14 +2413,14 @@ CheckEnemyTrainerDefeated: ; 3cf35
Function3cf4a: ; 3cf4a Function3cf4a: ; 3cf4a
ld hl, EnemyHPPal ld hl, EnemyHPPal
ld e, HP_BAR_LENGTH_PX ld e, HP_BAR_LENGTH_PX
call Function3e12e call UpdateHPPal
call WaitBGMap call WaitBGMap
callba Function2c012 callba Function2c012
ld a, [wLinkMode] ld a, [wLinkMode]
and a and a
jr z, .not_linked jr z, .not_linked
call Function3e8e4 call LinkBattleSendReceiveAction
ld a, [wBattleAction] ld a, [wBattleAction]
cp BATTLEACTION_FORFEIT cp BATTLEACTION_FORFEIT
ret z ret z
@ -2459,7 +2460,7 @@ EnemyPartyMonEntrance: ; 3cf78
call SpikesDamage call SpikesDamage
xor a xor a
ld [wEnemyMoveStruct + MOVE_ANIM], a ld [wEnemyMoveStruct + MOVE_ANIM], a
ld [wd0ec], a ld [wPlayerAction], a
inc a inc a
ret ret
; 3cfa4 ; 3cfa4
@ -2813,10 +2814,10 @@ HandlePlayerMonFaint: ; 3d14e
and a and a
ret nz ret nz
ld a, $1 ld a, $1
ld [wd0ec], a ld [wPlayerAction], a
call Function3cf4a call Function3cf4a
jp z, WildFled_EnemyFled_LinkBattleCanceled jp z, WildFled_EnemyFled_LinkBattleCanceled
jp Function3cdca jp DoubleSwitch
; 3d1aa ; 3d1aa
PlayerMonFaintHappinessMod: ; 3d1aa PlayerMonFaintHappinessMod: ; 3d1aa
@ -2896,12 +2897,12 @@ ForcePlayerMonChoice: ; 3d227
and a and a
jr z, .skip_link jr z, .skip_link
ld a, $1 ld a, $1
ld [wd0ec], a ld [wPlayerAction], a
call Function3e8e4 call LinkBattleSendReceiveAction
.skip_link .skip_link
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
call CheckMobileBattleError call CheckMobileBattleError
jr c, .enemy_fainted_mobile_error jr c, .enemy_fainted_mobile_error
ld hl, EnemyMonHP ld hl, EnemyMonHP
@ -3344,7 +3345,7 @@ EnemySwitch: ; 3d4e1
xor a xor a
ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsNotFainted], a
ld [wc6fc], a ld [wc6fc], a
ld [wd0ec], a ld [wPlayerAction], a
inc a inc a
ld [wEnemyIsSwitching], a ld [wEnemyIsSwitching], a
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
@ -3938,9 +3939,9 @@ TryToRunAwayFromBattle: ; 3d8b3
jp .can_escape jp .can_escape
.no_flee_item .no_flee_item
ld a, [wd267] ld a, [wNumFleeAttempts]
inc a inc a
ld [wd267], a ld [wNumFleeAttempts], a
ld a, [hli] ld a, [hli]
ld [hStringCmpString2 + 0], a ld [hStringCmpString2 + 0], a
ld a, [hl] ld a, [hl]
@ -3981,12 +3982,12 @@ TryToRunAwayFromBattle: ; 3d8b3
ld a, [hQuotient + 1] ld a, [hQuotient + 1]
and a and a
jr nz, .can_escape jr nz, .can_escape
ld a, [wd267] ld a, [wNumFleeAttempts]
ld c, a ld c, a
.loop .loop
dec c dec c
jr z, .cant_escape_2 jr z, .cant_escape_2
ld b, $1e ld b, 30
ld a, [hQuotient + 2] ld a, [hQuotient + 2]
add b add b
ld [hQuotient + 2], a ld [hQuotient + 2], a
@ -4000,7 +4001,7 @@ TryToRunAwayFromBattle: ; 3d8b3
cp b cp b
jr nc, .can_escape jr nc, .can_escape
ld a, $1 ld a, $1
ld [wd0ec], a ld [wPlayerAction], a
ld hl, BattleText_CantEscape2 ld hl, BattleText_CantEscape2
jr .print_inescapable_text jr .print_inescapable_text
@ -4014,7 +4015,7 @@ TryToRunAwayFromBattle: ; 3d8b3
.print_inescapable_text .print_inescapable_text
call StdBattleTextBox call StdBattleTextBox
ld a, $1 ld a, $1
ld [wd266], a ld [wFailedToFlee], a
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
and a and a
ret ret
@ -4026,12 +4027,12 @@ TryToRunAwayFromBattle: ; 3d8b3
jr z, .fled jr z, .fled
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ld a, $f ld a, $f
ld [CurMoveNum], a ld [CurMoveNum], a
xor a xor a
ld [CurPlayerMove], a ld [CurPlayerMove], a
call Function3e8e4 call LinkBattleSendReceiveAction
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
call CheckMobileBattleError call CheckMobileBattleError
jr c, .mobile jr c, .mobile
@ -4886,7 +4887,7 @@ DrawPlayerHUD: ; 3df58
UpdatePlayerHPPal: ; 3df98 UpdatePlayerHPPal: ; 3df98
ld hl, PlayerHPPal ld hl, PlayerHPPal
jp Function3e12e jp UpdateHPPal
; 3df9e ; 3df9e
CheckDanger: ; 3df9e CheckDanger: ; 3df9e
@ -4917,7 +4918,7 @@ CheckDanger: ; 3df9e
PrintPlayerHUD: ; 3dfbf PrintPlayerHUD: ; 3dfbf
ld de, BattleMonNick ld de, BattleMonNick
hlcoord 10, 7 hlcoord 10, 7
call Function3e138 call ret_3e138
call PlaceString call PlaceString
push bc push bc
@ -5005,7 +5006,7 @@ DrawEnemyHUD: ; 3e043
call GetBaseData call GetBaseData
ld de, EnemyMonNick ld de, EnemyMonNick
hlcoord 1, 0 hlcoord 1, 0
call Function3e138 call ret_3e138
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
@ -5028,12 +5029,12 @@ DrawEnemyHUD: ; 3e043
ld [MonType], a ld [MonType], a
callab GetGender callab GetGender
ld a, " " ld a, " "
jr c, .asm_3e09a jr c, .got_gender
ld a, "♂" ld a, "♂"
jr nz, .asm_3e09a jr nz, .got_gender
ld a, "♀" ld a, "♀"
.asm_3e09a .got_gender
hlcoord 9, 1 hlcoord 9, 1
ld [hl], a ld [hl], a
@ -5044,16 +5045,16 @@ DrawEnemyHUD: ; 3e043
predef PlaceNonFaintStatus predef PlaceNonFaintStatus
pop hl pop hl
pop bc pop bc
jr nz, .asm_3e0be jr nz, .skip_level
ld a, b ld a, b
cp " " cp " "
jr nz, .asm_3e0b5 jr nz, .print_level
dec hl dec hl
.asm_3e0b5 .print_level
ld a, [EnemyMonLevel] ld a, [EnemyMonLevel]
ld [TempMonLevel], a ld [TempMonLevel], a
call PrintLevel call PrintLevel
.asm_3e0be .skip_level
ld hl, EnemyMonHP ld hl, EnemyMonHP
ld a, [hli] ld a, [hli]
@ -5061,14 +5062,14 @@ DrawEnemyHUD: ; 3e043
ld a, [hld] ld a, [hld]
ld [hMultiplicand + 2], a ld [hMultiplicand + 2], a
or [hl] or [hl]
jr nz, .asm_3e0d1 jr nz, .not_fainted
ld c, a ld c, a
ld e, a ld e, a
ld d, HP_BAR_LENGTH ld d, HP_BAR_LENGTH
jp .asm_3e11a jp .draw_bar
.asm_3e0d1 .not_fainted
xor a xor a
ld [hMultiplicand], a ld [hMultiplicand], a
ld a, HP_BAR_LENGTH_PX ld a, HP_BAR_LENGTH_PX
@ -5081,7 +5082,7 @@ DrawEnemyHUD: ; 3e043
ld [hMultiplier], a ld [hMultiplier], a
ld a, b ld a, b
and a and a
jr z, .asm_3e105 jr z, .less_than_256_max
ld a, [hMultiplier] ld a, [hMultiplier]
srl b srl b
rr a rr a
@ -5099,12 +5100,12 @@ DrawEnemyHUD: ; 3e043
ld a, b ld a, b
ld [hProduct + 2], a ld [hProduct + 2], a
.asm_3e105 .less_than_256_max
ld a, [hProduct + 2] ld a, [hProduct + 2]
ld [hDividend + 0], a ld [hDividend + 0], a
ld a, [hProduct + 3] ld a, [hProduct + 3]
ld [hDividend + 1], a ld [hDividend + 1], a
ld a, $2 ld a, 2
ld b, a ld b, a
call Divide call Divide
ld a, [hQuotient + 2] ld a, [hQuotient + 2]
@ -5113,7 +5114,7 @@ DrawEnemyHUD: ; 3e043
ld d, a ld d, a
ld c, a ld c, a
.asm_3e11a .draw_bar
xor a xor a
ld [wd10a], a ld [wd10a], a
hlcoord 2, 2 hlcoord 2, 2
@ -5124,11 +5125,11 @@ DrawEnemyHUD: ; 3e043
UpdateEnemyHPPal: ; 3e127 UpdateEnemyHPPal: ; 3e127
ld hl, EnemyHPPal ld hl, EnemyHPPal
call Function3e12e call UpdateHPPal
ret ret
; 3e12e ; 3e12e
Function3e12e: ; 3e12e UpdateHPPal: ; 3e12e
ld b, [hl] ld b, [hl]
call SetHPPal call SetHPPal
ld a, [hl] ld a, [hl]
@ -5137,7 +5138,7 @@ Function3e12e: ; 3e12e
jp FinishBattleAnim jp FinishBattleAnim
; 3e138 ; 3e138
Function3e138: ; 3e138 ret_3e138: ; 3e138
ret ret
; 3e139 ; 3e139
@ -5192,7 +5193,7 @@ BattleMenu: ; 3e139
BattleMenu_Fight: ; 3e192 BattleMenu_Fight: ; 3e192
xor a xor a
ld [wd267], a ld [wNumFleeAttempts], a
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
and a and a
ret ret
@ -5242,13 +5243,13 @@ BattleMenu_Pack: ; 3e1c7
jr z, .contest jr z, .contest
callba BattlePack callba BattlePack
ld a, [wd0ec] ld a, [wPlayerAction]
and a and a
jr z, .didnt_use_item jr z, .didnt_use_item
jr .got_item jr .got_item
.tutorial .tutorial
callba Function107bb callba TutorialPack
ld a, POKE_BALL ld a, POKE_BALL
ld [CurItem], a ld [CurItem], a
call DoItemEffect call DoItemEffect
@ -5448,7 +5449,7 @@ Function3e358: ; 3e358
ld a, [CurBattleMon] ld a, [CurBattleMon]
ld [LastPlayerMon], a ld [LastPlayerMon], a
ld a, $2 ld a, $2
ld [wd0ec], a ld [wPlayerAction], a
call ClearPalettes call ClearPalettes
call DelayFrame call DelayFrame
call ClearSprites call ClearSprites
@ -5468,7 +5469,7 @@ PlayerSwitch: ; 3e3ad
and a and a
jr z, .not_linked jr z, .not_linked
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
call Function3e8e4 call LinkBattleSendReceiveAction
call WriteBackup call WriteBackup
.not_linked .not_linked
@ -5585,9 +5586,9 @@ BattleMenu_Run: ; 3e489
ld de, EnemyMonSpeed ld de, EnemyMonSpeed
call TryToRunAwayFromBattle call TryToRunAwayFromBattle
ld a, $0 ld a, $0
ld [wd266], a ld [wFailedToFlee], a
ret c ret c
ld a, [wd0ec] ld a, [wPlayerAction]
and a and a
ret nz ret nz
jp BattleMenu jp BattleMenu
@ -5608,27 +5609,27 @@ CheckAmuletCoin: ; 3e4a8
MoveSelectionScreen: ; 3e4bc MoveSelectionScreen: ; 3e4bc
call IsMobileBattle call IsMobileBattle
jr nz, .asm_3e4c8 jr nz, .not_mobile
callba Function100b9f callba MobileMoveSelectionScreen
ret ret
.asm_3e4c8 .not_mobile
ld hl, EnemyMonMoves ld hl, EnemyMonMoves
ld a, [wd235] ld a, [wMoveSelectionMenuType]
dec a dec a
jr z, .asm_3e4e2 jr z, .got_menu_type
dec a dec a
jr z, .asm_3e4dd jr z, .ether_elixer_menu
call Function3e786 call CheckPlayerHasUsableMoves
ret z ret z ; use Struggle
ld hl, BattleMonMoves ld hl, BattleMonMoves
jr .asm_3e4e2 jr .got_menu_type
.asm_3e4dd .ether_elixer_menu
ld a, MON_MOVES ld a, MON_MOVES
call GetPartyParamLocation call GetPartyParamLocation
.asm_3e4e2 .got_menu_type
ld de, wListMoves_MoveIndicesBuffer ld de, wListMoves_MoveIndicesBuffer
ld bc, NUM_MOVES ld bc, NUM_MOVES
call CopyBytes call CopyBytes
@ -5638,44 +5639,44 @@ MoveSelectionScreen: ; 3e4bc
hlcoord 4, 17 - NUM_MOVES - 1 hlcoord 4, 17 - NUM_MOVES - 1
ld b, 4 ld b, 4
ld c, 14 ld c, 14
ld a, [wd235] ld a, [wMoveSelectionMenuType]
cp $2 cp $2
jr nz, .asm_3e503 jr nz, .got_dims
hlcoord 4, 17 - NUM_MOVES - 1 - 4 hlcoord 4, 17 - NUM_MOVES - 1 - 4
ld b, 4 ld b, 4
ld c, 14 ld c, 14
.asm_3e503 .got_dims
call TextBox call TextBox
hlcoord 6, 17 - NUM_MOVES hlcoord 6, 17 - NUM_MOVES
ld a, [wd235] ld a, [wMoveSelectionMenuType]
cp $2 cp $2
jr nz, .asm_3e513 jr nz, .got_start_coord
hlcoord 6, 17 - NUM_MOVES - 4 hlcoord 6, 17 - NUM_MOVES - 4
.asm_3e513 .got_start_coord
ld a, SCREEN_WIDTH ld a, SCREEN_WIDTH
ld [Buffer1], a ld [Buffer1], a
predef ListMoves predef ListMoves
ld b, 5 ld b, 5
ld a, [wd235] ld a, [wMoveSelectionMenuType]
cp $2 cp $2
ld a, 17 - NUM_MOVES ld a, 17 - NUM_MOVES
jr nz, .asm_3e52c jr nz, .got_default_coord
ld b, 5 ld b, 5
ld a, 17 - NUM_MOVES - 4 ld a, 17 - NUM_MOVES - 4
.asm_3e52c .got_default_coord
ld [wcfa1], a ld [wcfa1], a
ld a, b ld a, b
ld [wcfa2], a ld [wcfa2], a
ld a, [wd235] ld a, [wMoveSelectionMenuType]
cp $1 cp $1
jr z, .asm_3e53e jr z, .skip_inc
ld a, [CurMoveNum] ld a, [CurMoveNum]
inc a inc a
.asm_3e53e .skip_inc
ld [MenuSelection2], a ld [MenuSelection2], a
ld a, $1 ld a, $1
ld [wcfaa], a ld [wcfaa], a
@ -5685,19 +5686,19 @@ MoveSelectionScreen: ; 3e4bc
ld a, $1 ld a, $1
ld [wcfa4], a ld [wcfa4], a
ld c, $2c ld c, $2c
ld a, [wd235] ld a, [wMoveSelectionMenuType]
dec a dec a
ld b, $c1 ld b, $c1
jr z, .asm_3e569 jr z, .okay
dec a dec a
ld b, $c3 ld b, $c3
jr z, .asm_3e569 jr z, .okay
ld a, [wLinkMode] ld a, [wLinkMode]
and a and a
jr nz, .asm_3e569 jr nz, .okay
ld b, $c7 ld b, $c7
.asm_3e569 .okay
ld a, b ld a, b
ld [wcfa8], a ld [wcfa8], a
ld a, c ld a, c
@ -5706,64 +5707,64 @@ MoveSelectionScreen: ; 3e4bc
ld [wcfa6], a ld [wcfa6], a
ld a, $10 ld a, $10
ld [wcfa7], a ld [wcfa7], a
.asm_3e57a .menu_loop
ld a, [wd235] ld a, [wMoveSelectionMenuType]
and a and a
jr z, .asm_3e58e jr z, .battle_player_moves
dec a dec a
jr nz, .asm_3e5a3 jr nz, .interpret_joypad
hlcoord 11, 14 hlcoord 11, 14
ld de, .string_3e61c ld de, .string_3e61c
call PlaceString call PlaceString
jr .asm_3e5a3 jr .interpret_joypad
.asm_3e58e .battle_player_moves
call MoveInfoBox call MoveInfoBox
ld a, [wSwitchMon] ld a, [wMoveSwapBuffer]
and a and a
jr z, .asm_3e5a3 jr z, .interpret_joypad
hlcoord 5, 13 hlcoord 5, 13
ld bc, SCREEN_WIDTH ld bc, SCREEN_WIDTH
dec a dec a
call AddNTimes call AddNTimes
ld [hl], "▷" ld [hl], "▷"
.asm_3e5a3 .interpret_joypad
ld a, $1 ld a, $1
ld [hBGMapMode], a ld [hBGMapMode], a
call Function1bd3 call Function1bd3
bit 6, a ; D_UP bit D_UP_F, a
jp nz, .asm_3e61d jp nz, .pressed_up
bit 7, a ; D_DOWN bit D_DOWN_F, a
jp nz, .asm_3e62e jp nz, .pressed_down
bit 2, a ; B_BUTTON bit SELECT_F, a
jp nz, .asm_3e643 jp nz, .pressed_select
bit 1, a ; A_BUTTON bit B_BUTTON_F, a
push af push af
xor a xor a
ld [wSwitchMon], a ld [wMoveSwapBuffer], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
dec a dec a
ld [MenuSelection2], a ld [MenuSelection2], a
ld b, a ld b, a
ld a, [wd235] ld a, [wMoveSelectionMenuType]
dec a dec a
jr nz, .asm_3e5d0 jr nz, .not_enemy_moves_process_b
pop af pop af
ret ret
.asm_3e5d0 .not_enemy_moves_process_b
dec a dec a
ld a, b ld a, b
ld [CurMoveNum], a ld [CurMoveNum], a
jr nz, .asm_3e5d9 jr nz, .use_move
pop af pop af
ret ret
.asm_3e5d9 .use_move
pop af pop af
ret nz ret nz
@ -5774,16 +5775,16 @@ MoveSelectionScreen: ; 3e4bc
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
and $3f and $3f
jr z, .asm_3e610 jr z, .no_pp_left
ld a, [PlayerDisableCount] ld a, [PlayerDisableCount]
swap a swap a
and $f and $f
dec a dec a
cp c cp c
jr z, .asm_3e60b jr z, .move_disabled
ld a, [wc6e1] ld a, [wc6e1]
and a and a
jr nz, .asm_3e606 jr nz, .skip2
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld hl, BattleMonMoves ld hl, BattleMonMoves
ld c, a ld c, a
@ -5791,19 +5792,19 @@ MoveSelectionScreen: ; 3e4bc
add hl, bc add hl, bc
ld a, [hl] ld a, [hl]
.asm_3e606 .skip2
ld [CurPlayerMove], a ld [CurPlayerMove], a
xor a xor a
ret ret
.asm_3e60b .move_disabled
ld hl, BattleText_TheMoveIsDisabled ld hl, BattleText_TheMoveIsDisabled
jr .asm_3e613 jr .place_textbox_start_over
.asm_3e610 .no_pp_left
ld hl, BattleText_TheresNoPPLeftForThisMove ld hl, BattleText_TheresNoPPLeftForThisMove
.asm_3e613 .place_textbox_start_over
call StdBattleTextBox call StdBattleTextBox
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
jp MoveSelectionScreen jp MoveSelectionScreen
@ -5813,17 +5814,17 @@ MoveSelectionScreen: ; 3e4bc
db "@" db "@"
; 3e61d ; 3e61d
.asm_3e61d .pressed_up
ld a, [MenuSelection2] ld a, [MenuSelection2]
and a and a
jp nz, .asm_3e57a jp nz, .menu_loop
ld a, [wd0eb] ld a, [wd0eb]
inc a inc a
ld [MenuSelection2], a ld [MenuSelection2], a
jp .asm_3e57a jp .menu_loop
; 3e62e ; 3e62e
.asm_3e62e ; 3e62e .pressed_down ; 3e62e
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld b, a ld b, a
ld a, [wd0eb] ld a, [wd0eb]
@ -5831,20 +5832,20 @@ rept 2
inc a inc a
endr endr
cp b cp b
jp nz, .asm_3e57a jp nz, .menu_loop
ld a, $1 ld a, $1
ld [MenuSelection2], a ld [MenuSelection2], a
jp .asm_3e57a jp .menu_loop
; 3e643 ; 3e643
.asm_3e643 ; 3e643 .pressed_select ; 3e643
ld a, [wSwitchMon] ld a, [wMoveSwapBuffer]
and a and a
jr z, .asm_3e6bf jr z, .start_swap
ld hl, BattleMonMoves ld hl, BattleMonMoves
call .asm_3e6a5 call .swap_bytes
ld hl, BattleMonPP ld hl, BattleMonPP
call .asm_3e6a5 call .swap_bytes
ld hl, PlayerDisableCount ld hl, PlayerDisableCount
ld a, [hl] ld a, [hl]
swap a swap a
@ -5852,20 +5853,20 @@ endr
ld b, a ld b, a
ld a, [MenuSelection2] ld a, [MenuSelection2]
cp b cp b
jr nz, .asm_3e671 jr nz, .not_swapping_disabled_move
ld a, [hl] ld a, [hl]
and $f and $f
ld b, a ld b, a
ld a, [wSwitchMon] ld a, [wMoveSwapBuffer]
swap a swap a
add b add b
ld [hl], a ld [hl], a
jr .asm_3e682 jr .swap_moves_in_party_struct
.asm_3e671 .not_swapping_disabled_move
ld a, [wSwitchMon] ld a, [wMoveSwapBuffer]
cp b cp b
jr nz, .asm_3e682 jr nz, .swap_moves_in_party_struct
ld a, [hl] ld a, [hl]
and $f and $f
ld b, a ld b, a
@ -5874,28 +5875,29 @@ endr
add b add b
ld [hl], a ld [hl], a
.asm_3e682 .swap_moves_in_party_struct
; Fixes the COOLTRAINER glitch
ld a, [PlayerSubStatus5] ld a, [PlayerSubStatus5]
bit SUBSTATUS_TRANSFORMED, a bit SUBSTATUS_TRANSFORMED, a
jr nz, .asm_3e69e jr nz, .transformed
ld hl, PartyMon1Moves ld hl, PartyMon1Moves
ld a, [CurBattleMon] ld a, [CurBattleMon]
call GetPartyLocation call GetPartyLocation
push hl push hl
call .asm_3e6a5 call .swap_bytes
pop hl pop hl
ld bc, MON_PP - MON_MOVES ld bc, MON_PP - MON_MOVES
add hl, bc add hl, bc
call .asm_3e6a5 call .swap_bytes
.asm_3e69e .transformed
xor a xor a
ld [wSwitchMon], a ld [wMoveSwapBuffer], a
jp MoveSelectionScreen jp MoveSelectionScreen
.asm_3e6a5 .swap_bytes
push hl push hl
ld a, [wSwitchMon] ld a, [wMoveSwapBuffer]
dec a dec a
ld c, a ld c, a
ld b, 0 ld b, 0
@ -5915,9 +5917,9 @@ endr
ld [de], a ld [de], a
ret ret
.asm_3e6bf .start_swap
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wSwitchMon], a ld [wMoveSwapBuffer], a
jp MoveSelectionScreen jp MoveSelectionScreen
; 3e6c8 ; 3e6c8
@ -5933,21 +5935,21 @@ MoveInfoBox: ; 3e6c8
ld a, [PlayerDisableCount] ld a, [PlayerDisableCount]
and a and a
jr z, .asm_3e6f4 jr z, .not_disabled
swap a swap a
and $f and $f
ld b, a ld b, a
ld a, [MenuSelection2] ld a, [MenuSelection2]
cp b cp b
jr nz, .asm_3e6f4 jr nz, .not_disabled
hlcoord 1, 10 hlcoord 1, 10
ld de, .Disabled ld de, .Disabled
call PlaceString call PlaceString
jr .done jr .done
.asm_3e6f4 .not_disabled
ld hl, MenuSelection2 ld hl, MenuSelection2
dec [hl] dec [hl]
call SetPlayerTurn call SetPlayerTurn
@ -5974,7 +5976,7 @@ MoveInfoBox: ; 3e6c8
ld a, [hl] ld a, [hl]
and $3f and $3f
ld [StringBuffer1], a ld [StringBuffer1], a
call Function3e75f call .PrintPP
hlcoord 1, 9 hlcoord 1, 9
ld de, .Type ld de, .Type
@ -6000,7 +6002,7 @@ MoveInfoBox: ; 3e6c8
; 3e75f ; 3e75f
Function3e75f: ; 3e75f .PrintPP: ; 3e75f
hlcoord 5, 11 hlcoord 5, 11
ld a, [wLinkMode] ; What's the point of this check? ld a, [wLinkMode] ; What's the point of this check?
cp LINK_MOBILE cp LINK_MOBILE
@ -6023,13 +6025,13 @@ endr
ret ret
; 3e786 ; 3e786
Function3e786: ; 3e786 CheckPlayerHasUsableMoves: ; 3e786
ld a, STRUGGLE ld a, STRUGGLE
ld [CurPlayerMove], a ld [CurPlayerMove], a
ld a, [PlayerDisableCount] ld a, [PlayerDisableCount]
and a and a
ld hl, BattleMonPP ld hl, BattleMonPP
jr nz, .asm_3e79f jr nz, .disabled
ld a, [hli] ld a, [hli]
or [hl] or [hl]
@ -6039,29 +6041,29 @@ Function3e786: ; 3e786
or [hl] or [hl]
and $3f and $3f
ret nz ret nz
jr .asm_3e7b4 jr .force_struggle
.asm_3e79f .disabled
swap a swap a
and $f and $f
ld b, a ld b, a
ld d, $5 ld d, $5
xor a xor a
.asm_3e7a7 .loop
dec d dec d
jr z, .asm_3e7b2 jr z, .done
ld c, [hl] ld c, [hl]
inc hl inc hl
dec b dec b
jr z, .asm_3e7a7 jr z, .loop
or c or c
jr .asm_3e7a7 jr .loop
.asm_3e7b2 .done
and a and a
ret nz ret nz
.asm_3e7b4 .force_struggle
ld hl, BattleText_PkmnHasNoMovesLeft ld hl, BattleText_PkmnHasNoMovesLeft
call StdBattleTextBox call StdBattleTextBox
ld c, 60 ld c, 60
@ -6081,9 +6083,9 @@ ParseEnemyAction: ; 3e7c1
jr z, .not_linked jr z, .not_linked
call EmptyBattleTextBox call EmptyBattleTextBox
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
ld a, [wd0ec] ld a, [wPlayerAction]
and a and a
call z, Function3e8e4 call z, LinkBattleSendReceiveAction
call Call_LoadTempTileMapToTileMap call Call_LoadTempTileMapToTileMap
ld a, [wBattleAction] ld a, [wBattleAction]
cp BATTLEACTION_E cp BATTLEACTION_E
@ -6247,8 +6249,8 @@ CheckSubstatus_RechargeChargedRampageBideRollout: ; 3e8d1
ret ret
; 3e8e4 ; 3e8e4
Function3e8e4: ; 3e8e4 LinkBattleSendReceiveAction: ; 3e8e4
callba Function100a09 callba _LinkBattleSendReceiveAction
ret ret
; 3e8eb ; 3e8eb
@ -6569,13 +6571,13 @@ LoadEnemyMon: ; 3e8eb
xor a xor a
ld [hli], a ld [hli], a
; Full HP... ; Full HP..
ld a, [EnemyMonMaxHP] ld a, [EnemyMonMaxHP]
ld [hli], a ld [hli], a
ld a, [EnemyMonMaxHP + 1] ld a, [EnemyMonMaxHP + 1]
ld [hl], a ld [hl], a
; ...unless it's a RoamMon ; ..unless it's a RoamMon
ld a, [BattleType] ld a, [BattleType]
cp a, BATTLETYPE_ROAMING cp a, BATTLETYPE_ROAMING
jr nz, .Moves jr nz, .Moves
@ -6678,7 +6680,7 @@ endr
call CopyBytes call CopyBytes
.Finish .Finish
; Only the first five base stats are copied... ; Only the first five base stats are copied..
ld hl, BaseStats ld hl, BaseStats
ld de, EnemyMonBaseStats ld de, EnemyMonBaseStats
ld b, BaseSpecialDefense - BaseStats ld b, BaseSpecialDefense - BaseStats
@ -8759,8 +8761,8 @@ CleanUpBattleRAM: ; 3f6d0
ld [AttackMissed], a ld [AttackMissed], a
ld [TempWildMonSpecies], a ld [TempWildMonSpecies], a
ld [OtherTrainerClass], a ld [OtherTrainerClass], a
ld [wd266], a ld [wFailedToFlee], a
ld [wd267], a ld [wNumFleeAttempts], a
ld [wForcedSwitch], a ld [wForcedSwitch], a
ld [wd0d8], a ld [wd0d8], a
ld [wKeyItemsPocketCursor], a ld [wKeyItemsPocketCursor], a
@ -8768,13 +8770,13 @@ CleanUpBattleRAM: ; 3f6d0
ld [wd0d2], a ld [wd0d2], a
ld [CurMoveNum], a ld [CurMoveNum], a
ld [wBallsPocketCursor], a ld [wBallsPocketCursor], a
ld [wd0d6], a ld [wLastPocket], a
ld [wd0e4], a ld [wMenuScrollPosition], a
ld [wd0e0], a ld [wKeyItemsPocketScrollPosition], a
ld [wd0df], a ld [wItemsPocketScrollPosition], a
ld [wd0e1], a ld [wBallsPocketScrollPosition], a
ld hl, PlayerSubStatus1 ld hl, PlayerSubStatus1
ld b, $18 ld b, EnemyFuryCutterCount - PlayerSubStatus1
.loop .loop
ld [hli], a ld [hli], a
dec b dec b

View File

@ -9028,7 +9028,7 @@ BatonPass_LinkPlayerSwitch: ; 37a67
ld [wd0ec], a ld [wd0ec], a
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
ld hl, Function3e8e4 ld hl, LinkBattleSendReceiveAction
call CallBattleCore call CallBattleCore
call WriteBackup call WriteBackup
@ -9044,7 +9044,7 @@ BatonPass_LinkEnemySwitch: ; 37a82
ret z ret z
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
ld hl, Function3e8e4 ld hl, LinkBattleSendReceiveAction
call CallBattleCore call CallBattleCore
ld a, [OTPartyCount] ld a, [OTPartyCount]

View File

@ -176,6 +176,10 @@ const_value = 1
const LINK_COLOSSEUM const LINK_COLOSSEUM
const LINK_MOBILE const LINK_MOBILE
SERIAL_TIMECAPSULE EQU $60
SERIAL_TRADECENTER EQU $70
SERIAL_BATTLE EQU $80
HMENURETURN_SCRIPT EQU %10000000 HMENURETURN_SCRIPT EQU %10000000
HMENURETURN_ASM EQU %11111111 HMENURETURN_ASM EQU %11111111

View File

@ -2362,7 +2362,7 @@ _ChangeBox: ; e35aa (38:75aa)
ld hl, _ChangeBox_menudataheader ld hl, _ChangeBox_menudataheader
call CopyMenuDataHeader call CopyMenuDataHeader
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
hlcoord 0, 4 hlcoord 0, 4
lb bc, 8, 9 lb bc, 8, 9
call TextBox call TextBox

View File

@ -399,7 +399,7 @@ PopulateDecoCategoryMenu: ; 2695b
ld [hBGMapMode], a ld [hBGMapMode], a
call InitScrollingMenu call InitScrollingMenu
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wcf73] ld a, [wcf73]
cp 2 cp 2

View File

@ -9,7 +9,7 @@ EvolvePokemon: ; 421d8
EvolveAfterBattle: ; 421e6 EvolveAfterBattle: ; 421e6
xor a xor a
ld [wd268], a ld [wMonTriedToEvolve], a
dec a dec a
ld [CurPartyMon], a ld [CurPartyMon], a
push hl push hl
@ -201,7 +201,7 @@ endr
ld a, [TempMonLevel] ld a, [TempMonLevel]
ld [CurPartyLevel], a ld [CurPartyLevel], a
ld a, $1 ld a, $1
ld [wd268], a ld [wMonTriedToEvolve], a
push hl push hl
@ -349,7 +349,7 @@ Evolution_ReturnToMap: ; 423ff
ld a, [wBattleMode] ld a, [wBattleMode]
and a and a
ret nz ret nz
ld a, [wd268] ld a, [wMonTriedToEvolve]
and a and a
call nz, RestartMapMusic call nz, RestartMapMusic
ret ret

View File

@ -40,7 +40,7 @@ Function2805d: ; 2805d
call Function28499 call Function28499
call Function28434 call Function28434
xor a xor a
ld [wcf56], a ld [wPlayerLinkAction], a
call Function87d call Function87d
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]
cp $2 cp $2
@ -474,7 +474,7 @@ Function283b2: ; 283b2
ld b, $a ld b, $a
.asm_283b7 .asm_283b7
call DelayFrame call DelayFrame
call Function908 call LinkCommunicationsSignalDataReceived
dec b dec b
jr nz, .asm_283b7 jr nz, .asm_283b7
xor a xor a
@ -1213,7 +1213,7 @@ Function287e3: ; 287e3
call Function28ef8 call Function28ef8
callba Function16d673 callba Function16d673
xor a xor a
ld hl, wcf51 ld hl, wOtherPlayerLinkMode
rept 3 rept 3
ld [hli], a ld [hli], a
endr endr
@ -1221,7 +1221,7 @@ endr
ld a, $1 ld a, $1
ld [MenuSelection2], a ld [MenuSelection2], a
inc a inc a
ld [wcf56], a ld [wPlayerLinkAction], a
jp Function2888b jp Function2888b
; 28803 ; 28803
@ -1468,9 +1468,9 @@ Function28926: ; 28926
ld [MenuSelection2], a ld [MenuSelection2], a
dec a dec a
ld [wd002], a ld [wd002], a
ld [wcf56], a ld [wPlayerLinkAction], a
callba Function16d6ce callba Function16d6ce
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
cp $f cp $f
jp z, Function287e3 jp z, Function287e3
ld [wd003], a ld [wd003], a
@ -1483,7 +1483,7 @@ Function28926: ; 28926
jp nc, Function28b87 jp nc, Function28b87
xor a xor a
ld [wcf57], a ld [wcf57], a
ld [wcf52], a ld [wOtherPlayerLinkAction], a
hlcoord 0, 12 hlcoord 0, 12
ld b, $4 ld b, $4
ld c, $12 ld c, $12
@ -1497,7 +1497,7 @@ Function28926: ; 28926
.asm_28a58 .asm_28a58
xor a xor a
ld [wcf57], a ld [wcf57], a
ld [wcf52], a ld [wOtherPlayerLinkAction], a
ld a, [wd003] ld a, [wd003]
ld hl, OTPartySpecies ld hl, OTPartySpecies
ld c, a ld c, a
@ -1524,7 +1524,7 @@ Function28926: ; 28926
ld de, String28ece ld de, String28ece
call PlaceString call PlaceString
ld a, $1 ld a, $1
ld [wcf56], a ld [wPlayerLinkAction], a
callba Function16d6ce callba Function16d6ce
ld c, $64 ld c, $64
call DelayFrames call DelayFrames
@ -1591,9 +1591,9 @@ Function28ade: ; 28ade
ld a, $ec ld a, $ec
ldcoord_a 9, 17 ldcoord_a 9, 17
ld a, $f ld a, $f
ld [wcf56], a ld [wPlayerLinkAction], a
callba Function16d6ce callba Function16d6ce
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
cp $f cp $f
jr nz, .asm_28ade jr nz, .asm_28ade
@ -1634,7 +1634,7 @@ String_28b61: ; 28b61
; 28b68 ; 28b68
Function28b68: ; 28b68 Function28b68: ; 28b68
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
hlcoord 6, 9 hlcoord 6, 9
ld bc, SCREEN_WIDTH ld bc, SCREEN_WIDTH
call AddNTimes call AddNTimes
@ -1662,7 +1662,7 @@ Function28b77: ; 28b77
Function28b87: ; 28b87 Function28b87: ; 28b87
xor a xor a
ld [wcf57], a ld [wcf57], a
ld [wcf52], a ld [wOtherPlayerLinkAction], a
hlcoord 0, 12 hlcoord 0, 12
ld b, $4 ld b, $4
ld c, $12 ld c, $12
@ -1731,7 +1731,7 @@ Function28b87: ; 28b87
.asm_28c33 .asm_28c33
ld a, $1 ld a, $1
ld [wcf56], a ld [wPlayerLinkAction], a
hlcoord 0, 12 hlcoord 0, 12
ld b, 4 ld b, 4
ld c, 18 ld c, 18
@ -1744,9 +1744,9 @@ Function28b87: ; 28b87
.asm_28c54 .asm_28c54
ld a, $2 ld a, $2
ld [wcf56], a ld [wPlayerLinkAction], a
callba Function16d6ce callba Function16d6ce
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
dec a dec a
jr nz, .asm_28c7b jr nz, .asm_28c7b
hlcoord 0, 12 hlcoord 0, 12
@ -1959,7 +1959,7 @@ Function28b87: ; 28b87
.asm_28e49 .asm_28e49
ld a, b ld a, b
ld [wcf56], a ld [wPlayerLinkAction], a
push bc push bc
call Function862 call Function862
pop bc pop bc
@ -1969,7 +1969,7 @@ Function28b87: ; 28b87
ld a, b ld a, b
and a and a
jr z, .asm_28e63 jr z, .asm_28e63
ld a, [wcf52] ld a, [wOtherPlayerLinkAction]
cp b cp b
jr nz, .asm_28e49 jr nz, .asm_28e49
@ -2148,11 +2148,11 @@ Function29c67: ; 29c67
; 29c7b ; 29c7b
Special_EnterTimeCapsule: ; 29c7b Special_EnterTimeCapsule: ; 29c7b
ld c, $a ld c, 10
call DelayFrames call DelayFrames
ld a, $4 ld a, $4
call Function29f17 call Function29f17
ld c, $28 ld c, 40
call DelayFrames call DelayFrames
xor a xor a
ld [hVBlank], a ld [hVBlank], a
@ -2210,15 +2210,15 @@ Special_AbortLink: ; 29c92
; 29ce8 ; 29ce8
Special_SetBitsForLinkTradeRequest: ; 29ce8 Special_SetBitsForLinkTradeRequest: ; 29ce8
ld a, $1 ld a, LINK_TRADECENTER - 1
ld [wcf56], a ld [wPlayerLinkAction], a
ld [wd265], a ld [wd265], a
ret ret
; 29cf1 ; 29cf1
Special_SetBitsForBattleRequest: ; 29cf1 Special_SetBitsForBattleRequest: ; 29cf1
ld a, $2 ld a, LINK_COLOSSEUM - 1
ld [wcf56], a ld [wPlayerLinkAction], a
ld [wd265], a ld [wd265], a
ret ret
; 29cfa ; 29cfa
@ -2232,14 +2232,14 @@ Special_SetBitsForTimeCapsuleRequest: ; 29cfa
ld [rSC], a ld [rSC], a
ld a, $80 ld a, $80
ld [rSC], a ld [rSC], a
xor a xor a ; LINK_TIMECAPSULE - 1
ld [wcf56], a ld [wPlayerLinkAction], a
ld [wd265], a ld [wd265], a
ret ret
; 29d11 ; 29d11
Special_WaitForLinkedFriend: ; 29d11 Special_WaitForLinkedFriend: ; 29d11
ld a, [wcf56] ld a, [wPlayerLinkAction]
and a and a
jr z, .asm_29d2f jr z, .asm_29d2f
ld a, $2 ld a, $2
@ -2295,9 +2295,9 @@ Special_WaitForLinkedFriend: ; 29d11
jr .asm_29d39 jr .asm_29d39
.asm_29d79 .asm_29d79
call Function908 call LinkCommunicationsSignalDataReceived
call DelayFrame call DelayFrame
call Function908 call LinkCommunicationsSignalDataReceived
ld c, $32 ld c, $32
call DelayFrames call DelayFrames
ld a, $1 ld a, $1
@ -2312,7 +2312,7 @@ Special_WaitForLinkedFriend: ; 29d11
Special_CheckLinkTimeout: ; 29d92 Special_CheckLinkTimeout: ; 29d92
ld a, $1 ld a, $1
ld [wcf56], a ld [wPlayerLinkAction], a
ld hl, wcf5b ld hl, wcf5b
ld a, $3 ld a, $3
ld [hli], a ld [hli], a
@ -2334,7 +2334,7 @@ Special_CheckLinkTimeout: ; 29d92
Function29dba: ; 29dba Function29dba: ; 29dba
ld a, $5 ld a, $5
ld [wcf56], a ld [wPlayerLinkAction], a
ld hl, wcf5b ld hl, wcf5b
ld a, $3 ld a, $3
ld [hli], a ld [hli], a
@ -2355,17 +2355,17 @@ Function29dba: ; 29dba
ld a, b ld a, b
or c or c
jr nz, .asm_29de0 jr nz, .asm_29de0
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
cp $5 cp $5
jr nz, .asm_29e03 jr nz, .asm_29e03
ld a, $6 ld a, $6
ld [wcf56], a ld [wPlayerLinkAction], a
ld hl, wcf5b ld hl, wcf5b
ld a, $1 ld a, $1
ld [hli], a ld [hli], a
ld [hl], $32 ld [hl], $32
call Function29e0c call Function29e0c
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
cp $6 cp $6
jr z, .asm_29e08 jr z, .asm_29e08
@ -2426,7 +2426,7 @@ Function29e47: ; 29e47
ld b, $a ld b, $a
.asm_29e49 .asm_29e49
call DelayFrame call DelayFrame
call Function908 call LinkCommunicationsSignalDataReceived
dec b dec b
jr nz, .asm_29e49 jr nz, .asm_29e49
ret ret
@ -2467,14 +2467,14 @@ Special_CheckBothSelectedSameRoom: ; 29e82
ld a, [wd265] ld a, [wd265]
call Function29f17 call Function29f17
push af push af
call Function908 call LinkCommunicationsSignalDataReceived
call DelayFrame call DelayFrame
call Function908 call LinkCommunicationsSignalDataReceived
pop af pop af
ld b, a ld b, a
ld a, [wd265] ld a, [wd265]
cp b cp b
jr nz, .asm_29eaa jr nz, .fail
ld a, [wd265] ld a, [wd265]
inc a inc a
ld [wLinkMode], a ld [wLinkMode], a
@ -2484,7 +2484,7 @@ Special_CheckBothSelectedSameRoom: ; 29e82
ld [ScriptVar], a ld [ScriptVar], a
ret ret
.asm_29eaa .fail
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
ret ret
@ -2532,14 +2532,14 @@ Special_CloseLink: ; 29eee
; 29efa ; 29efa
Special_FailedLinkToPast: ; 29efa Special_FailedLinkToPast: ; 29efa
ld c, $28 ld c, 40
call DelayFrames call DelayFrames
ld a, $e ld a, $e
jp Function29f17 jp Function29f17
; 29f04 ; 29f04
Function29f04: ; 29f04 Function29f04: ; 29f04
ld c, $3 ld c, 3
call DelayFrames call DelayFrames
ld a, -1 ld a, -1
ld [hLinkPlayerNumber], a ld [hLinkPlayerNumber], a
@ -2553,26 +2553,26 @@ Function29f04: ; 29f04
Function29f17: ; 29f17 Function29f17: ; 29f17
add $d0 add $d0
ld [wcf56], a ld [wPlayerLinkAction], a
ld [wcf57], a ld [wcf57], a
ld a, $2 ld a, $2
ld [hVBlank], a ld [hVBlank], a
call DelayFrame call DelayFrame
call DelayFrame call DelayFrame
.asm_29f29 .receive_loop
call Function83b call Function83b
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
ld b, a ld b, a
and $f0 and $f0
cp $d0 cp $d0
jr z, .asm_29f40 jr z, .done
ld a, [wcf52] ld a, [wOtherPlayerLinkAction]
ld b, a ld b, a
and $f0 and $f0
cp $d0 cp $d0
jr nz, .asm_29f29 jr nz, .receive_loop
.asm_29f40 .done
xor a xor a
ld [hVBlank], a ld [hVBlank], a
ld a, b ld a, b

View File

@ -398,9 +398,9 @@ MailboxPC: ; 0x44806
ld a, [wCurMessageIndex] ld a, [wCurMessageIndex]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [OBPals + 8 * 6] ld a, [OBPals + 8 * 6]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [OBPals + 8 * 6], a ld [OBPals + 8 * 6], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wCurMessageIndex], a ld [wCurMessageIndex], a

View File

@ -477,9 +477,9 @@ BuyMenuLoop: ; 15cef
ld a, [wd045] ld a, [wd045]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd045 + 1] ld a, [wd045 + 1]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd045 + 1], a ld [wd045 + 1], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wd045], a ld [wd045], a
@ -658,7 +658,7 @@ MenuDataHeader_Buy: ; 0x15e18
dbw 0, CurMart dbw 0, CurMart
dba PlaceMenuItemName dba PlaceMenuItemName
dba .PrintBCDPrices dba .PrintBCDPrices
dba Function244c3 dba UpdateItemDescription
; 15e30 ; 15e30
.PrintBCDPrices: ; 15e30 .PrintBCDPrices: ; 15e30

View File

@ -1,7 +1,7 @@
Pack: ; 10000 Pack: ; 10000
ld hl, Options ld hl, Options
set 4, [hl] set NO_TEXT_SCROLL, [hl]
call Function1068a call Function1068a
.loop .loop
call JoyTextDelay call JoyTextDelay
@ -14,9 +14,9 @@ Pack: ; 10000
.done .done
ld a, [wcf65] ld a, [wcf65]
ld [wd0d6], a ld [wLastPocket], a
ld hl, Options ld hl, Options
res 4, [hl] res NO_TEXT_SCROLL, [hl]
ret ret
; 10026 ; 10026
@ -65,11 +65,11 @@ Function10067: ; 10067 (4:4067)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wItemsPocketCursor] ld a, [wItemsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0df] ld a, [wItemsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0df], a ld [wItemsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wItemsPocketCursor], a ld [wItemsPocketCursor], a
ld b, $7 ld b, $7
@ -93,11 +93,11 @@ Function100a6: ; 100a6 (4:40a6)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wKeyItemsPocketCursor] ld a, [wKeyItemsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0e0] ld a, [wKeyItemsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0e0], a ld [wKeyItemsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wKeyItemsPocketCursor], a ld [wKeyItemsPocketCursor], a
ld b, $3 ld b, $3
@ -164,7 +164,7 @@ MenuData2_0x1012c: ; 0x1012c
Jumptable_10137: ; 10137 Jumptable_10137: ; 10137
dw Function10159 dw Function10159
dw Function10492_ret dw QuitItemSubmenu
; 1013b ; 1013b
MenuDataHeader_0x1013b: ; 0x1013b MenuDataHeader_0x1013b: ; 0x1013b
@ -185,8 +185,8 @@ MenuData2_0x10143: ; 0x10143
Jumptable_10153: ; 10153 Jumptable_10153: ; 10153
dw Function10159 dw Function10159
dw Function103fd dw GiveItem
dw Function10492_ret dw QuitItemSubmenu
; 10159 ; 10159
Function10159: ; 10159 Function10159: ; 10159
@ -223,11 +223,11 @@ Function10198: ; 10198 (4:4198)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wBallsPocketCursor] ld a, [wBallsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0e1] ld a, [wBallsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0e1], a ld [wBallsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wBallsPocketCursor], a ld [wBallsPocketCursor], a
ld b, $1 ld b, $1
@ -267,32 +267,32 @@ Function101c5: ; 101c5 (4:41c5)
jr .tossable_unselectable jr .tossable_unselectable
.usable .usable
ld hl, MenuDataHeader_0x10249 ld hl, MenuDataHeader_UsableKeyItem
ld de, Jumptable_1026a ld de, Jumptable_1026a
jr .build_menu jr .build_menu
.selectable_usable .selectable_usable
ld hl, MenuDataHeader_0x10274 ld hl, MenuDataHeader_UsableItem
ld de, Jumptable_10291 ld de, Jumptable_10291
jr .build_menu jr .build_menu
.tossable_selectable .tossable_selectable
ld hl, MenuDataHeader_0x10299 ld hl, MenuDataHeader_UnusableItem
ld de, Jumptable_102ac ld de, Jumptable_102ac
jr .build_menu jr .build_menu
.tossable_unselectable .tossable_unselectable
ld hl, MenuDataHeader_0x102b0 ld hl, MenuDataHeader_UnusableKeyItem
ld de, Jumptable_102c7 ld de, Jumptable_102c7
jr .build_menu jr .build_menu
.unusable .unusable
ld hl, MenuDataHeader_0x102cd ld hl, MenuDataHeader_HoldableKeyItem
ld de, Jumptable_102ea ld de, Jumptable_102ea
jr .build_menu jr .build_menu
.selectable_unusable .selectable_unusable
ld hl, MenuDataHeader_0x102f2 ld hl, MenuDataHeader_HoldableItem
ld de, Jumptable_1030b ld de, Jumptable_1030b
.build_menu .build_menu
push de push de
@ -307,15 +307,15 @@ Function101c5: ; 101c5 (4:41c5)
jp [hl] jp [hl]
; 10249 (4:4249) ; 10249 (4:4249)
MenuDataHeader_0x10249: ; 0x10249 MenuDataHeader_UsableKeyItem: ; 0x10249
db $40 ; flags db $40 ; flags
db 01, 13 ; start coords db 01, 13 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x10251 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x10251 ; 0x10251
MenuData2_0x10251: ; 0x10251 .MenuData2: ; 0x10251
db $c0 ; flags db $c0 ; flags
db 5 ; items db 5 ; items
db "USE@" db "USE@"
@ -326,22 +326,22 @@ MenuData2_0x10251: ; 0x10251
; 0x1026a ; 0x1026a
Jumptable_1026a: ; 1026a Jumptable_1026a: ; 1026a
dw Function10311 dw UseItem
dw Function103fd dw GiveItem
dw Function10364 dw TossMenu
dw Function103c2 dw RegisterItem
dw Function10492_ret dw QuitItemSubmenu
; 10274 ; 10274
MenuDataHeader_0x10274: ; 0x10274 MenuDataHeader_UsableItem: ; 0x10274
db $40 ; flags db $40 ; flags
db 03, 13 ; start coords db 03, 13 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x1027c dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x1027c ; 0x1027c
MenuData2_0x1027c: ; 0x1027c .MenuData2: ; 0x1027c
db $c0 ; flags db $c0 ; flags
db 4 ; items db 4 ; items
db "USE@" db "USE@"
@ -351,21 +351,21 @@ MenuData2_0x1027c: ; 0x1027c
; 0x10291 ; 0x10291
Jumptable_10291: ; 10291 Jumptable_10291: ; 10291
dw Function10311 dw UseItem
dw Function103fd dw GiveItem
dw Function10364 dw TossMenu
dw Function10492_ret dw QuitItemSubmenu
; 10299 ; 10299
MenuDataHeader_0x10299: ; 0x10299 MenuDataHeader_UnusableItem: ; 0x10299
db %01000000 ; flags db %01000000 ; flags
db 07, 13 ; start coords db 07, 13 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x102a1 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x102a1 ; 0x102a1
MenuData2_0x102a1: ; 0x102a1 .MenuData2: ; 0x102a1
db $c0 ; flags db $c0 ; flags
db 2 ; items db 2 ; items
db "USE@" db "USE@"
@ -373,19 +373,19 @@ MenuData2_0x102a1: ; 0x102a1
; 0x102ac ; 0x102ac
Jumptable_102ac: ; 102ac Jumptable_102ac: ; 102ac
dw Function10311 dw UseItem
dw Function10492_ret dw QuitItemSubmenu
; 102b0 ; 102b0
MenuDataHeader_0x102b0: ; 0x102b0 MenuDataHeader_UnusableKeyItem: ; 0x102b0
db %01000000 ; flags db %01000000 ; flags
db 05, 13 ; start coords db 05, 13 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x102b8 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x102b8 ; 0x102b8
MenuData2_0x102b8: ; 0x102b8 .MenuData2: ; 0x102b8
db $c0 ; flags db $c0 ; flags
db 3 ; items db 3 ; items
db "USE@" db "USE@"
@ -394,20 +394,20 @@ MenuData2_0x102b8: ; 0x102b8
; 0x102c7 ; 0x102c7
Jumptable_102c7: ; 102c7 Jumptable_102c7: ; 102c7
dw Function10311 dw UseItem
dw Function103c2 dw RegisterItem
dw Function10492_ret dw QuitItemSubmenu
; 102cd ; 102cd
MenuDataHeader_0x102cd: ; 0x102cd MenuDataHeader_HoldableKeyItem: ; 0x102cd
db $40 ; flags db $40 ; flags
db 03, 13 ; start coords db 03, 13 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x102d5 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x102d5 ; 0x102d5
MenuData2_0x102d5: ; 0x102d5 .MenuData2: ; 0x102d5
db $c0 ; flags db $c0 ; flags
db 4 ; items db 4 ; items
db "GIVE@" db "GIVE@"
@ -417,21 +417,21 @@ MenuData2_0x102d5: ; 0x102d5
; 0x102ea ; 0x102ea
Jumptable_102ea: ; 102ea Jumptable_102ea: ; 102ea
dw Function103fd dw GiveItem
dw Function10364 dw TossMenu
dw Function103c2 dw RegisterItem
dw Function10492_ret dw QuitItemSubmenu
; 102f2 ; 102f2
MenuDataHeader_0x102f2: ; 0x102f2 MenuDataHeader_HoldableItem: ; 0x102f2
db $40 ; flags db $40 ; flags
db 05, 13 ; start coords db 05, 13 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x102fa dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x102fa ; 0x102fa
MenuData2_0x102fa: ; 0x102fa .MenuData2: ; 0x102fa
db $c0 ; flags db $c0 ; flags
db 3 ; items db 3 ; items
db "GIVE@" db "GIVE@"
@ -440,12 +440,12 @@ MenuData2_0x102fa: ; 0x102fa
; 0x1030b ; 0x1030b
Jumptable_1030b: ; 1030b Jumptable_1030b: ; 1030b
dw Function103fd dw GiveItem
dw Function10364 dw TossMenu
dw Function10492_ret dw QuitItemSubmenu
; 10311 ; 10311
Function10311: ; 10311 UseItem: ; 10311
callba CheckItemMenu callba CheckItemMenu
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeParamBuffer]
ld hl, .jumptable ld hl, .jumptable
@ -464,7 +464,7 @@ Function10311: ; 10311
; 1035c ; 1035c
.Oak: ; 1032d (4:432d) .Oak: ; 1032d (4:432d)
ld hl, UnknownText_0x10af3 ld hl, Text_ThisIsntTheTime
call Function10889 call Function10889
ret ret
@ -498,30 +498,30 @@ Function10311: ; 10311
ret ret
; 10364 (4:4364) ; 10364 (4:4364)
Function10364: ; 10364 TossMenu: ; 10364
ld hl, UnknownText_0x10ae4 ld hl, Text_ThrowAwayHowMany
call Function10889 call Function10889
callba Function24fbf callba Function24fbf
push af push af
call ExitMenu call ExitMenu
pop af pop af
jr c, .asm_1039c jr c, .finish
call Function10a1d call Pack_GetItemName
ld hl, UnknownText_0x10ae9 ld hl, Text_ConfirmThrowAway
call MenuTextBox call MenuTextBox
call YesNoBox call YesNoBox
push af push af
call ExitMenu call ExitMenu
pop af pop af
jr c, .asm_1039c jr c, .finish
ld hl, NumItems ld hl, NumItems
ld a, [wd107] ld a, [ItemCountBuffer]
call TossItem call TossItem
call Function10a1d call Pack_GetItemName
ld hl, UnknownText_0x10aee ld hl, Text_ThrewAway
call Function10889 call Function10889
.asm_1039c .finish
ret ret
; 1039d ; 1039d
@ -538,23 +538,23 @@ Function1039d: ; 1039d
.asm_103aa .asm_103aa
xor a xor a
ld [wBallsPocketCursor], a ld [wBallsPocketCursor], a
ld [wd0e1], a ld [wBallsPocketScrollPosition], a
ret ret
.asm_103b2 .asm_103b2
xor a xor a
ld [wItemsPocketCursor], a ld [wItemsPocketCursor], a
ld [wd0df], a ld [wItemsPocketScrollPosition], a
ret ret
.asm_103ba .asm_103ba
xor a xor a
ld [wKeyItemsPocketCursor], a ld [wKeyItemsPocketCursor], a
ld [wd0e0], a ld [wKeyItemsPocketScrollPosition], a
ret ret
; 103c2 ; 103c2
Function103c2: ; 103c2 RegisterItem: ; 103c2
callba CheckSelectableItem callba CheckSelectableItem
ld a, [wItemAttributeParamBuffer] ld a, [wItemAttributeParamBuffer]
and a and a
@ -564,27 +564,27 @@ Function103c2: ; 103c2
rrca rrca
and $c0 and $c0
ld b, a ld b, a
ld a, [wd107] ld a, [ItemCountBuffer]
inc a inc a
and $3f and $3f
or b or b
ld [WhichRegisteredItem], a ld [WhichRegisteredItem], a
ld a, [CurItem] ld a, [CurItem]
ld [RegisteredItem], a ld [RegisteredItem], a
call Function10a1d call Pack_GetItemName
ld de, SFX_FULL_HEAL ld de, SFX_FULL_HEAL
call WaitPlaySFX call WaitPlaySFX
ld hl, UnknownText_0x10afd ld hl, Text_RegisteredItem
call Function10889 call Function10889
ret ret
.asm_103f6 .asm_103f6
ld hl, UnknownText_0x10b02 ld hl, Text_CantRegister
call Function10889 call Function10889
ret ret
; 103fd ; 103fd
Function103fd: ; 103fd GiveItem: ; 103fd
ld a, [PartyCount] ld a, [PartyCount]
and a and a
jp z, Function10486 jp z, Function10486
@ -652,7 +652,7 @@ TextJump_AnEGGCantHoldAnItem: ; 0x1048d
db "@" db "@"
; 0x10492 ; 0x10492
Function10492_ret: ; 10492 QuitItemSubmenu: ; 10492
ret ret
; 10493 ; 10493
@ -661,18 +661,18 @@ BattlePack: ; 10493
ld hl, Options ld hl, Options
set 4, [hl] set 4, [hl]
call Function1068a call Function1068a
.asm_1049b .loop
call JoyTextDelay call JoyTextDelay
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
bit 7, a bit 7, a
jr nz, .asm_104ad jr nz, .end
call Function104b9 call Function104b9
call DelayFrame call DelayFrame
jr .asm_1049b jr .loop
.asm_104ad .end
ld a, [wcf65] ld a, [wcf65]
ld [wd0d6], a ld [wLastPocket], a
ld hl, Options ld hl, Options
res 4, [hl] res 4, [hl]
ret ret
@ -723,11 +723,11 @@ Function104fa: ; 104fa (4:44fa)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wItemsPocketCursor] ld a, [wItemsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0df] ld a, [wItemsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0df], a ld [wItemsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wItemsPocketCursor], a ld [wItemsPocketCursor], a
ld b, $7 ld b, $7
@ -751,11 +751,11 @@ Function10539: ; 10539 (4:4539)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wKeyItemsPocketCursor] ld a, [wKeyItemsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0e0] ld a, [wKeyItemsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0e0], a ld [wKeyItemsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wKeyItemsPocketCursor], a ld [wKeyItemsPocketCursor], a
ld b, $3 ld b, $3
@ -773,7 +773,7 @@ Function10566: ; 10566 (4:4566)
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
call WaitBGMap_DrawPackGFX call WaitBGMap_DrawPackGFX
ld hl, UnknownText_0x10b0c ld hl, Text_PackEmptyString
call Function10889 call Function10889
call Function10866 call Function10866
ret ret
@ -802,11 +802,11 @@ Function105a6: ; 105a6 (4:45a6)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wBallsPocketCursor] ld a, [wBallsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0e1] ld a, [wBallsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0e1], a ld [wBallsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wBallsPocketCursor], a ld [wBallsPocketCursor], a
ld b, $1 ld b, $1
@ -898,7 +898,7 @@ Function105dc: ; 105dc (4:45dc)
.Oak: ; 10645 (4:4645) .Oak: ; 10645 (4:4645)
ld hl, UnknownText_0x10af3 ld hl, Text_ThisIsntTheTime
call Function10889 call Function10889
ret ret
@ -951,7 +951,7 @@ Function105dc: ; 105dc (4:45dc)
Function1068a: ; 1068a Function1068a: ; 1068a
xor a xor a
ld [wJumptableIndex], a ld [wJumptableIndex], a
ld a, [wd0d6] ld a, [wLastPocket]
and $3 and $3
ld [wcf65], a ld [wcf65], a
inc a inc a
@ -1008,33 +1008,33 @@ Jumptable_106d1: ; 106d1 (4:46d1)
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wItemsPocketCursor] ld a, [wItemsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0df] ld a, [wItemsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0df], a ld [wItemsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wItemsPocketCursor], a ld [wItemsPocketCursor], a
ret ret
.KeyItemsPocket: ; 106ff (4:46ff) .KeyItemsPocket: ; 106ff (4:46ff)
ld a, $2 ld a, 2
call InitPocket call InitPocket
ld hl, MenuDataHeader_0x10a97 ld hl, MenuDataHeader_0x10a97
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wKeyItemsPocketCursor] ld a, [wKeyItemsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0e0] ld a, [wKeyItemsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0e0], a ld [wKeyItemsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wKeyItemsPocketCursor], a ld [wKeyItemsPocketCursor], a
ret ret
.TMHMPocket: ; 10726 (4:4726) .TMHMPocket: ; 10726 (4:4726)
ld a, $3 ld a, 3
call InitPocket call InitPocket
call WaitBGMap_DrawPackGFX call WaitBGMap_DrawPackGFX
callba Function2c76f callba Function2c76f
@ -1043,17 +1043,17 @@ Jumptable_106d1: ; 106d1 (4:46d1)
ret ret
.BallsPocket: ; 1073b (4:473b) .BallsPocket: ; 1073b (4:473b)
ld a, $1 ld a, 1
call InitPocket call InitPocket
ld hl, MenuDataHeader_0x10ac7 ld hl, MenuDataHeader_0x10ac7
call CopyMenuDataHeader call CopyMenuDataHeader
ld a, [wBallsPocketCursor] ld a, [wBallsPocketCursor]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0e1] ld a, [wBallsPocketScrollPosition]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0e1], a ld [wBallsPocketScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wBallsPocketCursor], a ld [wBallsPocketCursor], a
ret ret
@ -1120,17 +1120,17 @@ Function1076f: ; 1076f
ret ret
; 107bb ; 107bb
Function107bb: ; 107bb TutorialPack: ; 107bb
call Function106a5 call Function106a5
ld a, [InputType] ld a, [InputType]
or a or a
jr z, .asm_107ca jr z, .loop
callba _DudeAutoInput_RightA callba _DudeAutoInput_RightA
.asm_107ca .loop
call Function107d7 call Function107d7
call Function1076f call Function1076f
jr c, .asm_107ca jr c, .loop
xor a xor a
ld [wcf66], a ld [wcf66], a
ret ret
@ -1138,13 +1138,13 @@ Function107bb: ; 107bb
Function107d7: ; 107d7 Function107d7: ; 107d7
ld a, [wJumptableIndex] ld a, [wJumptableIndex]
ld hl, Jumptable_107e1 ld hl, .jumptable
call Function1086b call Function1086b
jp [hl] jp [hl]
; 107e1 ; 107e1
Jumptable_107e1: ; 107e1 (4:47e1) .jumptable: ; 107e1 (4:47e1)
dw Function107e9 dw Function107e9
dw Function1083b dw Function1083b
dw Function10807 dw Function10807
@ -1161,22 +1161,22 @@ MenuDataHeader_0x107ef: ; 0x107ef
db $40 ; flags db $40 ; flags
db 01, 07 ; start coords db 01, 07 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x107f7 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x107f7 ; 0x107f7
MenuData2_0x107f7: ; 0x107f7 .MenuData2: ; 0x107f7
db $ae ; flags db $ae ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 2 ; horizontal spacing db 2 ; horizontal spacing
dbw 0, OTPartyMons dbw 0, OTPartyMons
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10807 ; 10807
Function10807: ; 10807 (4:4807) Function10807: ; 10807 (4:4807)
ld a, $2 ld a, 2
ld hl, MenuDataHeader_0x1080e ld hl, MenuDataHeader_0x1080e
jr Function1085a jr Function1085a
; 1080e (4:480e) ; 1080e (4:480e)
@ -1185,22 +1185,22 @@ MenuDataHeader_0x1080e: ; 0x1080e
db $40 ; flags db $40 ; flags
db 01, 07 ; start coords db 01, 07 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x10816 dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x10816 ; 0x10816
MenuData2_0x10816: ; 0x10816 .MenuData2: ; 0x10816
db $ae ; flags db $ae ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 1 ; horizontal spacing db 1 ; horizontal spacing
dbw 0, OTPartyMon1Exp + 2 dbw 0, OTPartyMon1Exp + 2
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10826 ; 10826
Function10826: ; 10826 (4:4826) Function10826: ; 10826 (4:4826)
ld a, $3 ld a, 3
call InitPocket call InitPocket
call WaitBGMap_DrawPackGFX call WaitBGMap_DrawPackGFX
callba Function2c76f callba Function2c76f
@ -1209,7 +1209,7 @@ Function10826: ; 10826 (4:4826)
ret ret
Function1083b: ; 1083b (4:483b) Function1083b: ; 1083b (4:483b)
ld a, $1 ld a, 1
ld hl, MenuDataHeader_0x10842 ld hl, MenuDataHeader_0x10842
jr Function1085a jr Function1085a
; 10842 (4:4842) ; 10842 (4:4842)
@ -1218,18 +1218,18 @@ MenuDataHeader_0x10842: ; 0x10842
db $40 ; flags db $40 ; flags
db 01, 07 ; start coords db 01, 07 ; start coords
db 11, 19 ; end coords db 11, 19 ; end coords
dw MenuData2_0x1084a dw .MenuData2
db 1 ; default option db 1 ; default option
; 0x1084a ; 0x1084a
MenuData2_0x1084a: ; 0x1084a .MenuData2: ; 0x1084a
db $ae ; flags db $ae ; flags
db 5, 8 ; rows, columns db 5, 8 ; rows, columns
db 2 ; horizontal spacing db 2 ; horizontal spacing
dbw 0, OTPartyMon1CaughtGender dbw 0, OTPartyMon1CaughtGender
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 1085a ; 1085a
Function1085a: ; 1085a (4:485a) Function1085a: ; 1085a (4:485a)
@ -1374,7 +1374,7 @@ Function108d4: ; 108d4 (4:48d4)
ret ret
.asm_10923 .asm_10923
callba Function2490c callba Function2490c
ld hl, UnknownText_0x10b07 ld hl, Text_MoveItemWhere
call Function10889 call Function10889
scf scf
ret ret
@ -1410,13 +1410,19 @@ Function10955: ; 10955
ld bc, $60 tiles ld bc, $60 tiles
ld a, BANK(PackMenuGFX) ld a, BANK(PackMenuGFX)
call FarCopyBytes call FarCopyBytes
; Background (blue if male, pink if female)
hlcoord 0, 1 hlcoord 0, 1
ld bc, 11 * SCREEN_WIDTH ld bc, 11 * SCREEN_WIDTH
ld a, $24 ld a, $24
call ByteFill call ByteFill
; This is where the items themselves will be listed.
hlcoord 5, 1 hlcoord 5, 1
lb bc, 11, 15 lb bc, 11, 15
call ClearBox call ClearBox
; ◀▶ POCKET ▼▲ ITEMS
hlcoord 0, 0 hlcoord 0, 0
ld a, $28 ld a, $28
ld c, SCREEN_WIDTH ld c, SCREEN_WIDTH
@ -1425,31 +1431,34 @@ Function10955: ; 10955
inc a inc a
dec c dec c
jr nz, .loop jr nz, .loop
call DrawPocketName call DrawPocketName
call Function109a5 call PlacePackGFX
hlcoord 0, 12
lb bc, 4, 18 ; Place the textbox for displaying the item description
hlcoord 0, SCREEN_HEIGHT - 4 - 2
lb bc, 4, SCREEN_WIDTH - 2
call TextBox call TextBox
call EnableLCD call EnableLCD
call DrawPackGFX call DrawPackGFX
ret ret
; 109a5 ; 109a5
Function109a5: ; 109a5 PlacePackGFX: ; 109a5
hlcoord 0, 3 hlcoord 0, 3
ld a, $50 ld a, $50
ld de, 15 ld de, SCREEN_WIDTH - 5
ld b, 3 ld b, 3
.asm_109af .row
ld c, 5 ld c, 5
.asm_109b1 .column
ld [hli], a ld [hli], a
inc a inc a
dec c dec c
jr nz, .asm_109b1 jr nz, .column
add hl, de add hl, de
dec b dec b
jr nz, .asm_109af jr nz, .row
ret ret
; 109bb ; 109bb
@ -1487,21 +1496,33 @@ DrawPocketName: ; 109bb
; 109e1 ; 109e1
.tilemap: ; 109e1 .tilemap: ; 109e1
db $00, $04, $04, $04, $01, $06, $07, $08, $09, $0a, $02, $05, $05, $05, $03 db $00, $04, $04, $04, $01 ; top border
db $00, $04, $04, $04, $01, $15, $16, $17, $18, $19, $02, $05, $05, $05, $03 db $06, $07, $08, $09, $0a ; Items
db $00, $04, $04, $04, $01, $0b, $0c, $0d, $0e, $0f, $02, $05, $05, $05, $03 db $02, $05, $05, $05, $03 ; bottom border
db $00, $04, $04, $04, $01, $10, $11, $12, $13, $14, $02, $05, $05, $05, $03
db $00, $04, $04, $04, $01 ; top border
db $15, $16, $17, $18, $19 ; Balls
db $02, $05, $05, $05, $03 ; bottom border
db $00, $04, $04, $04, $01 ; top border
db $0b, $0c, $0d, $0e, $0f ; Key Items
db $02, $05, $05, $05, $03 ; bottom border
db $00, $04, $04, $04, $01 ; top border
db $10, $11, $12, $13, $14 ; TM/HM
db $02, $05, $05, $05, $03 ; bottom border
; 10a1d ; 10a1d
Function10a1d: ; 10a1d Pack_GetItemName: ; 10a1d
ld a, [CurItem] ld a, [CurItem]
ld [wd265], a ld [wNamedObjectIndexBuffer], a
call GetItemName call GetItemName
call CopyName1 call CopyName1
ret ret
; 10a2a ; 10a2a
Function10a2a: ; 10a2a Pack_ClearTilemap: ; 10a2a
; unreferenced
hlcoord 0, 0 hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " " ld a, " "
@ -1540,7 +1561,7 @@ MenuData2_0x10a57: ; 0x10a57
dbw 0, NumItems dbw 0, NumItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10a67 ; 10a67
MenuDataHeader_0x10a67: ; 0x10a67 MenuDataHeader_0x10a67: ; 0x10a67
@ -1558,7 +1579,7 @@ MenuData2_0x10a6f: ; 0x10a6f
dbw 0, NumItems dbw 0, NumItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10a7f ; 10a7f
MenuDataHeader_0x10a7f: ; 0x10a7f MenuDataHeader_0x10a7f: ; 0x10a7f
@ -1576,7 +1597,7 @@ MenuData2_0x10a87: ; 0x10a87
dbw 0, NumKeyItems dbw 0, NumKeyItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10a97 ; 10a97
MenuDataHeader_0x10a97: ; 0x10a97 MenuDataHeader_0x10a97: ; 0x10a97
@ -1594,7 +1615,7 @@ MenuData2_0x10a9f: ; 0x10a9f
dbw 0, NumKeyItems dbw 0, NumKeyItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10aaf ; 10aaf
MenuDataHeader_0x10aaf: ; 0x10aaf MenuDataHeader_0x10aaf: ; 0x10aaf
@ -1612,7 +1633,7 @@ MenuData2_0x10ab7: ; 0x10ab7
dbw 0, NumBalls dbw 0, NumBalls
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10ac7 ; 10ac7
MenuDataHeader_0x10ac7: ; 0x10ac7 MenuDataHeader_0x10ac7: ; 0x10ac7
@ -1630,34 +1651,34 @@ MenuData2_0x10acf: ; 0x10acf
dbw 0, NumBalls dbw 0, NumBalls
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
; 10adf ; 10adf
UnknownText_0x10adf: ; 0x10adf Text_PackNoItems: ; 0x10adf
; No items. ; No items.
text_jump UnknownText_0x1c0b9a text_jump UnknownText_0x1c0b9a
db "@" db "@"
; 0x10ae4 ; 0x10ae4
UnknownText_0x10ae4: ; 0x10ae4 Text_ThrowAwayHowMany: ; 0x10ae4
; Throw away how many? ; Throw away how many?
text_jump UnknownText_0x1c0ba5 text_jump UnknownText_0x1c0ba5
db "@" db "@"
; 0x10ae9 ; 0x10ae9
UnknownText_0x10ae9: ; 0x10ae9 Text_ConfirmThrowAway: ; 0x10ae9
; Throw away @ @ (S)? ; Throw away @ @ (S)?
text_jump UnknownText_0x1c0bbb text_jump UnknownText_0x1c0bbb
db "@" db "@"
; 0x10aee ; 0x10aee
UnknownText_0x10aee: ; 0x10aee Text_ThrewAway: ; 0x10aee
; Threw away @ (S). ; Threw away @ (S).
text_jump UnknownText_0x1c0bd8 text_jump UnknownText_0x1c0bd8
db "@" db "@"
; 0x10af3 ; 0x10af3
UnknownText_0x10af3: ; 0x10af3 Text_ThisIsntTheTime: ; 0x10af3
; OAK: ! This isn't the time to use that! ; OAK: ! This isn't the time to use that!
text_jump UnknownText_0x1c0bee text_jump UnknownText_0x1c0bee
db "@" db "@"
@ -1669,25 +1690,25 @@ TextJump_YouDontHaveAPkmn: ; 0x10af8
db "@" db "@"
; 0x10afd ; 0x10afd
UnknownText_0x10afd: ; 0x10afd Text_RegisteredItem: ; 0x10afd
; Registered the @ . ; Registered the @ .
text_jump UnknownText_0x1c0c2e text_jump UnknownText_0x1c0c2e
db "@" db "@"
; 0x10b02 ; 0x10b02
UnknownText_0x10b02: ; 0x10b02 Text_CantRegister: ; 0x10b02
; You can't register that item. ; You can't register that item.
text_jump UnknownText_0x1c0c45 text_jump UnknownText_0x1c0c45
db "@" db "@"
; 0x10b07 ; 0x10b07
UnknownText_0x10b07: ; 0x10b07 Text_MoveItemWhere: ; 0x10b07
; Where should this be moved to? ; Where should this be moved to?
text_jump UnknownText_0x1c0c63 text_jump UnknownText_0x1c0c63
db "@" db "@"
; 0x10b0c ; 0x10b0c
UnknownText_0x10b0c: ; 0x10b0c Text_PackEmptyString: ; 0x10b0c
; ;
text_jump UnknownText_0x1c0c83 text_jump UnknownText_0x1c0c83
db "@" db "@"

View File

@ -590,9 +590,9 @@ Function15985: ; 0x15985
ld a, [wd0d7] ld a, [wd0d7]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd0dd] ld a, [wd0dd]
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd0dd], a ld [wd0dd], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wd0d7], a ld [wd0d7], a
@ -659,7 +659,7 @@ MenuData15a08: ; 0x15a08
dbw 0, PCItems dbw 0, PCItems
dba PlaceMenuItemName dba PlaceMenuItemName
dba PlaceMenuItemQuantity dba PlaceMenuItemQuantity
dba Function244c3 dba UpdateItemDescription
PC_DisplayText: ; 15a20 PC_DisplayText: ; 15a20
call MenuTextBox call MenuTextBox

View File

@ -66,7 +66,7 @@ SpecialBuenasPassword: ; 8af6b
SpecialBuenaPrize: ; 8afd4 SpecialBuenaPrize: ; 8afd4
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
ld a, $1 ld a, $1
ld [MenuSelection], a ld [MenuSelection], a
call Function8b0d6 call Function8b0d6

View File

@ -130,7 +130,7 @@ Function134dd: ; 134dd
call InitScrollingMenu call InitScrollingMenu
call UpdateSprites call UpdateSprites
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call HandleScrollingMenu
call WriteBackup call WriteBackup
ld a, [wcf73] ld a, [wcf73]

View File

@ -26,7 +26,7 @@ Special_SelectApricornForKurt: ; 88018
call LoadStandardMenuDataHeader call LoadStandardMenuDataHeader
ld c, $1 ld c, $1
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
ld [wKurtApricornQuantity], a ld [wKurtApricornQuantity], a
.loop .loop
push bc push bc

View File

@ -1,12 +1,19 @@
SEER_INTRO EQU 0 const_def
SEER_CANT_TELL EQU 1 const SEER_INTRO
SEER_MET_AT EQU 2 const SEER_CANT_TELL
SEER_TIME_LEVEL EQU 3 const SEER_MET_AT
SEER_TRADED EQU 4 const SEER_TIME_LEVEL
SEER_CANCEL EQU 5 const SEER_TRADED
SEER_EGG EQU 6 const SEER_CANCEL
SEER_LEVEL_ONLY EQU 7 const SEER_EGG
const SEER_LEVEL_ONLY
const_def
const SEERACTION_MET
const SEERACTION_TRADED
const SEERACTION_CANT_TELL_1
const SEERACTION_CANT_TELL_2
const SEERACTION_LEVEL_ONLY
SpecialPokeSeer: ; 4f0bc SpecialPokeSeer: ; 4f0bc
ld a, SEER_INTRO ld a, SEER_INTRO
@ -44,7 +51,7 @@ SpecialPokeSeer: ; 4f0bc
SeerAction: ; 4f0ee SeerAction: ; 4f0ee
ld a, [wd002] ld a, [wSeerAction]
ld hl, SeerActions ld hl, SeerActions
rst JumpTable rst JumpTable
ret ret
@ -100,29 +107,30 @@ ReadCaughtData: ; 4f134
ld a, MON_CAUGHTDATA ld a, MON_CAUGHTDATA
call GetPartyParamLocation call GetPartyParamLocation
ld a, [hli] ld a, [hli]
ld [wd03b], a ld [wSeerCaughtData], a
ld a, [hld] ld a, [hld]
ld [wd03b + 1], a ld [wSeerCaughtGender], a
or [hl] or [hl]
jr z, .asm_4f170 jr z, .error
ld a, 1 ld a, SEERACTION_TRADED
ld [wd002], a ld [wSeerAction], a
ld a, MON_ID ld a, MON_ID
call GetPartyParamLocation call GetPartyParamLocation
ld a, [PlayerID] ld a, [PlayerID]
cp [hl] cp [hl]
jr nz, .asm_4f15f jr nz, .traded
inc hl inc hl
ld a, [PlayerID + 1] ld a, [PlayerID + 1]
jr nz, .asm_4f15f ; cp [hl]
jr nz, .traded
ld a, 0 ld a, SEERACTION_MET
ld [wd002], a ld [wSeerAction], a
.asm_4f15f .traded
call GetCaughtLevel call GetCaughtLevel
call GetCaughtOT call GetCaughtOT
call GetCaughtName call GetCaughtName
@ -131,9 +139,9 @@ ReadCaughtData: ; 4f134
and a and a
ret ret
.asm_4f170 .error
ld a, 2 ld a, SEERACTION_CANT_TELL_1
ld [wd002], a ld [wSeerAction], a
ret ret
; 4f176 ; 4f176
@ -142,7 +150,7 @@ GetCaughtName: ; 4f176
ld hl, PartyMonNicknames ld hl, PartyMonNicknames
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
call AddNTimes call AddNTimes
ld de, wd003 ld de, wSeerNickname
ld bc, PKMN_NAME_LENGTH ld bc, PKMN_NAME_LENGTH
call CopyBytes call CopyBytes
ret ret
@ -150,12 +158,12 @@ GetCaughtName: ; 4f176
GetCaughtLevel: ; 4f18c GetCaughtLevel: ; 4f18c
ld a, "@" ld a, "@"
ld hl, wd036 ld hl, wSeerCaughtLevelString
ld bc, 4 ld bc, 4
call ByteFill call ByteFill
; caught level ; caught level
ld a, [wd03b] ld a, [wSeerCaughtData]
and $3f and $3f
jr z, .unknown jr z, .unknown
cp 1 ; hatched from an egg cp 1 ; hatched from an egg
@ -163,15 +171,15 @@ GetCaughtLevel: ; 4f18c
ld a, 5 ; egg hatch level ld a, 5 ; egg hatch level
.print .print
ld [wd038 + 2], a ld [wSeerCaughtLevel], a
ld hl, wd036 ld hl, wSeerCaughtLevelString
ld de, wd038 + 2 ld de, wSeerCaughtLevel
lb bc, PRINTNUM_RIGHTALIGN | 1, 3 lb bc, PRINTNUM_RIGHTALIGN | 1, 3
call PrintNum call PrintNum
ret ret
.unknown .unknown
ld de, wd036 ld de, wSeerCaughtLevelString
ld hl, .unknown_level ld hl, .unknown_level
ld bc, 4 ld bc, 4
call CopyBytes call CopyBytes
@ -183,7 +191,7 @@ GetCaughtLevel: ; 4f18c
; 4f1c5 ; 4f1c5
GetCaughtTime: ; 4f1c5 GetCaughtTime: ; 4f1c5
ld a, [wd03b] ld a, [wSeerCaughtData]
and $c0 and $c0
jr z, .none jr z, .none
@ -194,13 +202,13 @@ GetCaughtTime: ; 4f1c5
call GetNthString call GetNthString
ld d, h ld d, h
ld e, l ld e, l
ld hl, wd01f ld hl, wSeerTimeOfDay
call CopyName2 call CopyName2
and a and a
ret ret
.none .none
ld de, wd01f ld de, wSeerTimeOfDay
call UnknownCaughtData call UnknownCaughtData
ret ret
; 4f1e6 ; 4f1e6
@ -213,7 +221,7 @@ GetCaughtTime: ; 4f1c5
UnknownCaughtData: ; 4f1f8 UnknownCaughtData: ; 4f1f8
ld hl, .unknown ld hl, .unknown
ld bc, $000b ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
ret ret
; 4f202 ; 4f202
@ -223,35 +231,35 @@ UnknownCaughtData: ; 4f1f8
; 4f20a ; 4f20a
GetCaughtLocation: ; 4f20a GetCaughtLocation: ; 4f20a
ld a, [wd03b + 1] ld a, [wSeerCaughtGender]
and $7f and $7f
jr z, .asm_4f22e jr z, .Unknown
cp $7f cp $7f
jr z, .asm_4f234 jr z, .event
cp $7e cp $7e
jr z, .asm_4f23b jr z, .fail
ld e, a ld e, a
callba GetLandmarkName callba GetLandmarkName
ld hl, StringBuffer1 ld hl, StringBuffer1
ld de, wd00e ld de, wSeerCaughtLocation
ld bc, $0011 ld bc, 17
call CopyBytes call CopyBytes
and a and a
ret ret
.asm_4f22e .Unknown
ld de, wd00e ld de, wSeerCaughtLocation
jp UnknownCaughtData jp UnknownCaughtData
.asm_4f234 .event
ld a, $4 ld a, SEERACTION_LEVEL_ONLY
ld [wd002], a ld [wSeerAction], a
scf scf
ret ret
.asm_4f23b .fail
ld a, $3 ld a, SEERACTION_CANT_TELL_2
ld [wd002], a ld [wSeerAction], a
scf scf
ret ret
; 4f242 ; 4f242
@ -261,17 +269,19 @@ GetCaughtOT: ; 4f242
ld hl, PartyMonOT ld hl, PartyMonOT
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call AddNTimes call AddNTimes
ld de, wd02a ld de, wSeerOTName
ld bc, $000b ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
; this routine is useless in Western localizations
ld hl, .male ld hl, .male
ld a, [wd03b + 1] ld a, [wSeerCaughtGender]
bit 7, a bit 7, a
jr z, .asm_4f264 jr z, .got_grammar
ld hl, .female ld hl, .female
.asm_4f264 .got_grammar
ld de, wd034 + 1 ld de, wSeerOTNameGrammar
ld a, "@" ld a, "@"
ld [de], a ld [de], a
ret ret
@ -360,7 +370,7 @@ SeerCancelText: ; 0x4f2af
SeerAdvice: ; 4f2b4 SeerAdvice: ; 4f2b4
ld a, MON_LEVEL ld a, MON_LEVEL
call GetPartyParamLocation call GetPartyParamLocation
ld a, [wd038 + 2] ld a, [wSeerCaughtLevel]
ld c, a ld c, a
ld a, [hl] ld a, [hl]
sub c sub c

View File

@ -247,8 +247,8 @@ Function833:: ; 833
; 83b ; 83b
Function83b:: ; 83b Function83b:: ; 83b
ld hl, wcf56 ld hl, wPlayerLinkAction
ld de, wcf51 ld de, wOtherPlayerLinkMode
ld c, $2 ld c, $2
ld a, $1 ld a, $1
ld [hFFCC], a ld [hFFCC], a
@ -274,7 +274,7 @@ Function83b:: ; 83b
Function862:: ; 862 Function862:: ; 862
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
callab Function4000 callab PlaceWaitingText
call Function87d call Function87d
jp Call_LoadTempTileMapToTileMap jp Call_LoadTempTileMapToTileMap
; 871 ; 871
@ -282,102 +282,106 @@ Function862:: ; 862
Function871:: ; 871 Function871:: ; 871
call LoadTileMapToTempTileMap call LoadTileMapToTempTileMap
callab Function4000 callab PlaceWaitingText
jp Function87d jp Function87d
; 87d ; 87d
; One "giant" leap for machinekind
Function87d:: ; 87d Function87d:: ; 87d
ld a, $ff ld a, $ff
ld [wcf52], a ld [wOtherPlayerLinkAction], a
.asm_882 .loop
call Function8c1 call LinkCommunicationsSendReceive
call DelayFrame call DelayFrame
call Function82b call Function82b
jr z, .asm_89e jr z, .check
push hl push hl
ld hl, wcf5c ld hl, wcf5c
dec [hl] dec [hl]
jr nz, .asm_89d jr nz, .skip
dec hl dec hl
dec [hl] dec [hl]
jr nz, .asm_89d jr nz, .skip
pop hl pop hl
xor a xor a
jp Function833 jp Function833
.asm_89d .skip
pop hl pop hl
.asm_89e .check
ld a, [wcf52] ld a, [wOtherPlayerLinkAction]
inc a inc a
jr z, .asm_882 jr z, .loop
ld b, $a
.asm_8a6 ld b, 10
.receive
call DelayFrame call DelayFrame
call Function8c1 call LinkCommunicationsSendReceive
dec b dec b
jr nz, .asm_8a6 jr nz, .receive
ld b, $a
.asm_8b1 ld b, 10
.acknowledge
call DelayFrame call DelayFrame
call Function908 call LinkCommunicationsSignalDataReceived
dec b dec b
jr nz, .asm_8b1 jr nz, .acknowledge
ld a, [wcf52]
ld [wcf51], a ld a, [wOtherPlayerLinkAction]
ld [wOtherPlayerLinkMode], a
ret ret
; 8c1 ; 8c1
Function8c1:: ; 8c1 LinkCommunicationsSendReceive:: ; 8c1
push bc push bc
ld b, $60 ld b, SERIAL_TIMECAPSULE
ld a, [wLinkMode] ld a, [wLinkMode]
cp $1 cp LINK_TIMECAPSULE
jr z, .asm_8d7 jr z, .got_high_nybble
ld b, $60 ld b, SERIAL_TIMECAPSULE
jr c, .asm_8d7 jr c, .got_high_nybble
cp $2 cp LINK_TRADECENTER
ld b, $70 ld b, SERIAL_TRADECENTER
jr z, .asm_8d7 jr z, .got_high_nybble
ld b, $80 ld b, SERIAL_BATTLE
.asm_8d7 .got_high_nybble
call Function8f3 call .Receive
ld a, [wcf56] ld a, [wPlayerLinkAction]
add b add b
ld [hSerialSend], a ld [hSerialSend], a
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]
cp $2 cp $2
jr nz, .asm_8ee jr nz, .player_1
ld a, $1 ld a, $1
ld [rSC], a ld [rSC], a
ld a, $81 ld a, $81
ld [rSC], a ld [rSC], a
.asm_8ee .player_1
call Function8f3 call .Receive
pop bc pop bc
ret ret
; 8f3 ; 8f3
Function8f3:: ; 8f3 .Receive ; 8f3
ld a, [hSerialReceive] ld a, [hSerialReceive]
ld [wcf51], a ld [wOtherPlayerLinkMode], a
and $f0 and $f0
cp b cp b
ret nz ret nz
xor a xor a
ld [hSerialReceive], a ld [hSerialReceive], a
ld a, [wcf51] ld a, [wOtherPlayerLinkMode]
and $f and $f
ld [wcf52], a ld [wOtherPlayerLinkAction], a
ret ret
; 908 ; 908
Function908:: ; 908 LinkCommunicationsSignalDataReceived:: ; 908
; Let the other system know that the data has been received.
xor a xor a
ld [hSerialSend], a ld [hSerialSend], a
ld a, [hLinkPlayerNumber] ld a, [hLinkPlayerNumber]

View File

@ -880,10 +880,10 @@ Text_TX_MOVE:: ; 1480
; [$03][addr] ; [$03][addr]
ld a, [hli] ld a, [hli]
ld [wd0e4 + 2], a ld [wMenuScrollPosition + 2], a
ld c, a ld c, a
ld a, [hli] ld a, [hli]
ld [wd0e4 + 2 + 1], a ld [wMenuScrollPosition + 2 + 1], a
ld b, a ld b, a
ret ret
; 148b ; 148b

View File

@ -4,7 +4,7 @@ _DoItemEffect:: ; e722
call GetItemName call GetItemName
call CopyName1 call CopyName1
ld a, 1 ld a, 1
ld [wd0ec], a ld [wPlayerAction], a
ld a, [CurItem] ld a, [CurItem]
dec a dec a
ld hl, ItemEffects ld hl, ItemEffects
@ -1209,7 +1209,7 @@ SunStone: ; ee0f
ld [wd1e9], a ld [wd1e9], a
callba EvolvePokemon callba EvolvePokemon
ld a, [wd268] ld a, [wMonTriedToEvolve]
and a and a
jr z, .NoEffect jr z, .NoEffect
@ -1220,7 +1220,7 @@ SunStone: ; ee0f
.DecidedNotToUse .DecidedNotToUse
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; ee3d ; ee3d
@ -1293,7 +1293,7 @@ UpdateStatsAfterItem: ; ee8c
RareCandy_StatBooster_ExitMenu: ; ee9f RareCandy_StatBooster_ExitMenu: ; ee9f
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
jp ClearPalettes jp ClearPalettes
; eea6 ; eea6
@ -1930,7 +1930,7 @@ StatusHealer_NoEffect: ; f299 (3:7299)
StatusHealer_ExitMenu: ; f29e (3:729e) StatusHealer_ExitMenu: ; f29e (3:729e)
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
StatusHealer_ClearPalettes: ; f2a2 (3:72a2) StatusHealer_ClearPalettes: ; f2a2 (3:72a2)
call ClearPalettes call ClearPalettes
ret ret
@ -2233,10 +2233,10 @@ Softboiled_MilkDrinkFunction: ; f3df (3:73df)
EscapeRope: ; f44f EscapeRope: ; f44f
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
callba EscapeRopeFunction callba EscapeRopeFunction
ld a, [wd0ec] ld a, [wPlayerAction]
cp 1 cp 1
call z, UseDisposableItem call z, UseDisposableItem
ret ret
@ -2298,7 +2298,7 @@ PokeDoll: ; f48f
.asm_f4a6 .asm_f4a6
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; f4ab ; f4ab
@ -2547,7 +2547,7 @@ Mysteryberry: ; f5bf
xor a xor a
ld [CurMoveNum], a ld [CurMoveNum], a
ld a, $2 ld a, $2
ld [wd235], a ld [wMoveSelectionMenuType], a
callba MoveSelectionScreen callba MoveSelectionScreen
pop bc pop bc
@ -2701,7 +2701,7 @@ PPRestoreItem_NoEffect: ; f6dd
PPRestoreItem_Cancel: ; f6e0 PPRestoreItem_Cancel: ; f6e0
call ClearPalettes call ClearPalettes
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; f6e8 ; f6e8
@ -2802,7 +2802,7 @@ BasementKey: ; f74c
SacredAsh: ; f753 SacredAsh: ; f753
callba _SacredAsh callba _SacredAsh
ld a, [wd0ec] ld a, [wPlayerAction]
cp $1 cp $1
ret nz ret nz
call UseDisposableItem call UseDisposableItem
@ -2973,7 +2973,7 @@ WontHaveAnyEffect_NotUsedMessage: ; f7ca
; Item wasn't used. ; Item wasn't used.
ld a, $2 ld a, $2
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; f7d6 ; f7d6
@ -2988,7 +2988,7 @@ Ball_BoxIsFullMessage: ; f7dc
; Item wasn't used. ; Item wasn't used.
ld a, $2 ld a, $2
ld [wd0ec], a ld [wPlayerAction], a
ret ret
; f7e8 ; f7e8
@ -3018,7 +3018,7 @@ CantGetOnYourBikeMessage: ; f801
CantUseItemMessage: ; f804 CantUseItemMessage: ; f804
; Item couldn't be used. ; Item couldn't be used.
xor a xor a
ld [wd0ec], a ld [wPlayerAction], a
jp PrintText jp PrintText
; f80b ; f80b

View File

@ -4,7 +4,7 @@ INCLUDE "includes.asm"
SECTION "bank1", ROMX, BANK[$1] SECTION "bank1", ROMX, BANK[$1]
Function4000:: ; 4000 PlaceWaitingText:: ; 4000
hlcoord 3, 10 hlcoord 3, 10
ld b, 1 ld b, 1
ld c, 11 ld c, 11
@ -5710,11 +5710,11 @@ TossTMHM: ; d3d8
ld [hl], a ld [hl], a
ld [wItemQuantityBuffer], a ld [wItemQuantityBuffer], a
jr nz, .yup jr nz, .yup
ld a, [wd0e2] ld a, [wTMHMPocketScrollPosition]
and a and a
jr z, .yup jr z, .yup
dec a dec a
ld [wd0e2], a ld [wTMHMPocketScrollPosition], a
.yup .yup
scf scf
@ -9901,7 +9901,7 @@ endr
; 244c3 ; 244c3
Function244c3: ; 0x244c3 UpdateItemDescription: ; 0x244c3
ld a, [MenuSelection] ld a, [MenuSelection]
ld [CurSpecies], a ld [CurSpecies], a
hlcoord 0, 12 hlcoord 0, 12
@ -10216,7 +10216,7 @@ MenuJoyAction: ; 24609
ld hl, wcfa6 ld hl, wcfa6
bit 7, [hl] bit 7, [hl]
jp z, xor_a jp z, xor_a
ld hl, wd0e4 ld hl, wMenuScrollPosition
ld a, [hl] ld a, [hl]
and a and a
jr z, .xor_dec_up jr z, .xor_dec_up
@ -10231,7 +10231,7 @@ MenuJoyAction: ; 24609
ld hl, wcfa6 ld hl, wcfa6
bit 7, [hl] bit 7, [hl]
jp z, xor_a jp z, xor_a
ld hl, wd0e4 ld hl, wMenuScrollPosition
ld a, [wMenuData2Items] ld a, [wMenuData2Items]
add [hl] add [hl]
ld b, a ld b, a
@ -10246,7 +10246,7 @@ MenuJoyAction: ; 24609
; 246fc ; 246fc
Function246fc: ; 246fc Function246fc: ; 246fc
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld c, a ld c, a
ld a, [MenuSelection2] ld a, [MenuSelection2]
add c add c
@ -10276,10 +10276,10 @@ ClearObjectStructsa: ; 2471a
ld a, [wcf95] ld a, [wcf95]
call GetFarByte call GetFarByte
ld [wd144], a ld [wd144], a
; if ([wd144] + 1) < [wMenuData2Items] + [wd0e4]: [wd0e4] = max(([wd144] + 1) - [wMenuData2Items], 0) ; if ([wd144] + 1) < [wMenuData2Items] + [wMenuScrollPosition]: [wMenuScrollPosition] = max(([wd144] + 1) - [wMenuData2Items], 0)
ld a, [wMenuData2Items] ld a, [wMenuData2Items]
ld c, a ld c, a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
add c add c
ld c, a ld c, a
ld a, [wd144] ld a, [wd144]
@ -10295,10 +10295,10 @@ ClearObjectStructsa: ; 2471a
xor a xor a
.store .store
ld [wd0e4], a ld [wMenuScrollPosition], a
.skip .skip
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld c, a ld c, a
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
add c add c
@ -10311,7 +10311,7 @@ ClearObjectStructsa: ; 2471a
.asm_2475a .asm_2475a
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
ld a, $1 ld a, $1
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
@ -10413,7 +10413,7 @@ Function247f0: ; 247f0
ld a, [wMenuData2Flags] ld a, [wMenuData2Flags]
bit 4, a bit 4, a
jr z, .asm_2480d jr z, .asm_2480d
ld a, [wd0e4] ld a, [wMenuScrollPosition]
and a and a
jr z, .asm_2480d jr z, .asm_2480d
ld a, [wMenuBorderTopCoord] ld a, [wMenuBorderTopCoord]
@ -10431,7 +10431,7 @@ Function247f0: ; 247f0
ld b, a ld b, a
ld c, $0 ld c, $0
.asm_2481a .asm_2481a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
add c add c
ld [wcf77], a ld [wcf77], a
ld a, c ld a, c
@ -10508,7 +10508,7 @@ Function2488b: ; 2488b
and a and a
jr z, .asm_248b7 jr z, .asm_248b7
ld b, a ld b, a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
cp b cp b
jr nc, .asm_248b7 jr nc, .asm_248b7
ld c, a ld c, a
@ -10558,7 +10558,7 @@ Function248d5: ; 248d5
push de push de
push hl push hl
ld e, a ld e, a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
add e add e
ld e, a ld e, a
ld d, $0 ld d, $0
@ -13540,7 +13540,7 @@ Function2c974: ; 2c974 (b:4974)
ld a, [MenuSelection2] ld a, [MenuSelection2]
dec a dec a
ld b, a ld b, a
ld a, [wd0e2] ld a, [wTMHMPocketScrollPosition]
add b add b
ld b, a ld b, a
ld a, [wd265] ld a, [wd265]
@ -13584,7 +13584,7 @@ Function2c9b1: ; 2c9b1 (b:49b1)
ld a, b ld a, b
bit 7, a bit 7, a
jr nz, .skip jr nz, .skip
ld hl, wd0e2 ld hl, wTMHMPocketScrollPosition
ld a, [hl] ld a, [hl]
and a and a
jp z, Function2c915 jp z, Function2c915
@ -13605,7 +13605,7 @@ Function2c9b1: ; 2c9b1 (b:49b1)
jr z, .loop jr z, .loop
dec b dec b
jr nz, .loop jr nz, .loop
ld hl, wd0e2 ld hl, wTMHMPocketScrollPosition
inc [hl] inc [hl]
call Function2c9e2 call Function2c9e2
jp Function2c946 jp Function2c946
@ -13737,7 +13737,7 @@ String_2caae: ; 2caae
Function2cab5: ; 2cab5 (b:4ab5) Function2cab5: ; 2cab5 (b:4ab5)
ld hl, TMsHMs ld hl, TMsHMs
ld a, [wd0e2] ld a, [wTMHMPocketScrollPosition]
ld b, a ld b, a
inc b inc b
ld c, 0 ld c, 0
@ -13820,11 +13820,11 @@ Function2cb0c: ; 2cb0c (b:4b0c)
dec a dec a
ld [hl], a ld [hl], a
ret nz ret nz
ld a, [wd0e2] ld a, [wTMHMPocketScrollPosition]
and a and a
ret z ret z
dec a dec a
ld [wd0e2], a ld [wTMHMPocketScrollPosition], a
ret ret
Function2cb2a: ; 2cb2a (b:4b2a) Function2cb2a: ; 2cb2a (b:4b2a)
@ -14186,7 +14186,7 @@ rept 3
endr endr
ld [hl], a ld [hl], a
ld [wd0e4], a ld [wMenuScrollPosition], a
ld [CriticalHit], a ld [CriticalHit], a
ld [BattleMonSpecies], a ld [BattleMonSpecies], a
ld [wBattleParticipantsNotFainted], a ld [wBattleParticipantsNotFainted], a

View File

@ -91,7 +91,7 @@ LinkReceptionistScript_Trade:
writetext Text_PleaseWait writetext Text_PleaseWait
special Special_CheckLinkTimeout special Special_CheckLinkTimeout
iffalse .LinkTimedOut iffalse .LinkTimedOut
copybytetovar wcf51 copybytetovar wOtherPlayerLinkMode
iffalse .LinkedToFirstGen iffalse .LinkedToFirstGen
special Special_CheckBothSelectedSameRoom special Special_CheckBothSelectedSameRoom
iffalse .IncompatibleRooms iffalse .IncompatibleRooms
@ -193,7 +193,7 @@ LinkReceptionistScript_Battle:
writetext Text_PleaseWait writetext Text_PleaseWait
special Special_CheckLinkTimeout special Special_CheckLinkTimeout
iffalse .LinkTimedOut iffalse .LinkTimedOut
copybytetovar wcf51 copybytetovar wOtherPlayerLinkMode
iffalse .LinkedToFirstGen iffalse .LinkedToFirstGen
special Special_CheckBothSelectedSameRoom special Special_CheckBothSelectedSameRoom
iffalse .IncompatibleRooms iffalse .IncompatibleRooms
@ -320,7 +320,7 @@ LinkReceptionistScript_TimeCapsule:
writetext Text_PleaseWait writetext Text_PleaseWait
special Special_CheckLinkTimeout special Special_CheckLinkTimeout
iffalse .LinkTimedOut iffalse .LinkTimedOut
copybytetovar wcf51 copybytetovar wOtherPlayerLinkMode
iffalse .OK iffalse .OK
special Special_CheckBothSelectedSameRoom special Special_CheckBothSelectedSameRoom
writetext Text_IncompatibleRooms writetext Text_IncompatibleRooms

View File

@ -346,7 +346,7 @@ Function48304: ; 48304 (12:4304)
call Function48cdc call Function48cdc
ld a, [wMenuCursorBuffer] ld a, [wMenuCursorBuffer]
ld b, a ld b, a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld c, a ld c, a
push bc push bc
ld a, [wd474] ld a, [wd474]
@ -358,7 +358,7 @@ Function48304: ; 48304 (12:4304)
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, $29 ld a, $29
.asm_4833f .asm_4833f
ld [wd0e4], a ld [wMenuScrollPosition], a
callba Function104148 callba Function104148
.asm_48348 .asm_48348
call HandleScrollingMenu call HandleScrollingMenu
@ -370,7 +370,7 @@ Function48304: ; 48304 (12:4304)
ld a, b ld a, b
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, c ld a, c
ld [wd0e4], a ld [wMenuScrollPosition], a
ld a, d ld a, d
push af push af
call ExitMenu call ExitMenu
@ -398,21 +398,21 @@ Function48383: ; 48383 (12:4383)
and a and a
jr .asm_483b7 jr .asm_483b7
.asm_48390 .asm_48390
ld a, [wd0e4] ld a, [wMenuScrollPosition]
sub d sub d
ld [wd0e4], a ld [wMenuScrollPosition], a
jr nc, .asm_483af jr nc, .asm_483af
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
jr .asm_483af jr .asm_483af
.asm_4839f .asm_4839f
ld a, [wd0e4] ld a, [wMenuScrollPosition]
add d add d
ld [wd0e4], a ld [wMenuScrollPosition], a
cp e cp e
jr c, .asm_483af jr c, .asm_483af
ld a, e ld a, e
ld [wd0e4], a ld [wMenuScrollPosition], a
jr .asm_483af jr .asm_483af
.asm_483af .asm_483af
ld hl, MenuSelection2 ld hl, MenuSelection2

View File

@ -805,7 +805,7 @@ Function8b7bd: ; 8b7bd
ld a, [wd030] ld a, [wd030]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ld a, [wd031] ld a, [wd031]
ld [wd0e4], a ld [wMenuScrollPosition], a
ld a, [wd032] ld a, [wd032]
and a and a
jr z, .asm_8b7e0 jr z, .asm_8b7e0
@ -856,13 +856,13 @@ Function8b7bd: ; 8b7bd
ld c, a ld c, a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wd030], a ld [wd030], a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld [wd031], a ld [wd031], a
ret ret
; 8b832 ; 8b832
Function8b832: ; 8b832 Function8b832: ; 8b832
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld hl, wMenuData2Items ld hl, wMenuData2Items
sub [hl] sub [hl]
jr nc, Function8b84b jr nc, Function8b84b
@ -871,7 +871,7 @@ Function8b832: ; 8b832
; 8b83e ; 8b83e
Function8b83e: ; 8b83e Function8b83e: ; 8b83e
ld a, [wd0e4] ld a, [wMenuScrollPosition]
ld hl, wMenuData2Items ld hl, wMenuData2Items
add [hl] add [hl]
cp $24 cp $24
@ -879,7 +879,7 @@ Function8b83e: ; 8b83e
ld a, $24 ld a, $24
Function8b84b: ; 8b84b Function8b84b: ; 8b84b
ld [wd0e4], a ld [wMenuScrollPosition], a
ld a, [MenuSelection2] ld a, [MenuSelection2]
ld [wMenuCursorBuffer], a ld [wMenuCursorBuffer], a
ret ret
@ -994,7 +994,7 @@ endr
hlcoord 19, 13 hlcoord 19, 13
ld a, $11 ld a, $11
ld [hl], a ld [hl], a
ld a, [wd0e4] ld a, [wMenuScrollPosition]
cp $24 cp $24
ret c ret c
hlcoord 0, 13 hlcoord 0, 13
@ -1018,7 +1018,7 @@ String_8b938: db "いれる ところを えらんでください@" ; Please sel
Function8b94a: ; 8b94a Function8b94a: ; 8b94a
ld [wd033], a ld [wd033], a
xor a xor a
ld [wd0e4], a ld [wMenuScrollPosition], a
ld [wd032], a ld [wd032], a
ld [wd0e3], a ld [wd0e3], a
ld [wd031], a ld [wd031], a

View File

@ -171,6 +171,7 @@ Function1000fa: ; 1000fa
ld [hFFC9], a ld [hFFC9], a
ld [hMobile], a ld [hMobile], a
ei ei
ld a, [wLinkMode] ld a, [wLinkMode]
push af push af
xor a xor a
@ -1620,78 +1621,81 @@ Function1009f3: ; 1009f3
ret ret
; 100a09 ; 100a09
Function100a09: ; 100a09 _LinkBattleSendReceiveAction: ; 100a09
call Function100a2e call .StageForSend
ld [wd431], a ld [wd431], a
callba Function4000 callba PlaceWaitingText
ld a, [wLinkMode] ld a, [wLinkMode]
cp LINK_MOBILE cp LINK_MOBILE
jr nz, .asm_100a2a jr nz, .not_mobile
call Function100a87 call Function100a87
call Function100da5 call Function100da5
callba FinishBattleAnim callba FinishBattleAnim
jr .asm_100a2d jr .done
.asm_100a2a .not_mobile
call Function100a53 call Function100a53
.asm_100a2d .done
ret ret
; 100a2e ; 100a2e
Function100a2e: ; 100a2e .StageForSend: ; 100a2e
ld a, [wd0ec] ld a, [wPlayerAction]
and a and a
jr nz, .asm_100a48 jr nz, .switch
ld a, [CurPlayerMove] ld a, [CurPlayerMove]
ld b, $e ld b, BATTLEACTION_E
cp STRUGGLE cp STRUGGLE
jr z, .asm_100a4f jr z, .struggle
ld b, $d ld b, BATTLEACTION_D
cp $ff cp $ff
jr z, .asm_100a4f jr z, .struggle
ld a, [CurMoveNum] ld a, [CurMoveNum]
jr .asm_100a50 jr .use_move
.asm_100a48 .switch
ld a, [CurPartyMon] ld a, [CurPartyMon]
add $4 add BATTLEACTION_SWITCH1
jr .asm_100a50 jr .use_move
.asm_100a4f .struggle
ld a, b ld a, b
.asm_100a50 .use_move
and $f and $f
ret ret
; 100a53 ; 100a53
Function100a53: ; 100a53 Function100a53: ; 100a53
ld a, [wd431] ld a, [wd431]
ld [wcf56], a ld [wPlayerLinkAction], a
ld a, $ff ld a, $ff
ld [wcf52], a ld [wOtherPlayerLinkAction], a
.asm_100a5e .waiting
call Function8c1 call LinkCommunicationsSendReceive
call DelayFrame call DelayFrame
ld a, [wcf52] ld a, [wOtherPlayerLinkAction]
inc a inc a
jr z, .asm_100a5e jr z, .waiting
ld b, $a
.asm_100a6c ld b, 10
.receive
call DelayFrame call DelayFrame
call Function8c1 call LinkCommunicationsSendReceive
dec b dec b
jr nz, .asm_100a6c jr nz, .receive
ld b, $a
.asm_100a77 ld b, 10
.acknowledge
call DelayFrame call DelayFrame
call Function908 call LinkCommunicationsSignalDataReceived
dec b dec b
jr nz, .asm_100a77 jr nz, .acknowledge
ld a, [wcf52]
ld [wd430], a ld a, [wOtherPlayerLinkAction]
ld [wBattleAction], a
ret ret
; 100a87 ; 100a87
@ -1850,10 +1854,10 @@ Function100b7a: ; 100b7a
ret ret
; 100b9f ; 100b9f
Function100b9f: ; 100b9f MobileMoveSelectionScreen: ; 100b9f
xor a xor a
ld [wd0e3], a ld [wd0e3], a
callba Function3e786 callba CheckPlayerHasUsableMoves
ret z ret z
call Function100dd8 call Function100dd8
jp c, xor_a_dec_a jp c, xor_a_dec_a
@ -2148,7 +2152,7 @@ Function100db0: ; 100db0
Function100dc0: ; 100dc0 Function100dc0: ; 100dc0
ld a, [wLinkMode] ld a, [wLinkMode]
cp $4 cp LINK_MOBILE
jr nz, .asm_100dd0 jr nz, .asm_100dd0
ld hl, wcd2a ld hl, wcd2a
bit 3, [hl] bit 3, [hl]
@ -2794,16 +2798,16 @@ Function1011f1: ; 1011f1
res 4, [hl] res 4, [hl]
ld hl, GameTimerPause ld hl, GameTimerPause
bit 7, [hl] bit 7, [hl]
jr z, .asm_101210 jr z, .skip
ld hl, wdc41 ld hl, wdc41
set 4, [hl] set 4, [hl]
.asm_101210 .skip
call Function10209c call Function10209c
xor a xor a
ld [wdc5f], a ld [wdc5f], a
ld [wdc60], a ld [wdc60], a
ld a, $4 ld a, LINK_MOBILE
ld [wLinkMode], a ld [wLinkMode], a
ret ret
; 101220 ; 101220
@ -7958,16 +7962,16 @@ Function10378c: ; 10378c
ld c, $0 ld c, $0
ld hl, SwarmFlags ld hl, SwarmFlags
bit 4, [hl] bit 4, [hl]
jr nz, .asm_10379c jr nz, .already_set
ld c, $1 ld c, $1
ld hl, SwarmFlags ld hl, SwarmFlags
set 4, [hl] set 4, [hl]
.asm_10379c .already_set
push bc push bc
callba Link_SaveGame callba Link_SaveGame
pop bc pop bc
jr c, .asm_1037b5 jr c, .failed_to_save
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
ld a, c ld a, c
@ -7976,7 +7980,7 @@ Function10378c: ; 10378c
callba Function1006fd callba Function1006fd
ret ret
.asm_1037b5 .failed_to_save
xor a xor a
ld [ScriptVar], a ld [ScriptVar], a
ld a, c ld a, c
@ -7989,19 +7993,19 @@ Function10378c: ; 10378c
Function1037c2: ; 1037c2 Function1037c2: ; 1037c2
call Function103823 call Function103823
jr c, .asm_1037de jr c, .nope
ld a, [wdc5f] ld a, [wdc5f]
and a and a
jr z, .asm_1037de jr z, .nope
ld hl, UnknownText_0x1037e6 ld hl, UnknownText_0x1037e6
call PrintText call PrintText
call YesNoBox call YesNoBox
jr c, .asm_1037de jr c, .nope
ld a, $1 ld a, $1
ld [ScriptVar], a ld [ScriptVar], a
ret ret
.asm_1037de .nope
xor a xor a
ld [wdc5f], a ld [wdc5f], a
ld [ScriptVar], a ld [ScriptVar], a

View File

@ -1298,9 +1298,10 @@ wcf41:: ds 1
wcf42:: ds 2 wcf42:: ds 2
wcf44:: ds 1 wcf44:: ds 1
wcf45:: ds 12 wcf45:: ds 12
wcf51:: ds 1 ; addresses dealing with serial comms
wcf52:: ds 4 wOtherPlayerLinkMode:: ds 1
wcf56:: ds 1 wOtherPlayerLinkAction:: ds 4
wPlayerLinkAction:: ds 1
wcf57:: ds 4 wcf57:: ds 4
wcf5b:: ds 1 wcf5b:: ds 1
wcf5c:: ds 1 wcf5c:: ds 1
@ -1509,6 +1510,18 @@ wd001:: ds 1
wTempMail:: mailmsg wTempMail wTempMail:: mailmsg wTempMail
ds wTempMail - @ ds wTempMail - @
wSeerAction:: ds 1
wSeerNickname:: ds PKMN_NAME_LENGTH
wSeerCaughtLocation:: ds 17
wSeerTimeOfDay:: ds NAME_LENGTH
wSeerOTName:: ds NAME_LENGTH
wSeerOTNameGrammar:: ds 1
wSeerCaughtLevelString:: ds 4
wSeerCaughtLevel:: ds 1
wSeerCaughtData:: ds 1
wSeerCaughtGender:: ds 1
ds wSeerAction - @
wd002:: wd002::
PhoneScriptBank:: PhoneScriptBank::
LuckyNumberDigit1Buffer:: LuckyNumberDigit1Buffer::
@ -1683,7 +1696,7 @@ CurBattleMon:: ; d0d4
CurMoveNum:: ; d0d5 CurMoveNum:: ; d0d5
ds 1 ds 1
wd0d6:: ds 1 wLastPocket:: ds 1
wd0d7:: ds 1 wd0d7:: ds 1
wPartyMenuCursor:: wPartyMenuCursor::
wd0d8:: ds 1 wd0d8:: ds 1
@ -1692,18 +1705,22 @@ wKeyItemsPocketCursor:: ds 1
wBallsPocketCursor:: ds 1 wBallsPocketCursor:: ds 1
wTMHMPocketCursor:: ds 1 wTMHMPocketCursor:: ds 1
wd0dd:: ds 2 wd0dd:: ds 2
wd0df:: ds 1 wItemsPocketScrollPosition:: ds 1
wd0e0:: ds 1 wKeyItemsPocketScrollPosition:: ds 1
wd0e1:: ds 1 wBallsPocketScrollPosition:: ds 1
wd0e2:: ds 1 wTMHMPocketScrollPosition:: ds 1
wMoveSwapBuffer:: wMoveSwapBuffer::
wSwitchMon:: wSwitchMon::
wd0e3:: ds 1 wd0e3:: ds 1
wd0e4:: ds 4 wMenuScrollPosition:: ds 4
wQueuedScriptBank:: ds 1 wQueuedScriptBank:: ds 1
wQueuedScriptAddr:: ds 2 wQueuedScriptAddr:: ds 2
wd0eb:: ds 1 wd0eb:: ds 1
wFieldMoveSucceeded:: wFieldMoveSucceeded::
wPlayerAction::
; 0 - use move
; 1 - use item
; 2 - switch
wd0ec:: ds 1 wd0ec:: ds 1
VramState:: ; d0ed VramState:: ; d0ed
@ -2034,7 +2051,7 @@ TrainerClass:: ; d233
UnownLetter:: ; d234 UnownLetter:: ; d234
ds 1 ds 1
wd235:: ds 1 wMoveSelectionMenuType:: ds 1
CurBaseData:: ; d236 CurBaseData:: ; d236
BaseDexNo:: ; d236 BaseDexNo:: ; d236
@ -2098,9 +2115,9 @@ wNamedObjectIndexBuffer::
wCurTMHM:: wCurTMHM::
wTypeMatchup:: wTypeMatchup::
wd265:: ds 1 wd265:: ds 1
wd266:: ds 1 wFailedToFlee:: ds 1
wd267:: ds 1 wNumFleeAttempts:: ds 1
wd268:: ds 1 wMonTriedToEvolve:: ds 1
TimeOfDay:: ; d269 TimeOfDay:: ; d269
ds 1 ds 1