summaryrefslogtreecommitdiff
path: root/engine/link
diff options
context:
space:
mode:
Diffstat (limited to 'engine/link')
-rw-r--r--engine/link/init_list.asm2
-rw-r--r--engine/link/link.asm213
-rw-r--r--engine/link/link_2.asm22
-rw-r--r--engine/link/link_trade.asm68
-rw-r--r--engine/link/mystery_gift.asm232
-rw-r--r--engine/link/mystery_gift_2.asm12
-rw-r--r--engine/link/place_waiting_text.asm4
-rw-r--r--engine/link/time_capsule.asm11
-rw-r--r--engine/link/time_capsule_2.asm7
9 files changed, 223 insertions, 348 deletions
diff --git a/engine/link/init_list.asm b/engine/link/init_list.asm
index 26c77b5bb..8557b2e9f 100644
--- a/engine/link/init_list.asm
+++ b/engine/link/init_list.asm
@@ -1,4 +1,4 @@
-InitList: ; 50db9
+InitList:
ld a, [wInitListType]
cp INIT_ENEMYOT_LIST
diff --git a/engine/link/link.asm b/engine/link/link.asm
index e0b7f7972..e5f354f57 100644
--- a/engine/link/link.asm
+++ b/engine/link/link.asm
@@ -1,4 +1,4 @@
-LinkCommunications: ; 28000
+LinkCommunications:
call ClearBGPalettes
ld c, 80
call DelayFrames
@@ -35,7 +35,7 @@ LinkCommunications: ; 28000
cp LINK_TIMECAPSULE
jp nz, Gen2ToGen2LinkComms
-Gen2ToGen1LinkComms: ; 2805d
+Gen2ToGen1LinkComms:
call ClearLinkData
call Link_PrepPartyData_Gen1
call FixDataForLinkTransfer
@@ -177,9 +177,8 @@ Gen2ToGen1LinkComms: ; 2805d
ld de, MUSIC_ROUTE_30
call PlayMusic
jp InitTradeMenuDisplay
-; 28177
-Gen2ToGen2LinkComms: ; 28177
+Gen2ToGen2LinkComms:
call ClearLinkData
call Link_PrepPartyData_Gen2
call FixDataForLinkTransfer
@@ -474,9 +473,8 @@ Gen2ToGen2LinkComms: ; 28177
ld de, MUSIC_ROUTE_30
call PlayMusic
jp InitTradeMenuDisplay
-; 283b2
-LinkTimeout: ; 283b2
+LinkTimeout:
ld de, .TooMuchTimeHasElapsed
ld b, 10
.loop
@@ -506,15 +504,13 @@ LinkTimeout: ; 283b2
call GetSGBLayout
call WaitBGMap2
ret
-; 283ed
-.TooMuchTimeHasElapsed: ; 0x283ed
+.TooMuchTimeHasElapsed:
; Too much time has elapsed. Please try again.
text_jump UnknownText_0x1c4183
db "@"
-; 0x283f2
-ExchangeBytes: ; 283f2
+ExchangeBytes:
ld a, TRUE
ld [hSerialIgnoringInitialData], a
.loop
@@ -546,13 +542,11 @@ ExchangeBytes: ; 283f2
or c
jr nz, .loop
ret
-; 28419
-String_PleaseWait: ; 28419
+String_PleaseWait:
db "PLEASE WAIT!@"
-; 28426
-ClearLinkData: ; 28426
+ClearLinkData:
ld hl, wLinkData
ld bc, wLinkDataEnd - wLinkData
.loop
@@ -563,9 +557,8 @@ ClearLinkData: ; 28426
or c
jr nz, .loop
ret
-; 28434
-FixDataForLinkTransfer: ; 28434
+FixDataForLinkTransfer:
ld hl, wd1f3
ld a, SERIAL_PREAMBLE_BYTE
ld b, wLinkBattleRNs - wd1f3
@@ -636,9 +629,8 @@ FixDataForLinkTransfer: ; 28434
ld a, SERIAL_PATCH_LIST_PART_TERMINATOR
ld [de], a
ret
-; 28499
-Link_PrepPartyData_Gen1: ; 28499
+Link_PrepPartyData_Gen1:
ld de, wLinkData
ld a, SERIAL_PREAMBLE_BYTE
ld b, PARTY_LENGTH
@@ -693,9 +685,8 @@ Link_PrepPartyData_Gen1: ; 28499
.copy_ot_nicks
ld bc, PARTY_LENGTH * NAME_LENGTH
jp CopyBytes
-; 284f6
-.ConvertPartyStruct2to1: ; 284f6
+.ConvertPartyStruct2to1:
ld b, h
ld c, l
push de
@@ -804,9 +795,8 @@ Link_PrepPartyData_Gen1: ; 28499
ld h, b
ld l, c
ret
-; 28595
-Link_PrepPartyData_Gen2: ; 28595
+Link_PrepPartyData_Gen2:
ld de, wLinkData
ld a, SERIAL_PREAMBLE_BYTE
ld b, PARTY_LENGTH
@@ -942,9 +932,8 @@ Link_PrepPartyData_Gen2: ; 28595
ld a, SERIAL_PATCH_LIST_PART_TERMINATOR
ld [de], a
ret
-; 28682
-Function28682: ; 28682
+Function28682:
ld c, 5
.loop
ld [de], a
@@ -952,9 +941,8 @@ Function28682: ; 28682
dec c
jr nz, .loop
ret
-; 2868a
-Function2868a: ; 2868a
+Function2868a:
push hl
ld d, h
ld e, l
@@ -980,9 +968,8 @@ Function2868a: ; 2868a
ld de, wOTPartyMonNicknames
ld bc, PARTY_LENGTH * MON_NAME_LENGTH
jp CopyBytes
-; 286ba
-.ConvertToGen2: ; 286ba
+.ConvertToGen2:
ld b, h
ld c, l
ld a, [de]
@@ -1102,9 +1089,8 @@ Function2868a: ; 2868a
inc de
inc de
ret
-; 28771
-TimeCapsule_ReplaceTeruSama: ; 28771
+TimeCapsule_ReplaceTeruSama:
ld a, b
and a
ret z
@@ -1126,11 +1112,9 @@ TimeCapsule_ReplaceTeruSama: ; 28771
pop hl
ret
-
INCLUDE "data/items/catch_rate_items.asm"
-
-Link_CopyOTData: ; 2879e
+Link_CopyOTData:
.loop
ld a, [hli]
cp SERIAL_NO_DATA_BYTE
@@ -1142,9 +1126,8 @@ Link_CopyOTData: ; 2879e
or c
jr nz, .loop
ret
-; 287ab
-Link_CopyRandomNumbers: ; 287ab
+Link_CopyRandomNumbers:
ld a, [hSerialConnectionStatus]
cp USING_INTERNAL_CLOCK
ret z
@@ -1163,9 +1146,8 @@ Link_CopyRandomNumbers: ; 287ab
dec c
jr nz, .loop
ret
-; 287ca
-Link_FindFirstNonControlCharacter_SkipZero: ; 287ca
+Link_FindFirstNonControlCharacter_SkipZero:
.loop
ld a, [hli]
and a
@@ -1176,9 +1158,8 @@ Link_FindFirstNonControlCharacter_SkipZero: ; 287ca
jr z, .loop
dec hl
ret
-; 287d8
-Link_FindFirstNonControlCharacter_AllowZero: ; 287d8
+Link_FindFirstNonControlCharacter_AllowZero:
.loop
ld a, [hli]
cp SERIAL_PREAMBLE_BYTE
@@ -1187,9 +1168,8 @@ Link_FindFirstNonControlCharacter_AllowZero: ; 287d8
jr z, .loop
dec hl
ret
-; 287e3
-InitTradeMenuDisplay: ; 287e3
+InitTradeMenuDisplay:
call ClearScreen
call LoadTradeScreenBorder
farcall InitTradeSpeciesList
@@ -1204,9 +1184,8 @@ InitTradeMenuDisplay: ; 287e3
inc a
ld [wPlayerLinkAction], a
jp LinkTrade_PlayerPartyMenu
-; 28803
-LinkTrade_OTPartyMenu: ; 28803
+LinkTrade_OTPartyMenu:
ld a, OTPARTYMON
ld [wMonType], a
ld a, A_BUTTON | D_UP | D_DOWN
@@ -1228,7 +1207,7 @@ LinkTrade_OTPartyMenu: ; 28803
xor a
ld [w2DMenuFlags2], a
-LinkTradeOTPartymonMenuLoop: ; 28835
+LinkTradeOTPartymonMenuLoop:
farcall LinkTradeMenu
ld a, d
and a
@@ -1268,9 +1247,8 @@ LinkTradeOTPartymonMenuLoop: ; 28835
bit D_DOWN_F, a
jp z, LinkTradePartiesMenuMasterLoop
jp Function28ac9
-; 2888b
-LinkTrade_PlayerPartyMenu: ; 2888b
+LinkTrade_PlayerPartyMenu:
farcall InitMG_Mobile_LinkTradePalMap
xor a
ld [wMonType], a
@@ -1294,7 +1272,7 @@ LinkTrade_PlayerPartyMenu: ; 2888b
ld [w2DMenuFlags2], a
call WaitBGMap2
-LinkTradePartymonMenuLoop: ; 288c5
+LinkTradePartymonMenuLoop:
farcall LinkTradeMenu
ld a, d
and a
@@ -1343,16 +1321,14 @@ LinkTradePartymonMenuLoop: ; 288c5
pop bc
pop hl
jp Function28ade
-; 2891c
-LinkTradePartiesMenuMasterLoop: ; 2891c
+LinkTradePartiesMenuMasterLoop:
ld a, [wMonType]
and a
jp z, LinkTradePartymonMenuLoop ; PARTYMON
jp LinkTradeOTPartymonMenuLoop ; OTPARTYMON
-; 28926
-Function28926: ; 28926
+Function28926:
call LoadTileMapToTempTileMap
ld a, [wMenuCursorY]
push af
@@ -1510,26 +1486,21 @@ Function28926: ; 28926
ld c, 100
call DelayFrames
jp InitTradeMenuDisplay
-; 28aaf
-
-.Text_CantTradeLastMon: ; 0x28aaf
+.Text_CantTradeLastMon:
; If you trade that #MON, you won't be able to battle.
text_jump UnknownText_0x1c41b1
db "@"
-; 0x28ab4
-.String_Stats_Trade: ; 28ab4
+.String_Stats_Trade:
db "STATS TRADE@"
-.Text_Abnormal: ; 0x28ac4
+.Text_Abnormal:
; Your friend's @ appears to be abnormal!
text_jump UnknownText_0x1c41e6
db "@"
-; 0x28ac9
-
-Function28ac9: ; 28ac9
+Function28ac9:
ld a, [wMenuCursorY]
cp 1
jp nz, LinkTradePartiesMenuMasterLoop
@@ -1541,7 +1512,7 @@ Function28ac9: ; 28ac9
ld [hl], " "
pop bc
pop hl
-Function28ade: ; 28ade
+Function28ade:
.loop1
ld a, "▶"
ldcoord_a 9, 17
@@ -1576,7 +1547,7 @@ Function28ade: ; 28ade
ld a, [wOtherPlayerLinkMode]
cp $f
jr nz, .loop1
-Function28b22: ; 28b22
+Function28b22:
call RotateThreePalettesRight
call ClearScreen
ld b, SCGB_DIPLOMA
@@ -1592,9 +1563,8 @@ Function28b22: ; 28b22
ld a, (1 << rSC_ON) | 1
ld [rSC], a
ret
-; 28b42
-Unreferenced_Function28b42: ; 28b42
+Unreferenced_Function28b42:
hlcoord 0, 16
ld a, "┘"
ld bc, 2 * SCREEN_WIDTH
@@ -1606,22 +1576,19 @@ Unreferenced_Function28b42: ; 28b42
hlcoord 2, 16
ld de, .Cancel
jp PlaceString
-; 28b61
-.Cancel: ; 28b61
+.Cancel:
db "CANCEL@"
-; 28b68
-Function28b68: ; 28b68
+Function28b68:
ld a, [wOtherPlayerLinkMode]
hlcoord 6, 9
ld bc, SCREEN_WIDTH
call AddNTimes
ld [hl], "▷"
ret
-; 28b77
-LinkEngine_FillBox: ; 28b77
+LinkEngine_FillBox:
.row
push bc
push hl
@@ -1636,9 +1603,8 @@ LinkEngine_FillBox: ; 28b77
dec b
jr nz, .row
ret
-; 28b87
-LinkTrade: ; 28b87
+LinkTrade:
xor a
ld [wcf57], a
ld [wOtherPlayerLinkAction], a
@@ -1972,51 +1938,44 @@ LinkTrade: ; 28b87
cp LINK_TIMECAPSULE
jp z, Gen2ToGen1LinkComms
jp Gen2ToGen2LinkComms
-; 28ea3
-Function28ea3: ; 28ea3
+Function28ea3:
ld c, 100
call DelayFrames
jp InitTradeMenuDisplay
-; 28eab
-String28eab: ; 28eab
+String28eab:
db "TRADE"
next "CANCEL@"
-UnknownText_0x28eb8: ; 0x28eb8
+UnknownText_0x28eb8:
; Trade @ for @ ?
text_jump UnknownText_0x1c4212
db "@"
-; 0x28ebd
-String28ebd: ; 28ebd
+String28ebd:
db "Trade completed!@"
-String_TooBadTheTradeWasCanceled: ; 28ece
+String_TooBadTheTradeWasCanceled:
db "Too bad! The trade"
next "was canceled!@"
-
-LinkTextboxAtHL: ; 28eef
+LinkTextboxAtHL:
ld d, h
ld e, l
farcall LinkTextbox
ret
-; 28ef8
-LoadTradeScreenBorder: ; 28ef8
+LoadTradeScreenBorder:
farcall _LoadTradeScreenBorder
ret
-; 28eff
-SetTradeRoomBGPals: ; 28eff
+SetTradeRoomBGPals:
farcall LoadTradeRoomBGPals_ ; just a nested farcall; so wasteful
call SetPalettes
ret
-; 28f09
-Unreferenced_Function28f09: ; 28f09
+Unreferenced_Function28f09:
hlcoord 0, 0
ld b, 6
ld c, 18
@@ -2027,11 +1986,10 @@ Unreferenced_Function28f09: ; 28f09
call LinkTextboxAtHL
farcall PlaceTradePartnerNamesAndParty
ret
-; 28f24
INCLUDE "engine/movie/trade_animation.asm"
-CheckTimeCapsuleCompatibility: ; 29bfb
+CheckTimeCapsuleCompatibility:
; Checks to see if your party is compatible with the Gen 1 games.
; Returns the following in wScriptVar:
; 0: Party is okay
@@ -2081,7 +2039,7 @@ CheckTimeCapsuleCompatibility: ; 29bfb
jr nc, .move_too_new
dec c
jr nz, .move_next
- ld de, wPartyMon2 - (wPartyMon1 + NUM_MOVES)
+ ld de, PARTYMON_STRUCT_LENGTH - NUM_MOVES
add hl, de
dec b
jr nz, .move_loop
@@ -2111,9 +2069,8 @@ CheckTimeCapsuleCompatibility: ; 29bfb
.done
ld [wScriptVar], a
ret
-; 29c67
-Function29c67: ; 29c67
+Function29c67:
ld a, [wPartyCount]
sub b
ld c, a
@@ -2125,9 +2082,8 @@ Function29c67: ; 29c67
ld [wd265], a
call GetPokemonName
ret
-; 29c7b
-EnterTimeCapsule: ; 29c7b
+EnterTimeCapsule:
ld c, 10
call DelayFrames
ld a, $4
@@ -2139,9 +2095,8 @@ EnterTimeCapsule: ; 29c7b
inc a
ld [wLinkMode], a
ret
-; 29c92
-WaitForOtherPlayerToExit: ; 29c92
+WaitForOtherPlayerToExit:
ld c, 3
call DelayFrames
ld a, CONNECTION_NOT_ESTABLISHED
@@ -2187,23 +2142,20 @@ WaitForOtherPlayerToExit: ; 29c92
ld [hVBlank], a
ld [wLinkMode], a
ret
-; 29ce8
-SetBitsForLinkTradeRequest: ; 29ce8
+SetBitsForLinkTradeRequest:
ld a, LINK_TRADECENTER - 1
ld [wPlayerLinkAction], a
ld [wd265], a
ret
-; 29cf1
-SetBitsForBattleRequest: ; 29cf1
+SetBitsForBattleRequest:
ld a, LINK_COLOSSEUM - 1
ld [wPlayerLinkAction], a
ld [wd265], a
ret
-; 29cfa
-SetBitsForTimeCapsuleRequest: ; 29cfa
+SetBitsForTimeCapsuleRequest:
ld a, $2
ld [rSB], a
xor a
@@ -2216,9 +2168,8 @@ SetBitsForTimeCapsuleRequest: ; 29cfa
ld [wPlayerLinkAction], a
ld [wd265], a
ret
-; 29d11
-WaitForLinkedFriend: ; 29d11
+WaitForLinkedFriend:
ld a, [wPlayerLinkAction]
and a
jr z, .no_link_action
@@ -2288,9 +2239,8 @@ WaitForLinkedFriend: ; 29d11
xor a
ld [wScriptVar], a
ret
-; 29d92
-CheckLinkTimeout: ; 29d92
+CheckLinkTimeout:
ld a, $1
ld [wPlayerLinkAction], a
ld hl, wLinkTimeoutFrames
@@ -2310,9 +2260,8 @@ CheckLinkTimeout: ; 29d92
and a
ret nz
jp Link_ResetSerialRegistersAfterLinkClosure
-; 29dba
-Function29dba: ; 29dba
+Function29dba:
ld a, $5
ld [wPlayerLinkAction], a
ld hl, wLinkTimeoutFrames
@@ -2358,9 +2307,8 @@ Function29dba: ; 29dba
xor a
ld [hVBlank], a
ret
-; 29e0c
-Link_CheckCommunicationError: ; 29e0c
+Link_CheckCommunicationError:
xor a
ld [hSerialReceivedNewData], a
ld a, [wLinkTimeoutFrames]
@@ -2389,9 +2337,8 @@ Link_CheckCommunicationError: ; 29e0c
ld [hli], a
ld [hl], a
ret
-; 29e3b
-.CheckConnected: ; 29e3b
+.CheckConnected:
call WaitLinkTransfer
ld hl, wLinkTimeoutFrames
ld a, [hli]
@@ -2400,9 +2347,8 @@ Link_CheckCommunicationError: ; 29e0c
ld a, [hl]
inc a
ret
-; 29e47
-.AcknowledgeSerial: ; 29e47
+.AcknowledgeSerial:
ld b, 10
.loop
call DelayFrame
@@ -2410,9 +2356,8 @@ Link_CheckCommunicationError: ; 29e0c
dec b
jr nz, .loop
ret
-; 29e53
-.ConvertDW: ; 29e53
+.ConvertDW:
; [wLinkTimeoutFrames] = ((hl - $100) / 4) + $100
; = (hl / 4) + $c0
dec h
@@ -2426,9 +2371,8 @@ Link_CheckCommunicationError: ; 29e0c
ld a, l
ld [wLinkTimeoutFrames + 1], a
ret
-; 29e66
-TryQuickSave: ; 29e66
+TryQuickSave:
ld a, [wd265]
push af
farcall Link_SaveGame
@@ -2442,9 +2386,8 @@ TryQuickSave: ; 29e66
pop af
ld [wd265], a
ret
-; 29e82
-CheckBothSelectedSameRoom: ; 29e82
+CheckBothSelectedSameRoom:
ld a, [wd265]
call Link_EnsureSync
push af
@@ -2469,9 +2412,8 @@ CheckBothSelectedSameRoom: ; 29e82
xor a ; FALSE
ld [wScriptVar], a
ret
-; 29eaf
-TimeCapsule: ; 29eaf
+TimeCapsule:
ld a, LINK_TIMECAPSULE
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2480,9 +2422,8 @@ TimeCapsule: ; 29eaf
xor a
ld [hVBlank], a
ret
-; 29ec4
-TradeCenter: ; 29ec4
+TradeCenter:
ld a, LINK_TRADECENTER
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2491,9 +2432,8 @@ TradeCenter: ; 29ec4
xor a
ld [hVBlank], a
ret
-; 29ed9
-Colosseum: ; 29ed9
+Colosseum:
ld a, LINK_COLOSSEUM
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2502,24 +2442,21 @@ Colosseum: ; 29ed9
xor a
ld [hVBlank], a
ret
-; 29eee
-CloseLink: ; 29eee
+CloseLink:
xor a
ld [wLinkMode], a
ld c, 3
call DelayFrames
jp Link_ResetSerialRegistersAfterLinkClosure
-; 29efa
-FailedLinkToPast: ; 29efa
+FailedLinkToPast:
ld c, 40
call DelayFrames
ld a, $e
jp Link_EnsureSync
-; 29f04
-Link_ResetSerialRegistersAfterLinkClosure: ; 29f04
+Link_ResetSerialRegistersAfterLinkClosure:
ld c, 3
call DelayFrames
ld a, CONNECTION_NOT_ESTABLISHED
@@ -2530,9 +2467,8 @@ Link_ResetSerialRegistersAfterLinkClosure: ; 29f04
ld [hSerialReceive], a
ld [rSC], a
ret
-; 29f17
-Link_EnsureSync: ; 29f17
+Link_EnsureSync:
add $d0
ld [wPlayerLinkAction], a
ld [wcf57], a
@@ -2559,9 +2495,8 @@ Link_EnsureSync: ; 29f17
ld a, b
and $f
ret
-; 29f47
-CableClubCheckWhichChris: ; 29f47
+CableClubCheckWhichChris:
ld a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
ld a, TRUE
@@ -2571,11 +2506,9 @@ CableClubCheckWhichChris: ; 29f47
.yes
ld [wScriptVar], a
ret
-; 29f54
-Unreferenced_Gen1LinkCommsBorderGFX: ; 29f54
+Unreferenced_Gen1LinkCommsBorderGFX:
INCBIN "gfx/trade/unused_gen_1_border_tiles.2bpp"
-; 29fe4
Unreferenced_Function29fe4:
ld a, BANK(sPartyMail)
diff --git a/engine/link/link_2.asm b/engine/link/link_2.asm
index e2fe47dc5..9406e43bb 100644
--- a/engine/link/link_2.asm
+++ b/engine/link/link_2.asm
@@ -1,4 +1,4 @@
-LinkMonStatsScreen: ; 4d319
+LinkMonStatsScreen:
ld a, [wMenuCursorY]
dec a
ld [wCurPartyMon], a
@@ -17,12 +17,12 @@ LinkMonStatsScreen: ; 4d319
call WaitBGMap2
ret
-Link_WaitBGMap: ; 4d354
+Link_WaitBGMap:
call WaitBGMap
call WaitBGMap2
ret
-LinkTextbox2: ; 4d35b
+LinkTextbox2:
ld h, d
ld l, e
push bc
@@ -52,9 +52,8 @@ LinkTextbox2: ; 4d35b
dec b
jr nz, .row
ret
-; 4d37e
-.PlaceBorder: ; 4d37e
+.PlaceBorder:
push hl
ld a, $76
ld [hli], a
@@ -67,26 +66,25 @@ LinkTextbox2: ; 4d35b
add hl, de
.loop
push hl
- ld a, "┌"
+ ld a, $79
ld [hli], a
ld a, " "
call .PlaceRow
- ld [hl], "─"
+ ld [hl], $7a
pop hl
ld de, SCREEN_WIDTH
add hl, de
dec b
jr nz, .loop
- ld a, "┐"
+ ld a, $7b
ld [hli], a
- ld a, "│"
+ ld a, $7c
call .PlaceRow
- ld [hl], "└"
+ ld [hl], $7d
ret
-; 4d3ab
-.PlaceRow: ; 4d3ab
+.PlaceRow:
ld d, c
.row_loop
ld [hli], a
diff --git a/engine/link/link_trade.asm b/engine/link/link_trade.asm
index 4c2af0842..a3c596bfe 100644
--- a/engine/link/link_trade.asm
+++ b/engine/link/link_trade.asm
@@ -1,24 +1,21 @@
LinkCommsBorderGFX:
INCBIN "gfx/trade/border_tiles.2bpp"
-; 16d421
-__LoadTradeScreenBorder: ; 16d421
+__LoadTradeScreenBorder:
ld de, LinkCommsBorderGFX
ld hl, vTiles2
lb bc, BANK(LinkCommsBorderGFX), 70
call Get2bpp
ret
-; 16d42e
-Function16d42e: ; 16d42e
+Function16d42e:
ld hl, Tilemap_MobileTradeBorderFullscreen
decoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
call CopyBytes
ret
-; 16d43b
-Function16d43b: ; 16d43b
+Function16d43b:
call LoadStandardMenuHeader
call ClearBGPalettes
call ClearTileMap
@@ -32,7 +29,6 @@ Function16d43b: ; 16d43b
call JoyWaitAorB
call Call_ExitMenu
ret
-; 16d465
Tilemap_MobileTradeBorderFullscreen:
INCBIN "gfx/trade/border_mobile_fullscreen.tilemap"
@@ -43,7 +39,7 @@ INCBIN "gfx/trade/border_cable_top.tilemap"
Tilemap_CableTradeBorderBottom:
INCBIN "gfx/trade/border_cable_bottom.tilemap"
-_LinkTextbox: ; 16d61d
+_LinkTextbox:
ld h, d
ld l, e
push bc
@@ -73,9 +69,8 @@ _LinkTextbox: ; 16d61d
dec b
jr nz, .row
ret
-; 16d640
-.PlaceBorder ; 16d640
+.PlaceBorder
push hl
ld a, $30
ld [hli], a
@@ -105,18 +100,16 @@ _LinkTextbox: ; 16d61d
call .PlaceRow
ld [hl], $37
ret
-; 16d66d
-.PlaceRow ; 16d66d
+.PlaceRow
ld d, c
.row_loop
ld [hli], a
dec d
jr nz, .row_loop
ret
-; 16d673
-InitTradeSpeciesList: ; 16d673
+InitTradeSpeciesList:
call _LoadTradeScreenBorder
call Function16d6ae
farcall InitMG_Mobile_LinkTradePalMap
@@ -125,32 +118,26 @@ InitTradeSpeciesList: ; 16d673
ld de, .CANCEL
call PlaceString
ret
-; 16d68f
-.CANCEL: ; 16d68f
+.CANCEL:
db "CANCEL@"
-; 16d696
-_LoadTradeScreenBorder: ; 16d696
+_LoadTradeScreenBorder:
call __LoadTradeScreenBorder
ret
-; 16d69a
-
-LinkComms_LoadPleaseWaitTextboxBorderGFX: ; 16d69a
+LinkComms_LoadPleaseWaitTextboxBorderGFX:
ld de, LinkCommsBorderGFX + $30 tiles
ld hl, vTiles2 tile $76
lb bc, BANK(LinkCommsBorderGFX), 8
call Get2bpp
ret
-; 16d6a7
-LoadTradeRoomBGPals_: ; 16d6a7
+LoadTradeRoomBGPals_:
farcall LoadTradeRoomBGPals
ret
-; 16d6ae
-Function16d6ae: ; 16d6ae
+Function16d6ae:
call Function16d42e
ld hl, Tilemap_CableTradeBorderTop
decoord 0, 0
@@ -161,23 +148,20 @@ Function16d6ae: ; 16d6ae
ld bc, 2 * SCREEN_WIDTH
call CopyBytes
ret
-; 16d6ca
-LinkTextbox: ; 16d6ca
+LinkTextbox:
call _LinkTextbox
ret
-; 16d6ce
-Function16d6ce: ; 16d6ce
+Function16d6ce:
call LoadStandardMenuHeader
call Function16d6e1
farcall WaitLinkTransfer
call Call_ExitMenu
call WaitBGMap2
ret
-; 16d6e1
-Function16d6e1: ; 16d6e1
+Function16d6e1:
hlcoord 4, 10
ld b, 1
ld c, 10
@@ -189,19 +173,16 @@ Function16d6e1: ; 16d6e1
call WaitBGMap2
ld c, 50
jp DelayFrames
-; 16d701
-.Waiting: ; 16d701
+.Waiting:
db "WAITING..!@"
-; 16d70c
-LinkTradeMenu: ; 16d70c
+LinkTradeMenu:
call .MenuAction
call .GetJoypad
ret
-; 16d713
-.GetJoypad: ; 16d713
+.GetJoypad:
push bc
push af
ld a, [hJoyLast]
@@ -216,9 +197,8 @@ LinkTradeMenu: ; 16d70c
pop bc
ld d, a
ret
-; 16d725
-.MenuAction: ; 16d725
+.MenuAction:
ld hl, w2DMenuFlags2
res 7, [hl]
ld a, [hBGMapMode]
@@ -246,9 +226,8 @@ LinkTradeMenu: ; 16d70c
.done
ret
-; 16d759
-.UpdateBGMapAndOAM: ; 16d759
+.UpdateBGMapAndOAM:
ld a, [hOAMUpdate]
push af
ld a, $1
@@ -269,9 +248,8 @@ LinkTradeMenu: ; 16d70c
jr z, .loop2
and a
ret
-; 16d77a
-.UpdateCursor: ; 16d77a
+.UpdateCursor:
ld hl, wCursorCurrentTile
ld a, [hli]
ld h, [hl]
@@ -346,9 +324,8 @@ LinkTradeMenu: ; 16d70c
ld a, h
ld [wCursorCurrentTile + 1], a
ret
-; 16d7e7
-.TryAnims: ; 16d7e7
+.TryAnims:
ld a, [w2DMenuFlags1]
bit 6, a
jr z, .skip_anims
@@ -360,4 +337,3 @@ LinkTradeMenu: ; 16d70c
ret z
scf
ret
-; 16d7fe
diff --git a/engine/link/mystery_gift.asm b/engine/link/mystery_gift.asm
index 4aed9ee70..0a5dfcec3 100644
--- a/engine/link/mystery_gift.asm
+++ b/engine/link/mystery_gift.asm
@@ -1,4 +1,4 @@
-DoMysteryGift: ; 1048ba (41:48ba)
+DoMysteryGift:
call ClearTileMap
call ClearSprites
call WaitBGMap
@@ -98,84 +98,74 @@ DoMysteryGift: ; 1048ba (41:48ba)
ld hl, .Text_Sent ; sent item
jr .PrintTextAndExit
-.LinkCanceled: ; 1049af (41:49af)
+.LinkCanceled:
ld hl, .Text_LinkCanceled ; Link has been canceled
jr .PrintTextAndExit
-.CommunicationError: ; 1049b4 (41:49b4)
+.CommunicationError:
ld hl, .Text_CommunicationError ; Communication error
call PrintText
jp DoMysteryGift
-.GiftWaiting: ; 1049bd (41:49bd)
+.GiftWaiting:
ld hl, .Text_ReceiveGiftAtCounter ; receive gift at counter
jr .PrintTextAndExit
-.FriendNotReady: ; 1049c2 (41:49c2)
+.FriendNotReady:
ld hl, .Text_FriendNotReady ; friend not ready
-.PrintTextAndExit: ; 1049c5 (41:49c5)
+.PrintTextAndExit:
call PrintText
ld a, LCDC_DEFAULT
ld [rLCDC], a
ret
-; 1049cd (41:49cd)
-.String_PressAToLink_BToCancel: ; 1049cd
+.String_PressAToLink_BToCancel:
db "Press A to"
next "link IR-Device"
next "Press B to"
next "cancel it."
db "@"
-; 1049fd
-.Text_LinkCanceled: ; 1049fd
+.Text_LinkCanceled:
text_jump UnknownText_0x1c0436
db "@"
-; 104a02
-.Text_CommunicationError: ; 104a02
+.Text_CommunicationError:
text_jump UnknownText_0x1c0454
db "@"
-; 104a07
-.Text_ReceiveGiftAtCounter: ; 104a07
+.Text_ReceiveGiftAtCounter:
text_jump UnknownText_0x1c046a
db "@"
-; 104a0c
-.Text_FriendNotReady: ; 104a0c
+.Text_FriendNotReady:
text_jump UnknownText_0x1c048e
db "@"
-; 104a11
-.Text_MaxFiveGifts: ; 104a11
+.Text_MaxFiveGifts:
text_jump UnknownText_0x1c04a7
db "@"
-; 104a16
-.Text_MaxOneGiftPerPerson: ; 104a16
+.Text_MaxOneGiftPerPerson:
text_jump UnknownText_0x1c04c6
db "@"
-; 104a1b
-.Text_Sent: ; 104a1b
+.Text_Sent:
text_jump UnknownText_0x1c04e9
db "@"
-; 104a20
-.Text_SentToHome: ; 104a20
+.Text_SentToHome:
text_jump UnknownText_0x1c04fa
db "@"
-; 104a25
-.CheckAlreadyGotFiveGiftsToday: ; 104a25 (41:4a25)
+.CheckAlreadyGotFiveGiftsToday:
call GetMysteryGiftBank
ld a, [sNumDailyMysteryGiftPartnerIDs]
cp $5
jp CloseSRAM
-.CheckAlreadyGotAGiftFromThatPerson: ; 104a30 (41:4a30)
+.CheckAlreadyGotAGiftFromThatPerson:
call GetMysteryGiftBank
ld a, [wMysteryGiftPartnerID]
ld b, a
@@ -203,7 +193,7 @@ DoMysteryGift: ; 1048ba (41:48ba)
.No:
jp CloseSRAM
-.AddMysteryGiftPartnerID: ; 104a56 (41:4a56)
+.AddMysteryGiftPartnerID:
call GetMysteryGiftBank
ld hl, sNumDailyMysteryGiftPartnerIDs
ld a, [hl]
@@ -219,7 +209,7 @@ DoMysteryGift: ; 1048ba (41:48ba)
ld [hl], a
jp CloseSRAM
-.SaveMysteryGiftTrainerName: ; 104a71 (41:4a71)
+.SaveMysteryGiftTrainerName:
call GetMysteryGiftBank
ld a, $1
ld [sMysteryGiftTrainerHouseFlag], a
@@ -235,7 +225,7 @@ DoMysteryGift: ; 1048ba (41:48ba)
call CopyBytes
jp CloseSRAM
-Function104a95: ; 104a95 (41:4a95)
+Function104a95:
di
farcall ClearChannels
call Function104d5e
@@ -305,10 +295,10 @@ Function104a95: ; 104a95 (41:4a95)
ld [hMGStatusFlags], a
jp Function104bd0
-Function104b04: ; 104b04 (41:4b04)
+Function104b04:
call Function104b40
jp nz, Function104bd0
-Function104b0a: ; 104b0a (41:4b0a)
+Function104b0a:
call Function104d38
jp nz, Function104bd0
call Function104b88
@@ -318,7 +308,7 @@ Function104b0a: ; 104b0a (41:4b0a)
call Function105033
jp Function104bd0
-Function104b22: ; 104b22 (41:4b22)
+Function104b22:
call Function104b88
jp nz, Function104bd0
call Function104d43
@@ -330,13 +320,13 @@ Function104b22: ; 104b22 (41:4b22)
call Function10502e
jp Function104bd0
-Function104b40: ; 104b40 (41:4b40)
+Function104b40:
ld hl, hPrintNum1
ld b, $1
call Function104d56
ret nz
-Function104b49: ; 104b49 (41:4b49)
+Function104b49:
call Function105033
ld a, [hMGStatusFlags]
cp $6c
@@ -368,7 +358,7 @@ Function104b49: ; 104b49 (41:4b49)
cp $6c
ret
-Function104b88: ; 104b88 (41:4b88)
+Function104b88:
ld a, $96
ld [hPrintNum1], a
ld hl, hPrintNum1
@@ -404,7 +394,7 @@ Function104b88: ; 104b88 (41:4b88)
cp $6c
ret
-Function104bd0: ; 104bd0 (41:4bd0)
+Function104bd0:
nop
ld a, [hMGStatusFlags]
cp $10
@@ -451,7 +441,7 @@ Function104bd0: ; 104bd0 (41:4bd0)
pop af
ret
-Function104c2d: ; 104c2d (41:4c2d)
+Function104c2d:
di
farcall ClearChannels
call Function104d5e
@@ -488,7 +478,7 @@ Function104c2d: ; 104c2d (41:4c2d)
call Function10502e
jp Function104d1c
-Function104c8a: ; 104c8a (41:4c8a)
+Function104c8a:
ld hl, hPrintNum1
ld b, $1
call Function104d56
@@ -524,7 +514,7 @@ Function104c8a: ; 104c8a (41:4c8a)
cp $6c
ret
-Function104cd2: ; 104cd2 (41:4cd2)
+Function104cd2:
ld a, $3c
ld [hPrintNum1], a
ld hl, hPrintNum1
@@ -561,7 +551,7 @@ Function104cd2: ; 104cd2 (41:4cd2)
cp $6c
ret
-Function104d1c: ; 104d1c (41:4d1c)
+Function104d1c:
nop
ld a, [hMGStatusFlags]
push af
@@ -576,39 +566,39 @@ Function104d1c: ; 104d1c (41:4d1c)
pop af
ret
-Function104d32: ; 104d32 (41:4d32)
+Function104d32:
ld a, $80
ld [hMGStatusFlags], a
and a
ret
-Function104d38: ; 104d38 (41:4d38)
+Function104d38:
call Function104d96
call Function104e46
ld a, [hMGStatusFlags]
cp $6c
ret
-Function104d43: ; 104d43 (41:4d43)
+Function104d43:
call Function104d96
call Function104dfe
ld a, [hMGStatusFlags]
cp $6c
ret
-Function104d4e: ; 104d4e (41:4d4e)
+Function104d4e:
call Function104e93
ld a, [hMGStatusFlags]
cp $6c
ret
-Function104d56: ; 104d56 (41:4d56)
+Function104d56:
call Function104f57
ld a, [hMGStatusFlags]
cp $6c
ret
-Function104d5e: ; 104d5e (41:4d5e)
+Function104d5e:
call Function104d74
ld a, $4
ld [rIE], a
@@ -624,7 +614,7 @@ Function104d5e: ; 104d5e (41:4d5e)
jr nz, .asm_104d6d
ret
-Function104d74: ; 104d74 (41:4d74)
+Function104d74:
xor a
ld [rTAC], a
ld a, $fe
@@ -636,7 +626,7 @@ Function104d74: ; 104d74 (41:4d74)
ld [rTAC], a
ret
-Function104d86: ; 104d86 (41:4d86)
+Function104d86:
xor a
ld [rTAC], a
ld [rTMA], a
@@ -647,21 +637,21 @@ Function104d86: ; 104d86 (41:4d86)
ld [rTAC], a
ret
-Function104d96: ; 104d96 (41:4d96)
+Function104d96:
ld a, $c0
call Function104e8c
ld a, $1
ld [hPrintNum9], a
ret
-Function104da0: ; 104da0 (41:4da0)
+Function104da0:
xor a
call Function104e8c
ld a, $2
ld [rTAC], a
ret
-Function104da9: ; 104da9 (41:4da9)
+Function104da9:
inc d
ret z
xor a
@@ -673,7 +663,7 @@ Function104da9: ; 104da9 (41:4da9)
or a
ret
-Function104db7: ; 104db7 (41:4db7)
+Function104db7:
inc d
ret z
xor a
@@ -685,7 +675,7 @@ Function104db7: ; 104db7 (41:4db7)
or a
ret
-Function104dc5: ; 104dc5 (41:4dc5)
+Function104dc5:
ld a, $c1
ld [$ff00+c], a
.wait
@@ -696,7 +686,7 @@ Function104dc5: ; 104dc5 (41:4dc5)
halt
jr .wait
-Function104dd1: ; 104dd1 (41:4dd1)
+Function104dd1:
ld a, $c0
ld [$ff00+c], a
.wait
@@ -707,7 +697,7 @@ Function104dd1: ; 104dd1 (41:4dd1)
halt
jr .wait
-Function104ddd: ; 104ddd (41:4ddd)
+Function104ddd:
ld d, $0
ld e, d
ld a, $1
@@ -730,7 +720,7 @@ Function104ddd: ; 104ddd (41:4ddd)
and b
jr nz, .loop
-Function104dfe: ; 104dfe (41:4dfe)
+Function104dfe:
ld c, LOW(rRP)
ld d, $0
ld e, d
@@ -757,7 +747,7 @@ Function104dfe: ; 104dfe (41:4dfe)
call Function104dd1
ret
-Function104e3a: ; 104e3a (41:4e3a)
+Function104e3a:
; Wait a random amount of time
call Random
ld e, a
@@ -768,7 +758,7 @@ Function104e3a: ; 104e3a (41:4e3a)
ld a, d
or e
jr nz, .loop
-Function104e46: ; 104e46 (41:4e46)
+Function104e46:
ld a, $2
ld [hPrintNum9], a
ld c, LOW(rRP)
@@ -800,13 +790,13 @@ Function104e46: ; 104e46 (41:4e46)
ld [hMGStatusFlags], a
ret
-Function104e8c: ; 104e8c (41:4e8c)
+Function104e8c:
ld [rRP], a
ld a, $ff
ld [hMGStatusFlags], a
ret
-Function104e93: ; 104e93 (41:4e93)
+Function104e93:
xor a
ld [hPrintNum5], a
ld [hPrintNum6], a
@@ -843,7 +833,7 @@ Function104e93: ; 104e93 (41:4e93)
pop hl
ret
-Function104ed6: ; 104ed6 (41:4ed6)
+Function104ed6:
ld c, LOW(rRP)
ld d, $5
call Function104dd1
@@ -910,25 +900,25 @@ Function104ed6: ; 104ed6 (41:4ed6)
call Function104dd1
ret
-Function104f42: ; 104f42 (41:4f42)
+Function104f42:
ld a, [hMGStatusFlags]
or $2
ld [hMGStatusFlags], a
ret
-Function104f49: ; 104f49 (41:4f49)
+Function104f49:
ld a, [hMGStatusFlags]
or $1
ld [hMGStatusFlags], a
ret
-Function104f50: ; 104f50 (41:4f50)
+Function104f50:
ld a, [hMGStatusFlags]
or $80
ld [hMGStatusFlags], a
ret
-Function104f57: ; 104f57 (41:4f57)
+Function104f57:
xor a
ld [hPrintNum5], a
ld [hPrintNum6], a
@@ -980,7 +970,7 @@ Function104f57: ; 104f57 (41:4f57)
ld [hPrintNum6], a
ret
-Function104faf: ; 104faf (41:4faf)
+Function104faf:
ld c, LOW(rRP)
ld d, $0
call Function104db7
@@ -1059,15 +1049,15 @@ Function104faf: ; 104faf (41:4faf)
call Function104dd1
ret
-Function10502e: ; 10502e (41:502e)
+Function10502e:
ld b, $0
jp Function104e93
-Function105033: ; 105033 (41:5033)
+Function105033:
ld b, $0
jp Function104f57
-MysteryGift_ReadJoypad: ; 105038 (41:5038)
+MysteryGift_ReadJoypad:
; We can only get four inputs at a time.
; We take d-pad first for no particular reason.
ld a, R_DPAD
@@ -1112,7 +1102,7 @@ endr
ld [rJOYP], a
ret
-MysteryGift_CheckAndSetDecorationAlreadyReceived: ; 105069 (41:5069)
+MysteryGift_CheckAndSetDecorationAlreadyReceived:
call GetMysteryGiftBank
ld d, $0
ld b, CHECK_FLAG
@@ -1134,7 +1124,7 @@ MysteryGift_CheckAndSetDecorationAlreadyReceived: ; 105069 (41:5069)
xor a
ret
-MysteryGift_CopyReceivedDecosToPC: ; 105091 (41:5091)
+MysteryGift_CopyReceivedDecosToPC:
call GetMysteryGiftBank
ld c, $0
.loop
@@ -1157,7 +1147,7 @@ MysteryGift_CopyReceivedDecosToPC: ; 105091 (41:5091)
jr c, .loop
jp CloseSRAM
-UnlockMysteryGift: ; 1050b9
+UnlockMysteryGift:
call GetMysteryGiftBank
ld hl, sMysteryGiftUnlocked
ld a, [hl]
@@ -1167,9 +1157,8 @@ UnlockMysteryGift: ; 1050b9
ld [hl], a
.ok
jp CloseSRAM
-; 1050c8
-Function1050c8: ; 1050c8
+Function1050c8:
call GetMysteryGiftBank
ld a, [sNumDailyMysteryGiftPartnerIDs]
cp $ff
@@ -1178,10 +1167,8 @@ Function1050c8: ; 1050c8
ld [sNumDailyMysteryGiftPartnerIDs], a
.okay
jp CloseSRAM
-; 1050d9
-
-BackupMysteryGift: ; 1050d9
+BackupMysteryGift:
call GetMysteryGiftBank
ld hl, sMysteryGiftItem
ld de, sBackupMysteryGiftItem
@@ -1191,10 +1178,8 @@ BackupMysteryGift: ; 1050d9
ld a, [hl]
ld [de], a
jp CloseSRAM
-; 1050ea
-
-RestoreMysteryGift: ; 1050ea (41:50ea)
+RestoreMysteryGift:
call GetMysteryGiftBank
ld hl, sBackupMysteryGiftItem
ld de, sMysteryGiftItem
@@ -1205,7 +1190,7 @@ RestoreMysteryGift: ; 1050ea (41:50ea)
ld [de], a
jp CloseSRAM
-MysteryGift_ClearTrainerData: ; 1050fb (41:50fb)
+MysteryGift_ClearTrainerData:
ld hl, wMysteryGiftTrainerData
xor a
ld b, wMysteryGiftTrainerDataEnd - wMysteryGiftTrainerData
@@ -1215,14 +1200,11 @@ MysteryGift_ClearTrainerData: ; 1050fb (41:50fb)
jr nz, .loop
ret
-
-GetMysteryGiftBank: ; 105106
+GetMysteryGiftBank:
ld a, BANK(sBackupMysteryGiftItem)
jp GetSRAMBank
-; 10510b
-
-StagePartyDataForMysteryGift: ; 10510b (41:510b)
+StagePartyDataForMysteryGift:
; You will be sending this data to your mystery gift partner.
; Structure is the same as a trainer with species and moves
; defined.
@@ -1273,7 +1255,7 @@ StagePartyDataForMysteryGift: ; 10510b (41:510b)
ld [wca00], a
jp CloseSRAM
-InitMysteryGiftLayout: ; 105153 (41:5153)
+InitMysteryGiftLayout:
call ClearBGPalettes
call DisableLCD
ld hl, MysteryGiftGFX
@@ -1364,37 +1346,36 @@ InitMysteryGiftLayout: ; 105153 (41:5153)
call SetPalettes
ret
-.Load5GFX: ; 10522e (41:522e)
+.Load5GFX:
ld b, 5
jr .gfx_loop
-; 105232 (41:5232)
.Unreferenced_Load6GFX:
ld b, 6
jr .gfx_loop
-.Load16GFX: ; 105236 (41:5236)
+.Load16GFX:
ld b, 16
-.gfx_loop ; 105238 (41:5238)
+.gfx_loop
ld [hli], a
inc a
dec b
jr nz, .gfx_loop
ret
-.Load9Column: ; 10523e (41:523e)
+.Load9Column:
ld b, 9
jr .col_loop
-.Load11Column: ; 105242 (41:5242)
+.Load11Column:
ld b, 11
jr .col_loop
-.Load14Column: ; 105246 (41:5246)
+.Load14Column:
ld b, 14
-.col_loop ; 105248 (41:5248)
+.col_loop
ld [hl], a
ld de, SCREEN_WIDTH
add hl, de
@@ -1402,7 +1383,7 @@ InitMysteryGiftLayout: ; 105153 (41:5153)
jr nz, .col_loop
ret
-.Load16Row: ; 105251 (41:5251)
+.Load16Row:
ld b, 16
.row_loop
ld [hli], a
@@ -1410,11 +1391,11 @@ InitMysteryGiftLayout: ; 105153 (41:5153)
jr nz, .row_loop
ret
-MysteryGiftGFX: ; 105258
+MysteryGiftGFX:
INCBIN "gfx/mystery_gift/mystery_gift.2bpp"
.End
-Function105688: ; 105688 (41:5688)
+Function105688:
call ClearTileMap
call ClearSprites
call WaitBGMap
@@ -1455,7 +1436,7 @@ Function105688: ; 105688 (41:5688)
ld hl, Text_ListedCardAsNumber
jr PrintTextAndExit_JP
-Function1056eb: ; 1056eb (41:56eb)
+Function1056eb:
ld c, 16
.loop
ld hl, wVirtualOAMSprite00YCoord
@@ -1484,55 +1465,51 @@ endr
pop bc
jr .loop
-Function105712: ; 105712 (41:5712)
+Function105712:
call Function105777
ld hl, Text_MGLinkCanceled
jr PrintTextAndExit_JP
-Function10571a: ; 10571a (41:571a)
+Function10571a:
call Function105777
ld hl, Text_MGCommError
call PrintText
jp Function105688
-PrintTextAndExit_JP: ; 105726 (41:5726)
+PrintTextAndExit_JP:
call PrintText
ld a, LCDC_DEFAULT
ld [rLCDC], a
ret
-; 10572e (41:572e)
-String_PressAToLink_BToCancel_JP: ; 10572e
+String_PressAToLink_BToCancel_JP:
db "エーボタン<WO>おすと"
next "つうしん<PKMN>おこなわれるよ!"
next "ビーボタン<WO>おすと"
next "つうしん<WO>ちゅうし します"
db "@"
-; 10575e
-
-Text_ReceivedCard: ; 10575e
+Text_ReceivedCard:
text_jump UnknownText_0x1c051a
db "@"
-Text_ListedCardAsNumber: ; 105763
+Text_ListedCardAsNumber:
text_jump UnknownText_0x1c0531
db "@"
-Text_CardNotRegistered: ; 105768
+Text_CardNotRegistered:
text_jump UnknownText_0x1c0555
db "@"
-Text_MGLinkCanceled: ; 10576d
+Text_MGLinkCanceled:
text_jump UnknownText_0x1c0573
db "@"
-Text_MGCommError: ; 105772
+Text_MGCommError:
text_jump UnknownText_0x1c0591
db "@"
-; 105777
-Function105777: ; 105777 (41:5777)
+Function105777:
call ClearSprites
call ClearTileMap
call EnableLCD
@@ -1542,7 +1519,7 @@ Function105777: ; 105777 (41:5777)
call SetPalettes
ret
-Function10578c: ; 10578c (41:578c)
+Function10578c:
ld de, wLinkData
ld a, BANK(sPlayerData)
call GetSRAMBank
@@ -1572,7 +1549,7 @@ Function10578c: ; 10578c (41:578c)
call CloseSRAM
ret
-Function1057d7: ; 1057d7 (41:57d7)
+Function1057d7:
call ClearBGPalettes
call DisableLCD
ld hl, MysteryGiftJP_GFX
@@ -1666,36 +1643,36 @@ Function1057d7: ; 1057d7 (41:57d7)
farcall GetMysteryGift_MobileAdapterLayout
jp SetPalettes
-.Load6Row: ; 1058c6 (41:58c6)
+.Load6Row:
ld b, 6
jr .row_loop
-.Load11Row: ; 1058ca (41:58ca)
+.Load11Row:
ld b, 11
jr .row_loop
-.Load12Row: ; 1058ce (41:58ce)
+.Load12Row:
ld b, 12
-.row_loop ; 1058d0 (41:58d0)
+.row_loop
ld [hli], a
inc a
dec b
jr nz, .row_loop
ret
-.Load9Column: ; 1058d6 (41:58d6)
+.Load9Column:
ld b, 9
jr .column_loop
-.Load11Column: ; 1058da (41:58da)
+.Load11Column:
ld b, 11
jr .column_loop
-.Load14Column: ; 1058de (41:58de)
+.Load14Column:
ld b, 14
-.column_loop ; 1058e0 (41:58e0)
+.column_loop
ld [hl], a
ld de, SCREEN_WIDTH
add hl, de
@@ -1703,16 +1680,15 @@ Function1057d7: ; 1057d7 (41:57d7)
jr nz, .column_loop
ret
-.Load16Row: ; 1058e9 (41:58e9)
+.Load16Row:
ld b, 16
.row_loop_no_inc
ld [hli], a
dec b
jr nz, .row_loop_no_inc
ret
-; 1058f0 (41:58f0)
-.OAM_data: ; 1058f0
+.OAM_data:
dsprite 2, 1, 6, 4, $00, 0
dsprite 2, 1, 7, 4, $01, 0
dsprite 2, 1, 8, 4, $02, 0
@@ -1731,5 +1707,5 @@ Function1057d7: ; 1057d7 (41:57d7)
dsprite 1, 1, 14, 4, $07, 0
; japanese mystery gift gfx
-MysteryGiftJP_GFX: ; 105930
+MysteryGiftJP_GFX:
INCBIN "gfx/mystery_gift/mystery_gift_jp.2bpp"
diff --git a/engine/link/mystery_gift_2.asm b/engine/link/mystery_gift_2.asm
index e0e2e88fd..c1b258724 100644
--- a/engine/link/mystery_gift_2.asm
+++ b/engine/link/mystery_gift_2.asm
@@ -1,4 +1,4 @@
-PrepMysteryGiftDataToSend: ; 2c642 (b:4642)
+PrepMysteryGiftDataToSend:
ld de, wMysteryGiftStaging
ld a, $1
ld [de], a
@@ -56,7 +56,7 @@ PrepMysteryGiftDataToSend: ; 2c642 (b:4642)
ld bc, wMysteryGiftPlayerDataEnd - wMysteryGiftPlayerData
jp CopyBytes
-.RandomSample: ; 2c6ac (b:46ac)
+.RandomSample:
push de
call Random
cp 10 percent
@@ -121,7 +121,7 @@ PrepMysteryGiftDataToSend: ; 2c642 (b:4642)
pop de
ret
-MysteryGiftGetItemHeldEffect: ; 2c708 (b:4708)
+MysteryGiftGetItemHeldEffect:
ld a, c
cp MysteryGiftItems.End - MysteryGiftItems
jr nc, MysteryGiftFallbackItem
@@ -131,7 +131,7 @@ MysteryGiftGetItemHeldEffect: ; 2c708 (b:4708)
ld c, [hl]
ret
-MysteryGiftGetDecoration: ; 2c715 (b:4715)
+MysteryGiftGetDecoration:
ld a, c
cp MysteryGiftDecos.End - MysteryGiftDecos
jr nc, MysteryGiftFallbackItem
@@ -141,11 +141,9 @@ MysteryGiftGetDecoration: ; 2c715 (b:4715)
ld c, [hl]
ret
-MysteryGiftFallbackItem: ; 2c722 (b:4722)
+MysteryGiftFallbackItem:
ld c, DECO_POLKADOT_BED ; GREAT_BALL
ret
-; 2c725 (b:4725)
-
INCLUDE "data/items/mystery_gift_items.asm"
diff --git a/engine/link/place_waiting_text.asm b/engine/link/place_waiting_text.asm
index 9b2260722..147683042 100644
--- a/engine/link/place_waiting_text.asm
+++ b/engine/link/place_waiting_text.asm
@@ -1,4 +1,4 @@
-PlaceWaitingText:: ; 4000
+PlaceWaitingText::
hlcoord 3, 10
ld b, 1
ld c, 11
@@ -20,5 +20,5 @@ PlaceWaitingText:: ; 4000
ld c, 50
jp DelayFrames
-.Waiting: ; 4025
+.Waiting:
db "Waiting...!@"
diff --git a/engine/link/time_capsule.asm b/engine/link/time_capsule.asm
index f90b7e249..195062c1e 100644
--- a/engine/link/time_capsule.asm
+++ b/engine/link/time_capsule.asm
@@ -1,6 +1,6 @@
; These functions seem to be related to backwards compatibility
-ValidateOTTrademon: ; fb57e
+ValidateOTTrademon:
ld a, [wd003]
ld hl, wOTPartyMon1Species
call GetPartyLocation
@@ -63,9 +63,8 @@ ValidateOTTrademon: ; fb57e
.abnormal
scf
ret
-; fb5dd
-Functionfb5dd: ; fb5dd
+Functionfb5dd:
ld a, [wd002]
ld d, a
ld a, [wPartyCount]
@@ -100,9 +99,8 @@ Functionfb5dd: ; fb5dd
.done
and a
ret
-; fb60d
-PlaceTradePartnerNamesAndParty: ; fb60d
+PlaceTradePartnerNamesAndParty:
hlcoord 4, 0
ld de, wPlayerName
call PlaceString
@@ -118,7 +116,7 @@ PlaceTradePartnerNamesAndParty: ; fb60d
call .PlaceSpeciesNames
hlcoord 7, 9
ld de, wOTPartySpecies
-.PlaceSpeciesNames: ; fb634
+.PlaceSpeciesNames:
ld c, $0
.loop
ld a, [de]
@@ -142,6 +140,5 @@ PlaceTradePartnerNamesAndParty: ; fb60d
pop bc
inc c
jr .loop
-; fb656
INCLUDE "data/pokemon/gen1_base_special.asm"
diff --git a/engine/link/time_capsule_2.asm b/engine/link/time_capsule_2.asm
index a56e51785..be7027f34 100644
--- a/engine/link/time_capsule_2.asm
+++ b/engine/link/time_capsule_2.asm
@@ -1,4 +1,4 @@
-ConvertMon_2to1: ; fb8f1
+ConvertMon_2to1:
; Takes the Gen-2 Pokemon number stored in wd265, finds it in the Pokered_MonIndices table, and returns its index in wd265.
push bc
push hl
@@ -16,9 +16,8 @@ ConvertMon_2to1: ; fb8f1
pop hl
pop bc
ret
-; fb908
-ConvertMon_1to2: ; fb908
+ConvertMon_1to2:
; Takes the Gen-1 Pokemon number stored in wd265 and returns the corresponding value from Pokered_MonIndices in wd265.
push bc
push hl
@@ -33,7 +32,5 @@ ConvertMon_1to2: ; fb908
pop hl
pop bc
ret
-; fb91c
-
INCLUDE "data/pokemon/gen1_order.asm"