~moody/pokecrystal

a1e711b80dbd652cdf3b89811f7539d93782b0b5 — mid-kid 5 months ago 4c4fd72
Use more appropriate labels for link operations
2 files changed, 13 insertions(+), 12 deletions(-)

M engine/link/link.asm
M ram/wram.asm
M engine/link/link.asm => engine/link/link.asm +13 -8
@@ 126,7 126,7 @@ endc
	call Link_CopyOTData

	ld de, wOTPatchLists
	ld hl, wLinkPatchData1
	ld hl, wLinkPlayerData
	ld c, 2
.loop
	ld a, [de]


@@ 152,11 152,11 @@ endc
	jr .loop

.next
	ld hl, wLinkPatchData2
	ld hl, wLinkPlayerData + SERIAL_PATCH_DATA_SIZE
	dec c
	jr nz, .loop

	ld hl, wLinkPlayerName
	ld hl, wLinkData
	ld de, wOTPlayerName
	ld bc, NAME_LENGTH
	call CopyBytes


@@ 293,8 293,8 @@ endc
	ld bc, NAME_LENGTH + 1 + PARTY_LENGTH + 1 + 2 + (PARTYMON_STRUCT_LENGTH + NAME_LENGTH * 2) * PARTY_LENGTH
	call Link_CopyOTData

	ld de, wPlayerTrademon
	ld hl, wLinkPatchData1
	ld de, wOTPatchLists
	ld hl, wLinkPlayerData
	ld c, 2
.loop1
	ld a, [de]


@@ 320,7 320,7 @@ endc
	jr .loop1

.next1
	ld hl, wLinkPatchData2
	ld hl, wLinkPlayerData + SERIAL_PATCH_DATA_SIZE
	dec c
	jr nz, .loop1



@@ 339,10 339,14 @@ endc
	cp SERIAL_MAIL_PREAMBLE_BYTE
	jr z, .loop3
	dec hl

	ld de, wLinkOTMail
	ld bc, wLinkDataEnd - wLinkOTMail ; should be wLinkOTMailEnd - wLinkOTMail
	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
.loop4
	ld a, [hl]


@@ 355,6 359,7 @@ endc
	ld a, b
	or c
	jr nz, .loop4

	ld de, wLinkOTMailPatchSet
.loop5
	ld a, [de]


@@ 434,7 439,7 @@ endc
	ld [de], a

.skip_mail
	ld hl, wLinkPlayerName
	ld hl, wLinkData
	ld de, wOTPlayerName
	ld bc, NAME_LENGTH
	call CopyBytes

M ram/wram.asm => ram/wram.asm +0 -4
@@ 1006,10 1006,6 @@ for n, 1, PARTY_LENGTH + 1
wTimeCapsulePartyMon{d:n}Nickname:: ds MON_NAME_LENGTH
endr

NEXTU
; link patch lists
wLinkPatchData1:: ds SERIAL_PATCH_DATA_SIZE
wLinkPatchData2:: ds SERIAL_PATCH_DATA_SIZE
ENDU