Jsystem work (#399)

* Almost match JASBasicInst

* JASDrumSet OK

* Some JAudio2 struct adjustment

* Match JKRHeap::callAllDisposer

* JAISe OK

* Fix setAutoDelete

* JAISound OK

* Match a few functions in linklist

* Few matches in d_a_e_ym

* JUTTexture OK

* Work on JUTGamePad

* Import JUTResource

* Work on JUTResFont::getFontCode
This commit is contained in:
hatal175
2023-08-06 06:12:26 +03:00
committed by GitHub
parent 8b34c0210f
commit dc985026fa
79 changed files with 519 additions and 2705 deletions
+8 -364
View File
@@ -3,169 +3,41 @@
// Translation Unit: JAISe
//
//#include "JSystem/JAudio2/JAISe.h"
#include "JSystem/JAudio2/JAISe.h"
#include "JSystem/JAudio2/JAIAudience.h"
//#include "JSystem/JAudio2/JAISeMgr.h"
#include "JSystem/JAudio2/JAISeMgr.h"
#include "JSystem/JAudio2/JAISound.h"
#include "JSystem/JAudio2/JASTrack.h"
#include "JSystem/JSupport/JSUList.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct JAISeMgr {};
struct JAISe {
/* 8029F03C */ JAISe(JAISeMgr*, JAISoundStrategyMgr<JAISe>*, u32);
/* 8029F0F8 */ void mixOut_(JASSoundParams const&);
/* 8029F214 */ void stopTrack_();
/* 8029F250 */ void startTrack_(JASSoundParams const&);
/* 8029F304 */ void JAISeCategoryMgr_mixOut_(bool, JASSoundParams const&, JAISoundActivity);
/* 8029F4CC */ void JAISeCategoryMgr_calc_();
/* 8029F5C8 */ bool JAISound_tryDie_();
/* 8029F650 */ void JAISeMgr_startID_(JAISoundID, JGeometry::TVec3<f32> const*, JAIAudience*);
/* 8029F6D8 */ bool getNumChild() const;
/* 8029F6E0 */ bool getChild(int);
/* 8029F6E8 */ void releaseChild(int);
/* 8029F6EC */ bool prepare_getSeqData_();
/* 8029F78C */ void prepare_();
/* 8029F84C */ JASTrack* getTrack();
/* 8029F854 */ JASTrack* getChildTrack(int);
/* 8029F864 */ JAISe* asSe();
/* 8029F868 */ JAITempoMgr* getTempoMgr();
};
//
// Forward References:
//
extern "C" void func_8029F03C();
extern "C" void mixOut___5JAISeFRC14JASSoundParams();
extern "C" void stopTrack___5JAISeFv();
extern "C" void startTrack___5JAISeFRC14JASSoundParams();
extern "C" void JAISeCategoryMgr_mixOut___5JAISeFbRC14JASSoundParams16JAISoundActivity();
extern "C" void JAISeCategoryMgr_calc___5JAISeFv();
extern "C" void JAISound_tryDie___5JAISeFv();
extern "C" void func_8029F650();
extern "C" bool getNumChild__5JAISeCFv();
extern "C" bool getChild__5JAISeFi();
extern "C" void releaseChild__5JAISeFi();
extern "C" void prepare_getSeqData___5JAISeFv();
extern "C" void prepare___5JAISeFv();
extern "C" void getTrack__5JAISeFv();
extern "C" void getChildTrack__5JAISeFi();
extern "C" void asSe__5JAISeFv();
extern "C" void getTempoMgr__5JAISeFv();
extern "C" static void func_8029F870();
extern "C" static void func_8029F878();
extern "C" static void func_8029F880();
extern "C" static void func_8029F888();
extern "C" static void func_8029F890();
extern "C" static void func_8029F898();
extern "C" static void func_8029F8A0();
extern "C" static void func_8029F8A8();
//
// External References:
//
extern "C" void __ct__8JASTrackFv();
extern "C" void setChannelMgrCount__8JASTrackFUl();
extern "C" void init__8JASTrackFv();
extern "C" void assignExtBuffer__8JASTrackFUlP14JASSoundParams();
extern "C" void setSeqData__8JASTrackFPvUl();
extern "C" void startSeq__8JASTrackFv();
extern "C" void stopSeq__8JASTrackFv();
extern "C" void mute__8JASTrackFb();
extern "C" void pause__8JASTrackFb();
extern "C" void setTempoRate__8JASTrackFf();
extern "C" void mixOutAll__14JAISoundParamsFRC14JASSoundParamsP14JASSoundParamsf();
extern "C" void __ct__8JAISoundFv();
extern "C" void func_802A2328();
extern "C" bool asSeq__8JAISoundFv();
extern "C" bool asStream__8JAISoundFv();
extern "C" void die_JAISound___8JAISoundFv();
extern "C" void increasePrepareCount_JAISound___8JAISoundFv();
extern "C" void calc_JAISound___8JAISoundFv();
extern "C" void initTrack_JAISound___8JAISoundFP8JASTrack();
extern "C" void __ct__10JSUPtrLinkFPv();
extern "C" void _savegpr_28();
extern "C" void _savegpr_29();
extern "C" void _restgpr_28();
extern "C" void _restgpr_29();
//
// Declarations:
//
/* ############################################################################################## */
/* 803C9858-803C98B0 026978 0058+00 1/1 1/1 0/0 .data __vt__5JAISe */
SECTION_DATA extern void* __vt__5JAISe[22] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)func_8029F8A8,
(void*)func_8029F8A0,
(void*)func_8029F898,
(void*)func_8029F890,
(void*)asSeq__8JAISoundFv,
(void*)asStream__8JAISoundFv,
(void*)func_8029F888,
(void*)func_8029F880,
(void*)func_8029F878,
(void*)func_8029F870,
(void*)getNumChild__5JAISeCFv,
(void*)getChild__5JAISeFi,
(void*)releaseChild__5JAISeFi,
(void*)getTrack__5JAISeFv,
(void*)getChildTrack__5JAISeFi,
(void*)asSe__5JAISeFv,
(void*)getTempoMgr__5JAISeFv,
(void*)JAISound_tryDie___5JAISeFv,
};
/* 80455778-8045577C 003D78 0004+00 2/2 0/0 0/0 .sdata2 @626 */
SECTION_SDATA2 static f32 lit_626 = 1.0f;
/* 8045577C-80455780 003D7C 0004+00 2/2 0/0 0/0 .sdata2 @627 */
SECTION_SDATA2 static u8 lit_627[4] = {
0x00,
0x00,
0x00,
0x00,
};
/* 80455780-80455784 003D80 0004+00 2/2 0/0 0/0 .sdata2 @628 */
SECTION_SDATA2 static f32 lit_628 = 0.5f;
/* 8029F03C-8029F0F8 29997C 00BC+00 0/0 1/1 0/0 .text
* __ct__5JAISeFP8JAISeMgrP27JAISoundStrategyMgr<5JAISe>Ul */
// multiple inheritance thunks
#ifdef NONMATCHING
JAISe::JAISe(JAISeMgr* param_0, JAISoundStrategyMgr<JAISe>* param_1, u32 param_2) : JSULink<JAISe>(this) {
inner_.mSoundStrategyMgr = param_1;
inner_.seMgr = param_0;
inner_.mProperPriority = param_2;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JAISe::JAISe(JAISeMgr* param_0, JAISoundStrategyMgr<JAISe>* param_1, u32 param_2) {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F03C.s"
}
#pragma pop
#endif
/* 8029F0F8-8029F214 299A38 011C+00 1/1 0/0 0/0 .text mixOut___5JAISeFRC14JASSoundParams
*/
// multiple inheritance thunks
#ifdef NONMATCHING
*/
void JAISe::mixOut_(JASSoundParams const& param_0) {
inner_.track.setTempoRate(inner_.mTempoMgr.getTempo());
JASSoundParams stackParams;
@@ -182,20 +54,8 @@ void JAISe::mixOut_(JASSoundParams const& param_0) {
inner_.mSoundParams = stackParams;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::mixOut_(JASSoundParams const& param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/mixOut___5JAISeFRC14JASSoundParams.s"
}
#pragma pop
#endif
/* 8029F214-8029F250 299B54 003C+00 1/1 0/0 0/0 .text stopTrack___5JAISeFv */
// multiple inheritance thunks
#ifdef NONMATCHING
void JAISe::stopTrack_() {
switch (inner_.track.getStatus()) {
case 0:
@@ -207,20 +67,8 @@ void JAISe::stopTrack_() {
break;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::stopTrack_() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/stopTrack___5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F250-8029F304 299B90 00B4+00 1/1 0/0 0/0 .text startTrack___5JAISeFRC14JASSoundParams */
// multiple inheritance thunks
#ifdef NONMATCHING
void JAISe::startTrack_(JASSoundParams const& param_0) {
if (inner_.track.getStatus() == 2) {
inner_.track.init();
@@ -236,25 +84,9 @@ void JAISe::startTrack_(JASSoundParams const& param_0) {
inner_.track.setSeqData(inner_.mSeqData.field_0x0, inner_.mSeqData.field_0x4);
inner_.track.startSeq();
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::startTrack_(JASSoundParams const& param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/startTrack___5JAISeFRC14JASSoundParams.s"
}
#pragma pop
#endif
/* ############################################################################################## */
/* 80455784-80455788 003D84 0004+00 2/2 0/0 0/0 .sdata2 @736 */
SECTION_SDATA2 static f32 lit_736 = 1.0f / 100.0f;
/* 8029F304-8029F4CC 299C44 01C8+00 0/0 1/1 0/0 .text
* JAISeCategoryMgr_mixOut___5JAISeFbRC14JASSoundParams16JAISoundActivity */
// Matches with literals
#ifdef NONMATCHING
void JAISe::JAISeCategoryMgr_mixOut_(bool param_0, JASSoundParams const& param_1, JAISoundActivity param_2) {
mixOut_(param_1);
if (isStopping()) {
@@ -289,21 +121,8 @@ void JAISe::JAISeCategoryMgr_mixOut_(bool param_0, JASSoundParams const& param_1
stop_JAISound_();
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::JAISeCategoryMgr_mixOut_(bool param_0, JASSoundParams const& param_1,
JAISoundActivity param_2) {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/JAISeCategoryMgr_mixOut___5JAISeFbRC14JASSoundParams16JAISoundActivity.s"
}
#pragma pop
#endif
/* 8029F4CC-8029F5C8 299E0C 00FC+00 0/0 1/1 0/0 .text JAISeCategoryMgr_calc___5JAISeFv */
// Matches with literals
#ifdef NONMATCHING
void JAISe::JAISeCategoryMgr_calc_() {
prepare_();
if (calc_JAISound_()) {
@@ -318,20 +137,8 @@ void JAISe::JAISeCategoryMgr_calc_() {
inner_.mPriority = inner_.mProperPriority + mPriority;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::JAISeCategoryMgr_calc_() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/JAISeCategoryMgr_calc___5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F5C8-8029F650 299F08 0088+00 2/1 0/0 0/0 .text JAISound_tryDie___5JAISeFv */
// multiple inheritance thunks
#ifdef NONMATCHING
bool JAISe::JAISound_tryDie_() {
switch (inner_.track.getStatus()) {
case 0:
@@ -347,21 +154,9 @@ bool JAISe::JAISound_tryDie_() {
}
return false;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm bool JAISe::JAISound_tryDie_() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/JAISound_tryDie___5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F650-8029F6D8 299F90 0088+00 0/0 1/1 0/0 .text
* JAISeMgr_startID___5JAISeF10JAISoundIDPCQ29JGeometry8TVec3<f>P11JAIAudience */
// multiple inheritance thunks
#ifdef NONMATCHING
void JAISe::JAISeMgr_startID_(JAISoundID param_0, JGeometry::TVec3<f32> const* param_1, JAIAudience* param_2) {
start_JAISound_(param_0, param_1, param_2);
inner_.field_0x26c = 0;
@@ -371,26 +166,15 @@ void JAISe::JAISeMgr_startID_(JAISoundID param_0, JGeometry::TVec3<f32> const* p
inner_.field_0x278 = NULL;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::JAISeMgr_startID_(JAISoundID param_0, JGeometry::TVec3<f32> const* param_1,
JAIAudience* param_2) {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F650.s"
}
#pragma pop
#endif
/* 8029F6D8-8029F6E0 29A018 0008+00 2/1 0/0 0/0 .text getNumChild__5JAISeCFv */
bool JAISe::getNumChild() const {
return false;
s32 JAISe::getNumChild() const {
return 0;
}
/* 8029F6E0-8029F6E8 29A020 0008+00 2/1 0/0 0/0 .text getChild__5JAISeFi */
bool JAISe::getChild(int param_0) {
return false;
JAISoundChild* JAISe::getChild(int param_0) {
return NULL;
}
/* 8029F6E8-8029F6EC 29A028 0004+00 2/1 0/0 0/0 .text releaseChild__5JAISeFi */
@@ -399,8 +183,6 @@ void JAISe::releaseChild(int param_0) {
}
/* 8029F6EC-8029F78C 29A02C 00A0+00 1/1 0/0 0/0 .text prepare_getSeqData___5JAISeFv */
// multiple inheritance thunks
#ifdef NONMATCHING
bool JAISe::prepare_getSeqData_() {
switch (inner_.seMgr->getSeqDataMgr()->getSeqData(soundID, &inner_.mSeqData)) {
case 0:
@@ -414,20 +196,8 @@ bool JAISe::prepare_getSeqData_() {
}
return false;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm bool JAISe::prepare_getSeqData_() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/prepare_getSeqData___5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F78C-8029F84C 29A0CC 00C0+00 1/1 0/0 0/0 .text prepare___5JAISeFv */
// multiple inheritance thunks
#ifdef NONMATCHING
void JAISe::prepare_() {
switch (status_.state.unk) {
case 6:
@@ -453,50 +223,16 @@ void JAISe::prepare_() {
break;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISe::prepare_() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/prepare___5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F84C-8029F854 29A18C 0008+00 2/1 0/0 0/0 .text getTrack__5JAISeFv */
// multiple inheritance thunks
#ifdef NONMATCHING
JASTrack* JAISe::getTrack() {
return &inner_.track;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASTrack* JAISe::getTrack() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/getTrack__5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F854-8029F864 29A194 0010+00 2/1 0/0 0/0 .text getChildTrack__5JAISeFi */
// multiple inheritance thunks
#ifdef NONMATCHING
JASTrack* JAISe::getChildTrack(int param_0) {
return inner_.track.getChild(param_0);
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASTrack* JAISe::getChildTrack(int param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/getChildTrack__5JAISeFi.s"
}
#pragma pop
#endif
/* 8029F864-8029F868 29A1A4 0004+00 2/1 0/0 0/0 .text asSe__5JAISeFv */
JAISe* JAISe::asSe() {
@@ -504,98 +240,6 @@ JAISe* JAISe::asSe() {
}
/* 8029F868-8029F870 29A1A8 0008+00 2/1 0/0 0/0 .text getTempoMgr__5JAISeFv */
// multiple inheritance thunks
#ifdef NONMATCHING
JAITempoMgr* JAISe::getTempoMgr() {
return &inner_.mTempoMgr;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JAITempoMgr* JAISe::getTempoMgr() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/getTempoMgr__5JAISeFv.s"
}
#pragma pop
#endif
/* 8029F870-8029F878 29A1B0 0008+00 1/0 0/0 0/0 .text @16@JAISound_tryDie___5JAISeFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F870() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F870.s"
}
#pragma pop
/* 8029F878-8029F880 29A1B8 0008+00 1/0 0/0 0/0 .text @16@getTempoMgr__5JAISeFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F878() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F878.s"
}
#pragma pop
/* 8029F880-8029F888 29A1C0 0008+00 1/0 0/0 0/0 .text @16@getChildTrack__5JAISeFi */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F880() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F880.s"
}
#pragma pop
/* 8029F888-8029F890 29A1C8 0008+00 1/0 0/0 0/0 .text @16@getTrack__5JAISeFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F888() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F888.s"
}
#pragma pop
/* 8029F890-8029F898 29A1D0 0008+00 1/0 0/0 0/0 .text @16@asSe__5JAISeFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F890() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F890.s"
}
#pragma pop
/* 8029F898-8029F8A0 29A1D8 0008+00 1/0 0/0 0/0 .text @16@releaseChild__5JAISeFi */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F898() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F898.s"
}
#pragma pop
/* 8029F8A0-8029F8A8 29A1E0 0008+00 1/0 0/0 0/0 .text @16@getChild__5JAISeFi */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F8A0() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F8A0.s"
}
#pragma pop
/* 8029F8A8-8029F8B0 29A1E8 0008+00 1/0 0/0 0/0 .text @16@getNumChild__5JAISeCFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
static asm void func_8029F8A8() {
nofralloc
#include "asm/JSystem/JAudio2/JAISe/func_8029F8A8.s"
}
#pragma pop
+1 -1
View File
@@ -197,7 +197,7 @@ void JAISeq::playSeqData_(JASSoundParams const& param_0, JAISoundActivity param_
static u8 lit_716[12];
/* 802A0CA4-802A0E48 29B5E4 01A4+00 1/1 0/0 0/0 .text reserveChildTracks___6JAISeqFi */
// setAutoDelete inline, operator new?
// operator new?
#ifdef NONMATCHING
void JAISeq::reserveChildTracks_(int param_0) {
for (int i = 0; i < 2; i++) {
+2 -113
View File
@@ -9,7 +9,6 @@
#include "JSystem/JAudio2/JAISoundHandles.h"
#include "JSystem/JAudio2/JASReport.h"
#include "JSystem/JAudio2/JASTrack.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "global.h"
@@ -17,37 +16,10 @@
// Forward References:
//
extern "C" void releaseSound__14JAISoundHandleFv();
extern "C" void releaseHandle__8JAISoundFv();
extern "C" void attachHandle__8JAISoundFP14JAISoundHandle();
extern "C" void lockWhenPrepared__15JAISoundStatus_Fv();
extern "C" void unlockIfLocked__15JAISoundStatus_Fv();
extern "C" void mixOutAll__14JAISoundParamsFRC14JASSoundParamsP14JASSoundParamsf();
extern "C" void __ct__8JAISoundFv();
extern "C" void func_802A2328();
extern "C" void acceptsNewAudible__8JAISoundCFv();
extern "C" void func_802A2474();
extern "C" void stop__8JAISoundFUl();
extern "C" void stop__8JAISoundFv();
extern "C" bool asSe__8JAISoundFv();
extern "C" bool asSeq__8JAISoundFv();
extern "C" bool asStream__8JAISoundFv();
extern "C" void die_JAISound___8JAISoundFv();
extern "C" void increasePrepareCount_JAISound___8JAISoundFv();
extern "C" void calc_JAISound___8JAISoundFv();
extern "C" void initTrack_JAISound___8JAISoundFP8JASTrack();
extern "C" extern char const* const JAISound__stringBase0;
//
// External References:
//
extern "C" void JASReport__FPCce();
extern "C" void setChannelMgrCount__8JASTrackFUl();
extern "C" void assignExtBuffer__8JASTrackFUlP14JASSoundParams();
extern "C" void _savegpr_26();
extern "C" void _restgpr_26();
//
// Declarations:
//
@@ -106,10 +78,6 @@ s32 JAISoundStatus_::unlockIfLocked() {
return 0;
}
/* ############################################################################################## */
/* 804557B8-804557BC 003DB8 0004+00 3/3 0/0 0/0 .sdata2 @659 */
SECTION_SDATA2 static f32 lit_659 = 0.5f;
/* 802A2280-802A22F8 29CBC0 0078+00 0/0 4/4 0/0 .text
* mixOutAll__14JAISoundParamsFRC14JASSoundParamsP14JASSoundParamsf */
void JAISoundParams::mixOutAll(JASSoundParams const& param_0, JASSoundParams* param_1,
@@ -117,55 +85,15 @@ void JAISoundParams::mixOutAll(JASSoundParams const& param_0, JASSoundParams* pa
param_1->mVolume = mMove.mParams.mVolume * (param_0.mVolume * mProperty.field_0x0) * param_2;
param_1->mFxMix = mMove.mParams.mFxMix + (param_0.mFxMix + mProperty.field_0x4);
param_1->mPitch = mMove.mParams.mPitch * (param_0.mPitch * mProperty.field_0x8);
param_1->mPan = (param_0.mPan + mMove.mParams.mPan) - lit_659;
param_1->mPan = (param_0.mPan + mMove.mParams.mPan) - 0.5f;
param_1->mDolby = param_0.mDolby + mMove.mParams.mDolby;
}
/* ############################################################################################## */
/* 803C9970-803C99A0 026A90 0030+00 1/1 0/0 0/0 .data __vt__8JAISound */
SECTION_DATA extern void* __vt__8JAISound[12] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)asSe__8JAISoundFv,
(void*)asSeq__8JAISoundFv,
(void*)asStream__8JAISoundFv,
(void*)NULL,
(void*)NULL,
(void*)NULL,
(void*)NULL,
};
/* 804557BC-804557C0 003DBC 0004+00 2/2 0/0 0/0 .sdata2 @697 */
SECTION_SDATA2 static f32 lit_697 = 1.0f;
/* 804557C0-804557C8 003DC0 0004+04 4/4 0/0 0/0 .sdata2 @698 */
SECTION_SDATA2 static f32 lit_698[1 + 1 /* padding */] = {
0.0f,
/* padding */
0.0f,
};
/* 802A22F8-802A2328 29CC38 0030+00 0/0 3/3 0/0 .text __ct__8JAISoundFv */
// matches with literals
#ifdef NONMATCHING
JAISound::JAISound() : params() {}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JAISound::JAISound() {
nofralloc
#include "asm/JSystem/JAudio2/JAISound/__ct__8JAISoundFv.s"
}
#pragma pop
#endif
/* 802A2328-802A244C 29CC68 0124+00 0/0 3/3 0/0 .text
* start_JAISound___8JAISoundF10JAISoundIDPCQ29JGeometry8TVec3<f>P11JAIAudience */
#ifdef NONMATCHING
void JAISound::start_JAISound_(JAISoundID param_0, JGeometry::TVec3<f32> const* param_1,
JAIAudience* param_2) {
handle_ = NULL;
@@ -182,19 +110,8 @@ void JAISound::start_JAISound_(JAISoundID param_0, JGeometry::TVec3<f32> const*
} else {
audible_ = NULL;
}
field_0x34 = 0;
mPriority = 0;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISound::start_JAISound_(JAISoundID param_0, JGeometry::TVec3<f32> const* param_1,
JAIAudience* param_2) {
nofralloc
#include "asm/JSystem/JAudio2/JAISound/func_802A2328.s"
}
#pragma pop
#endif
/* 802A244C-802A2474 29CD8C 0028+00 0/0 2/2 0/0 .text acceptsNewAudible__8JAISoundCFv */
bool JAISound::acceptsNewAudible() const {
@@ -216,12 +133,7 @@ void JAISound::newAudible(JGeometry::TVec3<f32> const& param_0,
audible_ = audience_->newAudible(param_0, sound, param_1, param_2);
}
/* ############################################################################################## */
/* 804557C8-804557D0 003DC8 0008+00 1/1 0/0 0/0 .sdata2 @766 */
SECTION_SDATA2 static f64 lit_766 = 4503599627370496.0 /* cast u32 to float */;
/* 802A24DC-802A2598 29CE1C 00BC+00 0/0 24/24 0/0 .text stop__8JAISoundFUl */
#ifdef NONMATCHING
void JAISound::stop(u32 fadeCount) {
ASSERT(status_.isAlive());
if (fadeCount == 0) {
@@ -235,16 +147,6 @@ void JAISound::stop(u32 fadeCount) {
status_.state.flags.flag1 = 1;
}
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISound::stop(u32 param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAISound/stop__8JAISoundFUl.s"
}
#pragma pop
#endif
/* 802A2598-802A25D8 29CED8 0040+00 2/2 21/21 0/0 .text stop__8JAISoundFv */
void JAISound::stop() {
@@ -268,7 +170,6 @@ JAIStream* JAISound::asStream() {
}
/* 802A25F0-802A266C 29CF30 007C+00 0/0 3/3 0/0 .text die_JAISound___8JAISoundFv */
#ifdef NONMATCHING
void JAISound::die_JAISound_() {
if (audible_ != NULL) {
audience_->deleteAudible(audible_);
@@ -279,16 +180,6 @@ void JAISound::die_JAISound_() {
releaseHandle();
status_.state.unk = 6;
}
#else
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAISound::die_JAISound_() {
nofralloc
#include "asm/JSystem/JAudio2/JAISound/die_JAISound___8JAISoundFv.s"
}
#pragma pop
#endif
/* 802A266C-802A26B8 29CFAC 004C+00 0/0 3/3 0/0 .text increasePrepareCount_JAISound___8JAISoundFv
*/
@@ -299,8 +190,6 @@ void JAISound::increasePrepareCount_JAISound_() {
}
}
/* ############################################################################################## */
/* 802A26B8-802A29DC 29CFF8 0324+00 0/0 3/3 0/0 .text calc_JAISound___8JAISoundFv */
bool JAISound::calc_JAISound_() {
status_.state.flags.flag2 = 1;
+54 -116
View File
@@ -4,6 +4,8 @@
//
#include "JSystem/JAudio2/JASBasicInst.h"
#include "JSystem/JAudio2/JASCalc.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "dol2asm.h"
#include "dolphin/types.h"
@@ -11,37 +13,6 @@
// Types:
//
struct JKRHeap {};
struct JASOscillator {
struct Data {};
};
struct JASInstParam {};
struct JASInst {
/* 8029828C */ ~JASInst();
};
struct JASCalc {
/* 8028F480 */ void bzero(void*, u32);
};
struct JASBasicInst {
struct TKeymap {
/* 80298250 */ ~TKeymap();
/* 802982D4 */ TKeymap();
};
/* 80298014 */ JASBasicInst();
/* 8029807C */ ~JASBasicInst();
/* 802980F8 */ void getParam(int, int, JASInstParam*) const;
/* 8029819C */ void setKeyRegionCount(u32, JKRHeap*);
/* 8029821C */ void setOsc(int, JASOscillator::Data const*);
/* 8029822C */ void getKeyRegion(int);
/* 802982E0 */ void getType() const;
};
//
// Forward References:
//
@@ -74,126 +45,93 @@ extern "C" void _restgpr_29();
//
/* ############################################################################################## */
/* 803C76E8-803C76FC 024808 0014+00 2/2 0/0 0/0 .data __vt__12JASBasicInst */
SECTION_DATA extern void* __vt__12JASBasicInst[5] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__12JASBasicInstFv,
(void*)getParam__12JASBasicInstCFiiP12JASInstParam,
(void*)getType__12JASBasicInstCFv,
};
/* 803C76FC-803C7710 02481C 0014+00 3/3 2/2 0/0 .data __vt__7JASInst */
SECTION_DATA extern void* __vt__7JASInst[5] = {
(void*)NULL /* RTTI */, (void*)NULL, (void*)__dt__7JASInstFv, (void*)NULL, (void*)NULL,
};
/* 80455640-80455648 003C40 0004+04 1/1 0/0 0/0 .sdata2 @187 */
SECTION_SDATA2 static f32 lit_187[1 + 1 /* padding */] = {
1.0f,
/* padding */
0.0f,
};
// /* 803C76FC-803C7710 02481C 0014+00 3/3 2/2 0/0 .data __vt__7JASInst */
SECTION_DATA extern void* __vt__7JASInst[5];
/* 80298014-8029807C 292954 0068+00 0/0 2/2 0/0 .text __ct__12JASBasicInstFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASBasicInst::JASBasicInst() {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/__ct__12JASBasicInstFv.s"
JASBasicInst::JASBasicInst() {
mVolume = 1.0;
mPitch = 1.0;
mKeymapCount = 0;
mKeymap = NULL;
JASCalc::bzero(field_0xc, sizeof(field_0xc));
}
#pragma pop
/* 8029807C-802980F8 2929BC 007C+00 1/0 0/0 0/0 .text __dt__12JASBasicInstFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASBasicInst::~JASBasicInst() {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/__dt__12JASBasicInstFv.s"
JASBasicInst::~JASBasicInst() {
delete[] mKeymap;
}
#pragma pop
/* 802980F8-8029819C 292A38 00A4+00 1/0 0/0 0/0 .text getParam__12JASBasicInstCFiiP12JASInstParam
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) const {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/getParam__12JASBasicInstCFiiP12JASInstParam.s"
bool JASBasicInst::getParam(int param_0, int param_1, JASInstParam* param_2) const {
param_2->field_0x1c = 0;
param_2->field_0x1e = 0;
param_2->field_0x14 = (JASOscillator::Data**)&field_0xc;
param_2->field_0x1d = 2;
param_2->mVolume = mVolume;
param_2->mPitch = mPitch;
TKeymap* keyMap = NULL;
for (int i = 0; i < mKeymapCount; i++) {
if (param_0 <= mKeymap[i].field_0x0) {
keyMap = &mKeymap[i];
break;
}
}
if (keyMap == NULL) {
return false;
}
param_2->mVolume *= keyMap->field_0x8;
param_2->mPitch *= keyMap->field_0xc;
param_2->field_0x1a = keyMap->field_0x4;
return true;
}
#pragma pop
/* 8029819C-8029821C 292ADC 0080+00 0/0 2/2 0/0 .text
* setKeyRegionCount__12JASBasicInstFUlP7JKRHeap */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASBasicInst::setKeyRegionCount(u32 param_0, JKRHeap* param_1) {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/setKeyRegionCount__12JASBasicInstFUlP7JKRHeap.s"
void JASBasicInst::setKeyRegionCount(u32 count, JKRHeap* param_1) {
delete [] mKeymap;
mKeymap = new (param_1, 0) TKeymap[count];
mKeymapCount = count;
}
#pragma pop
/* 8029821C-8029822C 292B5C 0010+00 0/0 2/2 0/0 .text
* setOsc__12JASBasicInstFiPCQ213JASOscillator4Data */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASBasicInst::setOsc(int param_0, JASOscillator::Data const* param_1) {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/setOsc__12JASBasicInstFiPCQ213JASOscillator4Data.s"
void JASBasicInst::setOsc(int param_0, JASOscillator::Data const* param_1) {
field_0xc[param_0] = param_1;
}
#pragma pop
/* 8029822C-80298250 292B6C 0024+00 0/0 2/2 0/0 .text getKeyRegion__12JASBasicInstFi */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASBasicInst::getKeyRegion(int param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/getKeyRegion__12JASBasicInstFi.s"
JASBasicInst::TKeymap* JASBasicInst::getKeyRegion(int param_0) {
if (param_0 >= mKeymapCount) {
return NULL;
}
return mKeymap + param_0;
}
#pragma pop
/* 80298250-8029828C 292B90 003C+00 2/2 0/0 0/0 .text __dt__Q212JASBasicInst7TKeymapFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASBasicInst::TKeymap::~TKeymap() {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/__dt__Q212JASBasicInst7TKeymapFv.s"
JASBasicInst::TKeymap::~TKeymap() {
}
#pragma pop
/* 8029828C-802982D4 292BCC 0048+00 1/0 0/0 0/0 .text __dt__7JASInstFv */
// If not here, default placement is after JASBasicInst::JASBasicInst
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASInst::~JASInst() {
//asm JASInst::~JASInst() {
asm void __dt__7JASInstFv() {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/__dt__7JASInstFv.s"
}
#pragma pop
/* 802982D4-802982E0 292C14 000C+00 1/1 0/0 0/0 .text __ct__Q212JASBasicInst7TKeymapFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASBasicInst::TKeymap::TKeymap() {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/__ct__Q212JASBasicInst7TKeymapFv.s"
JASBasicInst::TKeymap::TKeymap() {
field_0x0 = -1;
}
#pragma pop
/* 802982E0-802982EC 292C20 000C+00 1/0 0/0 0/0 .text getType__12JASBasicInstCFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASBasicInst::getType() const {
nofralloc
#include "asm/JSystem/JAudio2/JASBasicInst/getType__12JASBasicInstCFv.s"
}
#pragma pop
+62 -118
View File
@@ -4,175 +4,119 @@
//
#include "JSystem/JAudio2/JASDrumSet.h"
#include "dol2asm.h"
#include "JSystem/JAudio2/JASCalc.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/types.h"
//
// Types:
//
struct JKRHeap {};
struct JASInstParam {};
struct JASDrumSet {
struct TPerc {
/* 802984C4 */ TPerc();
/* 802984E4 */ void setRelease(u32);
};
/* 802982EC */ JASDrumSet();
/* 80298314 */ ~JASDrumSet();
/* 80298370 */ void newPercArray(u8, JKRHeap*);
/* 802983CC */ void getParam(int, int, JASInstParam*) const;
/* 802984B4 */ void setPerc(int, JASDrumSet::TPerc*);
/* 802984EC */ void getType() const;
};
struct JASCalc {
/* 8028F480 */ void bzero(void*, u32);
};
//
// Forward References:
//
extern "C" void __ct__10JASDrumSetFv();
extern "C" void __dt__10JASDrumSetFv();
extern "C" void newPercArray__10JASDrumSetFUcP7JKRHeap();
extern "C" void getParam__10JASDrumSetCFiiP12JASInstParam();
extern "C" void setPerc__10JASDrumSetFiPQ210JASDrumSet5TPerc();
extern "C" void __ct__Q210JASDrumSet5TPercFv();
extern "C" void setRelease__Q210JASDrumSet5TPercFUl();
extern "C" void getType__10JASDrumSetCFv();
//
// External References:
//
extern "C" void bzero__7JASCalcFPvUl();
extern "C" void* __nwa__FUlP7JKRHeapi();
extern "C" void __dl__FPv();
extern "C" extern void* __vt__7JASInst[5];
//
// Declarations:
//
/* ############################################################################################## */
/* 803C7710-803C7728 024830 0014+04 2/2 0/0 0/0 .data __vt__10JASDrumSet */
SECTION_DATA extern void* __vt__10JASDrumSet[5 + 1 /* padding */] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)__dt__10JASDrumSetFv,
(void*)getParam__10JASDrumSetCFiiP12JASInstParam,
(void*)getType__10JASDrumSetCFv,
/* padding */
NULL,
};
/* 802982EC-80298314 292C2C 0028+00 0/0 2/2 0/0 .text __ct__10JASDrumSetFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASDrumSet::JASDrumSet() {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/__ct__10JASDrumSetFv.s"
JASDrumSet::JASDrumSet() {
field_0x4 = NULL;
field_0x8 = 0;
}
#pragma pop
/* 80298314-80298370 292C54 005C+00 1/0 0/0 0/0 .text __dt__10JASDrumSetFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASDrumSet::~JASDrumSet() {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/__dt__10JASDrumSetFv.s"
JASDrumSet::~JASDrumSet() {
}
#pragma pop
/* 80298370-802983CC 292CB0 005C+00 0/0 2/2 0/0 .text newPercArray__10JASDrumSetFUcP7JKRHeap */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASDrumSet::newPercArray(u8 param_0, JKRHeap* param_1) {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/newPercArray__10JASDrumSetFUcP7JKRHeap.s"
void JASDrumSet::newPercArray(u8 param_0, JKRHeap* param_1) {
if (param_0) {
field_0x8 = param_0;
field_0x4 = new (param_1, 0) TPerc*[field_0x8];
JASCalc::bzero(field_0x4, field_0x8 * sizeof(TPerc*));
}
}
#pragma pop
/* ############################################################################################## */
/* 80431B58-80431B70 05E878 0018+00 1/1 0/0 0/0 .bss osc$213 */
static u8 osc[24];
static JASOscillator::Data osc;
/* 80451270-80451274 000770 0004+00 1/1 0/0 0/0 .sbss oscp$214 */
static u8 oscp[4];
static JASOscillator::Data* oscp;
/* 80451274-80451278 000774 0004+00 1/1 0/0 0/0 .sbss None */
static u8 data_80451274[4];
/* 80455648-8045564C 003C48 0004+00 2/2 0/0 0/0 .sdata2 @219 */
SECTION_SDATA2 static f32 lit_219 = 1.0f;
/* 8045564C-80455650 003C4C 0004+00 1/1 0/0 0/0 .sdata2 @220 */
SECTION_SDATA2 static u8 lit_220[4] = {
0x00,
0x00,
0x00,
0x00,
};
static s8 data_80451274[4];
/* 802983CC-802984B4 292D0C 00E8+00 1/0 0/0 0/0 .text getParam__10JASDrumSetCFiiP12JASInstParam */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASDrumSet::getParam(int param_0, int param_1, JASInstParam* param_2) const {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/getParam__10JASDrumSetCFiiP12JASInstParam.s"
bool JASDrumSet::getParam(int param_0, int param_1, JASInstParam* param_2) const {
if (field_0x4 == NULL) {
return false;
}
if (param_0 >= field_0x8) {
return false;
}
TPerc* perc = field_0x4[param_0];
if (perc == NULL) {
return false;
}
param_2->field_0x1c = 0;
param_2->field_0x1e = 1;
param_2->mVolume = perc->mVolume;
param_2->mPitch = perc->mPitch;
param_2->mPan = perc->mPan;
param_2->field_0x18 = perc->field_0xc;
osc._00 = 0;
osc._04 = 1.0f;
osc._08 = NULL;
osc._0C = NULL;
osc._10 = 1.0f;
osc._14 = 0.0f;
if (data_80451274[0] == 0) {
oscp = &osc;
data_80451274[0] = 1;
}
param_2->field_0x14 = &oscp;
param_2->field_0x1d = 1;
param_2->mVolume *= perc->field_0x10;
param_2->mPitch *= perc->field_0x14;
param_2->field_0x1a = perc->field_0xe;
return true;
}
#pragma pop
/* 802984B4-802984C4 292DF4 0010+00 0/0 2/2 0/0 .text setPerc__10JASDrumSetFiPQ210JASDrumSet5TPerc
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASDrumSet::setPerc(int param_0, JASDrumSet::TPerc* param_1) {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/setPerc__10JASDrumSetFiPQ210JASDrumSet5TPerc.s"
void JASDrumSet::setPerc(int param_0, JASDrumSet::TPerc* param_1) {
field_0x4[param_0] = param_1;
}
#pragma pop
/* ############################################################################################## */
/* 80455650-80455658 003C50 0004+04 1/1 0/0 0/0 .sdata2 @253 */
SECTION_SDATA2 static f32 lit_253[1 + 1 /* padding */] = {
0.5f,
/* padding */
0.0f,
};
/* 802984C4-802984E4 292E04 0020+00 0/0 2/2 0/0 .text __ct__Q210JASDrumSet5TPercFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASDrumSet::TPerc::TPerc() {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/__ct__Q210JASDrumSet5TPercFv.s"
JASDrumSet::TPerc::TPerc() {
mVolume = 1.0f;
mPitch = 1.0f;
mPan = 0.5f;
field_0xc = 1000;
}
#pragma pop
/* 802984E4-802984EC -00001 0008+00 0/0 0/0 0/0 .text setRelease__Q210JASDrumSet5TPercFUl
*/
void JASDrumSet::TPerc::setRelease(u32 param_0) {
*(u16*)(((u8*)this) + 12) /* this->field_0xc */ = (u16)(param_0);
field_0xc = param_0;
}
/* 802984EC-802984F8 292E2C 000C+00 1/0 0/0 0/0 .text getType__10JASDrumSetCFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASDrumSet::getType() const {
nofralloc
#include "asm/JSystem/JAudio2/JASDrumSet/getType__10JASDrumSetCFv.s"
}
#pragma pop
u32 JASDrumSet::getType() const { return 'PERC'; }