This commit is contained in:
Jcw87 2023-09-05 11:08:56 -07:00 committed by GitHub
parent 5d723a823f
commit d56a9719ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 166 additions and 204 deletions

View File

@ -1,33 +0,0 @@
lbl_80325800:
/* 80325800 88 04 00 00 */ lbz r0, 0(r4)
/* 80325804 98 03 00 00 */ stb r0, 0(r3)
/* 80325808 88 04 00 01 */ lbz r0, 1(r4)
/* 8032580C 98 03 00 01 */ stb r0, 1(r3)
/* 80325810 A0 04 00 02 */ lhz r0, 2(r4)
/* 80325814 B0 03 00 02 */ sth r0, 2(r3)
/* 80325818 C0 04 00 04 */ lfs f0, 4(r4)
/* 8032581C D0 03 00 04 */ stfs f0, 4(r3)
/* 80325820 C0 04 00 08 */ lfs f0, 8(r4)
/* 80325824 D0 03 00 08 */ stfs f0, 8(r3)
/* 80325828 C0 04 00 0C */ lfs f0, 0xc(r4)
/* 8032582C D0 03 00 0C */ stfs f0, 0xc(r3)
/* 80325830 C0 04 00 10 */ lfs f0, 0x10(r4)
/* 80325834 D0 03 00 10 */ stfs f0, 0x10(r3)
/* 80325838 88 04 00 14 */ lbz r0, 0x14(r4)
/* 8032583C 98 03 00 14 */ stb r0, 0x14(r3)
/* 80325840 88 04 00 15 */ lbz r0, 0x15(r4)
/* 80325844 98 03 00 15 */ stb r0, 0x15(r3)
/* 80325848 88 04 00 16 */ lbz r0, 0x16(r4)
/* 8032584C 98 03 00 16 */ stb r0, 0x16(r3)
/* 80325850 88 04 00 17 */ lbz r0, 0x17(r4)
/* 80325854 98 03 00 17 */ stb r0, 0x17(r3)
/* 80325858 38 A0 00 00 */ li r5, 0
/* 8032585C 38 00 00 0A */ li r0, 0xa
/* 80325860 7C 09 03 A6 */ mtctr r0
lbl_80325864:
/* 80325864 38 C5 00 18 */ addi r6, r5, 0x18
/* 80325868 7C 04 32 2E */ lhzx r0, r4, r6
/* 8032586C 7C 03 33 2E */ sthx r0, r3, r6
/* 80325870 38 A5 00 02 */ addi r5, r5, 2
/* 80325874 42 00 FF F0 */ bdnz lbl_80325864
/* 80325878 4E 80 00 20 */ blr

View File

@ -1,22 +0,0 @@
lbl_803256C4:
/* 803256C4 E0 44 00 00 */ psq_l f2, 0(r4), 0, 0 /* qr0 */
/* 803256C8 E0 24 00 08 */ psq_l f1, 8(r4), 0, 0 /* qr0 */
/* 803256CC E0 04 00 10 */ psq_l f0, 16(r4), 0, 0 /* qr0 */
/* 803256D0 F0 43 00 00 */ psq_st f2, 0(r3), 0, 0 /* qr0 */
/* 803256D4 F0 23 00 08 */ psq_st f1, 8(r3), 0, 0 /* qr0 */
/* 803256D8 F0 03 00 10 */ psq_st f0, 16(r3), 0, 0 /* qr0 */
/* 803256DC 88 04 00 18 */ lbz r0, 0x18(r4)
/* 803256E0 98 03 00 18 */ stb r0, 0x18(r3)
/* 803256E4 88 04 00 19 */ lbz r0, 0x19(r4)
/* 803256E8 98 03 00 19 */ stb r0, 0x19(r3)
/* 803256EC 88 04 00 1A */ lbz r0, 0x1a(r4)
/* 803256F0 98 03 00 1A */ stb r0, 0x1a(r3)
/* 803256F4 88 04 00 1B */ lbz r0, 0x1b(r4)
/* 803256F8 98 03 00 1B */ stb r0, 0x1b(r3)
/* 803256FC E0 44 00 1C */ psq_l f2, 28(r4), 0, 0 /* qr0 */
/* 80325700 E0 24 00 24 */ psq_l f1, 36(r4), 0, 0 /* qr0 */
/* 80325704 E0 04 00 2C */ psq_l f0, 44(r4), 0, 0 /* qr0 */
/* 80325708 F0 43 00 1C */ psq_st f2, 28(r3), 0, 0 /* qr0 */
/* 8032570C F0 23 00 24 */ psq_st f1, 36(r3), 0, 0 /* qr0 */
/* 80325710 F0 03 00 2C */ psq_st f0, 44(r3), 0, 0 /* qr0 */
/* 80325714 4E 80 00 20 */ blr

View File

@ -1,10 +0,0 @@
lbl_8032587C:
/* 8032587C 88 04 00 00 */ lbz r0, 0(r4)
/* 80325880 98 03 00 00 */ stb r0, 0(r3)
/* 80325884 C0 04 00 04 */ lfs f0, 4(r4)
/* 80325888 D0 03 00 04 */ stfs f0, 4(r3)
/* 8032588C C0 04 00 08 */ lfs f0, 8(r4)
/* 80325890 D0 03 00 08 */ stfs f0, 8(r3)
/* 80325894 C0 04 00 0C */ lfs f0, 0xc(r4)
/* 80325898 D0 03 00 0C */ stfs f0, 0xc(r3)
/* 8032589C 4E 80 00 20 */ blr

View File

@ -1,10 +0,0 @@
lbl_803257DC:
/* 803257DC E0 44 00 00 */ psq_l f2, 0(r4), 0, 0 /* qr0 */
/* 803257E0 E0 24 00 08 */ psq_l f1, 8(r4), 0, 0 /* qr0 */
/* 803257E4 E0 04 00 10 */ psq_l f0, 16(r4), 0, 0 /* qr0 */
/* 803257E8 F0 43 00 00 */ psq_st f2, 0(r3), 0, 0 /* qr0 */
/* 803257EC F0 23 00 08 */ psq_st f1, 8(r3), 0, 0 /* qr0 */
/* 803257F0 F0 03 00 10 */ psq_st f0, 16(r3), 0, 0 /* qr0 */
/* 803257F4 88 04 00 18 */ lbz r0, 0x18(r4)
/* 803257F8 98 03 00 18 */ stb r0, 0x18(r3)
/* 803257FC 4E 80 00 20 */ blr

View File

@ -15,13 +15,6 @@ struct J3DGXColor : public GXColor {
/* 8000E538 */ J3DGXColor() {}
};
struct J3DNBTScaleInfo {
/* 8032587C */ void operator=(J3DNBTScaleInfo const&);
/* 0x0 */ u8 mbHasScale;
/* 0x4 */ Vec mScale;
}; // Size: 0x10
struct J3DNBTScale : public J3DNBTScaleInfo {
J3DNBTScale() {}
J3DNBTScale(J3DNBTScaleInfo const& info) {
@ -578,23 +571,6 @@ struct J3DBlend : public J3DBlendInfo {
}
};
struct J3DFogInfo {
/* 80325800 */ void operator=(J3DFogInfo const&);
/* 0x00 */ u8 field_0x0;
/* 0x01 */ u8 field_0x1;
/* 0x02 */ u16 field_0x2;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
/* 0x0C */ f32 field_0xc;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ u8 field_0x14;
/* 0x15 */ u8 field_0x15;
/* 0x16 */ u8 field_0x16;
/* 0x17 */ u8 field_0x17;
/* 0x18 */ u16 field_0x18[10];
}; // Size: 0x2C
extern const J3DFogInfo j3dDefaultFogInfo;
struct J3DFog : public J3DFogInfo {

View File

@ -1,12 +1,13 @@
#ifndef J3DSTRUCT_H
#define J3DSTRUCT_H
#include "SSystem/SComponent/c_xyz.h"
#include "dolphin/gx/GXStruct.h"
#include "dolphin/mtx/mtx.h"
#include "dolphin/mtx/mtx44.h"
#include "dolphin/mtx/vec.h"
class J3DLightInfo {
public:
J3DLightInfo(J3DLightInfo const& other) { *this = other; }
/* 803256C4 */ void operator=(J3DLightInfo const&);
/* 0x00 */ Vec mLightPosition;
@ -20,7 +21,8 @@ extern "C" extern J3DLightInfo const j3dDefaultLightInfo;
class J3DLightObj {
public:
/* 80018C0C */ J3DLightObj() : mInfo(j3dDefaultLightInfo) {}
/* 80018C0C */ J3DLightObj() { mInfo = j3dDefaultLightInfo; }
/* 80323590 */ void load(u32) const;
J3DLightInfo& getLightInfo() { return mInfo; }
J3DLightObj& operator=(J3DLightObj const& other) {
@ -32,4 +34,54 @@ public:
/* 0x34 */ u8 field_0x34[64];
}; // Size = 0x74
struct J3DTextureSRTInfo {
/* 0x00 */ f32 mScaleX;
/* 0x04 */ f32 mScaleY;
/* 0x08 */ s16 mRotation;
/* 0x0C */ f32 mTranslationX;
/* 0x10 */ f32 mTranslationY;
}; // Size: 0x14
struct J3DTexMtxInfo {
/* 80325718 */ void operator=(J3DTexMtxInfo const&);
/* 80325794 */ void setEffectMtx(Mtx);
/* 0x00 */ u8 mProjection;
/* 0x01 */ s8 mInfo;
/* 0x04 */ Vec mCenter;
/* 0x10 */ J3DTextureSRTInfo mSRT;
/* 0x24 */ Mtx44 mEffectMtx;
}; // Size: 0x64
struct J3DIndTexMtxInfo {
/* 803257DC */ void operator=(J3DIndTexMtxInfo const&);
/* 0x00 */ Mtx23 field_0x0;
/* 0x18 */ u8 field_0x18;
}; // Size: 0x1C
struct J3DFogInfo {
/* 80325800 */ void operator=(J3DFogInfo const&);
/* 0x00 */ u8 field_0x0;
/* 0x01 */ u8 field_0x1;
/* 0x02 */ u16 field_0x2;
/* 0x04 */ f32 field_0x4;
/* 0x08 */ f32 field_0x8;
/* 0x0C */ f32 field_0xc;
/* 0x10 */ f32 field_0x10;
/* 0x14 */ u8 field_0x14;
/* 0x15 */ u8 field_0x15;
/* 0x16 */ u8 field_0x16;
/* 0x17 */ u8 field_0x17;
/* 0x18 */ u16 field_0x18[10];
}; // Size: 0x2C
struct J3DNBTScaleInfo {
/* 8032587C */ void operator=(J3DNBTScaleInfo const&);
/* 0x0 */ u8 mbHasScale;
/* 0x4 */ Vec mScale;
}; // Size: 0x10
#endif /* J3DSTRUCT_H */

View File

@ -1,6 +1,7 @@
#ifndef J3DTEXTURE_H
#define J3DTEXTURE_H
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/mtx/mtx.h"
#include "dolphin/types.h"
@ -25,25 +26,6 @@ public:
}
};
struct J3DTextureSRTInfo {
/* 0x00 */ f32 mScaleX;
/* 0x04 */ f32 mScaleY;
/* 0x08 */ s16 mRotation;
/* 0x0C */ f32 mTranslationX;
/* 0x10 */ f32 mTranslationY;
}; // Size: 0x14
struct J3DTexMtxInfo {
/* 80325718 */ void operator=(J3DTexMtxInfo const&);
/* 80325794 */ void setEffectMtx(Mtx);
/* 0x00 */ u8 mProjection;
/* 0x01 */ s8 mInfo;
/* 0x04 */ Vec mCenter;
/* 0x10 */ J3DTextureSRTInfo mSRT;
/* 0x24 */ Mtx44 mEffectMtx;
}; // Size: 0x64
class J3DTexMtx {
public:
J3DTexMtx(const J3DTexMtxInfo& info) {

View File

@ -38,7 +38,32 @@ inline f32 fastReciprocal(f32 value) {
return JMAFastReciprocal(value);
}
inline void gekko_ps_copy12(register f32* dst, register const f32* src) {
inline void gekko_ps_copy3(register void* dst, register const void* src) {
register f32 src0;
register f32 src1;
asm {
psq_l src0, 0(src), 0, 0
lfs src1, 8(src)
psq_st src0, 0(dst), 0, 0
stfs src1, 8(dst)
};
}
inline void gekko_ps_copy6(register void* dst, register const void* src) {
register f32 src0;
register f32 src1;
register f32 src2;
asm {
psq_l src0, 0(src), 0, 0
psq_l src1, 8(src), 0, 0
psq_l src2, 16(src), 0, 0
psq_st src0, 0(dst), 0, 0
psq_st src1, 8(dst), 0, 0
psq_st src2, 16(dst), 0, 0
};
}
inline void gekko_ps_copy12(register void* dst, register const void* src) {
register f32 src0;
register f32 src1;
register f32 src2;
@ -61,6 +86,35 @@ inline void gekko_ps_copy12(register f32* dst, register const f32* src) {
};
}
inline void gekko_ps_copy16(register void* dst, register const void* src) {
register f32 src0;
register f32 src1;
register f32 src2;
register f32 src3;
register f32 src4;
register f32 src5;
register f32 src6;
register f32 src7;
asm {
psq_l src0, 0(src), 0, 0
psq_l src1, 8(src), 0, 0
psq_l src2, 16(src), 0, 0
psq_l src3, 24(src), 0, 0
psq_l src4, 32(src), 0, 0
psq_l src5, 40(src), 0, 0
psq_l src6, 48(src), 0, 0
psq_l src7, 56(src), 0, 0
psq_st src0, 0(dst), 0, 0
psq_st src1, 8(dst), 0, 0
psq_st src2, 16(dst), 0, 0
psq_st src3, 24(dst), 0, 0
psq_st src4, 32(dst), 0, 0
psq_st src5, 40(dst), 0, 0
psq_st src6, 48(dst), 0, 0
psq_st src7, 56(dst), 0, 0
};
}
}; // namespace JMath
#endif /* JMATH_H */

View File

@ -15,10 +15,6 @@ struct J3DSys {
static u8 sTexCoordScaleTable[64 + 4 /* padding */];
};
struct J3DIndTexMtxInfo {
/* 803257DC */ void operator=(J3DIndTexMtxInfo const&);
};
//
// Forward References:
//

View File

@ -4,59 +4,31 @@
//
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "JSystem/JMath/JMath.h"
#include "dol2asm.h"
//
// Types:
//
struct J3DTexMtxInfo {
/* 80325718 */ void operator=(J3DTexMtxInfo const&);
/* 80325794 */ void setEffectMtx(f32 (*)[4]);
};
struct J3DNBTScaleInfo {
/* 8032587C */ void operator=(J3DNBTScaleInfo const&);
};
struct J3DIndTexMtxInfo {
/* 803257DC */ void operator=(J3DIndTexMtxInfo const&);
};
struct J3DFogInfo {
/* 80325800 */ void operator=(J3DFogInfo const&);
};
//
// Forward References:
//
extern "C" void __as__12J3DLightInfoFRC12J3DLightInfo();
extern "C" void __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo();
extern "C" void setEffectMtx__13J3DTexMtxInfoFPA4_f();
extern "C" void __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo();
extern "C" void __as__10J3DFogInfoFRC10J3DFogInfo();
extern "C" void __as__15J3DNBTScaleInfoFRC15J3DNBTScaleInfo();
//
// External References:
//
//
// Declarations:
//
/* 803256C4-80325718 320004 0054+00 0/0 11/11 24/24 .text __as__12J3DLightInfoFRC12J3DLightInfo */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DLightInfo::operator=(J3DLightInfo const& param_0) {
nofralloc
#include "asm/JSystem/J3DGraphBase/J3DStruct/__as__12J3DLightInfoFRC12J3DLightInfo.s"
void J3DLightInfo::operator=(J3DLightInfo const& param_0) {
JMath::gekko_ps_copy6(&mLightPosition, &param_0.mLightPosition);
mColor = param_0.mColor;
JMath::gekko_ps_copy6(&mCosAtten, &param_0.mCosAtten);
}
#pragma pop
/* 80325718-80325794 320058 007C+00 0/0 4/4 0/0 .text __as__13J3DTexMtxInfoFRC13J3DTexMtxInfo */
// J3DTextureSRTInfo::operator=
#ifdef NONMATCHING
void J3DTexMtxInfo::operator=(J3DTexMtxInfo const& param_0) {
mProjection = param_0.mProjection;
mInfo = param_0.mInfo;
JMath::gekko_ps_copy3(&mCenter, &param_0.mCenter);
mSRT = param_0.mSRT;
JMath::gekko_ps_copy16(&mEffectMtx, &param_0.mEffectMtx);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@ -65,6 +37,7 @@ asm void J3DTexMtxInfo::operator=(J3DTexMtxInfo const& param_0) {
#include "asm/JSystem/J3DGraphBase/J3DStruct/__as__13J3DTexMtxInfoFRC13J3DTexMtxInfo.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 80456410-80456414 004A10 0004+00 1/1 0/0 0/0 .sdata2 @409 */
@ -80,6 +53,16 @@ SECTION_SDATA2 static u8 lit_410[4] = {
/* 80325794-803257DC 3200D4 0048+00 0/0 2/2 7/7 .text setEffectMtx__13J3DTexMtxInfoFPA4_f
*/
// needs inline asm?
#ifdef NONMATCHING
void J3DTexMtxInfo::setEffectMtx(Mtx param_0) {
JMath::gekko_ps_copy12(&mEffectMtx, param_0);
mEffectMtx[3][0] = 0.0f;
mEffectMtx[3][1] = 0.0f;
mEffectMtx[3][2] = 0.0f;
mEffectMtx[3][3] = 1.0f;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
@ -88,36 +71,37 @@ asm void J3DTexMtxInfo::setEffectMtx(f32 (*param_0)[4]) {
#include "asm/JSystem/J3DGraphBase/J3DStruct/setEffectMtx__13J3DTexMtxInfoFPA4_f.s"
}
#pragma pop
#endif
/* 803257DC-80325800 32011C 0024+00 0/0 5/5 0/0 .text
* __as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DIndTexMtxInfo::operator=(J3DIndTexMtxInfo const& param_0) {
nofralloc
#include "asm/JSystem/J3DGraphBase/J3DStruct/__as__16J3DIndTexMtxInfoFRC16J3DIndTexMtxInfo.s"
void J3DIndTexMtxInfo::operator=(J3DIndTexMtxInfo const& param_0) {
JMath::gekko_ps_copy6(field_0x0, param_0.field_0x0);
field_0x18 = param_0.field_0x18;
}
#pragma pop
/* 80325800-8032587C 320140 007C+00 0/0 6/6 0/0 .text __as__10J3DFogInfoFRC10J3DFogInfo
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DFogInfo::operator=(J3DFogInfo const& param_0) {
nofralloc
#include "asm/JSystem/J3DGraphBase/J3DStruct/__as__10J3DFogInfoFRC10J3DFogInfo.s"
void J3DFogInfo::operator=(J3DFogInfo const& param_0) {
field_0x0 = param_0.field_0x0;
field_0x1 = param_0.field_0x1;
field_0x2 = param_0.field_0x2;
field_0x4 = param_0.field_0x4;
field_0x8 = param_0.field_0x8;
field_0xc = param_0.field_0xc;
field_0x10 = param_0.field_0x10;
field_0x14 = param_0.field_0x14;
field_0x15 = param_0.field_0x15;
field_0x16 = param_0.field_0x16;
field_0x17 = param_0.field_0x17;
for (int i = 0; i < 10; i++) {
field_0x18[i] = param_0.field_0x18[i];
}
}
#pragma pop
/* 8032587C-803258A0 3201BC 0024+00 0/0 6/6 0/0 .text __as__15J3DNBTScaleInfoFRC15J3DNBTScaleInfo
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void J3DNBTScaleInfo::operator=(J3DNBTScaleInfo const& param_0) {
nofralloc
#include "asm/JSystem/J3DGraphBase/J3DStruct/__as__15J3DNBTScaleInfoFRC15J3DNBTScaleInfo.s"
}
#pragma pop
void J3DNBTScaleInfo::operator=(J3DNBTScaleInfo const& param_0) {
mbHasScale = param_0.mbHasScale;
mScale = param_0.mScale;
}

View File

@ -14,10 +14,6 @@
struct J3DNBTScale {};
struct J3DLightObj {
/* 80323590 */ void load(u32) const;
};
//
// Forward References:
//
@ -266,11 +262,12 @@ asm void loadNBTScale(J3DNBTScale& param_0) {
/* ############################################################################################## */
/* 803A1EC8-803A1EFC 02E528 0034+00 0/0 9/9 24/24 .rodata j3dDefaultLightInfo */
SECTION_RODATA extern u8 const j3dDefaultLightInfo[52] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xBF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
0xFF, 0xFF, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x3F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
SECTION_RODATA extern const J3DLightInfo j3dDefaultLightInfo = {
0.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
0xff, 0xff, 0xff, 0xff,
1.0f, 0.0f, 0.0f,
1.0f, 0.0f, 0.0f,
};
COMPILER_STRIP_GATE(0x803A1EC8, &j3dDefaultLightInfo);

View File

@ -71,10 +71,6 @@ struct J3DMtxCalcAnimation__template0 {
/* 800150AC */ void func_800150AC(void* _this);
};
struct J3DIndTexMtxInfo {
/* 803257DC */ void operator=(J3DIndTexMtxInfo const&);
};
//
// Forward References:
//