Skip to content

Commit

Permalink
Support Building Virtual Console Patches #2
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcandth committed Jun 20, 2022
1 parent ff899b5 commit ed96c74
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
7 changes: 4 additions & 3 deletions engine/link/link.asm
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,20 @@ endc
ld hl, wOTPartyMons
ld de, wStringBuffer1
ld bc, 2 * PARTY_LENGTH + 15 ;6 preamble bytes, 2 replacement bytes, 1 stop byte, and 6 extra just in case
vc_hook Wireless_ExchangeBytes_5
call Serial_ExchangeBytes
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 Wireless_ExchangeBytes_5
vc_hook Wireless_ExchangeBytes_6
call Serial_ExchangeBytes
ld a, SERIAL_NO_DATA_BYTE
ld [de], a

ld hl, wPlayerPatchLists
ld de, wOTPatchLists
ld bc, 200
vc_hook Wireless_ExchangeBytes_6
vc_hook Wireless_ExchangeBytes_7
call Serial_ExchangeBytes

ld a, [wLinkMode]
Expand All @@ -280,7 +281,7 @@ endc
ld hl, wLinkPlayerMail
ld de, wLinkOTMail
ld bc, wLinkPlayerMailEnd - wLinkPlayerMail
vc_hook Wireless_ExchangeBytes_7
vc_hook Wireless_ExchangeBytes_8
call ExchangeBytes

.not_trading
Expand Down
11 changes: 0 additions & 11 deletions engine/menus/save.asm
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,6 @@ AddHallOfFameEntry:
ld bc, HOF_LENGTH
call CopyBytes
call CloseSRAM
; This vc_hook causes the Virtual Console to set [sMobileEventIndex] and [sMobileEventIndexBackup]
; to MOBILE_EVENT_OBJECT_GS_BALL, which enables you to get the GS Ball, take it to Kurt, and
; encounter Celebi. It assumes that sMobileEventIndex and sMobileEventIndexBackup are at their
; original addresses.
vc_hook Enable_GS_Ball_mobile_event
vc_assert BANK(sMobileEventIndex) == $1 && sMobileEventIndex == $be3c, \
"sMobileEventIndex is no longer located at 01:be3c."
vc_assert BANK(sMobileEventIndexBackup) == $1 && sMobileEventIndexBackup == $be44, \
"sMobileEventIndexBackup is no longer located at 01:be44."
vc_assert MOBILE_EVENT_OBJECT_GS_BALL == $0b, \
"MOBILE_EVENT_OBJECT_GS_BALL is no longer equal to $0b."
ret

AskOverwriteSaveFile:
Expand Down
15 changes: 8 additions & 7 deletions vc/pokecrystal.patch.template
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,22 @@ Mode = 2
Address = {HEX @}
Type = 4

[Network361@Wireless_ExchangeBytes_5]
[Wireless_ExchangeBytes_5]
Mode = 2
Address = {HEX @}
Type = 4

[Network362@Wireless_ExchangeBytes_6]
[Network361@Wireless_ExchangeBytes_6]
Mode = 2
Address = {HEX @}
Type = 4

[Network363@Wireless_ExchangeBytes_7]
[Network362@Wireless_ExchangeBytes_7]
Mode = 2
Address = {HEX @}
Type = 4

[Network363@Wireless_ExchangeBytes_8]
Mode = 2
Address = {HEX @}
Type = 4
Expand Down Expand Up @@ -235,10 +240,6 @@ Address = {HEx @}
Fixcode={db SCREEN_HEIGHT_PX}

;12 1b 0b 79 b0 find next C9
[BiographySave_ret@Enable_GS_Ball_mobile_event]
Mode = 2
Address = {HEX @}
Type = 60


; print forbid 1
Expand Down

0 comments on commit ed96c74

Please sign in to comment.