From ece6fcf9a17ffa95dd8d4097118ceb3e61d38032 Mon Sep 17 00:00:00 2001 From: Jcw87 Date: Sun, 7 Jan 2024 00:25:45 -0800 Subject: [PATCH] JAIConst --- configure.py | 2 +- include/JSystem/JAudio/JAIConst.h | 35 +++++++++++++++++++++++++++++++ src/JSystem/JAudio/JAIConst.cpp | 24 +++++++++++++++++++-- 3 files changed, 58 insertions(+), 3 deletions(-) diff --git a/configure.py b/configure.py index 28f732dd1..b97539669 100644 --- a/configure.py +++ b/configure.py @@ -709,7 +709,7 @@ config.libs = [ Object(NonMatching, "JSystem/JAudio/JAIAnimation.cpp"), Object(NonMatching, "JSystem/JAudio/JAIBasic.cpp"), Object(NonMatching, "JSystem/JAudio/JAIBankWave.cpp"), - Object(NonMatching, "JSystem/JAudio/JAIConst.cpp"), + Object(Matching, "JSystem/JAudio/JAIConst.cpp"), Object(Matching, "JSystem/JAudio/JAIDummyObject.cpp"), Object(NonMatching, "JSystem/JAudio/JAIFx.cpp"), Object(Matching, "JSystem/JAudio/JAIGlobalParameter.cpp"), diff --git a/include/JSystem/JAudio/JAIConst.h b/include/JSystem/JAudio/JAIConst.h index 96820d12f..22792939f 100644 --- a/include/JSystem/JAudio/JAIConst.h +++ b/include/JSystem/JAudio/JAIConst.h @@ -2,6 +2,7 @@ #define JAICONST_H #include "JSystem/JMath/random.h" +#include "dolphin/mtx/mtx.h" #include "dolphin/mtx/vec.h" namespace JAInter { @@ -10,8 +11,42 @@ namespace JAInter { void deleteTmpDVDFile(u8**); u32 routeToTrack(u32); + class Actor { + public: + Actor(Vec* p1, Vec* p2, u32 p3, void* p4) { + field_0x0 = p1; + field_0x4 = p2; + field_0x8 = p3; + field_0xc = p4; + } + + // order is unclear + Vec* field_0x0; + Vec* field_0x4; + u32 field_0x8; + void* field_0xc; + }; + + class Camera { + public: + Camera(Vec* p1 = NULL, Vec* p2 = NULL, MtxP p3 = NULL) { + field_0x0 = p1; + field_0x4 = p2; + field_0x8 = p3; + } + Vec* field_0x0; + Vec* field_0x4; + MtxP field_0x8; + }; + namespace Const { + extern Camera nullCamera; + extern Actor nullActor; + extern Mtx camMtx; + extern Vec camTrans; + extern Vec camPreTrans; extern Vec dummyZeroVec; + extern u8 sCInfos_0[]; extern JMath::TRandom_fast_ random; } } diff --git a/src/JSystem/JAudio/JAIConst.cpp b/src/JSystem/JAudio/JAIConst.cpp index 9a874ce0c..5d97836c8 100644 --- a/src/JSystem/JAudio/JAIConst.cpp +++ b/src/JSystem/JAudio/JAIConst.cpp @@ -11,7 +11,16 @@ #include "JSystem/JKernel/JKRSolidHeap.h" #include "JSystem/JUtility/JUTAssert.h" +JAInter::Camera JAInter::Const::nullCamera(&camTrans, &camPreTrans, camMtx); +JAInter::Actor JAInter::Const::nullActor(NULL, NULL, 0, NULL); +Mtx JAInter::Const::camMtx; +Vec JAInter::Const::camTrans; +Vec JAInter::Const::camPreTrans; Vec JAInter::Const::dummyZeroVec = {0.0f, 0.0f, 0.0f}; +u8 JAInter::Const::sCInfos_0[] = { + 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, + 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, 4, 2, +}; JMath::TRandom_fast_ JAInter::Const::random(0); /* 80291704-802917D8 .text transInitDataFile__7JAInterFPUcUl */ @@ -47,6 +56,17 @@ void JAInter::deleteTmpDVDFile(u8** tmpPointer) { } /* 802918FC-8029193C .text routeToTrack__7JAInterFUl */ -u32 JAInter::routeToTrack(u32) { - /* Nonmatching */ +u32 JAInter::routeToTrack(u32 param_1) { + u32 r4; + u32 r5 = 0; + r4 = param_1 & 0xF0000000; + if (r4 == 0) { + return 0; + } + if (r4 == 0x10000000) { + r5 = 0x0F; + } else if (r4 == 0x20000000) { + r5 = 0xFF; + } + return param_1 & r5; }