[Sonic Lost World] Load Link Sonic in World Map

Co-authored-by: DeaTh-G <55578911+DeaTh-G@users.noreply.github.com>
This commit is contained in:
M&M 2021-04-24 10:20:44 -07:00
parent 3b536a20ad
commit c3d3735d13
2 changed files with 69 additions and 2 deletions

View File

@ -1,6 +1,8 @@
[sonic2013_v48] [sonic2013_v48]
moduleMatches = 0xC5691A40 moduleMatches = 0xC5691A40
; load Linksonic in Stage
; load Linksonic on top of Sonic ; load Linksonic on top of Sonic
0x02A60414 = nop 0x02A60414 = nop
0x02A53680 = nop 0x02A53680 = nop
@ -11,4 +13,69 @@ moduleMatches = 0xC5691A40
; load chr_Linksonic shadow model instead of chr_Sonic shadow model ; load chr_Linksonic shadow model instead of chr_Sonic shadow model
0x02A607F8 = nop 0x02A607F8 = nop
0x02A60830 = blr
; load Linksonic in WorldAreaMap
0x026D285C = GetPackFile:
0x026D28E4 = GetModelResource:
0x026D2C40 = GetSkeletonResource:
0x101AC668 = LinksonicPacLoad:
0x101AC678 = LinksonicPacInit:
0x101AC688 = chrLinkSonic:
.origin = codecave
; app::WorldAreaMapInfo::Load
_linkSonicLoad:
lwz r12, 0(r31)
lwz r0, 0xC(r12)
lis r4, LinksonicPacLoad@ha
mtctr r0
addi r4, r4, LinksonicPacLoad@l
li r5, 0x4001
mr r3, r31
bctrl
; return to original code
lwz r12, 0(r31)
b 0x02B0FD04
; app::WorldAreaMapInfo::Initialize
_linkSonicInit:
; app::ObjUtil::GetPackFile
lis r4, LinksonicPacInit@ha
addi r3, r1, 0x14
addi r4, r4, LinksonicPacInit@l
bl GetPackFile
; app::ObjUtil::GetModelResource
lis r31, chrLinkSonic@ha
addi r3, r1, 0x40
addi r5, r1, 0x14
addi r4, r31, chrLinkSonic@l
bl GetModelResource
lwz r0, 0x40(r1)
addi r4, r1, 0x14
addi r3, r1, 0x20
stw r0, 0x10(r30)
bl 0x036924C8 ; hh::ut::Packfile::Packfile
; app::ObjUtil::GetSkeletonResource
mr r5, r3
addi r3, r1, 0x44
addi r4, r31, chrLinkSonic@l
bl GetSkeletonResource
; return to original code
lmw r23, 0x134(r1)
b 0x02B10D74
0x02B0FD00 = b _linkSonicLoad
0x02B10D70 = b _linkSonicInit

View File

@ -2,5 +2,5 @@
titleIds = 0005000010135700,000500001012B100,0005000010128F00 titleIds = 0005000010135700,000500001012B100,0005000010128F00
name = Link Sonic Everywhere name = Link Sonic Everywhere
path = "Sonic Lost World/Mods/Link Sonic Everywhere" path = "Sonic Lost World/Mods/Link Sonic Everywhere"
description = Allows you to play as Link Sonic from the Zelda DLC in every stage.|Requires the 'The Legend of Zelda Zone' DLC to be installed.||Made by DeaTh and M&&M. description = Allows you to play as Link Sonic from The Legend of Zelda Zone in every stage.|Requires the 'The Legend of Zelda Zone' DLC to be installed.||Made by DeaTh and M&&M.
version = 6 version = 6