Link object-camera, scaffold JStudio_JStage

This commit is contained in:
HeartPiece 2024-05-27 02:41:15 +10:00
parent a8da757bb1
commit f338dd5984
15 changed files with 472 additions and 2538 deletions

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,7 @@ LIBS = [
["JSystem/JStudio_JStage/object", True],
["JSystem/JStudio_JStage/object-actor", False],
["JSystem/JStudio_JStage/object-ambientlight", True],
["JSystem/JStudio_JStage/object-camera", False],
["JSystem/JStudio_JStage/object-camera", True],
["JSystem/JStudio_JStage/object-fog", True],
["JSystem/JStudio_JStage/control", True],
],

View File

@ -29,12 +29,12 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JGadget/std-list.cpp">JGadget/std-list.cpp</a> | 6905 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/jstudio-math.cpp">JStudio/jstudio-math.cpp</a> | 9130 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAResourceLoader.cpp">JParticle/JPAResourceLoader.cpp</a> | 9831 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISequenceHeap.cpp">JAudio//JAI/JAISequenceHeap.cpp</a> | 10033 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAMath.cpp">JParticle/JPAMath.cpp</a> | 10154 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAIInitData.cpp">JAudio//JAI/JAIInitData.cpp</a> | 10317 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JStage/object-light.cpp">JStudio_JStage/object-light.cpp</a> | 11420 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASDSPChannel.cpp">JAudio//JAS/JASDSPChannel.cpp</a> | 11896 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JStage/object-light.cpp">JStudio_JStage/object-light.cpp</a> | 11294 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASDSPChannel.cpp">JAudio//JAS/JASDSPChannel.cpp</a> | 11896 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASTaskThread.cpp">JAudio//JAS/JASTaskThread.cpp</a> | 12200 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASWSParser.cpp">JAudio//JAS/JASWSParser.cpp</a> | 12435 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DJoint.cpp">J3D/J3DJoint.cpp</a> | 13780 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPADynamicsBlock.cpp">JParticle/JPADynamicsBlock.cpp</a> | 13976 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASAiCtrl.cpp">JAudio//JAS/JASAiCtrl.cpp</a> | 14267 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DShape.cpp">J3D/J3DShape.cpp</a> | 14990 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JGadget/std-vector.cpp">JGadget/std-vector.cpp</a> | 16059 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JParticle/object-particle.cpp">JStudio_JParticle/object-particle.cpp</a> | 16851 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/stb.cpp">JStudio/stb.cpp</a> | 16978 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JStage/object-camera.cpp">JStudio_JStage/object-camera.cpp</a> | 17767 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JStage/object-actor.cpp">JStudio_JStage/object-actor.cpp</a> | 13714 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DJoint.cpp">J3D/J3DJoint.cpp</a> | 13780 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPADynamicsBlock.cpp">JParticle/JPADynamicsBlock.cpp</a> | 13976 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASAiCtrl.cpp">JAudio//JAS/JASAiCtrl.cpp</a> | 14267 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DShape.cpp">J3D/J3DShape.cpp</a> | 14990 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JGadget/std-vector.cpp">JGadget/std-vector.cpp</a> | 16059 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JParticle/object-particle.cpp">JStudio_JParticle/object-particle.cpp</a> | 16851 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/stb.cpp">JStudio/stb.cpp</a> | 16978 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DCluster.cpp">J3D/J3DCluster.cpp</a> | 18929 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DTextBoxEx.cpp">J2D/J2DTextBoxEx.cpp</a> | 19100 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASChannel.cpp">JAudio//JAS/JASChannel.cpp</a> | 19252 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JMessage/resource.cpp">JMessage/resource.cpp</a> | 19364 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASBNKParser.cpp">JAudio//JAS/JASBNKParser.cpp</a> | 19529 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/fvb.cpp">JStudio/fvb.cpp</a> | 20313 |
@ -44,18 +44,18 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DWindow.cpp">J2D/J2DWindow.cpp</a> | 23735 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JKernel/JKRHeap.cpp">JKernel/JKRHeap.cpp</a> | 23801 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DGD.cpp">J3D/J3DGD.cpp</a> | 24264 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DModel.cpp">J3D/J3DModel.cpp</a> | 28590 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAIBasic.cpp">JAudio//JAI/JAIBasic.cpp</a> | 29235 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialAttach.cpp">J3D/J3DMaterialAttach.cpp</a> | 29965 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DScreen.cpp">J2D/J2DScreen.cpp</a> | 30776 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio_JStage/object-actor.cpp">JStudio_JStage/object-actor.cpp</a> | 35187 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialFactory_v21.cpp">J3D/J3DMaterialFactory_v21.cpp</a> | 35247 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JMessage/processor.cpp">JMessage/processor.cpp</a> | 35637 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAParticle.cpp">JParticle/JPAParticle.cpp</a> | 36971 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DMaterialFactory.cpp">J2D/J2DMaterialFactory.cpp</a> | 39462 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DPicture.cpp">J2D/J2DPicture.cpp</a> | 46511 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASAramStream.cpp">JAudio//JAS/JASAramStream.cpp</a> | 47117 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DWindowEx.cpp">J2D/J2DWindowEx.cpp</a> | 47225 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASSeqParser.cpp">JAudio//JAS/JASSeqParser.cpp</a> | 47291 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/functionvalue.cpp">JStudio/functionvalue.cpp</a> | 50054 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISound.cpp">JAudio//JAI/JAISound.cpp</a> | 51800 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAIStreamMgr.cpp">JAudio//JAI/JAIStreamMgr.cpp</a> | 53010 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAFieldBlock.cpp">JParticle/JPAFieldBlock.cpp</a> | 58986 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISeMgr.cpp">JAudio//JAI/JAISeMgr.cpp</a> | 64949 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISequenceMgr.cpp">JAudio//JAI/JAISequenceMgr.cpp</a> | 68811 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASTrack.cpp">JAudio//JAS/JASTrack.cpp</a> | 72438 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialFactory.cpp">J3D/J3DMaterialFactory.cpp</a> | 75581 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DPictureEx.cpp">J2D/J2DPictureEx.cpp</a> | 90416 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAResource.cpp">JParticle/JPAResource.cpp</a> | 95965 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPABaseShape.cpp">JParticle/JPABaseShape.cpp</a> | 96579 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/jstudio-object.cpp">JStudio/jstudio-object.cpp</a> | 123297 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DMatBlock.cpp">J2D/J2DMatBlock.cpp</a> | 127830 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMatBlock.cpp">J3D/J3DMatBlock.cpp</a> | 165948 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DScreen.cpp">J2D/J2DScreen.cpp</a> | 30776 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialFactory_v21.cpp">J3D/J3DMaterialFactory_v21.cpp</a> | 35247 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JMessage/processor.cpp">JMessage/processor.cpp</a> | 35637 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAParticle.cpp">JParticle/JPAParticle.cpp</a> | 36971 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DMaterialFactory.cpp">J2D/J2DMaterialFactory.cpp</a> | 39462 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DPicture.cpp">J2D/J2DPicture.cpp</a> | 46511 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASAramStream.cpp">JAudio//JAS/JASAramStream.cpp</a> | 47117 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DWindowEx.cpp">J2D/J2DWindowEx.cpp</a> | 47225 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASSeqParser.cpp">JAudio//JAS/JASSeqParser.cpp</a> | 47291 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/functionvalue.cpp">JStudio/functionvalue.cpp</a> | 50054 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISound.cpp">JAudio//JAI/JAISound.cpp</a> | 51800 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAIStreamMgr.cpp">JAudio//JAI/JAIStreamMgr.cpp</a> | 53010 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAFieldBlock.cpp">JParticle/JPAFieldBlock.cpp</a> | 58986 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISeMgr.cpp">JAudio//JAI/JAISeMgr.cpp</a> | 64949 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAI/JAISequenceMgr.cpp">JAudio//JAI/JAISequenceMgr.cpp</a> | 68811 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JAudio/JSystem/JAS/JASTrack.cpp">JAudio//JAS/JASTrack.cpp</a> | 72438 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMaterialFactory.cpp">J3D/J3DMaterialFactory.cpp</a> | 75581 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DPictureEx.cpp">J2D/J2DPictureEx.cpp</a> | 90416 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPAResource.cpp">JParticle/JPAResource.cpp</a> | 95965 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JParticle/JPABaseShape.cpp">JParticle/JPABaseShape.cpp</a> | 96579 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/JStudio/jstudio-object.cpp">JStudio/jstudio-object.cpp</a> | 123297 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J2D/J2DMatBlock.cpp">J2D/J2DMatBlock.cpp</a> | 127830 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/JSystem/J3D/J3DMatBlock.cpp">J3D/J3DMatBlock.cpp</a> | 165948 | | |
### <section id="plugProjectEbisawaU">plugProjectEbisawaU</section>
| File | Size (bytes) | File | Size (bytes) |
@ -102,7 +102,7 @@
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKonoU/khCaveResult.cpp">khCaveResult.cpp</a> | 42333 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKonoU/khFinalResult.cpp">khFinalResult.cpp</a> | 59527 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKonoU/khDayEndResult.cpp">khDayEndResult.cpp</a> | 81837 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKonoU/khWorldMap.cpp">khWorldMap.cpp</a> | 158555 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKonoU/khDayEndResult.cpp">khDayEndResult.cpp</a> | 81837 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKonoU/khWorldMap.cpp">khWorldMap.cpp</a> | 158557 |
### <section id="plugProjectMorimuraU">plugProjectMorimuraU</section>
| File | Size (bytes) | File | Size (bytes) |
@ -171,7 +171,7 @@
### <section id="sysCommonU">sysCommonU</section>
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomIntersection.cpp">geomIntersection.cpp</a> | 10969 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/camera.cpp">camera.cpp</a> | 13024 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomIntersection.cpp">geomIntersection.cpp</a> | 10969 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/camera.cpp">camera.cpp</a> | 13097 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomTraceMove.cpp">geomTraceMove.cpp</a> | 14985 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/sysMath.cpp">sysMath.cpp</a> | 26371 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geomOBBTree.cpp">geomOBBTree.cpp</a> | 82131 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/sysCommonU/geometry.cpp">geometry.cpp</a> | 98859 |

View File

@ -30,6 +30,8 @@ struct TActor : public TObject {
virtual f32 JSGGetTextureAnimationFrame() const; // _80
virtual void JSGSetTextureAnimationFrame(f32); // _84
virtual f32 JSGGetTextureAnimationFrameMax() const; // _88
// _00 = VTBL
};
} // namespace JStage

View File

@ -7,59 +7,84 @@
namespace JStage {
struct TObject {
virtual ~TObject() = 0; // _08
virtual int JSGFGetType() const = 0; // _0C
virtual char const* JSGGetName() const; // _10
virtual void JSGUpdate(); // _14
virtual u32 JSGGetFlag() const; // _18
virtual void JSGSetFlag(u32); // _1C
virtual void* JSGGetData(u32, void*, u32) const; // _20
virtual void JSGSetData(u32, const void*, u32); // _24
virtual void JSGGetParent(TObject**, u32*) const; // _28
virtual void JSGSetParent(TObject*, u32); // _2C
virtual void JSGSetRelation(bool, TObject*, u32); // _30
virtual int JSGFindNodeID(const char*) const; // _34
virtual bool JSGGetNodeTransformation(u32, f32 (*)[4]) const; // _38
virtual ~TObject() = 0; // _08
virtual int JSGFGetType() const = 0; // _0C
virtual char const* JSGGetName() const; // _10
virtual void JSGUpdate(); // _14
virtual u32 JSGGetFlag() const; // _18
virtual void JSGSetFlag(u32); // _1C
virtual void* JSGGetData(u32, void*, u32) const; // _20
virtual void JSGSetData(u32, const void*, u32); // _24
virtual void JSGGetParent(TObject**, u32*) const; // _28
virtual void JSGSetParent(TObject*, u32); // _2C
virtual void JSGSetRelation(bool, TObject*, u32); // _30
virtual int JSGFindNodeID(const char*) const; // _34
virtual bool JSGGetNodeTransformation(u32, Mtx) const; // _38
/** @fabricated */
inline void setFlagOff(u32 flag) { JSGSetFlag(JSGGetFlag() & ~flag); }
/** @fabricated */
inline void setFlagOn(u32 flag) { JSGSetFlag(JSGGetFlag() | flag); }
// _00 VTBL
// _00 = VTBL
};
// this cannot generate a vtable. There isn't even an unused vtable in the link map. And yet it definitely has one. Hmm.
// There also aren't any unused funcs for this type at all.
// It's not a typedef. Typedefs don't show on the link map.
// Unless... maybe it's just a POD type that just has a pointer to a JStage::TObject?
// But then there still needs to be a subclass of that somewhere. And that doesn't look right at all.
// these are all from TP debug, ours are all mega stripped.
// my BEST guess atm is these get spawned in some stripped JStage/JSGLight.cpp, JStage/JSGFog.cpp etc files
// along with the vtables, but they never get actually hit, so the files gets stripped
// idk, it's mega weird and I'm Not A Fan - HP
struct TAmbientLight : public TObject {
typedef JStudio::TObject_ambientLight StudioObject;
inline virtual int JSGFGetType() const { return 4; } // _0C
inline virtual GXColor JSGGetColor() const { return GXColor(); } // _3C
inline virtual void JSGSetColor(GXColor) const { } // _40
// _00 = VTBL
};
// None of these should generate bodies. The vtbl should never be generated. Ever.
struct TFog : public TObject {
typedef JStudio::TObject_fog StudioObject;
inline virtual void virtual_3C() { } // _3C
inline virtual void virtual_40() { } // _40
inline virtual f32 virtual_44() const { return _04; } // _44
inline virtual void virtual_48(f32 p1) { _04 = p1; } // _48
inline virtual f32 virtual_4C() const { return _04; } // _4C
inline virtual void virtual_50(f32 p1) { _04 = p1; } // _50
inline virtual _GXColor JSGGetColor() const { return mColor; } // _54
inline virtual void JSGSetColor(_GXColor color) { mColor = color; } // _58
inline virtual int JSGFGetType() const { return 6; } // _0C
inline virtual GXFogType JSGGetFogFunction() const { return GX_FOG_NONE; } // _3C
inline virtual void JSGSetFogFunction(GXFogType) { } // _40
inline virtual f32 JSGGetStartZ() const { return mZ; } // _44
inline virtual void JSGSetStartZ(f32 z) { mZ = z; } // _48
inline virtual f32 JSGGetEndZ() const { return mZ; } // _4C
inline virtual void JSGSetEndZ(f32 z) { mZ = z; } // _50
inline virtual GXColor JSGGetColor() const { return mColor; } // _54
inline virtual void JSGSetColor(GXColor color) { mColor = color; } // _58
f32 _04;
_GXColor mColor;
// _00 = VTBL
f32 mZ; // _04
GXColor mColor; // _08
};
enum TELight {
TELIGHT_Unk0 = 0,
TELIGHT_Unk1 = 1,
TELIGHT_Unk2 = 2,
TELIGHT_Unk3 = 3,
};
struct TLight : public TObject {
typedef JStudio::TObject_light StudioObject;
inline virtual int JSGFGetType() const { return 5; } // _0C
inline virtual int JSGGetLightType() const { return TELIGHT_Unk1; } // _3C
inline virtual void JSGSetLightType(TELight) { } // _40
inline virtual void JSGGetPosition(Vec*) const { } // _44
inline virtual void JSGSetPosition(Vec&) { } // _48
inline virtual GXColor JSGGetColor() const { return GXColor(); } // _4C
inline virtual void JSGSetColor(GXColor color) { } // _50
inline virtual void JSGGetDistanceAttenuation(f32*, f32*, GXDistAttnFn*) const { } // _54
inline virtual void JSGSetDistanceAttenuation(f32, f32, GXDistAttnFn) { } // _58
inline virtual void JSGGetAngleAttenuation(f32*, GXSpotFn*) const { } // _5C
inline virtual void JSGSetAngleAttenuation(f32, GXSpotFn) { } // _60
inline virtual void JSGGetDirection(Vec*) const { } // _64
inline virtual void JSGSetDirection(Vec&) { } // _68
};
} // namespace JStage

View File

@ -8,7 +8,6 @@
namespace JStudio {
struct TObject;
struct TVariableValue;
struct TAdaptor {
struct TSetVariableValue_immediate {
@ -58,6 +57,12 @@ struct TAdaptor {
void adaptor_updateVariableValue();
void adaptor_updateVariableValue(JStudio::TObject*, u32);
inline TVariableValue& adaptor_referVariableValue(u32 idx) { return mVariableValues[idx]; }
inline TVariableValue* adaptor_getVariableValue(u32 idx) { return &mVariableValues[idx]; }
inline void adaptor_setVariableValue_immediate(u32 idx, f32 val) { adaptor_referVariableValue(idx).setValueImmediate(val); }
// VTBL _00
TVariableValue* mVariableValues; // _04
int mCount; // _08
@ -86,11 +91,13 @@ struct TAdaptor_actor : public TAdaptor {
virtual void adaptor_do_TEXTURE_ANIMATION(JStudio::data::TEOperationData, const void*, u32) = 0; // _48
virtual void adaptor_do_TEXTURE_ANIMATION_MODE(JStudio::data::TEOperationData, const void*, u32) = 0; // _4C
JStudio::TVariableValue _0C[14]; // _0C
static const u32 sauVariableValue_3_TRANSLATION_XYZ[3];
static const u32 sauVariableValue_3_ROTATION_XYZ[3];
static const u32 sauVariableValue_3_SCALING_XYZ[3];
// _00 = VTBL
// _00-_0C = TAdaptor
JStudio::TVariableValue _0C[14]; // _0C
};
struct TAdaptor_ambientLight : public TAdaptor {
@ -162,12 +169,14 @@ struct TAdaptor_light : public TAdaptor {
virtual void adaptor_do_ENABLE(JStudio::data::TEOperationData, const void*, u32) = 0; // _20
virtual void adaptor_do_FACULTY(JStudio::data::TEOperationData, const void*, u32) = 0; // _24
JStudio::TVariableValue _0C[13]; // _0C
static const u32 sauVariableValue_3_COLOR_RGB[3];
static const u32 sauVariableValue_4_COLOR_RGBA[4];
static const u32 sauVariableValue_3_POSITION_XYZ[3];
static const u32 sauVariableValue_3_TARGET_POSITION_XYZ[3];
// _00 = VTBL
// _00-_0C = TAdaptor
JStudio::TVariableValue _0C[13]; // _0C
};
struct TAdaptor_message : public TAdaptor {

View File

@ -37,6 +37,11 @@ struct TControl : public stb::TControl {
Vec mPosition;
};
struct TTransform_position_direction {
Vec mPosition; // _00
Vec mDirection; // _0C
};
TControl();
virtual ~TControl(); // _08
@ -77,6 +82,9 @@ struct TControl : public stb::TControl {
return obj->referFunctionValue();
}
inline f32 getOnGetRotY() const { return mTransformOnGet_RotY; }
inline f32 getOnSetRotY() const { return mTransformOnSet_RotY; }
f64 getSecondsPerFrame() const { return mSecondsPerFrame; }
// _00 = VTBL

View File

@ -108,6 +108,12 @@ struct TAdaptor_actor : public JStudio::TAdaptor_actor {
void setJSG_SRT_(const JStudio::TControl*);
void getJSG_SRT_(const JStudio::TControl*);
inline JStage::TActor* get_pJSG() { return mObject; }
static const TVVOutputObject saoVVOutput_[2];
static const TVVOutput_ANIMATION_FRAME_ saoVVOutput_ANIMATION_FRAME_[3];
// _00 = VTBL
const JStage::TSystem* mSystem; // _124
JStage::TActor* mObject; // _128
u32 _12C; // _12C
@ -118,9 +124,6 @@ struct TAdaptor_actor : public JStudio::TAdaptor_actor {
u8 _140; // _140
JStage::TObject* _144; // _144
u32 _148; // _148
static const TVVOutputObject saoVVOutput_[2];
static const TVVOutput_ANIMATION_FRAME_ saoVVOutput_ANIMATION_FRAME_[3];
};
struct TAdaptor_ambientLight : public JStudio::TAdaptor_ambientLight {
@ -162,6 +165,8 @@ struct TAdaptor_camera : public JStudio::TAdaptor_camera {
void setJSG_targetPosition_(const JStudio::TControl*);
void getJSG_targetPosition_(const JStudio::TControl*);
inline JStage::TCamera* get_pJSG() { return mObject; }
const JStage::TSystem* mSystem; // _FC
JStage::TCamera* mObject; // _100
u32 _104; // _104
@ -220,19 +225,21 @@ struct TAdaptor_light : public JStudio::TAdaptor_light {
virtual void adaptor_do_ENABLE(JStudio::data::TEOperationData, const void*, u32); // _20
virtual void adaptor_do_FACULTY(JStudio::data::TEOperationData, const void*, u32); // _24
static TVVOutput_direction_ saoVVOutput_direction_[6];
inline JStage::TLight* get_pJSG_() { return mObject; }
// _00 = VTBL
// _00-_110 = JStudio::TAdaptor_light
const JStage::TSystem* mSystem; // _110
JStage::TLight* mObject; // _114
int _118;
static const TVVOutput_direction_ saoVVOutput_direction[6];
int _118; // _118
};
bool transform_toGlobalFromLocal(f32 (*)[4], const JStudio::TControl::TTransform_translation_rotation_scaling&, const JStage::TObject*,
u32);
bool transform_toGlobalFromLocal(f32 (*)[4], const JStudio::TControl::TTransform_position&, const JStage::TObject*, u32);
bool transform_toLocalFromGlobal(f32 (*)[4], const JStudio::TControl::TTransform_translation_rotation_scaling&, const JStage::TObject*,
u32);
bool transform_toLocalFromGlobal(f32 (*)[4], const JStudio::TControl::TTransform_position&, const JStage::TObject*, u32);
bool transform_toGlobalFromLocal(Mtx, const JStudio::TControl::TTransform_translation_rotation_scaling&, const JStage::TObject*, u32);
bool transform_toGlobalFromLocal(Mtx, const JStudio::TControl::TTransform_position&, const JStage::TObject*, u32);
bool transform_toLocalFromGlobal(Mtx, const JStudio::TControl::TTransform_translation_rotation_scaling&, const JStage::TObject*, u32);
bool transform_toLocalFromGlobal(Mtx, const JStudio::TControl::TTransform_position&, const JStage::TObject*, u32);
} // namespace JStudio_JStage
#endif

View File

@ -163,4 +163,9 @@ static inline f32 dolsqrtfull(f32 mag)
static inline f32 scaleValue(f32 scale, f32 value) { return scale * value; }
static inline f32 dolsinf(f32 val) { return (f32)sin((f32)val); }
static inline f32 dolcosf(f32 val) { return (f32)cos((f32)val); }
static inline f32 doltanf(f32 val) { return (f32)tan((f32)val); }
static inline f32 dolatan2f(f32 val1, f32 val2) { return (f32)atan2((f32)val1, (f32)val2); }
#endif

View File

@ -3,7 +3,7 @@ JSTUDIO_JSTAGE_FILES:=\
$(BUILD_DIR)/src/JSystem/JStudio_JStage/object.o\
$(BUILD_DIR)/asm/JSystem/JStudio_JStage/object-actor.o\
$(BUILD_DIR)/src/JSystem/JStudio_JStage/object-ambientlight.o\
$(BUILD_DIR)/asm/JSystem/JStudio_JStage/object-camera.o\
$(BUILD_DIR)/src/JSystem/JStudio_JStage/object-camera.o\
$(BUILD_DIR)/src/JSystem/JStudio_JStage/object-fog.o\
$(BUILD_DIR)/src/JSystem/JStudio_JStage/control.o\

View File

@ -8,149 +8,6 @@
#include "JSystem/JStudio_JStage.h"
#include "types.h"
/*
Generated from dpostproc
.section .ctors, "wa" # 0x80472F00 - 0x804732C0
.4byte "__sinit_object-actor_cpp"
.section .data, "wa" # 0x8049E220 - 0x804EFC20
.global lbl_8049F5B0
lbl_8049F5B0:
.4byte 0x00000000
.4byte 0x00000058
.4byte 0x00000000
.global lbl_8049F5BC
lbl_8049F5BC:
.4byte 0x00000000
.4byte 0x00000060
.4byte 0x00000000
.global lbl_8049F5C8
lbl_8049F5C8:
.4byte 0x00000000
.4byte 0x0000007C
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000074
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000070
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000068
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000064
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x0000006C
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000084
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000080
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000088
.4byte 0x00000000
.global __vt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_
__vt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_:
.4byte 0
.4byte 0
.4byte
__cl__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_CFfPQ27JStudio8TAdaptor
.4byte
__dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv
.global __vt__Q214JStudio_JStage14TAdaptor_actor
__vt__Q214JStudio_JStage14TAdaptor_actor:
.4byte 0
.4byte 0
.4byte __dt__Q214JStudio_JStage14TAdaptor_actorFv
.4byte
adaptor_do_prepare__Q214JStudio_JStage14TAdaptor_actorFPCQ27JStudio7TObject
.4byte
adaptor_do_begin__Q214JStudio_JStage14TAdaptor_actorFPCQ27JStudio7TObject
.4byte
adaptor_do_end__Q214JStudio_JStage14TAdaptor_actorFPCQ27JStudio7TObject
.4byte
adaptor_do_update__Q214JStudio_JStage14TAdaptor_actorFPCQ27JStudio7TObjectUl
.4byte
adaptor_do_data__Q214JStudio_JStage14TAdaptor_actorFPCQ27JStudio7TObjectPCvUlPCvUl
.4byte
adaptor_do_PARENT__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_PARENT_NODE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_PARENT_ENABLE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_PARENT_FUNCTION__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_RELATION__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_RELATION_NODE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_RELATION_ENABLE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_SHAPE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_ANIMATION__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_ANIMATION_MODE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_TEXTURE_ANIMATION__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_TEXTURE_ANIMATION_MODE__Q214JStudio_JStage14TAdaptor_actorFQ37JStudio4data15TEOperationDataPCvUl
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.global
"__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"
"__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>":
.4byte 0
.4byte 0
.4byte
"__cl__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>CFfPQ27JStudio8TAdaptor"
.4byte
"__dt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>Fv"
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.section .bss # 0x804EFC20 - 0x8051467C
.global saoVVOutput___Q214JStudio_JStage14TAdaptor_actor
saoVVOutput___Q214JStudio_JStage14TAdaptor_actor:
.skip 0xD0
.global saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor
saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor:
.skip 0x90
.section .sdata2, "a" # 0x80516360 - 0x80520E40
.global lbl_805164A8
lbl_805164A8:
.4byte 0x00000000
.4byte 0x00000000
*/
namespace JStudio_JStage {
const TAdaptor_actor::TVVOutputObject TAdaptor_actor::saoVVOutput_[2]
@ -202,59 +59,6 @@ void TAdaptor_actor::adaptor_do_prepare(const JStudio::TObject*)
for (const TVVOutput_ANIMATION_FRAME_* output = saoVVOutput_ANIMATION_FRAME_; output->mValueIndex != -1; output++) {
mVariableValues[output->mValueIndex].setOutput(output);
}
/*
lis r4, saoVVOutput___Q214JStudio_JStage14TAdaptor_actor@ha
addi r0, r4, saoVVOutput___Q214JStudio_JStage14TAdaptor_actor@l
mr r5, r0
b lbl_80012310
lbl_800122E8:
mulli r0, r0, 0x14
lwz r4, 4(r3)
cmplwi r5, 0
add r4, r4, r0
beq lbl_80012304
mr r0, r5
b lbl_80012308
lbl_80012304:
addi r0, r13, soOutput_none___Q27JStudio14TVariableValue@sda21
lbl_80012308:
stw r0, 0x10(r4)
addi r5, r5, 0x20
lbl_80012310:
lwz r0, 4(r5)
cmpwi r0, -1
bne lbl_800122E8
lis r4,
saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@ha addi r0,
r4, saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@l mr r5, r0
b lbl_80012354
lbl_8001232C:
mulli r0, r0, 0x14
lwz r4, 4(r3)
cmplwi r5, 0
add r4, r4, r0
beq lbl_80012348
mr r0, r5
b lbl_8001234C
lbl_80012348:
addi r0, r13, soOutput_none___Q27JStudio14TVariableValue@sda21
lbl_8001234C:
stw r0, 0x10(r4)
addi r5, r5, 0x30
lbl_80012354:
lwz r0, 4(r5)
cmpwi r0, -1
bne lbl_8001232C
blr
*/
}
/**
@ -488,25 +292,35 @@ void TAdaptor_actor::setJSG_SRT_(const JStudio::TControl* control)
adaptor_getVariableValue_Vec(&transform.getScaling(), sauVariableValue_3_SCALING_XYZ);
JStudio::TControl::TTransform_translation_rotation_scaling* pTransform;
if (_140 == 0) {
JStudio::TControl::TTransform_translation_rotation_scaling* tempTransform;
if (control->mTransformOnSet == 0) {
pTransform = &transform;
tempTransform = &transform;
} else {
PSMTXMultVec(*const_cast<Mtx*>(&control->mTransformOnSet_Mtx), transform.getAll(), multipliedTransform.getAll());
pTransform = &multipliedTransform;
multipliedTransform.getRotation().y = transform.getRotation().y + control->mTransformOnSet_RotY;
tempTransform = &multipliedTransform;
multipliedTransform.getRotation().x = transform.getRotation().x;
multipliedTransform.getRotation().y = transform.getRotation().y + control->getOnSetRotY();
multipliedTransform.getRotation().z = transform.getRotation().z;
}
pTransform = tempTransform;
} else {
pTransform = &transform;
switch (_134) {
case 0: {
Mtx mtx;
if (transform_toGlobalFromLocal(mtx, *pTransform, _138, _13C) == false) {
bool check;
if (!transform_toGlobalFromLocal(mtx, *pTransform, _138, _13C)) {
check = false;
} else {
JStudio::math::getFromTransformation_SRxyzT(&multipliedTransform.getScaling(), &multipliedTransform.getRotation(),
&multipliedTransform.getTranslation(), mtx);
check = true;
}
if (!check) {
return;
}
JStudio::math::getFromTransformation_SRxyzT(&multipliedTransform.getScaling(), &multipliedTransform.getRotation(),
&multipliedTransform.getTranslation(), mtx);
pTransform = &multipliedTransform;
break;
}
@ -517,240 +331,84 @@ void TAdaptor_actor::setJSG_SRT_(const JStudio::TControl* control)
mObject->JSGSetTranslation(pTransform->getTranslation());
mObject->JSGSetRotation(pTransform->getRotation());
mObject->JSGSetScaling(pTransform->getScaling());
/*
stwu r1, -0x90(r1)
mflr r0
lis r5,
sauVariableValue_3_TRANSLATION_XYZ__Q27JStudio14TAdaptor_actor@ha stw r0,
0x94(r1) addi r5, r5,
sauVariableValue_3_TRANSLATION_XYZ__Q27JStudio14TAdaptor_actor@l stw r31,
0x8c(r1) mr r31, r4 addi r4, r1, 0x5c stw r30, 0x88(r1) mr r30,
r3 bl adaptor_getVariableValue_Vec__Q27JStudio8TAdaptorCFP3VecPCUl lis r3,
sauVariableValue_3_ROTATION_XYZ__Q27JStudio14TAdaptor_actor@ha addi r4, r1,
0x68 addi r5, r3,
sauVariableValue_3_ROTATION_XYZ__Q27JStudio14TAdaptor_actor@l mr r3, r30
bl adaptor_getVariableValue_Vec__Q27JStudio8TAdaptorCFP3VecPCUl
lis r4, sauVariableValue_3_SCALING_XYZ__Q27JStudio14TAdaptor_actor@ha
mr r3, r30
addi r5, r4,
sauVariableValue_3_SCALING_XYZ__Q27JStudio14TAdaptor_actor@l addi r4, r1,
0x74 bl adaptor_getVariableValue_Vec__Q27JStudio8TAdaptorCFP3VecPCUl lbz
r0, 0x140(r30) cmplwi r0, 0 bne lbl_800129A4 lbz r0, 0x74(r31)
cmplwi r0, 0
bne lbl_80012968
addi r0, r1, 0x5c
b lbl_8001299C
lbl_80012968:
addi r3, r31, 0x98
addi r4, r1, 0x5c
addi r5, r1, 0x38
bl PSMTXMultVec
lfs f1, 0x6c(r1)
addi r0, r1, 0x38
lfs f0, 0x90(r31)
lfs f2, 0x68(r1)
fadds f1, f1, f0
lfs f0, 0x70(r1)
stfs f2, 0x44(r1)
stfs f1, 0x48(r1)
stfs f0, 0x4c(r1)
lbl_8001299C:
mr r31, r0
b lbl_80012A0C
lbl_800129A4:
lwz r0, 0x134(r30)
addi r31, r1, 0x5c
cmpwi r0, 1
beq lbl_80012A0C
bge lbl_80012A0C
cmpwi r0, 0
bge lbl_800129C4
b lbl_80012A0C
lbl_800129C4:
lwz r5, 0x138(r30)
mr r4, r31
lwz r6, 0x13c(r30)
addi r3, r1, 8
bl
transform_toGlobalFromLocal__14JStudio_JStageFPA4_fRCQ37JStudio8TControl39TTransform_translation_rotation_scalingPCQ26JStage7TObjectUl
clrlwi. r0, r3, 0x18
bne lbl_800129E8
li r0, 0
b lbl_80012A00
lbl_800129E8:
addi r3, r1, 0x50
addi r4, r1, 0x44
addi r5, r1, 0x38
addi r6, r1, 8
bl getFromTransformation_SRxyzT__Q27JStudio4mathFP3VecP3VecP3VecPA4_Cf
li r0, 1
lbl_80012A00:
clrlwi. r0, r0, 0x18
beq lbl_80012A54
addi r31, r1, 0x38
lbl_80012A0C:
lwz r3, 0x128(r30)
mr r4, r31
lwz r12, 0(r3)
lwz r12, 0x40(r12)
mtctr r12
bctrl
lwz r3, 0x128(r30)
addi r4, r31, 0xc
lwz r12, 0(r3)
lwz r12, 0x50(r12)
mtctr r12
bctrl
lwz r3, 0x128(r30)
addi r4, r31, 0x18
lwz r12, 0(r3)
lwz r12, 0x48(r12)
mtctr r12
bctrl
lbl_80012A54:
lwz r0, 0x94(r1)
lwz r31, 0x8c(r1)
lwz r30, 0x88(r1)
mtlr r0
addi r1, r1, 0x90
blr
*/
}
/**
* @note Address: 0x80012A6C
* @note Size: 0x17C
*/
void TAdaptor_actor::getJSG_SRT_(const JStudio::TControl*)
void TAdaptor_actor::getJSG_SRT_(const JStudio::TControl* control)
{
/*
stwu r1, -0x90(r1)
mflr r0
stw r0, 0x94(r1)
stw r31, 0x8c(r1)
mr r31, r4
addi r4, r1, 0x5c
stw r30, 0x88(r1)
mr r30, r3
lwz r3, 0x128(r3)
lwz r12, 0(r3)
lwz r12, 0x3c(r12)
mtctr r12
bctrl
lwz r3, 0x128(r30)
addi r4, r1, 0x68
lwz r12, 0(r3)
lwz r12, 0x4c(r12)
mtctr r12
bctrl
lwz r3, 0x128(r30)
addi r4, r1, 0x74
lwz r12, 0(r3)
lwz r12, 0x44(r12)
mtctr r12
bctrl
lbz r0, 0x140(r30)
cmplwi r0, 0
bne lbl_80012B2C
lbz r0, 0x75(r31)
cmplwi r0, 0
bne lbl_80012AF0
addi r0, r1, 0x5c
b lbl_80012B24
JStudio::TControl::TTransform_translation_rotation_scaling transform;
JStudio::TControl::TTransform_translation_rotation_scaling trs;
Mtx mtx;
get_pJSG()->JSGGetTranslation(&transform.getTranslation());
get_pJSG()->JSGGetRotation(&transform.getRotation());
get_pJSG()->JSGGetScaling(&transform.getScaling());
lbl_80012AF0:
addi r3, r31, 0xc8
addi r4, r1, 0x5c
addi r5, r1, 0x38
bl PSMTXMultVec
lfs f1, 0x6c(r1)
addi r0, r1, 0x38
lfs f0, 0x94(r31)
lfs f2, 0x68(r1)
fadds f1, f1, f0
lfs f0, 0x70(r1)
stfs f2, 0x44(r1)
stfs f1, 0x48(r1)
stfs f0, 0x4c(r1)
JStudio::TControl::TTransform_translation_rotation_scaling* outTransform;
if (!_140) {
JStudio::TControl::TTransform_translation_rotation_scaling* tempTransform;
if (!control->mTransformOnGet) {
tempTransform = &transform;
} else {
PSMTXMultVec(control->mTransformOnGet_Mtx, &transform.getTranslation(), &trs.getTranslation());
tempTransform = &trs;
trs.getRotation().x = transform.getRotation().x;
trs.getRotation().y = transform.getRotation().y + control->getOnGetRotY();
trs.getRotation().z = transform.getRotation().z;
}
outTransform = tempTransform;
lbl_80012B24:
mr r31, r0
b lbl_80012B94
} else {
outTransform = &transform;
switch (_134) {
case 1:
break;
case 0:
bool check;
if (!transform_toLocalFromGlobal(mtx, *outTransform, _138, _13C)) {
check = false;
} else {
JStudio::math::getFromTransformation_SRxyzT(&trs.getScaling(), &trs.getRotation(), &trs.getTranslation(), mtx);
check = true;
}
lbl_80012B2C:
lwz r0, 0x134(r30)
addi r31, r1, 0x5c
cmpwi r0, 1
beq lbl_80012B94
bge lbl_80012B94
cmpwi r0, 0
bge lbl_80012B4C
b lbl_80012B94
if (!check) {
return;
}
outTransform = &trs;
break;
}
}
lbl_80012B4C:
lwz r5, 0x138(r30)
mr r4, r31
lwz r6, 0x13c(r30)
addi r3, r1, 8
bl
transform_toLocalFromGlobal__14JStudio_JStageFPA4_fRCQ37JStudio8TControl39TTransform_translation_rotation_scalingPCQ26JStage7TObjectUl
clrlwi. r0, r3, 0x18
bne lbl_80012B70
li r0, 0
b lbl_80012B88
lbl_80012B70:
addi r3, r1, 0x50
addi r4, r1, 0x44
addi r5, r1, 0x38
addi r6, r1, 8
bl getFromTransformation_SRxyzT__Q27JStudio4mathFP3VecP3VecP3VecPA4_Cf
li r0, 1
lbl_80012B88:
clrlwi. r0, r0, 0x18
beq lbl_80012BD0
addi r31, r1, 0x38
lbl_80012B94:
lis r4,
sauVariableValue_3_TRANSLATION_XYZ__Q27JStudio14TAdaptor_actor@ha mr r3,
r30 addi r4, r4,
sauVariableValue_3_TRANSLATION_XYZ__Q27JStudio14TAdaptor_actor@l mr r5,
r31 bl adaptor_setVariableValue_Vec__Q27JStudio8TAdaptorFPCUlRC3Vec lis
r4, sauVariableValue_3_ROTATION_XYZ__Q27JStudio14TAdaptor_actor@ha mr r3,
r30 addi r4, r4,
sauVariableValue_3_ROTATION_XYZ__Q27JStudio14TAdaptor_actor@l addi r5, r31,
0xc bl adaptor_setVariableValue_Vec__Q27JStudio8TAdaptorFPCUlRC3Vec lis
r4, sauVariableValue_3_SCALING_XYZ__Q27JStudio14TAdaptor_actor@ha mr r3,
r30 addi r4, r4,
sauVariableValue_3_SCALING_XYZ__Q27JStudio14TAdaptor_actor@l addi r5, r31,
0x18 bl adaptor_setVariableValue_Vec__Q27JStudio8TAdaptorFPCUlRC3Vec
lbl_80012BD0:
lwz r0, 0x94(r1)
lwz r31, 0x8c(r1)
lwz r30, 0x88(r1)
mtlr r0
addi r1, r1, 0x90
blr
*/
adaptor_setVariableValue_Vec(sauVariableValue_3_TRANSLATION_XYZ, outTransform->getTranslation());
adaptor_setVariableValue_Vec(sauVariableValue_3_ROTATION_XYZ, outTransform->getRotation());
adaptor_setVariableValue_Vec(sauVariableValue_3_SCALING_XYZ, outTransform->getScaling());
}
/**
* @note Address: 0x80012BE8
* @note Size: 0xE4
*/
void TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()(f32, JStudio::TAdaptor*) const
void TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()(f32 p1, JStudio::TAdaptor* adaptor) const
{
JStage::TActor* actor = static_cast<TAdaptor_actor*>(adaptor)->get_pJSG();
// not sure what this bit is
u8 idx = adaptor->mVariableValues[_08]._04;
f32 maxVal = (actor->*mMaxGetter)();
switch (idx & 0x2) { // not sure what this is either
case 1:
p1 = maxVal - p1;
break;
case 0:
break;
}
if (maxVal > 0.0f) {
p1 = (f32)(*JStudio::TFunctionValue::toFunction_outside(idx))(p1, maxVal);
}
(actor->*mSetter)(p1);
/*
.loc_0x0:
stwu r1, -0x40(r1)
@ -819,338 +477,4 @@ void TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::operator()(f32, JStudio::TAdapt
*/
}
/**
* @note Address: 0x80012CCC
* @note Size: 0x60
*/
// TAdaptor_actor::TVVOutput_ANIMATION_FRAME_::~TVVOutput_ANIMATION_FRAME_()
// {
// /*
// .loc_0x0:
// stwu r1, -0x10(r1)
// mflr r0
// stw r0, 0x14(r1)
// stw r31, 0xC(r1)
// mr r31, r4
// stw r30, 0x8(r1)
// mr. r30, r3
// beq- .loc_0x44
// lis r5, 0x804A
// li r4, 0
// subi r0, r5, 0x9CC
// stw r0, 0x0(r30)
// bl -0x5C94
// extsh. r0, r31
// ble- .loc_0x44
// mr r3, r30
// bl 0x113A8
// .loc_0x44:
// lwz r0, 0x14(r1)
// mr r3, r30
// lwz r31, 0xC(r1)
// lwz r30, 0x8(r1)
// mtlr r0
// addi r1, r1, 0x10
// blr
// */
// }
/**
* @note Address: 0x80012D2C
* @note Size: 0x3D0
*/
// void __sinit_object - actor_cpp()
// {
// /*
// stwu r1, -0x110(r1)
// mflr r0
// lis r3, lbl_8049F5B0@ha
// lis r4, __vt__Q37JStudio14TVariableValue7TOutput@ha
// stw r0, 0x114(r1)
// lis r5,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@ha
// lis r12, lbl_804EFDE8@ha
// li r11, 1
// stmw r25, 0xf4(r1)
// addi r31, r3, lbl_8049F5B0@l
// addi r25, r4, __vt__Q37JStudio14TVariableValue7TOutput@l
// lis r3, saoVVOutput___Q214JStudio_JStage14TAdaptor_actor@ha
// addi r30, r12, lbl_804EFDE8@l
// addi r12, r5,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@l
// lis r4,
// "__dt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>Fv"@ha
// addi r4, r4,
// "__dt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>Fv"@l
// addi r5, r30, 0
// stwu r25, saoVVOutput___Q214JStudio_JStage14TAdaptor_actor@l(r3)
// lwz r10, 0x24(r31)
// lwz r9, 0x28(r31)
// lwz r8, 0x2c(r31)
// lwz r7, 0x30(r31)
// lwz r6, 0x34(r31)
// lwz r0, 0x38(r31)
// stw r25, 0x34(r1)
// stw r12, 0x34(r1)
// stw r11, 0x38(r1)
// stw r10, 0x3c(r1)
// stw r9, 0x40(r1)
// stw r8, 0x44(r1)
// stw r7, 0x48(r1)
// stw r6, 0x4c(r1)
// stw r0, 0x50(r1)
// stw r12, 0(r3)
// stw r11, 4(r3)
// stw r10, 8(r3)
// stw r9, 0xc(r3)
// stw r8, 0x10(r3)
// stw r7, 0x14(r3)
// stw r6, 0x18(r3)
// stw r0, 0x1c(r3)
// bl __register_global_object
// lis r4,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@ha
// addi r3, r1, 0x34
// addi r0, r4,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@l
// li r4, 0
// stw r0, 0x34(r1)
// bl __dt__Q37JStudio14TVariableValue7TOutputFv
// lis r4, __vt__Q37JStudio14TVariableValue7TOutput@ha
// lis r3,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@ha
// addi r11, r4, __vt__Q37JStudio14TVariableValue7TOutput@l
// li r9, -1
// stw r11, 0x14(r1)
// addi r10, r3,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@l
// lis r4, __ptmf_null@ha
// lis r3, saoVVOutput___Q214JStudio_JStage14TAdaptor_actor@ha
// stw r10, 0x14(r1)
// addi r8, r4, __ptmf_null@l
// lis r4,
// "__dt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>Fv"@ha
// lwz r7, 0(r8)
// stw r9, 0x18(r1)
// addi r3, r3, saoVVOutput___Q214JStudio_JStage14TAdaptor_actor@l
// addi r4, r4,
// "__dt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>Fv"@l
// addi r5, r30, 0xc
// lwz r6, 4(r8)
// stw r7, 0x1c(r1)
// stw r6, 0x20(r1)
// lwz r0, 8(r8)
// stwu r11, 0x20(r3)
// stw r0, 0x24(r1)
// stw r7, 0x28(r1)
// stw r6, 0x2c(r1)
// stw r0, 0x30(r1)
// stw r10, 0(r3)
// stw r9, 4(r3)
// stw r7, 8(r3)
// stw r6, 0xc(r3)
// stw r0, 0x10(r3)
// stw r7, 0x14(r3)
// stw r6, 0x18(r3)
// stw r0, 0x1c(r3)
// bl __register_global_object
// lis r4,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@ha
// addi r3, r1, 0x14
// addi r0, r4,
// "__vt__Q214JStudio_JStage81TVariableValueOutput_object_<Q214JStudio_JStage14TAdaptor_actor,Q26JStage6TActor>"@l
// li r4, 0
// stw r0, 0x14(r1)
// bl __dt__Q37JStudio14TVariableValue7TOutputFv
// lis r4, __vt__Q37JStudio14TVariableValue7TOutput@ha
// lwz r25, 0x3c(r31)
// addi r29, r4, __vt__Q37JStudio14TVariableValue7TOutput@l
// lis r3,
// saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@ha lwz r12,
// 0x40(r31) li r27, 0 stwu r29,
// saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@l(r3) li
// r26, 0x12d lwz r11, 0x44(r31) addi r28, r31, 0x84 lwz r10,
// 0x48(r31) lis r4,
// __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv@ha
// lwz r9, 0x4c(r31)
// addi r4, r4,
// __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv@l lwz
// r8, 0x50(r31) addi r5, r30, 0x18 lwz r7, 0x54(r31) lwz r6,
// 0x58(r31) lwz r0, 0x5c(r31) stw r29, 0xb4(r1) stw r28,
// 0xb4(r1) stw r27, 0xb8(r1) stw r26, 0xbc(r1) stw r25,
// 0xc0(r1) stw r12, 0xc4(r1) stw r11, 0xc8(r1) stw r10,
// 0xcc(r1) stw r9, 0xd0(r1) stw r8, 0xd4(r1) stw r7, 0xd8(r1)
// stw r6, 0xdc(r1)
// stw r0, 0xe0(r1)
// stw r28, 0(r3)
// stw r27, 4(r3)
// stw r26, 8(r3)
// stw r25, 0xc(r3)
// stw r12, 0x10(r3)
// stw r11, 0x14(r3)
// stw r10, 0x18(r3)
// stw r9, 0x1c(r3)
// stw r8, 0x20(r3)
// stw r7, 0x24(r3)
// stw r6, 0x28(r3)
// stw r0, 0x2c(r3)
// bl __register_global_object
// mr r0, r28
// addi r3, r1, 0xb4
// stw r0, 0xb4(r1)
// li r4, 0
// bl __dt__Q37JStudio14TVariableValue7TOutputFv
// lis r4, __vt__Q37JStudio14TVariableValue7TOutput@ha
// lis r3,
// saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@ha addi
// r25, r4, __vt__Q37JStudio14TVariableValue7TOutput@l lwz r29, 0x60(r31)
// addi r3, r3,
// saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@l lwz r12,
// 0x64(r31) stwu r25, 0x30(r3) li r27, 2 lwz r11, 0x68(r31) li
// r28, 0x131 lwz r10, 0x6c(r31) addi r26, r31, 0x84 lwz r9,
// 0x70(r31) lis r4,
// __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv@ha
// lwz r8, 0x74(r31)
// addi r4, r4,
// __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv@l lwz
// r7, 0x78(r31) addi r5, r30, 0x24 lwz r6, 0x7c(r31) lwz r0,
// 0x80(r31) stw r25, 0x84(r1) stw r26, 0x84(r1) stw r27,
// 0x88(r1) stw r28, 0x8c(r1) stw r29, 0x90(r1) stw r12,
// 0x94(r1) stw r11, 0x98(r1) stw r10, 0x9c(r1) stw r9, 0xa0(r1)
// stw r8, 0xa4(r1)
// stw r7, 0xa8(r1)
// stw r6, 0xac(r1)
// stw r0, 0xb0(r1)
// stw r26, 0(r3)
// stw r27, 4(r3)
// stw r28, 8(r3)
// stw r29, 0xc(r3)
// stw r12, 0x10(r3)
// stw r11, 0x14(r3)
// stw r10, 0x18(r3)
// stw r9, 0x1c(r3)
// stw r8, 0x20(r3)
// stw r7, 0x24(r3)
// stw r6, 0x28(r3)
// stw r0, 0x2c(r3)
// bl __register_global_object
// mr r0, r26
// addi r3, r1, 0x84
// stw r0, 0x84(r1)
// li r4, 0
// bl __dt__Q37JStudio14TVariableValue7TOutputFv
// lis r3, __vt__Q37JStudio14TVariableValue7TOutput@ha
// li r10, -1
// addi r12, r3, __vt__Q37JStudio14TVariableValue7TOutput@l
// li r9, 0
// stw r12, 0x54(r1)
// mr r11, r26
// lis r4, __ptmf_null@ha
// lis r3,
// saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@ha stw r11,
// 0x54(r1) addi r8, r4, __ptmf_null@l lwz r7, 0(r8) lis r4,
// __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv@ha
// stw r10, 0x58(r1)
// addi r3, r3,
// saoVVOutput_ANIMATION_FRAME___Q214JStudio_JStage14TAdaptor_actor@l addi r5,
// r30, 0x30 addi r4, r4,
// __dt__Q314JStudio_JStage14TAdaptor_actor26TVVOutput_ANIMATION_FRAME_Fv@l stw
// r9, 0x5c(r1) lwz r6, 4(r8) stw r7, 8(r1) stw r7, 0x60(r1) stw
// r6, 0x64(r1) lwz r0, 8(r8) stw r6, 0xc(r1) stwu r12, 0x60(r3)
// stw r0, 0x68(r1)
// stw r0, 0x10(r1)
// stw r7, 0x6c(r1)
// stw r6, 0x70(r1)
// stw r0, 0x74(r1)
// stw r7, 0x78(r1)
// stw r6, 0x7c(r1)
// stw r0, 0x80(r1)
// stw r11, 0(r3)
// stw r10, 4(r3)
// stw r9, 8(r3)
// stw r7, 0xc(r3)
// stw r6, 0x10(r3)
// stw r0, 0x14(r3)
// stw r7, 0x18(r3)
// stw r6, 0x1c(r3)
// stw r0, 0x20(r3)
// stw r7, 0x24(r3)
// stw r6, 0x28(r3)
// stw r0, 0x2c(r3)
// bl __register_global_object
// mr r0, r26
// addi r3, r1, 0x54
// stw r0, 0x54(r1)
// li r4, 0
// bl __dt__Q37JStudio14TVariableValue7TOutputFv
// lmw r25, 0xf4(r1)
// lwz r0, 0x114(r1)
// mtlr r0
// addi r1, r1, 0x110
// blr
// */
// }
/**
* @note Address: 0x800130FC
* @note Size: 0x60
*/
// void TVariableValueOutput_object_<TAdaptor_actor, JStage::TActor>::~TVariableValueOutput_object_()
// {
// /*
// .loc_0x0:
// stwu r1, -0x10(r1)
// mflr r0
// stw r0, 0x14(r1)
// stw r31, 0xC(r1)
// mr r31, r4
// stw r30, 0x8(r1)
// mr. r30, r3
// beq- .loc_0x44
// lis r5, 0x804A
// li r4, 0
// subi r0, r5, 0x91C
// stw r0, 0x0(r30)
// bl -0x60C4
// extsh. r0, r31
// ble- .loc_0x44
// mr r3, r30
// bl 0x10F78
// .loc_0x44:
// lwz r0, 0x14(r1)
// mr r3, r30
// lwz r31, 0xC(r1)
// lwz r30, 0x8(r1)
// mtlr r0
// addi r1, r1, 0x10
// blr
// */
// }
/**
* @note Address: 0x8001315C
* @note Size: 0x30
*/
// void TVariableValueOutput_object_<TAdaptor_actor, JStage::TActor>::operator()(f32,
// JStudio::TAdaptor*) const
// {
// /*
// .loc_0x0:
// stwu r1, -0x10(r1)
// mflr r0
// mr r5, r3
// stw r0, 0x14(r1)
// addi r12, r5, 0x8
// lwz r3, 0x128(r4)
// bl 0xAE9B0
// nop
// lwz r0, 0x14(r1)
// mtlr r0
// addi r1, r1, 0x10
// blr
// */
// }
} // namespace JStudio_JStage

View File

@ -3,108 +3,14 @@
#include "JSystem/JStudio_JStage.h"
#include "types.h"
/*
Generated from dpostproc
.section .ctors, "wa" # 0x80472F00 - 0x804732C0
.4byte "__sinit_object-camera_cpp"
.section .data, "wa" # 0x8049E220 - 0x804EFC20
.global lbl_8049F728
lbl_8049F728:
.4byte 0x00000000
.4byte 0x00000090
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x0000008C
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000058
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000054
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000048
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000044
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x00000050
.4byte 0x00000000
.4byte 0x00000000
.4byte 0x0000004C
.4byte 0x00000000
.global __vt__Q214JStudio_JStage15TAdaptor_camera
__vt__Q214JStudio_JStage15TAdaptor_camera:
.4byte 0
.4byte 0
.4byte __dt__Q214JStudio_JStage15TAdaptor_cameraFv
.4byte
adaptor_do_prepare__Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio7TObject
.4byte
adaptor_do_begin__Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio7TObject
.4byte
adaptor_do_end__Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio7TObject
.4byte
adaptor_do_update__Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio7TObjectUl
.4byte
adaptor_do_data__Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio7TObjectPCvUlPCvUl
.4byte
adaptor_do_PARENT__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_PARENT_NODE__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_PARENT_ENABLE__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_PARENT_FUNCTION__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_TARGET_PARENT__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_TARGET_PARENT_NODE__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte
adaptor_do_TARGET_PARENT_ENABLE__Q214JStudio_JStage15TAdaptor_cameraFQ37JStudio4data15TEOperationDataPCvUl
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.global
"__vt__Q214JStudio_JStage83TVariableValueOutput_object_<Q214JStudio_JStage15TAdaptor_camera,Q26JStage7TCamera>"
"__vt__Q214JStudio_JStage83TVariableValueOutput_object_<Q214JStudio_JStage15TAdaptor_camera,Q26JStage7TCamera>":
.4byte 0
.4byte 0
.4byte
"__cl__Q214JStudio_JStage83TVariableValueOutput_object_<Q214JStudio_JStage15TAdaptor_camera,Q26JStage7TCamera>CFfPQ27JStudio8TAdaptor"
.4byte
"__dt__Q214JStudio_JStage83TVariableValueOutput_object_<Q214JStudio_JStage15TAdaptor_camera,Q26JStage7TCamera>Fv"
.4byte 0
.4byte 0
.4byte 0
.4byte 0
.section .bss # 0x804EFC20 - 0x8051467C
.global saoVVOutput___Q214JStudio_JStage15TAdaptor_camera
saoVVOutput___Q214JStudio_JStage15TAdaptor_camera:
.skip 0xA0
*/
namespace JStudio_JStage {
const TAdaptor_camera::TVVOutput TAdaptor_camera::saoVVOutput_[5] = {
TVVOutput(4, nullptr, nullptr), TVVOutput(5, nullptr, nullptr), TVVOutput(4, nullptr, nullptr),
TVVOutput(5, nullptr, nullptr), TVVOutput(-1, nullptr, nullptr),
TVVOutput(7, &JStage::TCamera::JSGSetViewRoll, &JStage::TCamera::JSGGetViewRoll),
TVVOutput(6, &JStage::TCamera::JSGSetProjectionFovy, &JStage::TCamera::JSGGetProjectionFovy),
TVVOutput(8, &JStage::TCamera::JSGSetProjectionNear, &JStage::TCamera::JSGGetProjectionNear),
TVVOutput(9, &JStage::TCamera::JSGSetProjectionFar, &JStage::TCamera::JSGGetProjectionFar),
TVVOutput(-1, nullptr, nullptr),
};
/**
@ -146,74 +52,15 @@ void JStudio_JStage::TAdaptor_camera::adaptor_do_prepare(const JStudio::TObject*
* @note Address: 0x800135AC
* @note Size: 0xE8
*/
void JStudio_JStage::TAdaptor_camera::adaptor_do_begin(const JStudio::TObject*)
void JStudio_JStage::TAdaptor_camera::adaptor_do_begin(const JStudio::TObject* object)
{
/*
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
stw r31, 0x1c(r1)
stw r30, 0x18(r1)
stw r29, 0x14(r1)
mr r29, r4
stw r28, 0x10(r1)
mr r28, r3
lwz r30, 0x100(r3)
lwz r12, 0(r30)
mr r3, r30
lwz r12, 0x18(r12)
mtctr r12
bctrl
lwz r12, 0(r30)
ori r4, r3, 1
mr r3, r30
lwz r12, 0x1c(r12)
mtctr r12
bctrl
lwz r30, 0x14(r29)
mr r3, r28
mr r4, r30
bl
getJSG_position___Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio8TControl mr
r3, r28 mr r4, r30 bl
getJSG_targetPosition___Q214JStudio_JStage15TAdaptor_cameraFPCQ27JStudio8TControl
lis r4, saoVVOutput___Q214JStudio_JStage15TAdaptor_camera@ha
lis r3,
update_immediate___Q27JStudio14TVariableValueFPQ27JStudio14TVariableValued@ha
addi r0, r4, saoVVOutput___Q214JStudio_JStage15TAdaptor_camera@l
li r31, 0
mr r29, r0
addi r30, r3,
update_immediate___Q27JStudio14TVariableValueFPQ27JStudio14TVariableValued@l b
lbl_80013668
lbl_80013638:
lwz r3, 0x100(r28)
addi r12, r29, 0x14
bl __ptmf_scall
nop
lwz r0, 4(r29)
addi r29, r29, 0x20
lwz r3, 4(r28)
mulli r0, r0, 0x14
add r3, r3, r0
stw r30, 8(r3)
stw r31, 4(r3)
stfs f1, 0xc(r3)
lbl_80013668:
lwz r0, 4(r29)
cmpwi r0, -1
bne lbl_80013638
lwz r0, 0x24(r1)
lwz r31, 0x1c(r1)
lwz r30, 0x18(r1)
lwz r29, 0x14(r1)
lwz r28, 0x10(r1)
mtlr r0
addi r1, r1, 0x20
blr
*/
get_pJSG()->setFlagOn(1);
JStudio::TControl* control = object->getControl();
getJSG_position_(control);
getJSG_targetPosition_(control);
for (const TVVOutput* output = saoVVOutput_; output->mValueIndex != -1; output++) {
mVariableValues[output->mValueIndex].setValueImmediate((mObject->*(output->mGetter))());
}
}
/**
@ -228,7 +75,7 @@ void JStudio_JStage::TAdaptor_camera::adaptor_do_end(const JStudio::TObject*) {
*/
void JStudio_JStage::TAdaptor_camera::adaptor_do_update(const JStudio::TObject* object, u32 p2)
{
const JStudio::TControl* control = static_cast<JStudio::TControl*>(object->mControl);
const JStudio::TControl* control = object->getControl();
setJSG_position_(control);
setJSG_targetPosition_(control);
mObject->JSGUpdate();
@ -278,49 +125,24 @@ void JStudio_JStage::TAdaptor_camera::adaptor_do_PARENT_NODE(JStudio::data::TEOp
*/
void JStudio_JStage::TAdaptor_camera::adaptor_do_PARENT_ENABLE(JStudio::data::TEOperationData operation, const void* p2, u32 p3)
{
/*
.loc_0x0:
stwu r1, -0x10(r1)
mflr r0
cmpwi r4, 0x2
stw r0, 0x14(r1)
beq- .loc_0x18
b .loc_0x70
.loc_0x18:
lwz r4, 0x0(r5)
neg r0, r4
or r0, r0, r4
rlwinm r0,r0,1,31,31
stb r0, 0x110(r3)
lwz r0, 0x104(r3)
cmpwi r0, 0x1
beq- .loc_0x40
bge- .loc_0x70
b .loc_0x70
.loc_0x40:
lbz r0, 0x110(r3)
li r4, 0
li r5, -0x1
cmplwi r0, 0
beq- .loc_0x5C
lwz r4, 0x108(r3)
lwz r5, 0x10C(r3)
.loc_0x5C:
lwz r3, 0x100(r3)
lwz r12, 0x0(r3)
lwz r12, 0x2C(r12)
mtctr r12
bctrl
.loc_0x70:
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
*/
switch (operation) {
case JStudio::data::TEOD_Unknown_02:
_110 = ((int*)p2)[0] != 0;
switch (_104) {
case 1:
JStage::TObject* parent = nullptr;
u32 idx = -1;
if (_110) {
parent = _108;
idx = _10C;
}
get_pJSG()->JSGSetParent(parent, idx);
break;
case 0:
break;
}
break;
}
}
/**
@ -380,337 +202,186 @@ void JStudio_JStage::TAdaptor_camera::adaptor_do_TARGET_PARENT_ENABLE(JStudio::d
* @note Address: 0x8001396C
* @note Size: 0xFC
*/
void JStudio_JStage::TAdaptor_camera::setJSG_position_(const JStudio::TControl*)
void JStudio_JStage::TAdaptor_camera::setJSG_position_(const JStudio::TControl* control)
{
/*
stwu r1, -0x60(r1)
mflr r0
lis r5, sauVariableValue_3_POSITION_XYZ__Q27JStudio15TAdaptor_camera@ha
stw r0, 0x64(r1)
addi r5, r5,
sauVariableValue_3_POSITION_XYZ__Q27JStudio15TAdaptor_camera@l stw r31,
0x5c(r1) mr r31, r4 addi r4, r1, 0x14 stw r30, 0x58(r1) mr r30,
r3 bl adaptor_getVariableValue_Vec__Q27JStudio8TAdaptorCFP3VecPCUl lbz r0,
0x110(r30) cmplwi r0, 0 bne lbl_800139D4 lbz r0, 0x74(r31) cmplwi
r0, 0 bne lbl_800139B8 addi r0, r1, 0x14 b lbl_800139CC
Mtx mtx;
JStudio::TControl::TTransform_position transform;
JStudio::TControl::TTransform_position tempTransform;
JStudio::TControl::TTransform_position* outTransform;
adaptor_getVariableValue_Vec(&transform.mPosition, sauVariableValue_3_POSITION_XYZ);
lbl_800139B8:
addi r3, r31, 0x98
addi r4, r1, 0x14
addi r5, r1, 8
bl PSMTXMultVec
addi r0, r1, 8
if (!_110) {
JStudio::TControl::TTransform_position* pos;
if (!control->mTransformOnSet) {
pos = &transform;
} else {
PSMTXMultVec(control->mTransformOnSet_Mtx, &transform.mPosition, &tempTransform.mPosition);
pos = &tempTransform;
}
lbl_800139CC:
mr r4, r0
b lbl_80013A3C
outTransform = pos;
} else {
outTransform = &transform;
switch (_104) {
case 0:
bool check;
if (!transform_toGlobalFromLocal(mtx, *outTransform, _108, _10C)) {
check = false;
} else {
tempTransform.mPosition.x = mtx[0][3];
tempTransform.mPosition.y = mtx[1][3];
tempTransform.mPosition.z = mtx[2][3];
check = true;
}
lbl_800139D4:
lwz r0, 0x104(r30)
addi r4, r1, 0x14
cmpwi r0, 1
beq lbl_80013A3C
bge lbl_80013A3C
cmpwi r0, 0
bge lbl_800139F4
b lbl_80013A3C
if (!check) {
return;
}
outTransform = &tempTransform;
break;
case 1:
break;
}
}
lbl_800139F4:
lwz r5, 0x108(r30)
addi r3, r1, 0x20
lwz r6, 0x10c(r30)
bl
transform_toGlobalFromLocal__14JStudio_JStageFPA4_fRCQ37JStudio8TControl19TTransform_positionPCQ26JStage7TObjectUl
clrlwi. r0, r3, 0x18
bne lbl_80013A14
li r0, 0
b lbl_80013A30
lbl_80013A14:
lfs f2, 0x2c(r1)
li r0, 1
lfs f1, 0x3c(r1)
lfs f0, 0x4c(r1)
stfs f2, 8(r1)
stfs f1, 0xc(r1)
stfs f0, 0x10(r1)
lbl_80013A30:
clrlwi. r0, r0, 0x18
beq lbl_80013A50
addi r4, r1, 8
lbl_80013A3C:
lwz r3, 0x100(r30)
lwz r12, 0(r3)
lwz r12, 0x78(r12)
mtctr r12
bctrl
lbl_80013A50:
lwz r0, 0x64(r1)
lwz r31, 0x5c(r1)
lwz r30, 0x58(r1)
mtlr r0
addi r1, r1, 0x60
blr
*/
get_pJSG()->JSGSetViewPosition(outTransform->mPosition);
}
/**
* @note Address: 0x80013A68
* @note Size: 0x108
*/
void JStudio_JStage::TAdaptor_camera::getJSG_position_(const JStudio::TControl*)
void JStudio_JStage::TAdaptor_camera::getJSG_position_(const JStudio::TControl* control)
{
/*
stwu r1, -0x60(r1)
mflr r0
stw r0, 0x64(r1)
stw r31, 0x5c(r1)
mr r31, r4
addi r4, r1, 0x14
stw r30, 0x58(r1)
mr r30, r3
lwz r3, 0x100(r3)
lwz r12, 0(r3)
lwz r12, 0x74(r12)
mtctr r12
bctrl
lbz r0, 0x110(r30)
cmplwi r0, 0
bne lbl_80013AD8
lbz r0, 0x75(r31)
cmplwi r0, 0
bne lbl_80013ABC
addi r0, r1, 0x14
b lbl_80013AD0
Mtx mtx;
JStudio::TControl::TTransform_position transform;
JStudio::TControl::TTransform_position tempTransform;
JStudio::TControl::TTransform_position* outTransform;
lbl_80013ABC:
addi r3, r31, 0xc8
addi r4, r1, 0x14
addi r5, r1, 8
bl PSMTXMultVec
addi r0, r1, 8
get_pJSG()->JSGGetViewPosition(&transform.mPosition);
lbl_80013AD0:
mr r4, r0
b lbl_80013B40
if (!_110) {
JStudio::TControl::TTransform_position* pos;
if (!control->mTransformOnGet) {
pos = &transform;
} else {
PSMTXMultVec(control->mTransformOnGet_Mtx, &transform.mPosition, &tempTransform.mPosition);
pos = &tempTransform;
}
lbl_80013AD8:
lwz r0, 0x104(r30)
addi r4, r1, 0x14
cmpwi r0, 1
beq lbl_80013B40
bge lbl_80013B40
cmpwi r0, 0
bge lbl_80013AF8
b lbl_80013B40
outTransform = pos;
} else {
outTransform = &transform;
switch (_104) {
case 0:
bool check;
if (!transform_toLocalFromGlobal(mtx, *outTransform, _108, _10C)) {
check = false;
} else {
tempTransform.mPosition.x = mtx[0][3];
tempTransform.mPosition.y = mtx[1][3];
tempTransform.mPosition.z = mtx[2][3];
check = true;
}
lbl_80013AF8:
lwz r5, 0x108(r30)
addi r3, r1, 0x20
lwz r6, 0x10c(r30)
bl
transform_toLocalFromGlobal__14JStudio_JStageFPA4_fRCQ37JStudio8TControl19TTransform_positionPCQ26JStage7TObjectUl
clrlwi. r0, r3, 0x18
bne lbl_80013B18
li r0, 0
b lbl_80013B34
if (!check) {
return;
}
outTransform = &tempTransform;
break;
case 1:
break;
}
}
lbl_80013B18:
lfs f2, 0x2c(r1)
li r0, 1
lfs f1, 0x3c(r1)
lfs f0, 0x4c(r1)
stfs f2, 8(r1)
stfs f1, 0xc(r1)
stfs f0, 0x10(r1)
lbl_80013B34:
clrlwi. r0, r0, 0x18
beq lbl_80013B58
addi r4, r1, 8
lbl_80013B40:
lis r5, sauVariableValue_3_POSITION_XYZ__Q27JStudio15TAdaptor_camera@ha
mr r3, r30
addi r0, r5,
sauVariableValue_3_POSITION_XYZ__Q27JStudio15TAdaptor_camera@l mr r5, r4
mr r4, r0
bl adaptor_setVariableValue_Vec__Q27JStudio8TAdaptorFPCUlRC3Vec
lbl_80013B58:
lwz r0, 0x64(r1)
lwz r31, 0x5c(r1)
lwz r30, 0x58(r1)
mtlr r0
addi r1, r1, 0x60
blr
*/
adaptor_setVariableValue_Vec(sauVariableValue_3_POSITION_XYZ, outTransform->mPosition);
}
/**
* @note Address: 0x80013B70
* @note Size: 0xE0
*/
void JStudio_JStage::TAdaptor_camera::setJSG_targetPosition_(const JStudio::TControl*)
void JStudio_JStage::TAdaptor_camera::setJSG_targetPosition_(const JStudio::TControl* control)
{
/*
.loc_0x0:
stwu r1, -0x60(r1)
mflr r0
lis r5, 0x8047
stw r0, 0x64(r1)
addi r5, r5, 0x339C
stw r31, 0x5C(r1)
mr r31, r4
addi r4, r1, 0x14
stw r30, 0x58(r1)
mr r30, r3
bl -0x686C
lbz r0, 0x11C(r30)
cmplwi r0, 0
bne- .loc_0x68
lbz r0, 0x74(r31)
cmplwi r0, 0
bne- .loc_0x4C
addi r0, r1, 0x14
b .loc_0x60
Mtx mtx;
JStudio::TControl::TTransform_position transform;
JStudio::TControl::TTransform_position tempTransform;
JStudio::TControl::TTransform_position* outTransform;
adaptor_getVariableValue_Vec(&transform.mPosition, sauVariableValue_3_TARGET_POSITION_XYZ);
.loc_0x4C:
addi r3, r31, 0x98
addi r4, r1, 0x14
addi r5, r1, 0x8
bl 0xD7010
addi r0, r1, 0x8
if (!_11C) {
JStudio::TControl::TTransform_position* pos;
if (!control->mTransformOnSet) {
pos = &transform;
} else {
PSMTXMultVec(control->mTransformOnSet_Mtx, &transform.mPosition, &tempTransform.mPosition);
pos = &tempTransform;
}
.loc_0x60:
mr r4, r0
b .loc_0xB4
outTransform = pos;
} else {
outTransform = &transform;
bool check;
if (!transform_toGlobalFromLocal(mtx, *outTransform, _114, _118)) {
check = false;
} else {
tempTransform.mPosition.x = mtx[0][3];
tempTransform.mPosition.y = mtx[1][3];
tempTransform.mPosition.z = mtx[2][3];
check = true;
}
.loc_0x68:
lwz r5, 0x114(r30)
addi r3, r1, 0x20
lwz r6, 0x118(r30)
addi r4, r1, 0x14
bl -0x1D84
rlwinm. r0,r3,0,24,31
bne- .loc_0x8C
li r0, 0
b .loc_0xA8
if (!check) {
return;
}
outTransform = &tempTransform;
}
.loc_0x8C:
lfs f2, 0x2C(r1)
li r0, 0x1
lfs f1, 0x3C(r1)
lfs f0, 0x4C(r1)
stfs f2, 0x8(r1)
stfs f1, 0xC(r1)
stfs f0, 0x10(r1)
.loc_0xA8:
rlwinm. r0,r0,0,24,31
beq- .loc_0xC8
addi r4, r1, 0x8
.loc_0xB4:
lwz r3, 0x100(r30)
lwz r12, 0x0(r3)
lwz r12, 0x88(r12)
mtctr r12
bctrl
.loc_0xC8:
lwz r0, 0x64(r1)
lwz r31, 0x5C(r1)
lwz r30, 0x58(r1)
mtlr r0
addi r1, r1, 0x60
blr
*/
get_pJSG()->JSGSetViewTargetPosition(outTransform->mPosition);
}
/**
* @note Address: 0x80013C50
* @note Size: 0xE4
*/
void JStudio_JStage::TAdaptor_camera::getJSG_targetPosition_(const JStudio::TControl*)
void JStudio_JStage::TAdaptor_camera::getJSG_targetPosition_(const JStudio::TControl* control)
{
/*
.loc_0x0:
stwu r1, -0x60(r1)
mflr r0
stw r0, 0x64(r1)
stw r31, 0x5C(r1)
mr r31, r4
addi r4, r1, 0x14
stw r30, 0x58(r1)
mr r30, r3
lwz r3, 0x100(r3)
lwz r12, 0x0(r3)
lwz r12, 0x84(r12)
mtctr r12
bctrl
lbz r0, 0x11C(r30)
cmplwi r0, 0
bne- .loc_0x70
lbz r0, 0x75(r31)
cmplwi r0, 0
bne- .loc_0x54
addi r0, r1, 0x14
b .loc_0x68
Mtx mtx;
JStudio::TControl::TTransform_position transform;
JStudio::TControl::TTransform_position tempTransform;
JStudio::TControl::TTransform_position* outTransform;
.loc_0x54:
addi r3, r31, 0xC8
addi r4, r1, 0x14
addi r5, r1, 0x8
bl 0xD6F28
addi r0, r1, 0x8
get_pJSG()->JSGGetViewTargetPosition(&transform.mPosition);
.loc_0x68:
mr r5, r0
b .loc_0xBC
if (!_11C) {
JStudio::TControl::TTransform_position* pos;
if (!control->mTransformOnGet) {
pos = &transform;
} else {
PSMTXMultVec(control->mTransformOnGet_Mtx, &transform.mPosition, &tempTransform.mPosition);
pos = &tempTransform;
}
.loc_0x70:
lwz r5, 0x114(r30)
addi r3, r1, 0x20
lwz r6, 0x118(r30)
addi r4, r1, 0x14
bl -0x1D30
rlwinm. r0,r3,0,24,31
bne- .loc_0x94
li r0, 0
b .loc_0xB0
outTransform = pos;
} else {
outTransform = &transform;
bool check;
if (!transform_toLocalFromGlobal(mtx, *outTransform, _114, _118)) {
check = false;
} else {
tempTransform.mPosition.x = mtx[0][3];
tempTransform.mPosition.y = mtx[1][3];
tempTransform.mPosition.z = mtx[2][3];
check = true;
}
.loc_0x94:
lfs f2, 0x2C(r1)
li r0, 0x1
lfs f1, 0x3C(r1)
lfs f0, 0x4C(r1)
stfs f2, 0x8(r1)
stfs f1, 0xC(r1)
stfs f0, 0x10(r1)
if (!check) {
return;
}
outTransform = &tempTransform;
}
.loc_0xB0:
rlwinm. r0,r0,0,24,31
beq- .loc_0xCC
addi r5, r1, 0x8
.loc_0xBC:
lis r4, 0x8047
mr r3, r30
addi r4, r4, 0x339C
bl -0x6A5C
.loc_0xCC:
lwz r0, 0x64(r1)
lwz r31, 0x5C(r1)
lwz r30, 0x58(r1)
mtlr r0
addi r1, r1, 0x60
blr
*/
adaptor_setVariableValue_Vec(sauVariableValue_3_TARGET_POSITION_XYZ, outTransform->mPosition);
}
} // namespace JStudio_JStage

View File

@ -7,8 +7,8 @@
namespace JStudio_JStage {
const TAdaptor_fog::TVVOutput TAdaptor_fog::saoVVOutput_[3]
= { TVVOutput(4, &JStage::TFog::virtual_48, &JStage::TFog::virtual_44),
TVVOutput(5, &JStage::TFog::virtual_50, &JStage::TFog::virtual_4C), TVVOutput(-1, nullptr, nullptr) };
= { TVVOutput(4, &JStage::TFog::JSGSetStartZ, &JStage::TFog::JSGGetStartZ),
TVVOutput(5, &JStage::TFog::JSGSetEndZ, &JStage::TFog::JSGGetEndZ), TVVOutput(-1, nullptr, nullptr) };
/**
* @note Address: 0x80014134

View File

@ -1,8 +1,9 @@
#include "JSystem/JStudio_JStage.h"
#include "stl/math.h"
namespace JStudio_JStage {
const TAdaptor_light::TVVOutput_direction_ saoVVOutput_direction[6]
TAdaptor_light::TVVOutput_direction_ TAdaptor_light::saoVVOutput_direction_[6]
= { TAdaptor_light::TVVOutput_direction_(10, 1), TAdaptor_light::TVVOutput_direction_(11, 1),
TAdaptor_light::TVVOutput_direction_(7, 2), TAdaptor_light::TVVOutput_direction_(8, 2),
TAdaptor_light::TVVOutput_direction_(9, 2), TAdaptor_light::TVVOutput_direction_(-1, 0) };
@ -30,7 +31,7 @@ TAdaptor_light::~TAdaptor_light() { adaptor_do_end(nullptr); }
*/
void TAdaptor_light::adaptor_do_prepare(const JStudio::TObject* obj)
{
for (const TVVOutput_direction_* output = saoVVOutput_direction; output->mValueIndex != -1; output++) {
for (const TVVOutput_direction_* output = saoVVOutput_direction_; output->mValueIndex != -1; output++) {
mVariableValues[output->mValueIndex].setOutput(output);
}
}
@ -39,8 +40,43 @@ void TAdaptor_light::adaptor_do_prepare(const JStudio::TObject* obj)
* @note Address: 0x80011530
* @note Size: 0x2AC
*/
void TAdaptor_light::adaptor_do_begin(const JStudio::TObject*)
void TAdaptor_light::adaptor_do_begin(const JStudio::TObject* object)
{
mObject->setFlagOn(1);
JStudio::TControl* control = object->getControl(); // r29
GXColor color = mObject->JSGGetColor();
adaptor_setVariableValue_GXColor(sauVariableValue_4_COLOR_RGBA, color);
JStudio::TControl::TTransform_position_direction posDir;
JStudio::TControl::TTransform_position_direction* vvVec = &posDir;
mObject->JSGGetPosition(&posDir.mPosition);
mObject->JSGGetDirection(&posDir.mDirection);
// this should probably be an inline
if (!control->mTransformOnGet) {
vvVec = &posDir;
} else {
JStudio::TControl::TTransform_position_direction transformedPosDir;
PSMTXMultVec(control->mTransformOnGet_Mtx, &posDir.mPosition, &transformedPosDir.mPosition);
PSMTXMultVecSR(control->mTransformOnGet_Mtx, &vvVec->mPosition, &transformedPosDir.mDirection);
vvVec = &transformedPosDir;
}
adaptor_setVariableValue_Vec(sauVariableValue_3_POSITION_XYZ, vvVec->mPosition);
f32 x = vvVec->mDirection.x;
f32 y = vvVec->mDirection.y;
f32 z = vvVec->mDirection.z;
f32 dist = dolsqrtfull(x * x + z * z);
f32 atanVal1 = dolatan2f(x, z);
f32 atanVal2 = dolatan2f(y, dist);
adaptor_setVariableValue_immediate(10, 57.29578f * atanVal1);
adaptor_setVariableValue_immediate(11, 57.29578f * atanVal2);
Vec targetPos;
PSVECAdd(&vvVec->mPosition, &vvVec->mDirection, &targetPos);
adaptor_setVariableValue_Vec(sauVariableValue_3_TARGET_POSITION_XYZ, targetPos);
/*
stwu r1, -0x90(r1)
mflr r0
@ -235,169 +271,63 @@ r1, 0x10 bl adaptor_setVariableValue_Vec__Q27JStudio8TAdaptorFPCUlRC3Vec
* @note Address: 0x800117DC
* @note Size: 0x54
*/
void TAdaptor_light::adaptor_do_end(const JStudio::TObject*)
{
JStage::TLight* obj = mObject;
obj->JSGSetFlag(obj->JSGGetFlag() & ~0x1);
}
void TAdaptor_light::adaptor_do_end(const JStudio::TObject*) { mObject->setFlagOff(1); }
/**
* @note Address: 0x80011830
* @note Size: 0x1C8
*/
void TAdaptor_light::adaptor_do_update(const JStudio::TObject*, u32)
void TAdaptor_light::adaptor_do_update(const JStudio::TObject* object, u32 p2)
{
/*
.loc_0x0:
stwu r1, -0x90(r1)
mflr r0
stw r0, 0x94(r1)
stfd f31, 0x80(r1)
psq_st f31,0x88(r1),0,0
stfd f30, 0x70(r1)
psq_st f30,0x78(r1),0,0
stfd f29, 0x60(r1)
psq_st f29,0x68(r1),0,0
stw r31, 0x5C(r1)
stw r30, 0x58(r1)
lis r5, 0x8047
lwz r31, 0x14(r4)
addi r5, r5, 0x33D0
mr r30, r3
addi r4, r1, 0xC
bl -0x442C
lwz r0, 0xC(r1)
addi r4, r1, 0x8
stw r0, 0x8(r1)
lwz r3, 0x114(r30)
lwz r12, 0x0(r3)
lwz r12, 0x50(r12)
mtctr r12
bctrl
lis r4, 0x8047
mr r3, r30
addi r5, r4, 0x33E0
addi r4, r1, 0x34
bl -0x4578
lwz r0, 0x118(r30)
cmpwi r0, 0x2
beq- .loc_0xF8
bge- .loc_0x11C
cmpwi r0, 0x1
bge- .loc_0x94
b .loc_0x11C
JStudio::TControl* control = object->getControl();
GXColor color;
adaptor_getVariableValue_GXColor(&color, sauVariableValue_4_COLOR_RGBA);
get_pJSG_()->JSGSetColor(color);
.loc_0x94:
lwz r3, 0x4(r30)
lfs f1, -0x7EBC(r2)
lfs f0, 0xDC(r3)
lfs f31, 0xC8(r3)
fmuls f29, f1, f0
fmr f1, f29
bl 0xBD9D8
frsp f30, f1
fmr f1, f29
bl 0xBDF34
lfs f0, -0x7EBC(r2)
frsp f29, f1
fmuls f31, f0, f31
fmr f1, f31
bl 0xBDF20
frsp f0, f1
stfs f29, 0x44(r1)
fmr f1, f31
fmuls f0, f30, f0
stfs f0, 0x40(r1)
bl 0xBD9A0
frsp f0, f1
fmuls f0, f30, f0
stfs f0, 0x48(r1)
b .loc_0x11C
JStudio::TControl::TTransform_position_direction posDir1;
adaptor_getVariableValue_Vec(&posDir1.mPosition, sauVariableValue_3_POSITION_XYZ);
.loc_0xF8:
lis r4, 0x8047
mr r3, r30
addi r5, r4, 0x33EC
addi r4, r1, 0x10
bl -0x460C
addi r3, r1, 0x10
addi r4, r1, 0x34
addi r5, r1, 0x40
bl 0xD9590
switch (_118) {
case 1:
f32 val10 = adaptor_getVariableValue(10)->getValue();
f32 val11 = adaptor_getVariableValue(11)->getValue();
f32 cosX = dolcosf(DEG2RAD * val11);
f32 sinX = dolsinf(DEG2RAD * val11);
.loc_0x11C:
lbz r0, 0x74(r31)
cmplwi r0, 0
bne- .loc_0x130
addi r31, r1, 0x34
b .loc_0x154
posDir1.mDirection.x = cosX * dolsinf(DEG2RAD * val10);
posDir1.mDirection.y = sinX;
posDir1.mDirection.z = cosX * dolcosf(DEG2RAD * val10);
.loc_0x130:
addi r3, r31, 0x98
addi r4, r1, 0x34
addi r5, r1, 0x1C
bl 0xD926C
addi r3, r31, 0x98
addi r4, r1, 0x40
addi r5, r1, 0x28
bl 0xD92B0
addi r31, r1, 0x1C
break;
case 2:
Vec target;
adaptor_getVariableValue_Vec(&target, sauVariableValue_3_TARGET_POSITION_XYZ);
PSVECSubtract(&target, &posDir1.mPosition, &posDir1.mDirection);
break;
}
.loc_0x154:
lwz r3, 0x114(r30)
mr r4, r31
lwz r12, 0x0(r3)
lwz r12, 0x48(r12)
mtctr r12
bctrl
lwz r3, 0x114(r30)
addi r4, r31, 0xC
lwz r12, 0x0(r3)
lwz r12, 0x68(r12)
mtctr r12
bctrl
lwz r3, 0x114(r30)
lwz r12, 0x0(r3)
lwz r12, 0x14(r12)
mtctr r12
bctrl
psq_l f31,0x88(r1),0,0
lfd f31, 0x80(r1)
psq_l f30,0x78(r1),0,0
lfd f30, 0x70(r1)
psq_l f29,0x68(r1),0,0
lfd f29, 0x60(r1)
lwz r31, 0x5C(r1)
lwz r0, 0x94(r1)
lwz r30, 0x58(r1)
mtlr r0
addi r1, r1, 0x90
blr
*/
JStudio::TControl::TTransform_position_direction* posDir;
if (!control->mTransformOnSet) {
posDir = &posDir1;
} else {
JStudio::TControl::TTransform_position_direction posDir2;
PSMTXMultVec(control->mTransformOnSet_Mtx, &posDir1.mPosition, &posDir2.mPosition);
PSMTXMultVecSR(control->mTransformOnSet_Mtx, &posDir1.mDirection, &posDir2.mDirection);
posDir = &posDir2;
}
get_pJSG_()->JSGSetPosition(posDir->mPosition);
get_pJSG_()->JSGSetDirection(posDir->mDirection);
get_pJSG_()->JSGUpdate();
}
/**
* @note Address: 0x800119F8
* @note Size: 0x34
*/
void TAdaptor_light::adaptor_do_data(const JStudio::TObject*, const void*, u32, const void*, u32)
void TAdaptor_light::adaptor_do_data(const JStudio::TObject* object, const void* p2, u32 p3, const void* p4, u32 p5)
{
/*
.loc_0x0:
stwu r1, -0x10(r1)
mflr r0
mr r4, r5
mr r5, r6
stw r0, 0x14(r1)
mr r6, r7
mr r7, r8
lwz r3, 0x114(r3)
bl 0x62C
lwz r0, 0x14(r1)
mtlr r0
addi r1, r1, 0x10
blr
*/
TAdaptor_object_::adaptor_data_(mObject, p2, p3, p4, p5);
}
/**
@ -408,24 +338,27 @@ void TAdaptor_light::adaptor_do_FACULTY(JStudio::data::TEOperationData op, const
{
switch (op) {
case JStudio::data::TEOD_Unknown_02:
return;
JStage::TELight lightType = JStage::TELIGHT_Unk0;
switch (((int*)data)[0]) {
default:
return;
case 0x301:
lightType = JStage::TELIGHT_Unk1;
break;
case 0x302:
lightType = JStage::TELIGHT_Unk2;
break;
case 0x303:
lightType = JStage::TELIGHT_Unk3;
break;
}
get_pJSG_()->JSGSetLightType(lightType);
break;
default:
break;
}
int flag;
switch (((int*)data)[0]) {
default:
return;
case 0x300:
flag = 1;
break;
case 0x302:
flag = 2;
break;
case 0x303:
flag = 3;
break;
}
mObject->JSGSetFlag(flag);
/*
.loc_0x0:
stwu r1, -0x10(r1)

View File

@ -997,3 +997,5 @@ You have 4584 out of 10000 Pokos and 113 out of 201 treasures.",2024-05-21 21:33
You have 4591 out of 10000 Pokos and 113 out of 201 treasures.",2024-05-21 22:29:01.908610
4595,2137948,0.45954132447415846,113,402733,0.564957017967163,"
You have 4595 out of 10000 Pokos and 113 out of 201 treasures.",2024-05-23 17:13:46.008587
4600,2140264,0.4600391371934024,113,402949,0.565260024464969,"
You have 4600 out of 10000 Pokos and 113 out of 201 treasures.",2024-05-27 02:38:52.714408

1 code_count_in_pokos code_completion_in_bytes code_completion_in_percentage data_count_in_treasures data_completion_in_bytes data_completion_in_percentage sentence created_at
997
998
999
1000
1001