Kuribo64
Views: 19,988,767 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
04-18-24 02:16 PM
Guest:

0 users reading for you 3d world nerds | 1 bot

Main - WiiU game hacking and emulation - for you 3d world nerds Hide post layouts | New reply


shibboleet
Posted on 08-27-16 07:28 AM (rev. 3 of 08-27-16 08:06 AM) Link | #76537
a bit of nice information:

object list (parts of it) are at 0x10326550 in the US RPX. Each entry contains a pointer to the function that calls the constructor:

.text:022D07A0 BGMPlayObjCtorCall:
.text:022D07A0 mr r5, r3
.text:022D07A4 li r3, 0
.text:022D07A8 mr r4, r3
.text:022D07AC b BGMPlayObjCtor

Here's an example (parts) of a constructor:

.text:02167728 # ---------------------------------------------------------------------------
.text:02167728
.text:02167728 BGMPlayObjCtor: # CODE XREF: .text:022D07ACj
.text:02167728 mflr r0
.text:0216772C stwu r1, -0x18(r1)
.text:02167730 stw r31, 0x14(r1)
.text:02167734 mr. r31, r3
.text:02167738 stw r30, 0x10(r1)
.text:0216773C stw r28, 8(r1)
.text:02167740 mr r30, r5
.text:02167744 stw r29, 0xC(r1)
.text:02167748 stw r0, 0x1C(r1)
.text:0216774C mr r29, r4
.text:02167750 bne loc_2167764
.text:02167754 li r3, 0x94
.text:02167758 bl alloc_mem
.text:0216775C mr. r31, r3
.text:02167760 beq loc_21678A4
.text:02167764
.text:02167764 loc_2167764: # CODE XREF: .text:02167750j
.text:02167764 cmpwi r29, 0
.text:02167768 bne loc_2167814
.text:0216776C lis r7, unk_102E2CC8@h
.text:02167770 addi r4, r31, 0x90
.text:02167774 lis r28, off_102E2D20@h
.text:02167778 addi r7, r7, unk_102E2CC8@l
.text:0216777C mr r5, r30
.text:02167780 addi r28, r28, off_102E2D20@l
.text:02167784 stw r7, 0x90(r31)
.text:02167788 mr r3, r31
.text:0216778C stw r28, 0(r31)
.text:02167790 bl this_is_called_alot
.text:02167794 lis r9, unk_102E2E60@h
.text:02167798 lis r10, unk_102E2E70@h
.text:0216779C addi r9, r9, unk_102E2E60@l
.text:021677A0 addi r10, r10, unk_102E2E70@l
.text:021677A4 lis r8, BGMPlayObjVTable@h
.text:021677A8 stw r9, 4(r31)
.text:021677AC addi r8, r8, BGMPlayObjVTable@l
.text:021677B0 stw r10, 8(r31)
.text:021677B4 li r10, 0
.text:021677B8 stw r8, 0(r31)
.text:021677BC lwz r11, ((off_102E2D24-0x2D20)@l)(r28)
.text:021677C0 lis r0, unk_102E2EA8@h
.text:021677C4 stw r10, 0x88(r31)
.text:021677C8 addic r0, r0, unk_102E2EA8@l
.text:021677CC lis r7, unk_102E2EB8@h
.text:021677D0 stw r10, 0x80(r31)
.text:021677D4 addi r7, r7, unk_102E2EB8@l
.text:021677D8 stw r10, 0x8C(r31)
.text:021677DC lis r8, unk_102E2EC8@h
.text:021677E0 stw r0, 0x14(r31)
.text:021677E4 addi r8, r8, unk_102E2EC8@l
.text:021677E8 stw r7, 0x18(r31)
.text:021677EC lis r12, unk_102E2E90@h
.text:021677F0 stw r11, 0x90(r31)
.text:021677F4 addi r12, r12, unk_102E2E90@l
.text:021677F8 stw r8, 0x1C(r31)
.text:021677FC lis r0, unk_102E2ED8@h
.text:02167800 stw r10, 0x84(r31)
.text:02167804 addic r0, r0, unk_102E2ED8@l
.text:02167808 stw r12, 0xC(r31)
.text:0216780C stw r0, 0x20(r31)
.text:02167810 b loc_21678A4
.text:02167814 # ---------------------------------------------------------------------------

The VTable can be instantly found by looking for this instruction:
.text:021677B8 stw r8, 0(r31)

From what I've seen, I've always had that happen. It's called like this:
.text:021677A4 lis r8, BGMPlayObjVTable@h
.text:021677A8 stw r9, 4(r31)
.text:021677AC addi r8, r8, BGMPlayObjVTable@l

and inside of the vtables are a bunch of offsets that are a part of the object. If you press "d" 3 times on the 2nd entry you'll come up with some sort of init function:

.text:021678C8 # ---------------------------------------------------------------------------
.text:021678C8
.text:021678C8 BGMPlayObj_Init: # DATA XREF: .rodata:102E2D8Co
.text:021678C8 mflr r0
.text:021678CC stwu r1, -0x30(r1)
.text:021678D0 stw r30, 0x28(r1)
.text:021678D4 stw r31, 0x2C(r1)
.text:021678D8 mr r31, r4
.text:021678DC mr r30, r3
.text:021678E0 stw r29, 0x24(r1)
.text:021678E4 stw r0, 0x34(r1)
.text:021678E8 bl sub_23FC93C
.text:021678EC mr r3, r30
.text:021678F0 bl sub_23FCA5C
.text:021678F4 mr r4, r31
.text:021678F8 mr r3, r30
.text:021678FC bl sub_23FCB7C
.text:02167900 mr r4, r31
.text:02167904 addi r3, r30, 0xC
.text:02167908 bl sub_2446858
.text:0216790C mr r3, r30
.text:02167910 mr r4, r31
.text:02167914 bl sub_23FCA04
.text:02167918 li r29, 0
.text:0216791C mr r3, r30
.text:02167920 mr r4, r31
.text:02167924 mr r5, r29
.text:02167928 bl sub_23FD160
.text:0216792C mr r3, r30
.text:02167930 mr r4, r31
.text:02167934 bl sub_23FC1D0
.text:02167938 lis r5, aBgmplayname@h # "BgmPlayName"
.text:0216793C mr r4, r31
.text:02167940 addi r3, r30, 0x80
.text:02167944 addi r5, r5, aBgmplayname@l # "BgmPlayName"
.text:02167948 bl sub_248C4BC
.text:0216794C cmpwi r3, 0
.text:02167950 bne loc_2167960
.text:02167954 lis r0, aStage_7@h # "Stage"
.text:02167958 addic r0, r0, aStage_7@l # "Stage"
.text:0216795C stw r0, 0x80(r30)
.text:02167960
.text:02167960 loc_2167960: # CODE XREF: .text:02167950j
.text:02167960 lis r5, aStartdelayfram@h # "StartDelayFrameNum"
.text:02167964 mr r4, r31
.text:02167968 addi r5, r5, aStartdelayfram@l # "StartDelayFrameNum"
.text:0216796C addi r3, r30, 0x84
.text:02167970 bl sub_248C484
.text:02167974 cmpwi r3, 0
.text:02167978 bne loc_2167980
.text:0216797C stw r29, 0x84(r30)
.text:02167980
.text:02167980 loc_2167980: # CODE XREF: .text:02167978j
.text:02167980 lis r5, aFadeinframenum@h # "FadeInFrameNum"
.text:02167984 mr r4, r31
.text:02167988 addi r5, r5, aFadeinframenum@l # "FadeInFrameNum"
.text:0216798C addi r3, r30, 0x88
.text:02167990 bl sub_248C484
.text:02167994 cmpwi r3, 0
.text:02167998 bne loc_21679A0
.text:0216799C stw r29, 0x88(r30)
.text:021679A0
.text:021679A0 loc_21679A0: # CODE XREF: .text:02167998j
.text:021679A0 lis r5, aCurbgmfadeoutf@h # "CurBgmFadeOutFrameNum"
.text:021679A4 mr r4, r31
.text:021679A8 addi r5, r5, aCurbgmfadeoutf@l # "CurBgmFadeOutFrameNum"
.text:021679AC addi r3, r30, 0x8C
.text:021679B0 bl sub_248C484
.text:021679B4 cmpwi r3, 0
.text:021679B8 bne loc_21679C0
.text:021679BC stw r29, 0x8C(r30)
.text:021679C0
.text:021679C0 loc_21679C0: # CODE XREF: .text:021679B8j
.text:021679C0 mr r3, r30
.text:021679C4 bl sub_23FC608
.text:021679C8 lis r10, dword_102E2CC0@h
.text:021679CC lwzu r12, dword_102E2CC0@l(r10)
.text:021679D0 lwz r0, ((aNormalcamerase+0x10)@l)(r10)
.text:021679D4 mr r4, r30
.text:021679D8 stw r12, 8(r1)
.text:021679DC addi r3, r1, 0x10
.text:021679E0 addi r5, r1, 8
.text:021679E4 stw r0, 0xC(r1)
.text:021679E8 bl sub_2167BE4
.text:021679EC addi r4, r1, 0x10
.text:021679F0 addi r3, r30, 0xC
.text:021679F4 bl sub_2446E78
.text:021679F8 cmpwi r3, 0
.text:021679FC beq loc_2167A14
.text:02167A00 lis r4, dword_104E2BA8@h
.text:02167A04 mr r3, r30
.text:02167A08 li r5, 0
.text:02167A0C addi r4, r4, dword_104E2BA8@l
.text:02167A10 bl sub_24006B0
.text:02167A14
.text:02167A14 loc_2167A14: # CODE XREF: .text:021679FCj
.text:02167A14 lwz r7, 0(r30)
.text:02167A18 lwz r8, 0x2C(r7)
.text:02167A1C mtctr r8
.text:02167A20 mr r3, r30
.text:02167A24 bctrl
.text:02167A28 lwz r29, 0x24(r1)
.text:02167A2C lwz r0, 0x34(r1)
.text:02167A30 lwz r30, 0x28(r1)
.text:02167A34 mtlr r0
.text:02167A38 lwz r31, 0x2C(r1)
.text:02167A3C addi r1, r1, 0x30
.text:02167A40 blr
.text:02167A44 # ---------------------------------------------------------------------------

I haven't figured out much about this yet but have fun nerds

anyways that's all out of me for now lol


how about more juicy stuff

I can't find any object tables other than the RPX, but here's a nice file that is like UseResource from SMG:
<?xml version="1.0" encoding="utf-8"?>
<yaml xmlns:yamlconv="yamlconv" yamlconv:endianness="big" yamlconv:offsetCount="3" type="array">
<value>
<Path type="string">StageData/HexScrollStageMap1.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">StageData/HexScrollStageDesign1.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">StageData/HexScrollStageSound1.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">CubeMapTextureData/HexScrollStage.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/NeedleBarRoot.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/Hacchin.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/TentenWing.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/BlockSwitch.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollGoal.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollTexture.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollGoalShadow.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollStepAParts.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollSlideStep.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollSlideStepLava.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollSlideStepIce.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollGoalSlideStep.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/HexScrollStepA.szs</Path>
<Type type="string">Archive</Type>
</value>
<value>
<Path type="string">ObjectData/PackunFire.szs</Path>
<Type type="string">Archive</Type>
</value>
</yaml>


____________________
a

SunakazeKun
Posted on 08-27-16 08:11 AM (rev. 2 of 08-27-16 04:33 PM) Link | #76539
Ah, yeah. That's the newer UseResource format from 3D Land - PreLoadFileList :)
Here's a little example from World 1-1:
<?xml version="1.0" encoding="shift_jis"?>
<Root>
<isBigEndian Value="False" />
<BymlFormatVersion Value="1" />
<C0>
<C1>
<A0 Name="Path" StringValue="StageData/FirstStageDesign1.szs" />
<A0 Name="Type" StringValue="Archive" />
</C1>
<C1>
<A0 Name="Path" StringValue="StageData/FirstStageSound1.szs" />
<A0 Name="Type" StringValue="Archive" />
</C1>
<C1>
<A0 Name="Path" StringValue="ObjectData/DemoCameraCourseStart.szs" />
<A0 Name="Type" StringValue="Archive" />
</C1>
<C1>
<A0 Name="Name" StringValue="SeSyGameOverRetry" />
<A0 Name="Type" StringValue="SoundItem" />
</C1>
<C1>
<A0 Name="Name" StringValue="SeSyWindowDecideBack" />
<A0 Name="Type" StringValue="SoundItem" />
</C1>
</C0>
</Root>

Does 3D World still use Scenarios for special world levels like 3D Land...or SMG?



Youtube | Github | Neo Mario Galaxy | Super Mario Galaxy & Super Mario 3D Land Modding


shibboleet
Posted on 08-27-16 04:51 PM Link | #76543
Well it doesn't look like it's assigned per level: it looks as if it's assigned for a few levels and the rest are thrown into default. I'm not very sure yet tho...
Also, no. There are no scenarios: everything is sorted into an external file.

____________________
a

SunakazeKun
Posted on 08-27-16 04:59 PM Link | #76544
Hmm, 3D Land has something similar. A file called ResourceSystem contains a set of different paths to certain resources.

And another thing that I was wondering about is if levels are still separated into Map, Sound and Design files.



Youtube | Github | Neo Mario Galaxy | Super Mario Galaxy & Super Mario 3D Land Modding


shibboleet
Posted on 08-27-16 07:06 PM Link | #76547
Posted by SunakazeKun
Hmm, 3D Land has something similar. A file called ResourceSystem contains a set of different paths to certain resources.

And another thing that I was wondering about is if levels are still separated into Map, Sound and Design files.

yep, that's how 3DW does it

____________________
a


Main - WiiU game hacking and emulation - for you 3d world nerds Hide post layouts | New reply

Page rendered in 0.062 seconds. (2048KB of memory used)
MySQL - queries: 28, rows: 202/202, time: 0.011 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.