From ae4fe08084f3c3c5775bc286bcc630f2c20af083 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 22 Oct 2020 00:53:54 -0400 Subject: [PATCH] Identify some more labels (a few link-related) --- data/text/battle.asm | 4 ++-- engine/battle/core.asm | 14 +++++++------- engine/link/link.asm | 10 +++++----- home/serial.asm | 3 ++- macros/wram.asm | 2 +- wram.asm | 26 +++++++++++++++++--------- 6 files changed, 34 insertions(+), 25 deletions(-) diff --git a/data/text/battle.asm b/data/text/battle.asm index 39554bf6125..48d0ff483b2 100644 --- a/data/text/battle.asm +++ b/data/text/battle.asm @@ -199,7 +199,7 @@ SentAllToMomText: text "Sent all to MOM!" prompt -BattleText_0x80a4f: +UnusedRivalLossText: ; unreferenced text ": Huh? I" line "should've chosen" cont "your #MON!" @@ -215,7 +215,7 @@ BattleText_UseNextMon: text "Use next #MON?" done -BattleText_0x80a93: +UnusedRivalWinText: ; unreferenced text ": Yes!" line "I guess I chose a" cont "good #MON!" diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 218fbeb75a7..85cba5f8503 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -8470,7 +8470,7 @@ ReadAndPrintLinkBattleRecord: call .PrintBattleRecord hlcoord 0, 8 ld b, NUM_LINK_BATTLE_RECORDS - ld de, sLinkBattleRecord + 2 + ld de, sLinkBattleRecord1Name .loop push bc push hl @@ -8485,35 +8485,35 @@ ReadAndPrintLinkBattleRecord: push hl ld h, d ld l, e - ld de, wd002 + ld de, wLinkBattleRecordName ld bc, NAME_LENGTH - 1 call CopyBytes ld a, "@" ld [de], a - inc de + inc de ; wLinkBattleRecordWins ld bc, 6 call CopyBytes - ld de, wd002 + ld de, wLinkBattleRecordName pop hl call PlaceString pop hl ld de, 26 add hl, de push hl - ld de, wd00d + ld de, wLinkBattleRecordWins lb bc, 2, 4 call PrintNum pop hl ld de, 5 add hl, de push hl - ld de, wd00f + ld de, wLinkBattleRecordLosses lb bc, 2, 4 call PrintNum pop hl ld de, 5 add hl, de - ld de, wd011 + ld de, wLinkBattleRecordDraws lb bc, 2, 4 call PrintNum jr .next diff --git a/engine/link/link.asm b/engine/link/link.asm index e30f7837884..855f5ed0d82 100644 --- a/engine/link/link.asm +++ b/engine/link/link.asm @@ -2159,7 +2159,7 @@ SetBitsForBattleRequest: ret SetBitsForTimeCapsuleRequest: - ld a, $2 + ld a, USING_INTERNAL_CLOCK ldh [rSB], a xor a ldh [hSerialReceive], a @@ -2176,7 +2176,7 @@ WaitForLinkedFriend: ld a, [wPlayerLinkAction] and a jr z, .no_link_action - ld a, $2 + ld a, USING_INTERNAL_CLOCK ldh [rSB], a xor a ldh [hSerialReceive], a @@ -2201,7 +2201,7 @@ WaitForLinkedFriend: jr z, .connected ld a, CONNECTION_NOT_ESTABLISHED ldh [hSerialConnectionStatus], a - ld a, $2 + ld a, USING_INTERNAL_CLOCK ldh [rSB], a xor a ldh [hSerialReceive], a @@ -2219,7 +2219,7 @@ WaitForLinkedFriend: jr z, .done .not_done - ld a, $1 + ld a, USING_EXTERNAL_CLOCK ldh [rSB], a ld a, (0 << rSC_ON) | (1 << rSC_CLOCK) ldh [rSC], a @@ -2464,7 +2464,7 @@ Link_ResetSerialRegistersAfterLinkClosure: call DelayFrames ld a, CONNECTION_NOT_ESTABLISHED ldh [hSerialConnectionStatus], a - ld a, $2 + ld a, USING_INTERNAL_CLOCK ldh [rSB], a xor a ldh [hSerialReceive], a diff --git a/home/serial.asm b/home/serial.asm index 671ec7a42ee..6b03649a276 100644 --- a/home/serial.asm +++ b/home/serial.asm @@ -388,7 +388,8 @@ LinkDataReceived:: ldh [rSC], a ret -Function919:: ; unreferenced +SetBitsForTimeCapsuleRequestIfNotLinked:: ; unreferenced +; Similar to SetBitsForTimeCapsuleRequest (see engine/link/link.asm). ld a, [wLinkMode] and a ret nz diff --git a/macros/wram.asm b/macros/wram.asm index 88b5ba35d21..b7da3df19a6 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -230,8 +230,8 @@ hall_of_fame: MACRO ENDM link_battle_record: MACRO -\1Name:: ds NAME_LENGTH - 1 \1ID:: dw +\1Name:: ds NAME_LENGTH - 1 \1Wins:: dw \1Losses:: dw \1Draws:: dw diff --git a/wram.asm b/wram.asm index 3bae80d1223..f70b3cd8a3b 100644 --- a/wram.asm +++ b/wram.asm @@ -1056,8 +1056,13 @@ ENDU NEXTU ; mystery gift data -wMysteryGiftPartyTemp:: ; ds PARTY_LENGTH * (1 + 1 + NUM_MOVES) -wMysteryGiftStaging:: +UNION +wMysteryGiftPartyTemp:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + +NEXTU +wMysteryGiftStaging:: ds 80 + +NEXTU wc800:: ds 1 wc801:: ds 1 wc802:: ds 1 @@ -1076,6 +1081,7 @@ wMobileSDK_SendCommandID:: db wc820:: ds 1 wc821:: ds 1 wc822:: ds 46 +ENDU UNION wMysteryGiftTrainerData:: ds (1 + 1 + NUM_MOVES) * PARTY_LENGTH + 2 @@ -1829,6 +1835,13 @@ wSuicuneFrame:: wStartFlypoint:: db wEndFlypoint:: db +NEXTU +; link battle record data +wLinkBattleRecordName:: ds NAME_LENGTH +wLinkBattleRecordWins:: dw +wLinkBattleRecordLosses:: dw +wLinkBattleRecordDraws:: dw + NEXTU ; unidentified wd002:: db @@ -1837,13 +1850,9 @@ wd004:: db ; mobile? ds 1 -wd006:: ds 2 -wd008:: ds 2 ds 2 -wd00c:: ds 1 -wd00d:: ds 1 - ds 1 -wd00f:: ds 1 +wd008:: ds 2 + ds 6 wd010:: ds 1 wd011:: ds 1 wd012:: ds 1 @@ -2331,7 +2340,6 @@ wPutativeTMHMMove:: db wInitListType:: db wBattleHasJustStarted:: db -; wd265 has many different short-term uses wNamedObjectIndexBuffer:: wDeciramBuffer:: wTempByteValue::