Merge pull request #235 from jdflyer/master

JAudio2 Work
This commit is contained in:
notyourav
2023-01-02 00:34:39 -08:00
committed by GitHub
12 changed files with 428 additions and 430 deletions
+5 -1
View File
@@ -54,6 +54,10 @@ else
endif
endif
ifeq ($(WINE_LD),)
WINE_LD := $(WINE)
endif
# Hack for OSX
ifeq ($(UNAME_S),Darwin)
CPP := cpp-10 -P
@@ -67,7 +71,7 @@ AS := $(DEVKITPPC)/bin/powerpc-eabi-as
OBJCOPY := $(DEVKITPPC)/bin/powerpc-eabi-objcopy
STRIP := $(DEVKITPPC)/bin/powerpc-eabi-strip
CC := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwcceppc_patched.exe
LD := $(WINE) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
LD := $(WINE_LD) tools/mwcc_compiler/$(MWCC_VERSION)/mwldeppc.exe
ELF2DOL := $(BUILD_PATH)/elf2dol
PYTHON := python3
ICONV := iconv
+55 -59
View File
@@ -10,17 +10,23 @@
class JAISoundID {
public:
operator u32() const { return this->mId; }
void operator=(JAISoundID const& other) {mId = other.mId;};
operator u32() const { return this->mId.mFullId; }
void operator=(JAISoundID const& other) { mId.mFullId = other.mId.mFullId; };
JAISoundID(u32 pId) { mId = pId; };
JAISoundID(u32 pId) { mId.mFullId = pId; };
JAISoundID(JAISoundID const& other) {mId = other.mId;};
JAISoundID(JAISoundID const& other) { mId = other.mId; };
JAISoundID() {}
private:
u32 mId;
union {
u32 mFullId;
struct {
u16 mSoundType;
u16 mShortId;
} mAdvancedId; // Debug doesn't have an inline for referencing the short ID so I assume
// it's similar to this
} mId;
};
struct JASTrack {
@@ -30,11 +36,9 @@ struct JASTrack {
/* 80292918 */ void writePort(u32, u16);
/* 8029297C */ void readPort(u32);
inline int getChannelMgrCount() {
return channelMgrCount;
}
inline int getChannelMgrCount() { return channelMgrCount; }
/* 0x0 */u8 field_0x0[0x1d0];
/* 0x0 */ u8 field_0x0[0x1d0];
/* 0x1d0 */ int channelMgrCount;
};
@@ -49,54 +53,50 @@ struct JAISoundStatus_ {
user_data = 0;
}
bool isAlive(); //used in assert
bool isAlive(); // used in assert
inline bool isPlaying() {
return state.unk==5;
}
inline bool isPlaying() { return state.unk == 5; }
inline bool isPaused() {
return field_0x0.flags.paused;
}
inline bool isPaused() { return field_0x0.flags.paused; }
/* 0x0 */ union {
u8 value;
struct{
u8 flag1:1;
u8 paused:1;
u8 flag3:1;
u8 flag4:1;
u8 flag5:1;
u8 flag6:1;
u8 flag7:1;
u8 flag8:1;
}flags;
}field_0x0;
struct {
u8 flag1 : 1;
u8 paused : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x0;
/* 0x1 */ union {
u8 value;
struct{
u8 flag1:1;
u8 flag2:1;
u8 flag3:1;
u8 flag4:1;
u8 flag5:1;
u8 flag6:1;
u8 flag7:1;
u8 flag8:1;
}flags;
}field_0x1;
struct {
u8 flag1 : 1;
u8 flag2 : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} field_0x1;
/* 0x2 */ struct {
u8 unk;
struct {
u8 flag1:1;
u8 flag2:1;
u8 flag3:1;
u8 flag4:1;
u8 flag5:1;
u8 flag6:1;
u8 flag7:1;
u8 flag8:1;
}flags;
u8 flag1 : 1;
u8 flag2 : 1;
u8 flag3 : 1;
u8 flag4 : 1;
u8 flag5 : 1;
u8 flag6 : 1;
u8 flag7 : 1;
u8 flag8 : 1;
} flags;
} state;
/* 0x4 */ u32 user_data;
}; // Size: 0x6
@@ -111,21 +111,19 @@ struct JAISoundFader {
mTransition.zero();
}
void fadeOut(u32 fadeCount) {
if (fadeCount!=0) {
mTransition.set(0.0f,mIntensity,fadeCount);
}else{
if (fadeCount != 0) {
mTransition.set(0.0f, mIntensity, fadeCount);
} else {
forceOut();
}
}
bool isOut() {
if(mTransition.mCount != 0 || mIntensity < 0.01f) {
if (mTransition.mCount != 0 || mIntensity < 0.01f) {
return true;
}
return false;
}
inline void calc() {
mIntensity = mTransition.apply(mIntensity);
}
inline void calc() { mIntensity = mTransition.apply(mIntensity); }
/* 0x00 */ f32 mIntensity;
/* 0x04 */ JAISoundParamsTransition::TTransition mTransition;
@@ -181,16 +179,14 @@ public:
u32 getUserData() const { return status_.user_data; }
bool isHandleAttached() const { return handle_ != NULL; }
void removeLifeTime_() {
status_.field_0x1.flags.flag1 = false;
}
void removeLifeTime_() { status_.field_0x1.flags.flag1 = false; }
void stop_JAISound_() {
status_.state.flags.flag5 = 0;
status_.state.flags.flag1 = 1;
}
bool isStopping() {
bool isStopping = false;
if(status_.state.flags.flag1) {
if (status_.state.flags.flag1) {
isStopping = status_.state.flags.flag5 ? fader.isOut() : true;
}
return isStopping;
+1 -1
View File
@@ -10,7 +10,7 @@ public:
/* 8028F9EC */ void allocCallStack(void (*)(void*), void*);
/* 8028F850 */ void allocCallStack(void (*)(void*), void const*, u32);
/* 8028FC54 */ void sendCmdMsg(void (*)(void*), void*);
/* 8028FB5C */ void sendCmdMsg(void (*)(void*), void const*, u32);
/* 8028FB5C */ int sendCmdMsg(void (*)(void*), void const*, u32);
/* 8028FE88 */ void pause(bool);
/* 8028F724 */ virtual ~JASTaskThread();
+104
View File
@@ -1,6 +1,110 @@
#ifndef JASWAVEARCLOADER_H
#define JASWAVEARCLOADER_H
#include "dol2asm.h"
#include "dolphin/types.h"
#include "global.h"
#include "MSL_C/MSL_Common/Src/string.h"
#include "dolphin/os/OSMutex.h"
#include "JSystem/JAudio2/JASDvdThread.h"
#include "JSystem/JAudio2/JASHeapCtrl.h"
#include "JSystem/JKernel/JKRDvdAramRipper.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
struct JASDisposer {
JASDisposer() {}
/* 8029A7B8 */ virtual ~JASDisposer() {}
/* 80290BCC */ virtual void onDispose();
};
struct JASHeap : JSUTree<JASHeap> {
/* 80290140 */ JASHeap(JASDisposer*);
/* 802901AC */ void initRootHeap(void*, u32);
/* 8029021C */ bool alloc(JASHeap*, u32);
/* 802903F4 */ bool allocTail(JASHeap*, u32);
/* 802904E4 */ void free();
/* 80290608 */ void insertChild(JASHeap*, JASHeap*, void*, u32, bool);
/* 802906F0 */ void getTailHeap();
/* 8029077C */ void getTailOffset();
/* 802907E0 */ void getCurOffset();
/* 80290B54 */ ~JASHeap() {}
void* getBase() { return mBase; }
/* 0x1C */ OSMutex mMutex;
/* 0x38 */ JASDisposer* mDisposer;
/* 0x3C */ void* mBase;
/* 0x40 */ u32 _3c;
/* 0x44 */ u32 _40;
};
struct JASKernel {
/* 802909B8 */ void setupRootHeap(JKRSolidHeap*, u32);
/* 80290AC0 */ static JKRHeap* getSystemHeap();
/* 80290AC8 */ u32 getCommandHeap();
/* 80290AD0 */ void setupAramHeap(u32, u32);
/* 80290B08 */ static JASHeap* getAramHeap();
static u8 audioAramHeap[68];
static u8 sAramBase[4];
static JKRHeap* sSystemHeap;
static u8 sCommandHeap[4];
};
#define DIR_MAX 64
struct JASWaveArcLoader {
/* 8029A0A0 */ static JASHeap* getRootHeap();
/* 8029A0D0 */ static void setCurrentDir(char const*);
/* 8029A130 */ static char* getCurrentDir();
static char sCurrentDir[DIR_MAX];
static JASHeap* sAramHeap;
};
struct JASWaveArc : JASDisposer {
/* 8029A13C */ JASWaveArc();
/* 8029A258 */ bool loadSetup(u32);
/* 8029A2EC */ bool eraseSetup();
/* 8029A378 */ static void loadToAramCallback(void*);
/* 8029A404 */ bool sendLoadCmd();
/* 8029A4C0 */ bool load(JASHeap*);
/* 8029A580 */ bool loadTail(JASHeap*);
/* 8029A640 */ void erase();
/* 8029A6AC */ void setEntryNum(s32);
/* 8029A70C */ void setFileName(char const*);
/* 8029A1B4 */ virtual ~JASWaveArc();
/* 8029A664 */ virtual void onDispose();
/* 80298FA0 */ virtual void onLoadDone();
/* 80298FA4 */ virtual void onEraseDone();
struct loadToAramCallbackParams {
// not official struct name
/* 0x0 */ JASWaveArc* mWavArc;
/* 0x4 */ long mEntryNum;
/* 0x8 */ u32 mBase;
/* 0xC */ u32 _c;
};
/* 0x04 */ JASHeap mHeap;
/* 0x48 */ u32 _48;
/* 0x4C */ volatile s32 _4c;
/* 0x50 */ int mEntryNum;
/* 0x54 */ u32 mFileLength;
/* 0x58 */ u16 _58;
/* 0x5A */ u16 _5a;
/* 0x5C */ OSMutex mMutex;
};
struct JASMutexLock {
JASMutexLock(OSMutex* mutex) {
mMutex = mutex;
OSLockMutex(mMutex);
}
~JASMutexLock() { OSUnlockMutex(mMutex); }
/* 0x0 */ OSMutex* mMutex;
};
#endif /* JASWAVEARCLOADER_H */
+24
View File
@@ -1,6 +1,30 @@
#ifndef JAUBANKTABLE_H
#define JAUBANKTABLE_H
#include "JSystem/JSupport/JSUList.h"
#include "dolphin/types.h"
template <typename T>
struct JASPtrTable {
T* get(u32 value) const {
if (value >= mLength) {
return NULL;
}
return mTable[value];
}
T** mTable;
u32 mLength;
};
struct JASBank;
struct JAUBankTable {
/* 802A4AA0 */ /*virtual*/ JASBank* getBank(u32) const;
/* 0x0 */ void* vtable;
/* 0x4 */ JASPtrTable<JASBank> mBankPtrTable;
};
struct JAUBankTableDictionary : JSUList<JAUBankTable> {
/* 802A4A80 */ void appendBankTable(JSULink<JAUBankTable>*);
};
#endif /* JAUBANKTABLE_H */
@@ -1,6 +1,33 @@
#ifndef JAUSTREAMFILETABLE_H
#define JAUSTREAMFILETABLE_H
#include "JSystem/JAudio2/JAISound.h"
#include "dolphin/types.h"
struct BinaryStreamFileTable {
/* 0x0 */ char mIdentifier[4];
/* 0x4 */ int mNumFiles;
/* 0x8 */ int mFilePathOffsets[];
};
struct JAUStreamFileTable {
/* 802A7420 */ JAUStreamFileTable();
/* 802A742C */ void init(void const*);
/* 802A7478 */ int getNumFiles() const;
/* 802A7484 */ const char* getFilePath(int) const;
/* 0x0 */ const BinaryStreamFileTable* mData;
};
struct JAIStreamDataMgr {
/* 802A3AD8 */ ~JAIStreamDataMgr();
};
struct JAUStreamDataMgr_StreamFileTable : JAIStreamDataMgr {
/* 802A74AC */ virtual int getStreamFileEntry(JAISoundID);
/* 802A74E8 */ virtual ~JAUStreamDataMgr_StreamFileTable() {}
/* 0x4 */ JAUStreamFileTable mStreamFileTable;
};
#endif /* JAUSTREAMFILETABLE_H */
+1 -1
View File
@@ -91,7 +91,7 @@ DVDDiskID* DVDGetCurrentDiskID(void);
BOOL DVDFastOpen(long, DVDFileInfo* fileinfo);
BOOL DVDGetCommandBlockStatus(DVDCommandBlock*);
BOOL DVDReadAsyncPrio(DVDFileInfo* fileinfo, void*, long, long, DVDCallback, long);
BOOL DVDConvertPathToEntrynum(const char*);
int DVDConvertPathToEntrynum(const char*);
DVDState DVDGetDriveStatus(void);
BOOL DVDCheckDisk(void);
+1 -1
View File
@@ -107,7 +107,7 @@ asm void JASTaskThread::allocCallStack(void (*param_0)(void*), void* param_1) {
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASTaskThread::sendCmdMsg(void (*param_0)(void*), void const* param_1, u32 param_2) {
asm int JASTaskThread::sendCmdMsg(void (*param_0)(void*), void const* param_1, u32 param_2) {
nofralloc
#include "asm/JSystem/JAudio2/JASTaskThread/sendCmdMsg__13JASTaskThreadFPFPv_vPCvUl.s"
}
+156 -188
View File
@@ -4,74 +4,6 @@
//
#include "JSystem/JAudio2/JASWaveArcLoader.h"
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct JSUPtrList {
/* 802DBEAC */ ~JSUPtrList();
};
struct JSUPtrLink {
/* 802DBE14 */ ~JSUPtrLink();
};
struct JKRHeap {};
struct JKRExpandSwitch {};
struct JKRDvdAramRipper {
/* 802DA874 */ void loadToAram(s32, u32, JKRExpandSwitch, u32, u32, u32*);
};
struct JASWaveArcLoader {
/* 8029A0A0 */ void getRootHeap();
/* 8029A0D0 */ void setCurrentDir(char const*);
/* 8029A130 */ void getCurrentDir();
static u8 sCurrentDir[64];
static u8 sAramHeap[4 + 4 /* padding */];
};
struct JASDisposer {
/* 80290BCC */ void onDispose();
/* 8029A7B8 */ ~JASDisposer();
};
struct JASHeap {
/* 80290140 */ JASHeap(JASDisposer*);
/* 8029021C */ void alloc(JASHeap*, u32);
/* 802903F4 */ void allocTail(JASHeap*, u32);
/* 802904E4 */ void free();
};
struct JASWaveArc {
/* 80298FA0 */ void onLoadDone();
/* 80298FA4 */ void onEraseDone();
/* 8029A13C */ JASWaveArc();
/* 8029A1B4 */ ~JASWaveArc();
/* 8029A258 */ void loadSetup(u32);
/* 8029A2EC */ void eraseSetup();
/* 8029A378 */ void loadToAramCallback(void*);
/* 8029A404 */ void sendLoadCmd();
/* 8029A4C0 */ void load(JASHeap*);
/* 8029A580 */ void loadTail(JASHeap*);
/* 8029A640 */ void erase();
/* 8029A664 */ void onDispose();
/* 8029A6AC */ void setEntryNum(s32);
/* 8029A70C */ void setFileName(char const*);
};
struct JASTaskThread {
/* 8028FB5C */ void sendCmdMsg(void (*)(void*), void const*, u32);
};
struct JASKernel {
/* 80290B08 */ void getAramHeap();
};
//
// Forward References:
@@ -117,17 +49,8 @@ extern "C" void __dla__FPv();
extern "C" void loadToAram__16JKRDvdAramRipperFlUl15JKRExpandSwitchUlUlPUl();
extern "C" void __dt__10JSUPtrLinkFv();
extern "C" void __dt__10JSUPtrListFv();
extern "C" void OSInitMutex();
extern "C" void OSLockMutex();
extern "C" void OSUnlockMutex();
extern "C" void DVDConvertPathToEntrynum();
extern "C" void DVDFastOpen();
extern "C" void DVDClose();
extern "C" void _savegpr_27();
extern "C" void _restgpr_27();
extern "C" void strcat();
extern "C" void strcpy();
extern "C" void strlen();
//
// Declarations:
@@ -135,48 +58,39 @@ extern "C" void strlen();
/* ############################################################################################## */
/* 80451290-80451298 000790 0004+04 1/1 0/0 0/0 .sbss sAramHeap__16JASWaveArcLoader */
u8 JASWaveArcLoader::sAramHeap[4 + 4 /* padding */];
JASHeap* JASWaveArcLoader::sAramHeap;
/* 8029A0A0-8029A0D0 2949E0 0030+00 2/2 0/0 0/0 .text getRootHeap__16JASWaveArcLoaderFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArcLoader::getRootHeap() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/getRootHeap__16JASWaveArcLoaderFv.s"
JASHeap* JASWaveArcLoader::getRootHeap() {
if (JASWaveArcLoader::sAramHeap) {
return JASWaveArcLoader::sAramHeap;
}
return JASKernel::getAramHeap();
}
#pragma pop
/* ############################################################################################## */
/* 803C77E0-803C7820 024900 0040+00 2/2 0/0 0/0 .data sCurrentDir__16JASWaveArcLoader */
SECTION_DATA u8 JASWaveArcLoader::sCurrentDir[64] = {
0x2F, 0x41, 0x75, 0x64, 0x69, 0x6F, 0x52, 0x65, 0x73, 0x2F, 0x57, 0x61, 0x76, 0x65, 0x73, 0x2F,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
char JASWaveArcLoader::sCurrentDir[DIR_MAX] = "/AudioRes/Waves/";
/* 8029A0D0-8029A130 294A10 0060+00 0/0 1/1 0/0 .text setCurrentDir__16JASWaveArcLoaderFPCc */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArcLoader::setCurrentDir(char const* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/setCurrentDir__16JASWaveArcLoaderFPCc.s"
void JASWaveArcLoader::setCurrentDir(char const* dir) {
ASSERT(std::strlen(dir) < DIR_MAX - 1);
strcpy(sCurrentDir, dir);
u32 len = strlen(sCurrentDir);
if (sCurrentDir[len - 1] != '/') {
ASSERT(len + 1 < DIR_MAX);
sCurrentDir[len] = '/';
sCurrentDir[len + 1] = '\0';
}
}
#pragma pop
/* 8029A130-8029A13C 294A70 000C+00 1/1 0/0 0/0 .text getCurrentDir__16JASWaveArcLoaderFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArcLoader::getCurrentDir() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/getCurrentDir__16JASWaveArcLoaderFv.s"
char* JASWaveArcLoader::getCurrentDir() {
return sCurrentDir;
}
#pragma pop
/* ############################################################################################## */
/* 803C7820-803C7838 024940 0018+00 2/2 0/0 0/0 .data __vt__10JASWaveArc */
@@ -198,131 +112,185 @@ SECTION_DATA extern void* __vt__11JASDisposer[4] = {
};
/* 8029A13C-8029A1B4 294A7C 0078+00 0/0 2/2 0/0 .text __ct__10JASWaveArcFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASWaveArc::JASWaveArc() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/__ct__10JASWaveArcFv.s"
JASWaveArc::JASWaveArc() : mHeap(this) {
_48 = 0;
_4c = 0;
mEntryNum = -1;
mFileLength = 0;
_58 = 0;
_5a = 0;
OSInitMutex(&mMutex);
}
#pragma pop
/* 8029A1B4-8029A258 294AF4 00A4+00 1/0 2/2 0/0 .text __dt__10JASWaveArcFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASWaveArc::~JASWaveArc() {
#ifdef NONMATCHING
JASWaveArc::~JASWaveArc() {}
#else
asm void __dt__10JASWaveArcFv() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/__dt__10JASWaveArcFv.s"
}
#pragma pop
#endif
/* 8029A258-8029A2EC 294B98 0094+00 1/1 0/0 0/0 .text loadSetup__10JASWaveArcFUl */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::loadSetup(u32 param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/loadSetup__10JASWaveArcFUl.s"
bool JASWaveArc::loadSetup(u32 param_0) {
JASMutexLock mutexLock(&mMutex);
if (_58 != param_0) {
return false;
}
if (_4c != 1) {
return false;
}
_48 = 1;
_4c = 2;
return true;
}
#pragma pop
/* 8029A2EC-8029A378 294C2C 008C+00 1/1 0/0 0/0 .text eraseSetup__10JASWaveArcFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::eraseSetup() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/eraseSetup__10JASWaveArcFv.s"
bool JASWaveArc::eraseSetup() {
JASMutexLock mutexLock(&mMutex);
if (_4c == 0) {
return false;
}
if (_4c == 1) {
_4c = 0;
return false;
}
_48 = 0;
_4c = 0;
return true;
}
#pragma pop
/* 8029A378-8029A404 294CB8 008C+00 1/1 0/0 0/0 .text loadToAramCallback__10JASWaveArcFPv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::loadToAramCallback(void* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/loadToAramCallback__10JASWaveArcFPv.s"
void JASWaveArc::loadToAramCallback(void* this_) {
loadToAramCallbackParams* tmp = (loadToAramCallbackParams*)this_;
JASWaveArc* wavArc = tmp->mWavArc;
JKRAramBlock* block = JKRDvdAramRipper::loadToAram(tmp->mEntryNum, tmp->mBase,
EXPAND_SWITCH_UNKNOWN0, 0, 0, NULL);
if (block == NULL) {
// "loadToAram Failed"
return;
}
wavArc->_5a--;
if (wavArc->loadSetup(tmp->_c)) {
wavArc->onLoadDone();
}
}
#pragma pop
/* 8029A404-8029A4C0 294D44 00BC+00 2/2 0/0 0/0 .text sendLoadCmd__10JASWaveArcFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::sendLoadCmd() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/sendLoadCmd__10JASWaveArcFv.s"
bool JASWaveArc::sendLoadCmd() {
JASMutexLock mutexLock(&mMutex);
_48 = 0;
_4c = 1;
void* base = mHeap.getBase();
loadToAramCallbackParams commandInfo;
commandInfo.mWavArc = this;
commandInfo.mEntryNum = mEntryNum;
commandInfo.mBase = (u32)mHeap.mBase;
commandInfo._c = ++_58;
_5a++;
JASTaskThread* thread = JASDvd::getThreadPointer();
int status = thread->sendCmdMsg(loadToAramCallback, &commandInfo, 0x10);
if (status == 0) {
// "sendCmdMsg loadToAramCallback Failed"
mHeap.free();
return false;
}
return true;
}
#pragma pop
/* 8029A4C0-8029A580 294E00 00C0+00 0/0 2/2 0/0 .text load__10JASWaveArcFP7JASHeap */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::load(JASHeap* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/load__10JASWaveArcFP7JASHeap.s"
bool JASWaveArc::load(JASHeap* heap) {
if (mEntryNum < 0) {
return false;
}
JASMutexLock mutexLock(&mMutex);
if (_4c != 0) {
return false;
}
if (heap == NULL) {
heap = JASWaveArcLoader::getRootHeap();
}
bool result = mHeap.alloc(heap, mFileLength);
if (result == false) {
return false;
}
return sendLoadCmd();
}
#pragma pop
/* 8029A580-8029A640 294EC0 00C0+00 0/0 1/1 0/0 .text loadTail__10JASWaveArcFP7JASHeap */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::loadTail(JASHeap* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/loadTail__10JASWaveArcFP7JASHeap.s"
bool JASWaveArc::loadTail(JASHeap* heap) {
if (mEntryNum < 0) {
return false;
}
JASMutexLock mutexLock(&mMutex);
if (_4c != 0) {
return false;
}
if (heap == NULL) {
heap = JASWaveArcLoader::getRootHeap();
}
bool result = mHeap.allocTail(heap, mFileLength);
if (result == false) {
return false;
}
return sendLoadCmd();
}
#pragma pop
/* 8029A640-8029A664 294F80 0024+00 0/0 2/2 0/0 .text erase__10JASWaveArcFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::erase() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/erase__10JASWaveArcFv.s"
void JASWaveArc::erase() {
mHeap.free();
}
#pragma pop
/* 8029A664-8029A6AC 294FA4 0048+00 1/0 2/0 0/0 .text onDispose__10JASWaveArcFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::onDispose() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/onDispose__10JASWaveArcFv.s"
void JASWaveArc::onDispose() {
if (eraseSetup()) {
onEraseDone();
}
}
#pragma pop
/* 8029A6AC-8029A70C 294FEC 0060+00 1/1 0/0 0/0 .text setEntryNum__10JASWaveArcFl */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::setEntryNum(s32 param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/setEntryNum__10JASWaveArcFl.s"
void JASWaveArc::setEntryNum(s32 entryNum) {
DVDFileInfo fileInfo;
if (entryNum < 0) {
return;
}
BOOL openStatus = DVDFastOpen(entryNum, &fileInfo);
if (openStatus == FALSE) {
return;
}
mFileLength = fileInfo.length;
DVDClose(&fileInfo);
mEntryNum = entryNum;
}
#pragma pop
/* 8029A70C-8029A7B8 29504C 00AC+00 0/0 2/2 0/0 .text setFileName__10JASWaveArcFPCc */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JASWaveArc::setFileName(char const* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/setFileName__10JASWaveArcFPCc.s"
void JASWaveArc::setFileName(char const* fileName) {
char* currentDir = JASWaveArcLoader::getCurrentDir();
size_t length = strlen(currentDir);
length = length + strlen(fileName);
JKRHeap* systemHeap = JASKernel::getSystemHeap();
char* fileString = new (systemHeap, -4) char[length + 1];
strcpy(fileString, currentDir);
strcat(fileString, fileName);
fileString[length] = '\0';
int entryNum = DVDConvertPathToEntrynum(fileString);
delete[] fileString;
if (entryNum < 0) {
return;
}
setEntryNum(entryNum);
}
#pragma pop
/* 8029A7B8-8029A800 2950F8 0048+00 1/0 0/0 0/0 .text __dt__11JASDisposerFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JASDisposer::~JASDisposer() {
asm void __dt__11JASDisposerFv() {
nofralloc
#include "asm/JSystem/JAudio2/JASWaveArcLoader/__dt__11JASDisposerFv.s"
}
+4 -54
View File
@@ -7,63 +7,13 @@
#include "dol2asm.h"
#include "dolphin/types.h"
//
// Types:
//
struct JSUPtrLink {};
struct JSUPtrList {
/* 802DBF4C */ void append(JSUPtrLink*);
};
template <typename A0>
struct JSULink {};
/* JSULink<JAUBankTable> */
struct JSULink__template0 {};
struct JAUBankTable {
/* 802A4AA0 */ void getBank(u32) const;
};
struct JAUBankTableDictionary {
/* 802A4A80 */ void appendBankTable(JSULink<JAUBankTable>*);
};
//
// Forward References:
//
extern "C" void func_802A4A80();
extern "C" void getBank__12JAUBankTableCFUl();
//
// External References:
//
extern "C" void append__10JSUPtrListFP10JSUPtrLink();
//
// Declarations:
//
/* 802A4A80-802A4AA0 29F3C0 0020+00 0/0 1/1 0/0 .text
* appendBankTable__22JAUBankTableDictionaryFP23JSULink<12JAUBankTable> */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAUBankTableDictionary::appendBankTable(JSULink<JAUBankTable>* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAUBankTable/func_802A4A80.s"
void JAUBankTableDictionary::appendBankTable(JSULink<JAUBankTable>* bankTableList) {
append(bankTableList);
}
#pragma pop
/* 802A4AA0-802A4AC4 29F3E0 0024+00 0/0 2/0 0/0 .text getBank__12JAUBankTableCFUl */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAUBankTable::getBank(u32 param_0) const {
nofralloc
#include "asm/JSystem/JAudio2/JAUBankTable/getBank__12JAUBankTableCFUl.s"
JASBank* JAUBankTable::getBank(u32 bank) const {
return mBankPtrTable.get(bank);
}
#pragma pop
+30 -105
View File
@@ -1,124 +1,49 @@
//
// Generated By: dol2asm
// Translation Unit: JAUStreamFileTable
//
#include "JSystem/JAudio2/JAUStreamFileTable.h"
#include "dol2asm.h"
#include "dolphin/dvd/dvd.h"
#include "dolphin/types.h"
//
// Types:
//
struct JAUStreamFileTable {
/* 802A7420 */ JAUStreamFileTable();
/* 802A742C */ void init(void const*);
/* 802A7478 */ void getNumFiles() const;
/* 802A7484 */ void getFilePath(int) const;
};
struct JAISoundID {};
struct JAUStreamDataMgr_StreamFileTable {
/* 802A74AC */ void getStreamFileEntry(JAISoundID);
/* 802A74E8 */ ~JAUStreamDataMgr_StreamFileTable();
};
struct JAIStreamDataMgr {
/* 802A3AD8 */ ~JAIStreamDataMgr();
};
//
// Forward References:
//
extern "C" void __ct__18JAUStreamFileTableFv();
extern "C" void init__18JAUStreamFileTableFPCv();
extern "C" void getNumFiles__18JAUStreamFileTableCFv();
extern "C" void getFilePath__18JAUStreamFileTableCFi();
extern "C" void getStreamFileEntry__32JAUStreamDataMgr_StreamFileTableF10JAISoundID();
extern "C" void __dt__32JAUStreamDataMgr_StreamFileTableFv();
//
// External References:
//
extern "C" void __dt__16JAIStreamDataMgrFv();
extern "C" void __dl__FPv();
extern "C" void DVDConvertPathToEntrynum();
//
// Declarations:
//
#include "global.h"
/* 802A7420-802A742C 2A1D60 000C+00 0/0 1/1 0/0 .text __ct__18JAUStreamFileTableFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JAUStreamFileTable::JAUStreamFileTable() {
nofralloc
#include "asm/JSystem/JAudio2/JAUStreamFileTable/__ct__18JAUStreamFileTableFv.s"
JAUStreamFileTable::JAUStreamFileTable() {
mData = NULL;
}
#pragma pop
/* 802A742C-802A7478 2A1D6C 004C+00 0/0 1/1 0/0 .text init__18JAUStreamFileTableFPCv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAUStreamFileTable::init(void const* param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAUStreamFileTable/init__18JAUStreamFileTableFPCv.s"
void JAUStreamFileTable::init(void const* data) {
if (data == NULL) {
mData = NULL;
return;
}
const BinaryStreamFileTable* binaryTable = (const BinaryStreamFileTable*)data;
const char* ident = binaryTable->mIdentifier;
if (ident[0] == 'b' && ident[1] == 's' && ident[2] == 'f' && ident[3] == 't') {
mData = binaryTable;
}
}
#pragma pop
/* 802A7478-802A7484 2A1DB8 000C+00 0/0 1/1 0/0 .text getNumFiles__18JAUStreamFileTableCFv */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAUStreamFileTable::getNumFiles() const {
nofralloc
#include "asm/JSystem/JAudio2/JAUStreamFileTable/getNumFiles__18JAUStreamFileTableCFv.s"
int JAUStreamFileTable::getNumFiles() const {
return mData->mNumFiles;
}
#pragma pop
/* 802A7484-802A74AC 2A1DC4 0028+00 1/1 1/1 0/0 .text getFilePath__18JAUStreamFileTableCFi */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAUStreamFileTable::getFilePath(int param_0) const {
nofralloc
#include "asm/JSystem/JAudio2/JAUStreamFileTable/getFilePath__18JAUStreamFileTableCFi.s"
const char* JAUStreamFileTable::getFilePath(int index) const {
if (mData == NULL) {
return 0;
}
ASSERT(index >= 0);
ASSERT(index < getNumFiles());
char* data = (char*)mData;
return (char*)(data + *(int*)(data + 8 + (index * sizeof(s32))));
}
#pragma pop
/* 802A74AC-802A74E8 2A1DEC 003C+00 1/0 0/0 0/0 .text
* getStreamFileEntry__32JAUStreamDataMgr_StreamFileTableF10JAISoundID */
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm void JAUStreamDataMgr_StreamFileTable::getStreamFileEntry(JAISoundID param_0) {
nofralloc
#include "asm/JSystem/JAudio2/JAUStreamFileTable/getStreamFileEntry__32JAUStreamDataMgr_StreamFileTableF10JAISoundID.s"
int JAUStreamDataMgr_StreamFileTable::getStreamFileEntry(JAISoundID soundId) {
const char* filePath = mStreamFileTable.getFilePath(soundId.mId.mAdvancedId.mShortId);
if (filePath == NULL) {
return -1;
}
return DVDConvertPathToEntrynum(filePath);
}
#pragma pop
/* ############################################################################################## */
/* 803C9B50-803C9B60 026C70 0010+00 1/1 1/1 0/0 .data __vt__32JAUStreamDataMgr_StreamFileTable */
SECTION_DATA extern void* __vt__32JAUStreamDataMgr_StreamFileTable[4] = {
(void*)NULL /* RTTI */,
(void*)NULL,
(void*)getStreamFileEntry__32JAUStreamDataMgr_StreamFileTableF10JAISoundID,
(void*)__dt__32JAUStreamDataMgr_StreamFileTableFv,
};
/* 802A74E8-802A7548 2A1E28 0060+00 1/0 0/0 0/0 .text __dt__32JAUStreamDataMgr_StreamFileTableFv
*/
#pragma push
#pragma optimization_level 0
#pragma optimizewithasm off
asm JAUStreamDataMgr_StreamFileTable::~JAUStreamDataMgr_StreamFileTable() {
nofralloc
#include "asm/JSystem/JAudio2/JAUStreamFileTable/__dt__32JAUStreamDataMgr_StreamFileTableFv.s"
}
#pragma pop
+20 -20
View File
@@ -4,10 +4,10 @@
//
#include "f_op/f_op_scene.h"
#include "f_op/f_op_scene_tag.h"
#include "f_pc/f_pc_manager.h"
#include "dol2asm.h"
#include "dolphin/types.h"
#include "f_op/f_op_scene_tag.h"
#include "f_pc/f_pc_manager.h"
/* 8001EB34-8001EB5C 019474 0028+00 1/0 0/0 0/0 .text fopScn_Draw__FP11scene_class */
static void fopScn_Draw(scene_class* pScene) {
@@ -20,43 +20,43 @@ static void fopScn_Execute(scene_class* pScene) {
}
/* 8001EB84-8001EBAC 0194C4 0028+00 1/0 0/0 0/0 .text fopScn_IsDelete__FPv */
static s32 fopScn_IsDelete(scene_class* pScene) {
return fpcMtd_IsDelete(pScene->mpMtd, pScene);
static s32 fopScn_IsDelete(void* pScene) {
return fpcMtd_IsDelete(static_cast<scene_class*>(pScene)->mpMtd, pScene);
}
/* 8001EBAC-8001EC00 0194EC 0054+00 1/0 0/0 0/0 .text fopScn_Delete__FPv */
static s32 fopScn_Delete(void* param_1) {
scene_class* pScene = (scene_class*)param_1;
s32 ret = fpcMtd_Delete(pScene->mpMtd, pScene);
static s32 fopScn_Delete(void* pScene) {
scene_class* scene = static_cast<scene_class*>(pScene);
s32 ret = fpcMtd_Delete(scene->mpMtd, scene);
if (ret == 1) {
fopScnTg_QueueTo(&pScene->mScnTg);
fopScnTg_QueueTo(&scene->mScnTg);
}
return ret;
}
/* 8001EC00-8001EC74 019540 0074+00 1/0 0/0 0/0 .text fopScn_Create__FPv */
static s32 fopScn_Create(scene_class * pScene) {
static s32 fopScn_Create(void* pScene) {
scene_class* scene = static_cast<scene_class*>(pScene);
if (fpcM_IsFirstCreating(pScene)) {
scene_process_profile_definition* profile = (scene_process_profile_definition*) fpcM_GetProfile(pScene);
pScene->mpMtd = profile->mpMtd;
fopScnTg_Init(&pScene->mScnTg, pScene);
fopScnTg_ToQueue(&pScene->mScnTg);
scene_process_profile_definition* profile =
(scene_process_profile_definition*)fpcM_GetProfile(pScene);
scene->mpMtd = profile->mpMtd;
fopScnTg_Init(&scene->mScnTg, pScene);
fopScnTg_ToQueue(&scene->mScnTg);
u32 * append = (u32*)fpcM_GetAppend(pScene);
u32* append = (u32*)fpcM_GetAppend(pScene);
if (append != NULL) {
pScene->mBase.mBase.mParameters = *append;
scene->mBase.mBase.mParameters = *append;
}
}
return fpcMtd_Create(pScene->mpMtd, pScene);
return fpcMtd_Create(scene->mpMtd, pScene);
}
/* ############################################################################################## */
/* 803A38B0-803A38C8 -00001 0014+04 0/0 9/0 0/0 .data g_fopScn_Method */
nodedraw_method_class g_fopScn_Method = {
(process_method_func)fopScn_Create,
(process_method_func)fopScn_Delete,
(process_method_func)fopScn_Execute,
(process_method_func)fopScn_IsDelete,
(process_method_func)fopScn_Create, (process_method_func)fopScn_Delete,
(process_method_func)fopScn_Execute, (process_method_func)fopScn_IsDelete,
(process_method_func)fopScn_Draw,
};