Skip to content

Commit

Permalink
Match and link vi.c and THPDec.c, minor CPhysicsActor and GBA.c fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Nov 3, 2024
1 parent 0b74ded commit 6a3e0c0
Show file tree
Hide file tree
Showing 10 changed files with 111 additions and 875 deletions.
70 changes: 39 additions & 31 deletions config/GM8E01_00/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19029,10 +19029,18 @@ LeapYearDays = .data:0x803F2320; // type:object size:0x30 scope:local
...data.0 = .data:0x803F2350; // type:label scope:local
ResetFunctionInfo = .data:0x803F2398; // type:object size:0x10 scope:local
...data.0 = .data:0x803F23A8; // type:label scope:local
lbl_803F23A8 = .data:0x803F23A8; // type:object size:0x1F4
jumptable_803F259C = .data:0x803F259C; // type:object size:0x6C scope:local
lbl_803F2608 = .data:0x803F2608; // type:object size:0x154 scope:local
@724 = .data:0x803F275C; // type:object size:0x1C scope:local
@3 = .data:0x803F23A8; // type:object size:0x44 scope:local data:string
timing = .data:0x803F23EC; // type:object size:0x17C scope:local
taps = .data:0x803F2568; // type:object size:0x34 scope:local
@90 = .data:0x803F259C; // type:object size:0x6C scope:local
@333 = .data:0x803F2608; // type:object size:0x29 scope:local data:string
@334 = .data:0x803F2634; // type:object size:0x29 scope:local data:string
@335 = .data:0x803F2660; // type:object size:0x29 scope:local data:string
@336 = .data:0x803F268C; // type:object size:0x29 scope:local data:string
@337 = .data:0x803F26B8; // type:object size:0x29 scope:local data:string
@338 = .data:0x803F26E4; // type:object size:0x29 scope:local data:string
@521 = .data:0x803F2710; // type:object size:0x4B scope:local data:string
@694 = .data:0x803F275C; // type:object size:0x1C scope:local
__files = .data:0x803F2778; // type:object size:0x140 scope:global
lbl_803F28B8 = .data:0x803F28B8; // type:object size:0x40
jumptable_803F28F8 = .data:0x803F28F8; // type:object size:0x124 scope:local
Expand Down Expand Up @@ -19304,8 +19312,10 @@ Type = .bss:0x80541FF0; // type:object size:0x10 scope:local
...bss.0 = .bss:0x80541FF0; // type:label scope:local
Origin = .bss:0x80542000; // type:object size:0x30 scope:local
CmdProbeDevice = .bss:0x80542030; // type:object size:0x10 scope:local
lbl_80542040 = .bss:0x80542040; // type:object size:0xF0 data:2byte
lbl_80542130 = .bss:0x80542130; // type:object size:0x58 data:2byte
...bss.0 = .bss:0x80542040; // type:label scope:local
regs = .bss:0x80542040; // type:object size:0x76 scope:local data:2byte
shdwRegs = .bss:0x805420B8; // type:object size:0x76 scope:local
HorVer = .bss:0x80542130; // type:object size:0x58 scope:local data:2byte
fragmentinfo = .bss:0x80542188; // type:object size:0xC scope:local data:4byte
__atexit_funcs = .bss:0x80542198; // type:object size:0x100 scope:local
protopool$192 = .bss:0x80542298; // type:object size:0x38 scope:local data:4byte
Expand Down Expand Up @@ -19394,9 +19404,9 @@ Ecb = .bss:0x80569E98; // type:object size:0xC0 scope:local data:4byte
__THPIDCTWorkspace = .bss:0x80569F60; // type:object size:0x100 scope:local align:32
__THPLCWork512 = .bss:0x8056A060; // type:object size:0xC scope:local
__THPLCWork640 = .bss:0x8056A06C; // type:object size:0xC scope:local
__THPMCUBuffer = .bss:0x8056A078; // type:object size:0x28 scope:global data:4byte
SecParams = .bss:0x8056A0A0; // type:object size:0x100 scope:local
__GBA = .bss:0x8056A1A0; // type:object size:0x400 scope:global
__THPMCUBuffer = .bss:0x8056A078; // type:object size:0x18 scope:global data:4byte
SecParams = .bss:0x8056A0A0; // type:object size:0x100 scope:local align:32
__GBA = .bss:0x8056A1A0; // type:object size:0x400 scope:global align:8
gCommandFilterFlag__13ControlMapper = .bss:0x8056A5A0; // type:object size:0x48 scope:global data:4byte
sIdentity__10CAxisAngle = .bss:0x8056A5E8; // type:object size:0xC scope:global data:float
lbl_8056A5F4 = .bss:0x8056A5F4; // type:object size:0xC data:float
Expand Down Expand Up @@ -21453,8 +21463,8 @@ Spec = .sdata:0x805A8B68; // type:object size:0x4 scope:local data:4byte
MakeStatus = .sdata:0x805A8B6C; // type:object size:0x4 scope:local data:4byte
CmdReadOrigin = .sdata:0x805A8B70; // type:object size:0x4 scope:local
CmdCalibrate = .sdata:0x805A8B74; // type:object size:0x4 scope:local
lbl_805A8B78 = .sdata:0x805A8B78; // type:object size:0x4 data:4byte
lbl_805A8B7C = .sdata:0x805A8B7C; // type:object size:0xC
__VIVersion = .sdata:0x805A8B78; // type:object size:0x4 data:4byte
@520 = .sdata:0x805A8B7C; // type:object size:0x5 scope:local data:string
fragmentID = .sdata:0x805A8B88; // type:object size:0x4 scope:local data:4byte
@wstringBase0 = .sdata:0x805A8B90; // type:object size:0x2 scope:local
next = .sdata:0x805A8B98; // type:object size:0x4 scope:local data:4byte
Expand Down Expand Up @@ -22235,27 +22245,25 @@ PendingBits = .sbss:0x805A9948; // type:object size:0x4 scope:local data:4byte
SamplingCallback = .sbss:0x805A994C; // type:object size:0x4 scope:local data:4byte
recalibrated$396 = .sbss:0x805A9950; // type:object size:0x4 scope:local data:4byte
__PADSpec = .sbss:0x805A9954; // type:object size:0x4 scope:global data:4byte
lbl_805A9958 = .sbss:0x805A9958; // type:object size:0x4 data:4byte
lbl_805A995C = .sbss:0x805A995C; // type:object size:0x4 data:4byte
lbl_805A9960 = .sbss:0x805A9960; // type:object size:0x4 data:4byte
lbl_805A9964 = .sbss:0x805A9964; // type:object size:0x8
lbl_805A996C = .sbss:0x805A996C; // type:object size:0x4 data:4byte
lbl_805A9970 = .sbss:0x805A9970; // type:object size:0x4 data:4byte
lbl_805A9974 = .sbss:0x805A9974; // type:object size:0x4 data:4byte
lbl_805A9978 = .sbss:0x805A9978; // type:object size:0x2 data:2byte
lbl_805A997A = .sbss:0x805A997A; // type:object size:0x2 data:2byte
lbl_805A997C = .sbss:0x805A997C; // type:object size:0x4 data:4byte
lbl_805A9980 = .sbss:0x805A9980; // type:object size:0x4 data:4byte
lbl_805A9984 = .sbss:0x805A9984; // type:object size:0x4 data:4byte
lbl_805A9988 = .sbss:0x805A9988; // type:object size:0x8 data:4byte
lbl_805A9990 = .sbss:0x805A9990; // type:object size:0x4 data:4byte
lbl_805A9994 = .sbss:0x805A9994; // type:object size:0x4 data:4byte
lbl_805A9998 = .sbss:0x805A9998; // type:object size:0x4 data:4byte
IsInitialized = .sbss:0x805A9958; // type:object size:0x4 scope:local data:4byte
retraceCount = .sbss:0x805A995C; // type:object size:0x4 scope:local data:4byte
flushFlag = .sbss:0x805A9960; // type:object size:0x4 scope:local data:4byte
retraceQueue = .sbss:0x805A9964; // type:object size:0x8 scope:local
PreCB = .sbss:0x805A996C; // type:object size:0x4 scope:local data:4byte
PostCB = .sbss:0x805A9970; // type:object size:0x4 scope:local data:4byte
encoderType = .sbss:0x805A9974; // type:object size:0x4 scope:local data:4byte
displayOffsetH = .sbss:0x805A9978; // type:object size:0x2 scope:local data:2byte
displayOffsetV = .sbss:0x805A997A; // type:object size:0x2 scope:local data:2byte
changeMode = .sbss:0x805A997C; // type:object size:0x4 scope:local data:4byte
changed = .sbss:0x805A9980; // type:object size:0x8 scope:local data:8byte
shdwChangeMode = .sbss:0x805A9988; // type:object size:0x4 scope:local data:4byte
shdwChanged = .sbss:0x805A9990; // type:object size:0x8 scope:local data:8byte
CurrTiming = .sbss:0x805A9998; // type:object size:0x4 scope:local data:4byte
CurrTvMode = .sbss:0x805A999C; // type:object size:0x4 scope:local data:4byte
lbl_805A99A0 = .sbss:0x805A99A0; // type:object size:0x4 data:4byte
lbl_805A99A4 = .sbss:0x805A99A4; // type:object size:0x4 data:4byte
lbl_805A99A8 = .sbss:0x805A99A8; // type:object size:0x4 data:4byte
lbl_805A99AC = .sbss:0x805A99AC; // type:object size:0x4 data:4byte
NextBufAddr = .sbss:0x805A99A0; // type:object size:0x4 scope:local data:4byte
CurrBufAddr = .sbss:0x805A99A4; // type:object size:0x4 scope:local data:4byte
FBSet = .sbss:0x805A99A8; // type:object size:0x4 scope:local data:4byte
message$329 = .sbss:0x805A99AC; // type:object size:0x4 scope:local data:4byte
__global_destructor_chain = .sbss:0x805A99B0; // type:object size:0x4 scope:global data:4byte
__aborting = .sbss:0x805A99B8; // type:object size:0x4 scope:global data:4byte
__atexit_curr_func = .sbss:0x805A99BC; // type:object size:0x4 scope:local data:4byte
Expand Down
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ def MatchingFor(*versions):
DolphinLib(
"vi",
[
Object(NonMatching, "Dolphin/vi.c"),
Object(Matching, "Dolphin/vi.c"),
],
),
{
Expand Down Expand Up @@ -1349,7 +1349,7 @@ def MatchingFor(*versions):
DolphinLib(
"thp",
[
Object(NonMatching, "Dolphin/thp/THPDec.c"),
Object(Matching, "Dolphin/thp/THPDec.c"),
Object(NonMatching, "Dolphin/thp/THPAudio.c"),
],
),
Expand Down
1 change: 1 addition & 0 deletions include/GuiSys/CGuiObject.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CGuiObject {
}

CGuiObject* Parent();
const CGuiObject* GetParent() const { return x64_parent; }
const CGuiObject* GetChildObject() const;
CGuiObject* ChildObject();
const CGuiObject* GetNextSibling() const;
Expand Down
2 changes: 1 addition & 1 deletion include/MetroidPrime/CAnimRes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CAnimRes {
// CAnimRes()
// : x4_charIdx(-1), x14_canLoop(false), x8_scale(????), x18_defaultAnim(-1) {}

CAnimRes(CAssetId ancs, int charIdx, const CVector3f& scale, int defaultAnim, bool loop)
CAnimRes(CAssetId ancs, const int charIdx, const CVector3f& scale, int defaultAnim, bool loop)
: x0_ancsId(ancs)
, x4_charIdx(charIdx)
, x8_scale(scale)
Expand Down
5 changes: 3 additions & 2 deletions include/MetroidPrime/CPhysicsActor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ class CPhysicsActor : public CActor {
void Stop();

CVector3f GetPrimitiveOffset() const;
uchar IsStandardCollider() const { return xf9_standardCollider; } // name and type?
void SetStandardCollider(uchar v) { xf9_standardCollider = v; } // name and type?
const bool IsStandardCollider() const { return xf9_standardCollider; } // name and type?
void SetStandardCollider(const bool v) { xf9_standardCollider = v; } // name and type?
const CVector3f& GetConstantForceWR() const { return xfc_constantForce; }
void SetConstantForceWR(const CVector3f& force) { xfc_constantForce = force; }
const CAxisAngle& GetAngularMomentumWR() const { return x108_angularMomentum; }
Expand Down Expand Up @@ -167,6 +167,7 @@ class CPhysicsActor : public CActor {
void RotateToOR(const CQuaternion&, float);

CVector3f GetTotalForceWR() const;
CVector3f GetConstantTotalForceWR() const { return x15c_force + x150_momentum; }

static float GravityConstant() { return kGravityAccel; }

Expand Down
2 changes: 1 addition & 1 deletion include/MetroidPrime/CPhysicsState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CPhysicsState {
const CAxisAngle& torque, const CAxisAngle& angularImpulse);

CVector3f GetTranslation() const { return x0_translation; }
CQuaternion GetOrientationWR() const { return xc_orientation; }
CQuaternion GetOrientation() const { return xc_orientation; }
CVector3f GetConstantForceWR() const { return x1c_constantForce; }
CAxisAngle GetAngularMomentumWR() const { return x28_angularMomentum; }
CVector3f GetMomentumWR() const { return x34_momentum; }
Expand Down
2 changes: 1 addition & 1 deletion src/Dolphin/GBA/GBA.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
#include "dolphin/GBAPriv.h"

static GBASecParam SecParams[4];
static GBASecParam SecParams[4] ATTRIBUTE_ALIGN(32);
GBAControl __GBA[4];
BOOL __GBAReset = FALSE;

Expand Down
32 changes: 16 additions & 16 deletions src/Dolphin/thp/THPDec.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static THPSample* Gbase ATTRIBUTE_ALIGN(32);
static u32 Gwid ATTRIBUTE_ALIGN(32);
static f32* Gq ATTRIBUTE_ALIGN(32);
static u8* __THPLCWork512[3];
static u8* __THPLCWork672[3];
static u8* __THPLCWork640[3];
static u32 __THPOldGQR5;
static u32 __THPOldGQR6;
static u8* __THPWorkArea;
Expand Down Expand Up @@ -1545,7 +1545,7 @@ static void __THPDecompressiMCURow640x480(void)
__THPHuffDecodeDCTCompV(__THPInfo, __THPMCUBuffer[5]);

comp = &__THPInfo->components[0];
Gbase = __THPLCWork672[0];
Gbase = __THPLCWork640[0];
Gwid = 640;
Gq = __THPInfo->quantTabs[comp->quantizationTableSelector];
x_pos = (u32)(cl_num * 16);
Expand All @@ -1555,14 +1555,14 @@ static void __THPDecompressiMCURow640x480(void)
__THPInverseDCTY8(__THPMCUBuffer[3], x_pos + 8);

comp = &__THPInfo->components[1];
Gbase = __THPLCWork672[1];
Gbase = __THPLCWork640[1];
Gwid = 320;
Gq = __THPInfo->quantTabs[comp->quantizationTableSelector];
x_pos /= 2;
__THPInverseDCTNoYPos(__THPMCUBuffer[4], x_pos);

comp = &__THPInfo->components[2];
Gbase = __THPLCWork672[2];
Gbase = __THPLCWork640[2];
Gq = __THPInfo->quantTabs[comp->quantizationTableSelector];
__THPInverseDCTNoYPos(__THPMCUBuffer[5], x_pos);

Expand All @@ -1585,9 +1585,9 @@ static void __THPDecompressiMCURow640x480(void)
}
}

LCStoreData(__THPInfo->dLC[0], __THPLCWork672[0], 0x2800);
LCStoreData(__THPInfo->dLC[1], __THPLCWork672[1], 0xA00);
LCStoreData(__THPInfo->dLC[2], __THPLCWork672[2], 0xA00);
LCStoreData(__THPInfo->dLC[0], __THPLCWork640[0], 0x2800);
LCStoreData(__THPInfo->dLC[1], __THPLCWork640[1], 0xA00);
LCStoreData(__THPInfo->dLC[2], __THPLCWork640[2], 0xA00);

__THPInfo->dLC[0] += 0x2800;
__THPInfo->dLC[1] += 0xA00;
Expand Down Expand Up @@ -1618,7 +1618,7 @@ static void __THPDecompressiMCURowNxN(void)
__THPHuffDecodeDCTCompV(__THPInfo, __THPMCUBuffer[5]);

comp = &__THPInfo->components[0];
Gbase = __THPLCWork672[0];
Gbase = __THPLCWork640[0];
Gwid = x;
Gq = __THPInfo->quantTabs[comp->quantizationTableSelector];
x_pos = (u32)(cl_num * 16);
Expand All @@ -1628,14 +1628,14 @@ static void __THPDecompressiMCURowNxN(void)
__THPInverseDCTY8(__THPMCUBuffer[3], x_pos + 8);

comp = &__THPInfo->components[1];
Gbase = __THPLCWork672[1];
Gbase = __THPLCWork640[1];
Gwid = x / 2;
Gq = __THPInfo->quantTabs[comp->quantizationTableSelector];
x_pos /= 2;
__THPInverseDCTNoYPos(__THPMCUBuffer[4], x_pos);

comp = &__THPInfo->components[2];
Gbase = __THPLCWork672[2];
Gbase = __THPLCWork640[2];
Gq = __THPInfo->quantTabs[comp->quantizationTableSelector];
__THPInverseDCTNoYPos(__THPMCUBuffer[5], x_pos);

Expand All @@ -1656,9 +1656,9 @@ static void __THPDecompressiMCURowNxN(void)
}
}

LCStoreData(__THPInfo->dLC[0], __THPLCWork672[0], ((4 * sizeof(u8) * 64) * (x / 16)));
LCStoreData(__THPInfo->dLC[1], __THPLCWork672[1], ((sizeof(u8) * 64) * (x / 16)));
LCStoreData(__THPInfo->dLC[2], __THPLCWork672[2], ((sizeof(u8) * 64) * (x / 16)));
LCStoreData(__THPInfo->dLC[0], __THPLCWork640[0], ((4 * sizeof(u8) * 64) * (x / 16)));
LCStoreData(__THPInfo->dLC[1], __THPLCWork640[1], ((sizeof(u8) * 64) * (x / 16)));
LCStoreData(__THPInfo->dLC[2], __THPLCWork640[2], ((sizeof(u8) * 64) * (x / 16)));
__THPInfo->dLC[0] += ((4 * sizeof(u8) * 64) * (x / 16));
__THPInfo->dLC[1] += ((sizeof(u8) * 64) * (x / 16));
__THPInfo->dLC[2] += ((sizeof(u8) * 64) * (x / 16));
Expand Down Expand Up @@ -2356,11 +2356,11 @@ BOOL THPInit(void)
base += 0x200;

base = (u8*)(0xE000 << 16);
__THPLCWork672[0] = base;
__THPLCWork640[0] = base;
base += 0x2800;
__THPLCWork672[1] = base;
__THPLCWork640[1] = base;
base += 0xA00;
__THPLCWork672[2] = base;
__THPLCWork640[2] = base;
base += 0xA00;

OSInitFastCast();
Expand Down
Loading

0 comments on commit 6a3e0c0

Please sign in to comment.