mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Port more pokegold link engine symbols, and name an unused WRAM byte
This commit is contained in:
parent
bcc0d633e9
commit
a51b1a2f13
@ -101,9 +101,9 @@ Gen2ToGen1LinkComms:
|
||||
ld a, [hl]
|
||||
pop hl
|
||||
and a
|
||||
jp z, Function28b22
|
||||
jp z, ExitLinkCommunications
|
||||
cp $7
|
||||
jp nc, Function28b22
|
||||
jp nc, ExitLinkCommunications
|
||||
ld de, wLinkData
|
||||
ld bc, $1a2
|
||||
call Link_CopyOTData
|
||||
@ -163,7 +163,7 @@ Gen2ToGen1LinkComms:
|
||||
.done_party
|
||||
ld [de], a
|
||||
ld hl, wTimeCapsulePlayerData
|
||||
call Function2868a
|
||||
call Link_ConvertPartyStruct1to2
|
||||
ld a, LOW(wOTPartyMonOT)
|
||||
ld [wUnusedNamesPointer], a
|
||||
ld a, HIGH(wOTPartyMonOT)
|
||||
@ -467,7 +467,7 @@ Gen2ToGen2LinkComms:
|
||||
pop af
|
||||
ld [wOptions], a
|
||||
farcall LoadPokemonData
|
||||
jp Function28b22
|
||||
jp ExitLinkCommunications
|
||||
|
||||
.ready_to_trade
|
||||
ld de, MUSIC_ROUTE_30
|
||||
@ -833,7 +833,7 @@ Link_PrepPartyData_Gen2:
|
||||
; Fill 5 bytes at wc9f4 with $20
|
||||
ld de, wc9f4
|
||||
ld a, $20
|
||||
call Function28682
|
||||
call Link_CopyMailPreamble
|
||||
|
||||
; Copy all the mail messages to wc9f9
|
||||
ld a, BANK(sPartyMail)
|
||||
@ -934,7 +934,8 @@ Link_PrepPartyData_Gen2:
|
||||
ld [de], a
|
||||
ret
|
||||
|
||||
Function28682:
|
||||
Link_CopyMailPreamble:
|
||||
; fill 5 bytes with the value of a, starting at de
|
||||
ld c, 5
|
||||
.loop
|
||||
ld [de], a
|
||||
@ -943,7 +944,7 @@ Function28682:
|
||||
jr nz, .loop
|
||||
ret
|
||||
|
||||
Function2868a:
|
||||
Link_ConvertPartyStruct1to2:
|
||||
push hl
|
||||
ld d, h
|
||||
ld e, l
|
||||
@ -1247,7 +1248,7 @@ LinkTradeOTPartymonMenuLoop:
|
||||
.not_d_up
|
||||
bit D_DOWN_F, a
|
||||
jp z, LinkTradePartiesMenuMasterLoop
|
||||
jp Function28ac9
|
||||
jp LinkTradeCheckCancel
|
||||
|
||||
LinkTrade_PlayerPartyMenu:
|
||||
farcall InitMG_Mobile_LinkTradePalMap
|
||||
@ -1283,7 +1284,7 @@ LinkTradePartymonMenuLoop:
|
||||
.check_joypad
|
||||
bit A_BUTTON_F, a
|
||||
jr z, .not_a_button
|
||||
jp Function28926
|
||||
jp LinkTrade_TradeStatsMenu
|
||||
|
||||
.not_a_button
|
||||
bit D_DOWN_F, a
|
||||
@ -1329,7 +1330,7 @@ LinkTradePartiesMenuMasterLoop:
|
||||
jp z, LinkTradePartymonMenuLoop ; PARTYMON
|
||||
jp LinkTradeOTPartymonMenuLoop ; OTPARTYMON
|
||||
|
||||
Function28926:
|
||||
LinkTrade_TradeStatsMenu:
|
||||
call LoadTilemapToTempTilemap
|
||||
ld a, [wMenuCursorY]
|
||||
push af
|
||||
@ -1427,12 +1428,12 @@ Function28926:
|
||||
dec a
|
||||
ld [wCurTradePartyMon], a
|
||||
ld [wPlayerLinkAction], a
|
||||
farcall Function16d6ce
|
||||
farcall PrintWaitingTextAndSyncAndExchangeNybble
|
||||
ld a, [wOtherPlayerLinkMode]
|
||||
cp $f
|
||||
jp z, InitTradeMenuDisplay
|
||||
ld [wCurOTTradePartyMon], a
|
||||
call Function28b68
|
||||
call LinkTradePlaceArrow
|
||||
ld c, 100
|
||||
call DelayFrames
|
||||
farcall ValidateOTTrademon
|
||||
@ -1483,7 +1484,7 @@ Function28926:
|
||||
call PlaceString
|
||||
ld a, $1
|
||||
ld [wPlayerLinkAction], a
|
||||
farcall Function16d6ce
|
||||
farcall PrintWaitingTextAndSyncAndExchangeNybble
|
||||
ld c, 100
|
||||
call DelayFrames
|
||||
jp InitTradeMenuDisplay
|
||||
@ -1499,7 +1500,7 @@ Function28926:
|
||||
text_far _LinkAbnormalMonText
|
||||
text_end
|
||||
|
||||
Function28ac9:
|
||||
LinkTradeCheckCancel:
|
||||
ld a, [wMenuCursorY]
|
||||
cp 1
|
||||
jp nz, LinkTradePartiesMenuMasterLoop
|
||||
@ -1542,18 +1543,18 @@ Function28ade:
|
||||
ldcoord_a 9, 17
|
||||
ld a, $f
|
||||
ld [wPlayerLinkAction], a
|
||||
farcall Function16d6ce
|
||||
farcall PrintWaitingTextAndSyncAndExchangeNybble
|
||||
ld a, [wOtherPlayerLinkMode]
|
||||
cp $f
|
||||
jr nz, .loop1
|
||||
Function28b22:
|
||||
ExitLinkCommunications:
|
||||
call RotateThreePalettesRight
|
||||
call ClearScreen
|
||||
ld b, SCGB_DIPLOMA
|
||||
call GetSGBLayout
|
||||
call WaitBGMap2
|
||||
xor a
|
||||
ld [wcfbb], a
|
||||
ld [wUnusedLinkCommunicationByte], a
|
||||
xor a
|
||||
ldh [rSB], a
|
||||
ldh [hSerialSend], a
|
||||
@ -1563,15 +1564,18 @@ Function28b22:
|
||||
ldh [rSC], a
|
||||
ret
|
||||
|
||||
Function28b42: ; unreferenced
|
||||
GSPlaceTradeScreenFooter: ; unreferenced
|
||||
; Fill the screen footer with pattern tile
|
||||
hlcoord 0, 16
|
||||
ld a, "┘"
|
||||
ld a, $7e
|
||||
ld bc, 2 * SCREEN_WIDTH
|
||||
call ByteFill
|
||||
; Clear out area for cancel string
|
||||
hlcoord 1, 16
|
||||
ld a, " "
|
||||
ld bc, SCREEN_WIDTH - 2
|
||||
call ByteFill
|
||||
; Place the string
|
||||
hlcoord 2, 16
|
||||
ld de, .CancelString
|
||||
jp PlaceString
|
||||
@ -1579,7 +1583,8 @@ Function28b42: ; unreferenced
|
||||
.CancelString:
|
||||
db "CANCEL@"
|
||||
|
||||
Function28b68:
|
||||
LinkTradePlaceArrow:
|
||||
; Indicates which pokemon the other player has selected to trade
|
||||
ld a, [wOtherPlayerLinkMode]
|
||||
hlcoord 6, 9
|
||||
ld bc, SCREEN_WIDTH
|
||||
@ -1640,7 +1645,7 @@ LinkTrade:
|
||||
ld b, 3
|
||||
ld c, 7
|
||||
call LinkTextboxAtHL
|
||||
ld de, String28eab
|
||||
ld de, String_TradeCancel
|
||||
hlcoord 12, 8
|
||||
call PlaceString
|
||||
ld a, 8
|
||||
@ -1668,12 +1673,12 @@ LinkTrade:
|
||||
call WaitBGMap2
|
||||
pop af
|
||||
bit 1, a
|
||||
jr nz, .asm_28c33
|
||||
jr nz, .canceled
|
||||
ld a, [wMenuCursorY]
|
||||
dec a
|
||||
jr z, .asm_28c54
|
||||
jr z, .try_trade
|
||||
|
||||
.asm_28c33
|
||||
.canceled
|
||||
ld a, $1
|
||||
ld [wPlayerLinkAction], a
|
||||
hlcoord 0, 12
|
||||
@ -1683,16 +1688,17 @@ LinkTrade:
|
||||
hlcoord 1, 14
|
||||
ld de, String_TooBadTheTradeWasCanceled
|
||||
call PlaceString
|
||||
farcall Function16d6ce
|
||||
jp Function28ea3
|
||||
farcall PrintWaitingTextAndSyncAndExchangeNybble
|
||||
jp InitTradeMenuDisplay_Delay
|
||||
|
||||
.asm_28c54
|
||||
.try_trade
|
||||
ld a, $2
|
||||
ld [wPlayerLinkAction], a
|
||||
farcall Function16d6ce
|
||||
farcall PrintWaitingTextAndSyncAndExchangeNybble
|
||||
ld a, [wOtherPlayerLinkMode]
|
||||
dec a
|
||||
jr nz, .asm_28c7b
|
||||
jr nz, .do_trade
|
||||
; If we're here, the other player canceled the trade
|
||||
hlcoord 0, 12
|
||||
ld b, 4
|
||||
ld c, 18
|
||||
@ -1700,9 +1706,9 @@ LinkTrade:
|
||||
hlcoord 1, 14
|
||||
ld de, String_TooBadTheTradeWasCanceled
|
||||
call PlaceString
|
||||
jp Function28ea3
|
||||
jp InitTradeMenuDisplay_Delay
|
||||
|
||||
.asm_28c7b
|
||||
.do_trade
|
||||
ld hl, sPartyMail
|
||||
ld a, [wCurTradePartyMon]
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
@ -1715,18 +1721,18 @@ LinkTrade:
|
||||
add hl, bc
|
||||
ld a, [wCurTradePartyMon]
|
||||
ld c, a
|
||||
.asm_28c96
|
||||
.copy_mail
|
||||
inc c
|
||||
ld a, c
|
||||
cp PARTY_LENGTH
|
||||
jr z, .asm_28ca6
|
||||
jr z, .copy_player_data
|
||||
push bc
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
call CopyBytes
|
||||
pop bc
|
||||
jr .asm_28c96
|
||||
jr .copy_mail
|
||||
|
||||
.asm_28ca6
|
||||
.copy_player_data
|
||||
ld hl, sPartyMail
|
||||
ld a, [wPartyCount]
|
||||
dec a
|
||||
@ -1741,10 +1747,14 @@ LinkTrade:
|
||||
ld bc, MAIL_STRUCT_LENGTH
|
||||
call CopyBytes
|
||||
call CloseSRAM
|
||||
|
||||
; Buffer player data
|
||||
; nickname
|
||||
ld hl, wPlayerName
|
||||
ld de, wPlayerTrademonSenderName
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
; species
|
||||
ld a, [wCurTradePartyMon]
|
||||
ld hl, wPartySpecies
|
||||
ld b, 0
|
||||
@ -1753,12 +1763,14 @@ LinkTrade:
|
||||
ld a, [hl]
|
||||
ld [wPlayerTrademonSpecies], a
|
||||
push af
|
||||
; OT name
|
||||
ld a, [wCurTradePartyMon]
|
||||
ld hl, wPartyMonOT
|
||||
call SkipNames
|
||||
ld de, wPlayerTrademonOTName
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
; ID
|
||||
ld hl, wPartyMon1ID
|
||||
ld a, [wCurTradePartyMon]
|
||||
call GetPartyLocation
|
||||
@ -1766,6 +1778,7 @@ LinkTrade:
|
||||
ld [wPlayerTrademonID], a
|
||||
ld a, [hl]
|
||||
ld [wPlayerTrademonID + 1], a
|
||||
; DVs
|
||||
ld hl, wPartyMon1DVs
|
||||
ld a, [wCurTradePartyMon]
|
||||
call GetPartyLocation
|
||||
@ -1773,6 +1786,7 @@ LinkTrade:
|
||||
ld [wPlayerTrademonDVs], a
|
||||
ld a, [hl]
|
||||
ld [wPlayerTrademonDVs + 1], a
|
||||
; caught data
|
||||
ld a, [wCurTradePartyMon]
|
||||
ld hl, wPartyMon1Species
|
||||
call GetPartyLocation
|
||||
@ -1781,10 +1795,14 @@ LinkTrade:
|
||||
farcall GetCaughtGender
|
||||
ld a, c
|
||||
ld [wPlayerTrademonCaughtData], a
|
||||
|
||||
; Buffer other player data
|
||||
; nickname
|
||||
ld hl, wOTPlayerName
|
||||
ld de, wOTTrademonSenderName
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
; species
|
||||
ld a, [wCurOTTradePartyMon]
|
||||
ld hl, wOTPartySpecies
|
||||
ld b, 0
|
||||
@ -1792,12 +1810,14 @@ LinkTrade:
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wOTTrademonSpecies], a
|
||||
; OT name
|
||||
ld a, [wCurOTTradePartyMon]
|
||||
ld hl, wOTPartyMonOT
|
||||
call SkipNames
|
||||
ld de, wOTTrademonOTName
|
||||
ld bc, NAME_LENGTH
|
||||
call CopyBytes
|
||||
; ID
|
||||
ld hl, wOTPartyMon1ID
|
||||
ld a, [wCurOTTradePartyMon]
|
||||
call GetPartyLocation
|
||||
@ -1805,6 +1825,7 @@ LinkTrade:
|
||||
ld [wOTTrademonID], a
|
||||
ld a, [hl]
|
||||
ld [wOTTrademonID + 1], a
|
||||
; DVs
|
||||
ld hl, wOTPartyMon1DVs
|
||||
ld a, [wCurOTTradePartyMon]
|
||||
call GetPartyLocation
|
||||
@ -1812,6 +1833,7 @@ LinkTrade:
|
||||
ld [wOTTrademonDVs], a
|
||||
ld a, [hl]
|
||||
ld [wOTTrademonDVs + 1], a
|
||||
; caught data
|
||||
ld a, [wCurOTTradePartyMon]
|
||||
ld hl, wOTPartyMon1Species
|
||||
call GetPartyLocation
|
||||
@ -1820,6 +1842,7 @@ LinkTrade:
|
||||
farcall GetCaughtGender
|
||||
ld a, c
|
||||
ld [wOTTrademonCaughtData], a
|
||||
|
||||
ld a, [wCurTradePartyMon]
|
||||
ld [wCurPartyMon], a
|
||||
ld hl, wPartySpecies
|
||||
@ -1828,6 +1851,7 @@ LinkTrade:
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wCurTradePartyMon], a
|
||||
|
||||
xor a ; REMOVE_PARTY
|
||||
ld [wPokemonWithdrawDepositParameter], a
|
||||
callfar RemoveMonFromPartyOrBox
|
||||
@ -1844,6 +1868,7 @@ LinkTrade:
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
ld [wCurOTTradePartyMon], a
|
||||
|
||||
ld c, 100
|
||||
call DelayFrames
|
||||
call ClearTilemap
|
||||
@ -1935,7 +1960,7 @@ LinkTrade:
|
||||
ld c, 18
|
||||
call LinkTextboxAtHL
|
||||
hlcoord 1, 14
|
||||
ld de, String28ebd
|
||||
ld de, String_TradeCompleted
|
||||
call PlaceString
|
||||
farcall Link_WaitBGMap
|
||||
ld c, 50
|
||||
@ -1945,12 +1970,12 @@ LinkTrade:
|
||||
jp z, Gen2ToGen1LinkComms
|
||||
jp Gen2ToGen2LinkComms
|
||||
|
||||
Function28ea3:
|
||||
InitTradeMenuDisplay_Delay:
|
||||
ld c, 100
|
||||
call DelayFrames
|
||||
jp InitTradeMenuDisplay
|
||||
|
||||
String28eab:
|
||||
String_TradeCancel:
|
||||
db "TRADE"
|
||||
next "CANCEL@"
|
||||
|
||||
@ -1958,7 +1983,7 @@ LinkAskTradeForText:
|
||||
text_far _LinkAskTradeForText
|
||||
text_end
|
||||
|
||||
String28ebd:
|
||||
String_TradeCompleted:
|
||||
db "Trade completed!@"
|
||||
|
||||
String_TooBadTheTradeWasCanceled:
|
||||
|
@ -153,15 +153,15 @@ LinkTextbox:
|
||||
call _LinkTextbox
|
||||
ret
|
||||
|
||||
Function16d6ce:
|
||||
PrintWaitingTextAndSyncAndExchangeNybble:
|
||||
call LoadStandardMenuHeader
|
||||
call Function16d6e1
|
||||
call .PrintWaitingText
|
||||
farcall WaitLinkTransfer
|
||||
call Call_ExitMenu
|
||||
call WaitBGMap2
|
||||
ret
|
||||
|
||||
Function16d6e1:
|
||||
.PrintWaitingText:
|
||||
hlcoord 4, 10
|
||||
ld b, 1
|
||||
ld c, 10
|
||||
|
Loading…
Reference in New Issue
Block a user