aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle/core.asm
diff options
context:
space:
mode:
authorvulcandth <vulcandth@gmail.com>2022-03-26 21:05:06 -0500
committerGitHub <noreply@github.com>2022-03-26 22:05:06 -0400
commitfbaa5c9d4b48c000a52860a8392fc423c4e312f9 (patch)
tree80c5d8b0458ab6a2c2f1995ed0addd1f6cb5570f /engine/battle/core.asm
parentRefactor pkmncompress.c to use common.h (diff)
downloadpokeyellow-fbaa5c9d4b48c000a52860a8392fc423c4e312f9.tar.gz
pokeyellow-fbaa5c9d4b48c000a52860a8392fc423c4e312f9.tar.xz
pokeyellow-fbaa5c9d4b48c000a52860a8392fc423c4e312f9.zip
Build the Virtual Console patch with `make yellow_vc` (#80)
Diffstat (limited to 'engine/battle/core.asm')
-rw-r--r--engine/battle/core.asm23
1 files changed, 23 insertions, 0 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index fa1a8d56..e8624289 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -3192,6 +3192,7 @@ LinkBattleExchangeData:
ld a, b
.doExchange
ld [wSerialExchangeNybbleSendData], a
+ vc_hook send_byt2
callfar PrintWaitingText
.syncLoop1
call Serial_ExchangeNybble
@@ -3199,18 +3200,33 @@ LinkBattleExchangeData:
ld a, [wSerialExchangeNybbleReceiveData]
inc a
jr z, .syncLoop1
+ vc_hook send_byt2_ret
+ vc_patch FIGHT
+IF DEF(_YELLOW_VC)
+ ld b, 26
+ELSE
ld b, 10
+ENDC
+ vc_patch_end
.syncLoop2
call DelayFrame
call Serial_ExchangeNybble
dec b
jr nz, .syncLoop2
+ vc_hook send_dummy
+ vc_patch FIGHT2
+IF DEF(_YELLOW_VC)
+ ld b, 26
+ELSE
ld b, 10
+ENDC
+ vc_patch_end
.syncLoop3
call DelayFrame
call Serial_SendZeroByte
dec b
jr nz, .syncLoop3
+ vc_hook send_dummy_end
ret
ExecutePlayerMove:
@@ -6844,7 +6860,14 @@ BattleRandom:
ld a, [hl]
pop bc
pop hl
+ vc_hook fight_ret_c
+ vc_patch fight_ret
+IF DEF(_YELLOW_VC)
+ ret
+ELSE
ret c
+ENDC
+ vc_patch_end
; if we picked the last seed, we need to recalculate the nine seeds
push hl