Improved Virtual Console patch identifiers (#907)

This commit is contained in:
vulcandth
2022-06-06 16:22:48 -05:00
committed by GitHub
parent c3bf7fd0bd
commit a4d346cc8c
14 changed files with 110 additions and 108 deletions

View File

@@ -67,7 +67,7 @@ Gen2ToGen1LinkComms:
.player_1
ld de, MUSIC_NONE
call PlayMusic
vc_patch NetworkDelay1
vc_patch Wireless_net_delay_5
if DEF(_CRYSTAL11_VC)
ld c, 26
else
@@ -83,7 +83,7 @@ endc
ld hl, wLinkBattleRNPreamble
ld de, wEnemyMon
ld bc, SERIAL_RN_PREAMBLE_LENGTH + SERIAL_RNS_LENGTH
vc_hook Network358
vc_hook Wireless_ExchangeBytes_1
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a
@@ -91,7 +91,7 @@ endc
ld hl, wLinkData
ld de, wOTPartyData
ld bc, SERIAL_PREAMBLE_LENGTH + NAME_LENGTH + 1 + PARTY_LENGTH + 1 + (REDMON_STRUCT_LENGTH + NAME_LENGTH * 2) * PARTY_LENGTH + 3
vc_hook Network359
vc_hook Wireless_ExchangeBytes_2
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a
@@ -99,7 +99,7 @@ endc
ld hl, wPlayerPatchLists
ld de, wOTPatchLists
ld bc, 200
vc_hook Network364
vc_hook Wireless_ExchangeBytes_3_Gen2toGen1Fix
call Serial_ExchangeBytes
xor a
@@ -233,7 +233,7 @@ Gen2ToGen2LinkComms:
.player_1
ld de, MUSIC_NONE
call PlayMusic
vc_patch NetworkDelay4
vc_patch Wireless_net_delay_8
if DEF(_CRYSTAL11_VC)
ld c, 26
else
@@ -249,7 +249,7 @@ endc
ld hl, wLinkBattleRNPreamble
ld de, wEnemyMon
ld bc, SERIAL_RN_PREAMBLE_LENGTH + SERIAL_RNS_LENGTH
vc_hook Network360
vc_hook Wireless_ExchangeBytes_4
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a
@@ -257,7 +257,7 @@ endc
ld hl, wLinkData
ld de, wOTPartyData
ld bc, SERIAL_PREAMBLE_LENGTH + NAME_LENGTH + 1 + PARTY_LENGTH + 1 + 2 + (PARTYMON_STRUCT_LENGTH + NAME_LENGTH * 2) * PARTY_LENGTH + 3
vc_hook Network361
vc_hook Wireless_ExchangeBytes_5
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a
@@ -265,7 +265,7 @@ endc
ld hl, wPlayerPatchLists
ld de, wOTPatchLists
ld bc, 200
vc_hook Network362
vc_hook Wireless_ExchangeBytes_6
call Serial_ExchangeBytes
ld a, [wLinkMode]
@@ -274,7 +274,7 @@ endc
ld hl, wLinkPlayerMail
ld de, wLinkOTMail
ld bc, wLinkPlayerMailEnd - wLinkPlayerMail
vc_hook Network363
vc_hook Wireless_ExchangeBytes_7
call ExchangeBytes
.not_trading
@@ -1627,7 +1627,7 @@ ExitLinkCommunications:
ldh [rSC], a
ld a, (1 << rSC_ON) | (1 << rSC_CLOCK)
ldh [rSC], a
vc_hook ret_heya
vc_hook ExitLinkCommunications_ret
ret
GSPlaceTradeScreenFooter: ; unreferenced
@@ -2029,7 +2029,7 @@ LinkTrade:
ld de, String_TradeCompleted
call PlaceString
farcall Link_WaitBGMap
vc_hook save_game_end
vc_hook Trade_save_game_end
ld c, 50
call DelayFrames
ld a, [wLinkMode]
@@ -2182,7 +2182,7 @@ GetIncompatibleMonName:
ret
EnterTimeCapsule:
vc_patch NetworkDelay2
vc_patch Wireless_net_delay_6
if DEF(_CRYSTAL11_VC)
ld c, 26
else
@@ -2245,7 +2245,7 @@ WaitForOtherPlayerToExit:
ld [hl], a
ldh [hVBlank], a
ld [wLinkMode], a
vc_hook term_exit
vc_hook Wireless_term_exit
ret
SetBitsForLinkTradeRequest:
@@ -2314,7 +2314,7 @@ WaitForLinkedFriend:
; USING_INTERNAL_CLOCK, which allows the player to proceed past the link
; receptionist's "Please wait." It assumes that hSerialConnectionStatus is at
; its original address.
vc_hook linkCable_fake_begin
vc_hook Link_fake_connection_status
vc_assert hSerialConnectionStatus == $ffcb, \
"hSerialConnectionStatus is no longer located at 00:ffcb."
vc_assert USING_INTERNAL_CLOCK == $02, \
@@ -2411,7 +2411,7 @@ CheckLinkTimeout_Gen2:
ld a, $6
ld [wPlayerLinkAction], a
ld hl, wLinkTimeoutFrames
vc_patch NetworkDelay6
vc_patch Wireless_net_delay_9
if DEF(_CRYSTAL11_VC)
ld a, $3
else
@@ -2438,7 +2438,7 @@ endc
Link_CheckCommunicationError:
xor a
ldh [hSerialReceivedNewData], a
vc_hook linkCable_fake_end
vc_hook Wireless_prompt
ld a, [wLinkTimeoutFrames]
ld h, a
ld a, [wLinkTimeoutFrames + 1]
@@ -2469,7 +2469,7 @@ Link_CheckCommunicationError:
.CheckConnected:
call WaitLinkTransfer
ld hl, wLinkTimeoutFrames
vc_hook Network_RECHECK
vc_hook Wireless_net_recheck
ld a, [hli]
inc a
ret nz
@@ -2478,7 +2478,7 @@ Link_CheckCommunicationError:
ret
.AcknowledgeSerial:
vc_patch NetworkDelay3
vc_patch Wireless_net_delay_7
if DEF(_CRYSTAL11_VC)
ld b, 26
else
@@ -2511,10 +2511,10 @@ TryQuickSave:
ld a, [wChosenCableClubRoom]
push af
farcall Link_SaveGame
vc_hook linkCable_block_input
vc_hook Wireless_TryQuickSave_block_input_1
ld a, TRUE
jr nc, .return_result
vc_hook linkCable_block_input2
vc_hook Wireless_TryQuickSave_block_input_2
xor a ; FALSE
.return_result
ld [wScriptVar], a
@@ -2551,7 +2551,7 @@ CheckBothSelectedSameRoom:
ret
TimeCapsule:
vc_hook to_play2_mons1
vc_hook Wireless_TimeCapsule
ld a, LINK_TIMECAPSULE
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2562,7 +2562,7 @@ TimeCapsule:
ret
TradeCenter:
vc_hook to_play2_trade
vc_hook Wireless_TradeCenter
ld a, LINK_TRADECENTER
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2573,7 +2573,7 @@ TradeCenter:
ret
Colosseum:
vc_hook to_play2_battle
vc_hook Wireless_Colosseum
ld a, LINK_COLOSSEUM
ld [wLinkMode], a
call DisableSpriteUpdates
@@ -2588,7 +2588,7 @@ CloseLink:
ld [wLinkMode], a
ld c, 3
call DelayFrames
vc_hook room_check
vc_hook Wireless_room_check
jp Link_ResetSerialRegistersAfterLinkClosure
FailedLinkToPast:

View File

@@ -37,7 +37,7 @@ DoMysteryGift:
; Prepare the first of two messages for wMysteryGiftPartnerData
farcall StageDataForMysteryGift
call ClearMysteryGiftTrainer
vc_patch infrared_fake_0
vc_patch Infrared_stage_party_data
if DEF(_CRYSTAL11_VC)
farcall StagePartyDataForMysteryGift
call ClearMysteryGiftTrainer
@@ -53,7 +53,7 @@ endc
ldh a, [rIE]
push af
call ExchangeMysteryGiftData
vc_hook infrared_fake_4
vc_hook Infrared_ExchangeMysteryGiftData_end
ld d, a
xor a
ldh [rIF], a
@@ -269,8 +269,8 @@ endc
jp CloseSRAM
ExchangeMysteryGiftData:
vc_hook infrared_fake_2
vc_patch infrared_fake_1
vc_hook Infrared_ExchangeMysteryGiftData_start
vc_patch Infrared_ExchangeMysteryGiftData_function
if DEF(_CRYSTAL11_VC)
ld d, $ef
.loop
@@ -278,7 +278,7 @@ if DEF(_CRYSTAL11_VC)
ld a, d
or a
jr nz, .loop
vc_hook infrared_fake_3
vc_hook Infrared_ExchangeMysteryGiftData_loop_done
nop
cp MG_CANCELED
.restart ; same location as unpatched .restart