summaryrefslogtreecommitdiff
path: root/engine/overworld/cable_club_npc.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld/cable_club_npc.asm')
-rwxr-xr-xengine/overworld/cable_club_npc.asm34
1 files changed, 14 insertions, 20 deletions
diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm
index bdab41a6..a2feba06 100755
--- a/engine/overworld/cable_club_npc.asm
+++ b/engine/overworld/cable_club_npc.asm
@@ -1,15 +1,14 @@
CableClubNPC: ; 71c5 (1:71c5)
ld hl, CableClubNPCWelcomeText
call PrintText
- ld a, [wd74b]
- bit 5, a ; received pokedex?
+ CheckEvent EVENT_GOT_POKEDEX
jp nz, .receivedPokedex
; if the player hasn't received the pokedex
- ld c, $3c
+ ld c, 60
call DelayFrames
ld hl, CableClubNPCMakingPreparationsText
call PrintText
- jp Func_7298
+ jp .didNotConnect
.receivedPokedex
ld a, $1
ld [wMenuJoypadPollCount], a
@@ -57,7 +56,7 @@ CableClubNPC: ; 71c5 (1:71c5)
jr nz, .choseNo
callab SaveSAVtoSRAM
call WaitForSoundToFinish
- ld a, (SFX_02_5d - SFX_Headers_02) / 3
+ ld a, SFX_SAVE
call PlaySoundWaitForCurrent
ld hl, CableClubNPCPleaseWaitText
call PrintText
@@ -72,31 +71,29 @@ CableClubNPC: ; 71c5 (1:71c5)
ld hl, wUnknownSerialCounter
ld a, [hli]
inc a
- jr nz, Func_72a8 ; 0x726b $3b
+ jr nz, .connected
ld a, [hl]
inc a
- jr nz, Func_72a8 ; 0x726f $37
- ld b, $a
-.asm_7273
+ jr nz, .connected
+ ld b, 10
+.syncLoop
call DelayFrame
call Serial_SendZeroByte
dec b
- jr nz, .asm_7273 ; 0x727a $f7
+ jr nz, .syncLoop
call CloseLinkConnection
ld hl, CableClubNPCLinkClosedBecauseOfInactivityText
call PrintText
- jr Func_7298 ; 0x7285 $11
+ jr .didNotConnect
.failedToEstablishConnection
ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText
call PrintText
- jr Func_7298 ; 0x728d $9
+ jr .didNotConnect
.choseNo
call CloseLinkConnection
ld hl, CableClubNPCPleaseComeAgainText
call PrintText
- ; fall through
-
-Func_7298: ; 7298 (1:7298)
+.didNotConnect
xor a
ld hl, wUnknownSerialCounter
ld [hli], a
@@ -106,14 +103,11 @@ Func_7298: ; 7298 (1:7298)
xor a
ld [wMenuJoypadPollCount], a
ret
-
-Func_72a8: ; 72a8 (1:72a8)
+.connected
xor a
ld [hld], a
ld [hl], a
- ld hl, LinkMenu
- ld b, BANK(LinkMenu)
- jp Bankswitch
+ jpab LinkMenu
CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 72b3 (1:72b3)
TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText