mirror of https://github.com/pret/pokecrystal.git
parent
3c3d87e765
commit
4401d24074
|
@ -2554,20 +2554,20 @@ Link_ResetSerialRegistersAfterLinkClosure:
|
||||||
|
|
||||||
Link_EnsureSync:
|
Link_EnsureSync:
|
||||||
add $d0
|
add $d0
|
||||||
ld [wPlayerLinkAction], a
|
ld [wLinkPlayerSyncBuffer], a
|
||||||
ld [wUnusedLinkAction], a
|
ld [wLinkPlayerSyncBuffer + 1], a
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ldh [hVBlank], a
|
ldh [hVBlank], a
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
call DelayFrame
|
call DelayFrame
|
||||||
.receive_loop
|
.receive_loop
|
||||||
call Serial_ExchangeLinkMenuSelection
|
call Serial_ExchangeSyncBytes
|
||||||
ld a, [wOtherPlayerLinkMode]
|
ld a, [wLinkReceivedSyncBuffer]
|
||||||
ld b, a
|
ld b, a
|
||||||
and $f0
|
and $f0
|
||||||
cp $d0
|
cp $d0
|
||||||
jr z, .done
|
jr z, .done
|
||||||
ld a, [wOtherPlayerLinkAction]
|
ld a, [wLinkReceivedSyncBuffer + 1]
|
||||||
ld b, a
|
ld b, a
|
||||||
and $f0
|
and $f0
|
||||||
cp $d0
|
cp $d0
|
||||||
|
|
|
@ -252,11 +252,10 @@ SerialDisconnected::
|
||||||
ld [wLinkTimeoutFrames + 1], a
|
ld [wLinkTimeoutFrames + 1], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; This is used to exchange the button press and selected menu item on the link menu.
|
; This is used to check that both players entered the same Cable Club room.
|
||||||
; The data is sent thrice and read twice to increase reliability.
|
Serial_ExchangeSyncBytes::
|
||||||
Serial_ExchangeLinkMenuSelection::
|
ld hl, wLinkPlayerSyncBuffer
|
||||||
ld hl, wPlayerLinkAction
|
ld de, wLinkReceivedSyncBuffer
|
||||||
ld de, wOtherPlayerLinkMode
|
|
||||||
ld c, 2
|
ld c, 2
|
||||||
ld a, TRUE
|
ld a, TRUE
|
||||||
ldh [hSerialIgnoringInitialData], a
|
ldh [hSerialIgnoringInitialData], a
|
||||||
|
|
5
wram.asm
5
wram.asm
|
@ -1357,12 +1357,17 @@ wTileAnimBuffer:: ds 1 tiles
|
||||||
ENDU
|
ENDU
|
||||||
|
|
||||||
; link data
|
; link data
|
||||||
|
UNION
|
||||||
wOtherPlayerLinkMode:: db
|
wOtherPlayerLinkMode:: db
|
||||||
wOtherPlayerLinkAction:: db
|
wOtherPlayerLinkAction:: db
|
||||||
ds 3
|
ds 3
|
||||||
wPlayerLinkAction:: db
|
wPlayerLinkAction:: db
|
||||||
wUnusedLinkAction:: db
|
wUnusedLinkAction:: db
|
||||||
ds 3
|
ds 3
|
||||||
|
NEXTU
|
||||||
|
wLinkReceivedSyncBuffer:: ds 5
|
||||||
|
wLinkPlayerSyncBuffer:: ds 5
|
||||||
|
ENDU
|
||||||
wLinkTimeoutFrames:: dw
|
wLinkTimeoutFrames:: dw
|
||||||
wLinkByteTimeout:: dw
|
wLinkByteTimeout:: dw
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue