Use more appropriate labels for link operations

This commit is contained in:
mid-kid 2023-04-01 02:58:53 +02:00
parent 4c4fd7258c
commit a1e711b80d
2 changed files with 13 additions and 12 deletions

View File

@ -126,7 +126,7 @@ endc
call Link_CopyOTData call Link_CopyOTData
ld de, wOTPatchLists ld de, wOTPatchLists
ld hl, wLinkPatchData1 ld hl, wLinkPlayerData
ld c, 2 ld c, 2
.loop .loop
ld a, [de] ld a, [de]
@ -152,11 +152,11 @@ endc
jr .loop jr .loop
.next .next
ld hl, wLinkPatchData2 ld hl, wLinkPlayerData + SERIAL_PATCH_DATA_SIZE
dec c dec c
jr nz, .loop jr nz, .loop
ld hl, wLinkPlayerName ld hl, wLinkData
ld de, wOTPlayerName ld de, wOTPlayerName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes
@ -293,8 +293,8 @@ endc
ld bc, NAME_LENGTH + 1 + PARTY_LENGTH + 1 + 2 + (PARTYMON_STRUCT_LENGTH + NAME_LENGTH * 2) * PARTY_LENGTH ld bc, NAME_LENGTH + 1 + PARTY_LENGTH + 1 + 2 + (PARTYMON_STRUCT_LENGTH + NAME_LENGTH * 2) * PARTY_LENGTH
call Link_CopyOTData call Link_CopyOTData
ld de, wPlayerTrademon ld de, wOTPatchLists
ld hl, wLinkPatchData1 ld hl, wLinkPlayerData
ld c, 2 ld c, 2
.loop1 .loop1
ld a, [de] ld a, [de]
@ -320,7 +320,7 @@ endc
jr .loop1 jr .loop1
.next1 .next1
ld hl, wLinkPatchData2 ld hl, wLinkPlayerData + SERIAL_PATCH_DATA_SIZE
dec c dec c
jr nz, .loop1 jr nz, .loop1
@ -339,10 +339,14 @@ endc
cp SERIAL_MAIL_PREAMBLE_BYTE cp SERIAL_MAIL_PREAMBLE_BYTE
jr z, .loop3 jr z, .loop3
dec hl dec hl
ld de, wLinkOTMail ld de, wLinkOTMail
ld bc, wLinkDataEnd - wLinkOTMail ; should be wLinkOTMailEnd - wLinkOTMail ld bc, wLinkDataEnd - wLinkOTMail ; should be wLinkOTMailEnd - wLinkOTMail
call CopyBytes call CopyBytes
ld hl, wLinkOTMail
; Replace SERIAL_MAIL_REPLACEMENT_BYTE with SERIAL_NO_DATA_BYTE across all mail
; message bodies.
ld hl, wLinkOTMailMessages
ld bc, (MAIL_MSG_LENGTH + 1) * PARTY_LENGTH ld bc, (MAIL_MSG_LENGTH + 1) * PARTY_LENGTH
.loop4 .loop4
ld a, [hl] ld a, [hl]
@ -355,6 +359,7 @@ endc
ld a, b ld a, b
or c or c
jr nz, .loop4 jr nz, .loop4
ld de, wLinkOTMailPatchSet ld de, wLinkOTMailPatchSet
.loop5 .loop5
ld a, [de] ld a, [de]
@ -434,7 +439,7 @@ endc
ld [de], a ld [de], a
.skip_mail .skip_mail
ld hl, wLinkPlayerName ld hl, wLinkData
ld de, wOTPlayerName ld de, wOTPlayerName
ld bc, NAME_LENGTH ld bc, NAME_LENGTH
call CopyBytes call CopyBytes

View File

@ -1006,10 +1006,6 @@ for n, 1, PARTY_LENGTH + 1
wTimeCapsulePartyMon{d:n}Nickname:: ds MON_NAME_LENGTH wTimeCapsulePartyMon{d:n}Nickname:: ds MON_NAME_LENGTH
endr endr
NEXTU
; link patch lists
wLinkPatchData1:: ds SERIAL_PATCH_DATA_SIZE
wLinkPatchData2:: ds SERIAL_PATCH_DATA_SIZE
ENDU ENDU