mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-05 18:28:11 -04:00
@@ -1006,6 +1006,7 @@ config.libs = [
|
||||
JSystemLib(
|
||||
"JGadget",
|
||||
[
|
||||
Object(Matching, "JSystem/JGadget/define.cpp"),
|
||||
Object(Matching, "JSystem/JGadget/binary.cpp"),
|
||||
Object(Matching, "JSystem/JGadget/linklist.cpp"),
|
||||
Object(Matching, "JSystem/JGadget/std-vector.cpp"),
|
||||
@@ -1936,6 +1937,7 @@ def link_order_callback(module_id: int, objects: List[str]) -> List[str]:
|
||||
# objects.insert(objects.index("d/actor/d_a_agb.cpp"), "d/d_debug_camera.cpp")
|
||||
# objects.insert(objects.index("d/actor/d_a_agb.cpp"), "d/d_event_debug.cpp")
|
||||
# objects.insert(objects.index("d/actor/d_a_agb.cpp"), "d/d_kankyo_debug.cpp")
|
||||
objects.insert(objects.index("JSystem/JGadget/binary.cpp"), "JSystem/JGadget/define.cpp")
|
||||
objects.insert(objects.index("dolphin/pad/Padclamp.c"), "dolphin/vi/i2c.c")
|
||||
objects.insert(objects.index("dolphin/pad/Padclamp.c"), "dolphin/vi/initphilips.c")
|
||||
objects.insert(objects.index("dolphin/pad/Padclamp.c"), "dolphin/vi/gpioexi.c")
|
||||
|
||||
@@ -44,7 +44,9 @@ public:
|
||||
void startSoundDirectID(u32, JAISound**, JAInter::Actor*, u32, u8);
|
||||
void startSoundBasic(u32, JAISound**, JAInter::Actor*, u32, u8, void*);
|
||||
void stopSoundHandle(JAISound*, u32);
|
||||
void stopPlayingCategorySe(u8);
|
||||
void stopPlayingCategoryObjectSe(u8, void*);
|
||||
void stopAllSe(u8);
|
||||
void stopAllSe(u8, void*);
|
||||
void stopActorSoundOneBuffer(void*, JAISound*);
|
||||
void stopIDSoundOneBuffer(u32, JAISound*);
|
||||
@@ -54,6 +56,7 @@ public:
|
||||
void stopAllSound(u32, void*);
|
||||
void deleteObject(void*);
|
||||
u16 getSoundOffsetNumberFromID(u32);
|
||||
void setSeCancelSwitch(u8, u8);
|
||||
void setSeCategoryVolume(u8, u8);
|
||||
static u16 setParameterSeqSync(JASystem::TTrack*, u16);
|
||||
bool allocStreamBuffer(void*, s32);
|
||||
|
||||
@@ -16,15 +16,15 @@ namespace JAInter {
|
||||
Actor(Vec* p1, Vec* p2, u32 p3, void* p4) {
|
||||
field_0x0 = p1;
|
||||
field_0x4 = p2;
|
||||
field_0x8 = p3;
|
||||
field_0xc = p4;
|
||||
field_0x8 = p4;
|
||||
field_0xc = p3;
|
||||
}
|
||||
|
||||
// order is unclear
|
||||
Vec* field_0x0;
|
||||
Vec* field_0x4;
|
||||
u32 field_0x8;
|
||||
void* field_0xc;
|
||||
void* field_0x8;
|
||||
u32 field_0xc;
|
||||
};
|
||||
|
||||
class Camera {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef JAIDUMMYOBJECT_H
|
||||
#define JAIDUMMYOBJECT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
class JAISound;
|
||||
|
||||
@@ -10,9 +10,7 @@ namespace JAInter {
|
||||
DummyVec* field_0x0;
|
||||
DummyVec* field_0x4;
|
||||
JAISound* field_0x8;
|
||||
u32 field_0xc;
|
||||
int field_0x10;
|
||||
int field_0x14;
|
||||
Vec field_0xc;
|
||||
u32 field_0x18;
|
||||
bool field_0x1c;
|
||||
};
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace JAInter {
|
||||
|
||||
extern LinkSound seqControl;
|
||||
extern SeqUpdateData* seqTrackInfo;
|
||||
extern int* FixSeqBufPointer;
|
||||
extern JAISound** FixSeqBufPointer;
|
||||
extern JKRArchive* arcPointer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef JAISOUND_H
|
||||
#define JAISOUND_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/mtx/vec.h"
|
||||
|
||||
enum JAISoundType {
|
||||
SOUNDPARAM_Unk0 = 0,
|
||||
@@ -86,8 +86,8 @@ public:
|
||||
virtual void setSePositionDopplar();
|
||||
|
||||
u8 getSeCategoryNumber();
|
||||
int getSwBit();
|
||||
int checkSwBit(u32);
|
||||
u32 getSwBit();
|
||||
u32 checkSwBit(u32);
|
||||
u8 getInfoPriority();
|
||||
void clearMainSoundPPointer();
|
||||
void start(u32);
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
/* 0x1c */ int field_0x1c;
|
||||
/* 0x20 */ PositionInfo_t* mPositionInfo;
|
||||
/* 0x24 */ void* field_0x24;
|
||||
/* 0x28 */ u32 field_0x28;
|
||||
/* 0x28 */ Vec* field_0x28;
|
||||
/* 0x2C */ int field_0x2c;
|
||||
/* 0x30 */ JAISound* field_0x30;
|
||||
/* 0x34 */ JAISound* field_0x34;
|
||||
|
||||
@@ -27,6 +27,8 @@ namespace JASystem {
|
||||
TVeloRegion* getVeloRegion(int);
|
||||
const TVeloRegion* getVeloRegion(int) const;
|
||||
|
||||
u32 getVeloRegionCount() const { return mVeloRegionCount; }
|
||||
|
||||
/* 0x00 */ int mBaseKey;
|
||||
/* 0x04 */ u32 mVeloRegionCount;
|
||||
/* 0x08 */ TVeloRegion* mVelomap;
|
||||
|
||||
@@ -54,6 +54,8 @@ namespace JASystem {
|
||||
void onEraseDone();
|
||||
u32 getWaveID(int) const;
|
||||
|
||||
u32 getWaveCount() const { return mWaveCount; }
|
||||
|
||||
/* 0x78 */ TBasicWaveBank* mBank;
|
||||
/* 0x7C */ TWaveInfo* mCtrlWaveArray;
|
||||
/* 0x80 */ u32 mWaveCount;
|
||||
|
||||
@@ -20,12 +20,14 @@ namespace JASystem {
|
||||
/* 0x24 */ f32 mTrackTempo;
|
||||
};
|
||||
|
||||
typedef void (*TPortFunc)(TPortArgs*);
|
||||
|
||||
class TPortCmd;
|
||||
|
||||
class TPortHead {
|
||||
public:
|
||||
/* 0x00 */ TPortCmd* field_0x0;
|
||||
/* 0x04 */ TPortCmd* field_0x4;
|
||||
/* 0x00 */ TPortCmd* mFirst;
|
||||
/* 0x04 */ TPortCmd* mLast;
|
||||
};
|
||||
|
||||
class TPortCmd {
|
||||
@@ -33,13 +35,20 @@ namespace JASystem {
|
||||
TPortCmd();
|
||||
~TPortCmd() {}
|
||||
bool addPortCmdOnce();
|
||||
bool setPortCmd(void (*)(TPortArgs*), TPortArgs*);
|
||||
bool setPortCmd(TPortFunc, TPortArgs*);
|
||||
bool addPortCmd(TPortHead*);
|
||||
|
||||
/* 0x00 */ TPortHead* field_0x0;
|
||||
/* 0x04 */ TPortCmd* field_0x4;
|
||||
/* 0x08 */ void (*field_0x8)(TPortArgs*);
|
||||
/* 0x0C */ TPortArgs* field_0xc;
|
||||
TPortHead* getHead() { return mHead; }
|
||||
void setHead(TPortHead* head) { mHead = head; }
|
||||
TPortCmd* getNext() { return mNext; }
|
||||
TPortFunc getFunc() { return mFunc; }
|
||||
TPortArgs* getArgs() { return mArgs; }
|
||||
|
||||
private:
|
||||
/* 0x00 */ TPortHead* mHead;
|
||||
/* 0x04 */ TPortCmd* mNext;
|
||||
/* 0x08 */ TPortFunc mFunc;
|
||||
/* 0x0C */ TPortArgs* mArgs;
|
||||
};
|
||||
|
||||
void portCmdProcOnce(TPortHead*);
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
/* 0x04 */ u8* argspace;
|
||||
};
|
||||
|
||||
JASTaskThread(u32 param_1, int param_2, s32 param_3) : JKRThread(param_1, param_2, param_3) {
|
||||
JASTaskThread(int param_1, int param_2, u32 param_3) : JKRThread(param_3, param_2, param_1) {
|
||||
mPaused = 0;
|
||||
OSInitThreadQueue(&mQ);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@ namespace JASystem {
|
||||
virtual f32 getY(int, int) const = 0;
|
||||
void setTarget(int);
|
||||
|
||||
u8 getTarget() const { return mTarget; }
|
||||
|
||||
private:
|
||||
/* 0x04 */ u8 mTarget;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,6 +7,26 @@ class JKRArchive;
|
||||
|
||||
namespace JASystem {
|
||||
namespace ResArcLoader {
|
||||
struct TLoadResInfo {
|
||||
TLoadResInfo(JKRArchive* archive, u16 id, void* buffer, u32 size) {
|
||||
mArchive = archive;
|
||||
mId = id;
|
||||
mBuffer = buffer;
|
||||
mSize = size;
|
||||
mCallback = NULL;
|
||||
mCallbackParam = 0;
|
||||
mMessageQueue = NULL;
|
||||
}
|
||||
|
||||
/* 0x00 */ JKRArchive* mArchive;
|
||||
/* 0x04 */ u16 mId;
|
||||
/* 0x08 */ void* mBuffer;
|
||||
/* 0x0C */ u32 mSize;
|
||||
/* 0x10 */ void (*mCallback)(u32, u32);
|
||||
/* 0x14 */ u32 mCallbackParam;
|
||||
/* 0x18 */ OSMessageQueue* mMessageQueue;
|
||||
};
|
||||
|
||||
u32 getResSize(JKRArchive*, u16);
|
||||
s32 loadResourceCallback(void*);
|
||||
u32 loadResource(JKRArchive*, u16, u8*, u32);
|
||||
|
||||
@@ -11,41 +11,26 @@ class JGadget_outMessage {
|
||||
public:
|
||||
typedef void (*MessageFunc)(const char*, int, const char*);
|
||||
|
||||
static void warning(const char*, int, const char*) {
|
||||
/* Nonmatching - debug only */
|
||||
}
|
||||
static void warning(const char*, int, const char*);
|
||||
|
||||
JGadget_outMessage(MessageFunc fn, const char* file, int line) {
|
||||
/* Nonmatching - debug only */
|
||||
}
|
||||
~JGadget_outMessage() {
|
||||
/* Nonmatching - debug only */
|
||||
}
|
||||
JGadget_outMessage(MessageFunc fn, const char* file, int line);
|
||||
~JGadget_outMessage();
|
||||
|
||||
JGadget_outMessage& operator<<(int param_1) { return *this << (s32)param_1; }
|
||||
JGadget_outMessage& operator<<(u16);
|
||||
JGadget_outMessage& operator<<(unsigned int);
|
||||
JGadget_outMessage& operator<<(u16 param_1) { return *this << (u32)param_1; }
|
||||
JGadget_outMessage& operator<<(uint param_1) { return *this << (u32)param_1; }
|
||||
JGadget_outMessage& operator<<(u8);
|
||||
JGadget_outMessage& operator<<(const char* str) {
|
||||
/* Nonmatching - debug only */
|
||||
return *this;
|
||||
}
|
||||
JGadget_outMessage& operator<<(s8);
|
||||
JGadget_outMessage& operator<<(const char* str);
|
||||
JGadget_outMessage& operator<<(char);
|
||||
JGadget_outMessage& operator<<(s32);
|
||||
JGadget_outMessage& operator<<(u32 value) {
|
||||
/* Nonmatching - debug only */
|
||||
char sz[64];
|
||||
snprintf(sz, 64, "%u", value);
|
||||
|
||||
return *this << sz;
|
||||
}
|
||||
JGadget_outMessage& operator<<(u32 value);
|
||||
JGadget_outMessage& operator<<(const void*);
|
||||
|
||||
private:
|
||||
MessageFunc mMsgFunc;
|
||||
char mBuffer[256];
|
||||
char* mWrite_p;
|
||||
char* mFile;
|
||||
const char* mFile;
|
||||
int mLine;
|
||||
};
|
||||
|
||||
|
||||
@@ -60,4 +60,6 @@ public:
|
||||
static JKRSolidHeap* create(u32, JKRHeap*, bool);
|
||||
}; // Size: 0x80
|
||||
|
||||
inline JKRSolidHeap* JKRCreateSolidHeap(u32 size, JKRHeap* parent, bool errorFlag) { return JKRSolidHeap::create(size, parent, errorFlag); }
|
||||
|
||||
#endif /* JKRSOLIDHEAP_H */
|
||||
|
||||
@@ -34,4 +34,6 @@ public:
|
||||
OSHeapHandle mHeapHandle;
|
||||
};
|
||||
|
||||
inline JKRStdHeap* JKRCreateStdHeap(u32 size, JKRHeap* parent, bool errorFlag) { return JKRStdHeap::create(size, parent, errorFlag); }
|
||||
|
||||
#endif /* JKRSTDHEAP_H */
|
||||
|
||||
@@ -27,9 +27,9 @@ public:
|
||||
void setCurrentHeap(JKRHeap* heap) {
|
||||
mCurrentHeap = heap ? heap : JKRHeap::getCurrentHeap();
|
||||
}
|
||||
void resume() { OSResumeThread(mThreadRecord); }
|
||||
|
||||
protected:
|
||||
void resume() { OSResumeThread(mThreadRecord); }
|
||||
BOOL sendMessage(OSMessage message) {
|
||||
return OSSendMessage(&mMessageQueue, message, OS_MESSAGE_NOBLOCK);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
virtual void do_wait(u32);
|
||||
virtual void do_data(void const*, u32, void const*, u32);
|
||||
|
||||
TAdaptor* getAdaptor() { return mpAdaptor; }
|
||||
TAdaptor* getAdaptor() const { return mpAdaptor; }
|
||||
TControl* getControl() { return (TControl*)stb::TObject::getControl(); }
|
||||
const TControl* getControl() const { return (const TControl*)stb::TObject::getControl(); }
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ public:
|
||||
do_data(arg1, arg2, arg3, arg4);
|
||||
}
|
||||
|
||||
TControl* getControl() { return pControl; }
|
||||
TControl* getControl() const { return pControl; }
|
||||
void setControl_(TControl* control) { pControl = control; }
|
||||
int getSuspend() const { return _20; }
|
||||
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
T& operator*() { return *this->getObject(); }
|
||||
T& operator*() const { return *mLink->getObject(); }
|
||||
|
||||
T* operator->() const { return mLink->getObject(); }
|
||||
|
||||
|
||||
@@ -30,6 +30,12 @@ inline u8 JSUHiByte(u16 in) {
|
||||
return in >> 8;
|
||||
}
|
||||
|
||||
inline u16 JSULoHalf(u32 param_0) {return param_0; }
|
||||
inline u16 JSULoHalf(u32 in) {
|
||||
return in;
|
||||
}
|
||||
|
||||
inline u16 JSUHiHalf(u32 in) {
|
||||
return (in >> 16);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -50,6 +50,10 @@ namespace JUTAssertion {
|
||||
void flushMessage_dbPrint();
|
||||
void setVisible(bool);
|
||||
void setMessageCount(int);
|
||||
|
||||
inline void setWarningMessage(u32 device, char* file, int line, const char* msg) {
|
||||
setWarningMessage_f(device, file, line, "%s", msg);
|
||||
}
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -75,7 +75,7 @@ void JAIAnimeSound::initActorAnimSound(void* _asdata, u32 direction, f32 loopEnd
|
||||
|
||||
/* 8028F268-8028F2A0 .text setAnimSoundVec__13JAIAnimeSoundFP8JAIBasicP3VecffUlUc */
|
||||
void JAIAnimeSound::setAnimSoundVec(JAIBasic* basic, Vec* r5, f32 currentFrame, f32 speed, u32 r6, u8 ownerID) {
|
||||
JAInter::Actor actor(r5, r5, (u32)r5, (void*)r6);
|
||||
JAInter::Actor actor(r5, r5, r6, r5);
|
||||
setAnimSoundActor(basic, &actor, currentFrame, speed, ownerID);
|
||||
}
|
||||
|
||||
|
||||
+251
-37
@@ -15,7 +15,10 @@
|
||||
#include "JSystem/JAudio/JAISeMgr.h"
|
||||
#include "JSystem/JAudio/JAISequenceHeap.h"
|
||||
#include "JSystem/JAudio/JAISequenceMgr.h"
|
||||
#include "JSystem/JAudio/JAISound.h"
|
||||
#include "JSystem/JAudio/JAISoundTable.h"
|
||||
#include "JSystem/JAudio/JAIStreamMgr.h"
|
||||
#include "JSystem/JAudio/JAISystemInterface.h"
|
||||
#include "JSystem/JAudio/JASAudioThread.h"
|
||||
#include "JSystem/JAudio/JASDriverIF.h"
|
||||
#include "JSystem/JAudio/JASSystemHeap.h"
|
||||
@@ -92,9 +95,6 @@ void JAIBasic::initHeap() {
|
||||
msCurrentHeap = field_0x8;
|
||||
} else {
|
||||
msCurrentHeap = JASDram;
|
||||
if (msCurrentHeap) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
JUT_ASSERT_MSG(186, msCurrentHeap, "JAIBasic::initHeap オーディオヒープが異常(NULL)です。\n");
|
||||
}
|
||||
@@ -206,37 +206,119 @@ BOOL JAIBasic::initReadFile() {
|
||||
|
||||
/* 8029046C-802904B4 .text processFrameWork__8JAIBasicFv */
|
||||
void JAIBasic::processFrameWork() {
|
||||
/* Nonmatching */
|
||||
JAInter::DummyObjectMgr::check();
|
||||
JAInter::BankWave::loadSecondStayWave();
|
||||
JAInter::SeMgr::processGFrameSe();
|
||||
JAInter::SequenceMgr::processGFrameSequence();
|
||||
JAInter::StreamMgr::processGFrameStream();
|
||||
field_0x10++;
|
||||
}
|
||||
|
||||
/* 802904B4-802904EC .text startSoundVec__8JAIBasicFUlPP8JAISoundP3VecUlUlUc */
|
||||
void JAIBasic::startSoundVec(u32 soundID, JAISound**, Vec*, u32, u32, u8) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::startSoundVec(u32 soundID, JAISound** param_2, Vec* param_3, u32 param_4, u32 param_5, u8 param_6) {
|
||||
JAInter::Actor actor(param_3, param_3, param_5, param_3);
|
||||
startSoundActor(soundID, param_2, &actor, param_4, param_6);
|
||||
}
|
||||
|
||||
/* 802904EC-8029050C .text startSoundActor__8JAIBasicFUlPP8JAISoundPQ27JAInter5ActorUlUc */
|
||||
void JAIBasic::startSoundActor(u32 param_1, JAISound** param_2, JAInter::Actor* param_3, u32 param_4, u8 param_5) {
|
||||
startSoundDirectID(param_1, param_2, param_3, param_4, param_5);
|
||||
void JAIBasic::startSoundActor(u32 soundID, JAISound** param_2, JAInter::Actor* param_3, u32 param_4, u8 param_5) {
|
||||
startSoundDirectID(soundID, param_2, param_3, param_4, param_5);
|
||||
}
|
||||
|
||||
/* 8029050C-8029057C .text startSoundDirectID__8JAIBasicFUlPP8JAISoundPQ27JAInter5ActorUlUc */
|
||||
void JAIBasic::startSoundDirectID(u32, JAISound**, JAInter::Actor*, u32, u8) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::startSoundDirectID(u32 soundID, JAISound** param_2, JAInter::Actor* param_3, u32 param_4, u8 param_5) {
|
||||
SoundInfo* info = JAInter::SoundTable::getInfoPointer(soundID);
|
||||
if (info) {
|
||||
startSoundBasic(soundID, param_2, param_3, param_4, param_5, info);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8029057C-80290708 .text startSoundBasic__8JAIBasicFUlPP8JAISoundPQ27JAInter5ActorUlUcPv */
|
||||
void JAIBasic::startSoundBasic(u32, JAISound**, JAInter::Actor*, u32, u8, void*) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::startSoundBasic(u32 soundID, JAISound** param_2, JAInter::Actor* param_3, u32 param_4, u8 param_5, void* param_6) {
|
||||
switch (soundID & JAISoundID_TypeMask) {
|
||||
case JAISoundID_Type_Sequence:
|
||||
if (field_0xe.flag2 == 1) {
|
||||
break;
|
||||
}
|
||||
if (JAInter::SeMgr::seHandle && (JAInter::SeMgr::seHandle->mSoundID & 0x3ff) == (soundID & 0x3ff)) {
|
||||
break;
|
||||
}
|
||||
if (!param_2) {
|
||||
SoundInfo* info = (SoundInfo*)param_6;
|
||||
param_2 = &JAInter::SequenceMgr::FixSeqBufPointer[info->_05];
|
||||
}
|
||||
JAInter::SequenceMgr::storeSeqBuffer(param_2, param_3, soundID, param_4, param_5, param_6);
|
||||
break;
|
||||
case JAISoundID_Type_Se:
|
||||
if (JAInter::SeMgr::seEntryCancel[soundID >> 0xc] == 0) {
|
||||
JAInter::SeMgr::storeSeBuffer(param_2, param_3, soundID, param_4, param_5, param_6);
|
||||
break;
|
||||
}
|
||||
if (!param_2) {
|
||||
break;
|
||||
}
|
||||
*param_2 = NULL;
|
||||
break;
|
||||
case JAISoundID_Type_Stream:
|
||||
if (JAInter::StreamMgr::flags.flag2 != 0) {
|
||||
break;
|
||||
}
|
||||
if (field_0xe.flag3 == 1) {
|
||||
break;
|
||||
}
|
||||
JAInter::StreamMgr::storeStreamBuffer(param_2,param_3,soundID,param_4,param_5,param_6);
|
||||
break;
|
||||
default:
|
||||
JUT_ASSERT_MSG(567, 0, "JAIBasic::startSoundBasic サウンドカテゴリービットが異常です。\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void dummy1() {
|
||||
DEAD_STRING("JAIBasic::getPlayingSoundHandle シーケンスカテゴリー以外のサウンドが設定されました\n");
|
||||
}
|
||||
|
||||
/* 80290708-802907E0 .text stopSoundHandle__8JAIBasicFP8JAISoundUl */
|
||||
void JAIBasic::stopSoundHandle(JAISound*, u32 fadeTime) {
|
||||
void JAIBasic::stopSoundHandle(JAISound* param_1, u32 fadeTime) {
|
||||
/* Nonmatching */
|
||||
if (!param_1) {
|
||||
return;
|
||||
}
|
||||
switch (param_1->mSoundID & JAISoundID_TypeMask) {
|
||||
case JAISoundID_Type_Sequence:
|
||||
JAInter::SequenceMgr::releaseSeqBuffer(param_1, fadeTime);
|
||||
break;
|
||||
case JAISoundID_Type_Se:
|
||||
JAInter::SeMgr::releaseSeBuffer(param_1, fadeTime);
|
||||
break;
|
||||
case JAISoundID_Type_Stream:
|
||||
JAInter::StreamMgr::releaseStreamBuffer(param_1, fadeTime);
|
||||
break;
|
||||
default:
|
||||
JUT_ASSERT_MSG(617, 0, "JAIBasic::stopSoundHandle サウンドカテゴリービットが異常です。\n");
|
||||
}
|
||||
}
|
||||
|
||||
void JAIBasic::stopPlayingCategorySe(u8) {
|
||||
/* Nonmatching - debug only */
|
||||
}
|
||||
|
||||
/* 802907E0-80290864 .text stopPlayingCategoryObjectSe__8JAIBasicFUcPv */
|
||||
void JAIBasic::stopPlayingCategoryObjectSe(u8, void*) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::stopPlayingCategoryObjectSe(u8 param_1, void* param_2) {
|
||||
if (param_1 >= JAIGlobalParameter::getParamSeCategoryMax()) {
|
||||
return;
|
||||
}
|
||||
JAISound* sound = JAInter::SeMgr::seRegist[param_1].field_0x4;
|
||||
while (sound) {
|
||||
JAISound* nextSound = sound->field_0x34;
|
||||
if (sound->field_0x24 == param_2) {
|
||||
stopSoundHandle(sound, 0);
|
||||
}
|
||||
sound = nextSound;
|
||||
}
|
||||
}
|
||||
|
||||
void JAIBasic::stopAllSe(u8) {
|
||||
/* Nonmatching - debug only */
|
||||
}
|
||||
|
||||
/* 80290864-80290884 .text stopAllSe__8JAIBasicFUcPv */
|
||||
@@ -245,38 +327,120 @@ void JAIBasic::stopAllSe(u8 param_1, void* param_2) {
|
||||
}
|
||||
|
||||
/* 80290884-802908E8 .text stopActorSoundOneBuffer__8JAIBasicFPvP8JAISound */
|
||||
void JAIBasic::stopActorSoundOneBuffer(void*, JAISound*) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::stopActorSoundOneBuffer(void* param_1, JAISound* param_2) {
|
||||
while (param_2) {
|
||||
if (param_2->field_0x24 == param_1) {
|
||||
JAISound* sound = param_2->field_0x34;
|
||||
param_2->stop(1);
|
||||
param_2 = sound;
|
||||
} else {
|
||||
param_2 = param_2->field_0x34;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 802908E8-8029094C .text stopIDSoundOneBuffer__8JAIBasicFUlP8JAISound */
|
||||
void JAIBasic::stopIDSoundOneBuffer(u32, JAISound*) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::stopIDSoundOneBuffer(u32 soundID, JAISound* param_2) {
|
||||
while (param_2) {
|
||||
JAISound* sound = param_2->field_0x34;
|
||||
if (param_2->mSoundID == soundID) {
|
||||
stopSoundHandle(param_2, 0);
|
||||
}
|
||||
param_2 = sound;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8029094C-802909C0 .text stopIDActorSoundOneBuffer__8JAIBasicFUlPvP8JAISound */
|
||||
void JAIBasic::stopIDActorSoundOneBuffer(u32, void*, JAISound*) {
|
||||
void JAIBasic::stopIDActorSoundOneBuffer(u32 soundID, void* param_2, JAISound* param_3) {
|
||||
/* Nonmatching */
|
||||
while (param_3) {
|
||||
JAISound* sound = param_3->field_0x34;
|
||||
if (param_3->mSoundID == soundID && param_3->field_0x24 == param_2) {
|
||||
stopSoundHandle(param_3, 0);
|
||||
}
|
||||
param_3 = sound;
|
||||
}
|
||||
}
|
||||
|
||||
/* 802909C0-80290A5C .text stopAllSound__8JAIBasicFPv */
|
||||
void JAIBasic::stopAllSound(void*) {
|
||||
void JAIBasic::stopAllSound(void* param_1) {
|
||||
/* Nonmatching */
|
||||
for (int i = 0; i < JAIGlobalParameter::getParamSeCategoryMax(); i++) {
|
||||
stopActorSoundOneBuffer(param_1, JAInter::SeMgr::seRegist[i].field_0x4);
|
||||
}
|
||||
stopActorSoundOneBuffer(param_1, JAInter::SequenceMgr::seqControl.field_0x4);
|
||||
stopActorSoundOneBuffer(param_1, JAInter::StreamMgr::streamControl.field_0x4);
|
||||
}
|
||||
|
||||
static void dummy2() {
|
||||
DEAD_STRING("JAIBasic::getPlayingSoundLinkHeadPointer サウンドカテゴリービットが異常です。\n");
|
||||
}
|
||||
|
||||
/* 80290A5C-80290B64 .text stopAllSound__8JAIBasicFUl */
|
||||
void JAIBasic::stopAllSound(u32) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::stopAllSound(u32 soundID) {
|
||||
switch (soundID & JAISoundID_TypeMask) {
|
||||
case JAISoundID_Type_Se:
|
||||
stopIDSoundOneBuffer(soundID, JAInter::SeMgr::seRegist[JAInter::SeMgr::changeIDToCategory(soundID)].field_0x4);
|
||||
break;
|
||||
case JAISoundID_Type_Sequence:
|
||||
stopIDSoundOneBuffer(soundID, JAInter::SequenceMgr::seqControl.field_0x4);
|
||||
break;
|
||||
case JAISoundID_Type_Stream:
|
||||
stopIDSoundOneBuffer(soundID, JAInter::StreamMgr::streamControl.field_0x4);
|
||||
break;
|
||||
default:
|
||||
JUT_ASSERT_MSG(859, 0, "JAIBasic::stopAllSound サウンドカテゴリービットが異常です。\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* 80290B64-80290C74 .text stopAllSound__8JAIBasicFUlPv */
|
||||
void JAIBasic::stopAllSound(u32, void*) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::stopAllSound(u32 soundID, void* param_2) {
|
||||
switch (soundID & JAISoundID_TypeMask) {
|
||||
case JAISoundID_Type_Se:
|
||||
stopIDActorSoundOneBuffer(soundID, param_2, JAInter::SeMgr::seRegist[JAInter::SeMgr::changeIDToCategory(soundID)].field_0x4);
|
||||
break;
|
||||
case JAISoundID_Type_Sequence:
|
||||
stopIDActorSoundOneBuffer(soundID, param_2, JAInter::SequenceMgr::seqControl.field_0x4);
|
||||
break;
|
||||
case JAISoundID_Type_Stream:
|
||||
stopIDActorSoundOneBuffer(soundID, param_2, JAInter::StreamMgr::streamControl.field_0x4);
|
||||
break;
|
||||
default:
|
||||
JUT_ASSERT_MSG(880, 0, "JAIBasic::stopAllSound サウンドカテゴリービットが異常です。\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* 80290C74-80290D94 .text deleteObject__8JAIBasicFPv */
|
||||
void JAIBasic::deleteObject(void*) {
|
||||
void JAIBasic::deleteObject(void* param_1) {
|
||||
/* Nonmatching */
|
||||
JAInter::DummyVec* r30 = NULL;
|
||||
for (int i = 0; i < JAIGlobalParameter::getParamSeCategoryMax(); i++) {
|
||||
JAISound* sound = JAInter::SeMgr::seRegist[i].field_0x4;
|
||||
while (sound) {
|
||||
JAISound* nextSound = sound->field_0x34;
|
||||
if (sound->field_0x24 == param_1) {
|
||||
bool r29 = false;
|
||||
if (sound->checkSwBit(0x8000)) {
|
||||
r29 = true;
|
||||
if (!r30) {
|
||||
r30 = JAInter::DummyObjectMgr::getPointer(JAIGlobalParameter::dummyObjectLifeTime, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (r29 && r30) {
|
||||
r30->field_0xc = *sound->field_0x28;
|
||||
r30->field_0x8 = sound;
|
||||
sound->clearMainSoundPPointer();
|
||||
sound->field_0x38 = &r30->field_0x8;
|
||||
sound->field_0x28 = &r30->field_0xc;
|
||||
sound->field_0x24 = NULL;
|
||||
} else {
|
||||
stopSoundHandle(sound, 0);
|
||||
}
|
||||
}
|
||||
sound = nextSound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 80290D94-80290DA0 .text getMapInfoFxline__8JAIBasicFUl */
|
||||
@@ -291,7 +455,6 @@ BOOL JAIBasic::getMapInfoGround(u32 param_1) {
|
||||
|
||||
/* 80290DAC-80290DC4 .text getMapInfoFxParameter__8JAIBasicFUl */
|
||||
f32 JAIBasic::getMapInfoFxParameter(u32 param_1) {
|
||||
/* Nonmatching */
|
||||
if (param_1 == 0) {
|
||||
return 0.0f;
|
||||
}
|
||||
@@ -299,36 +462,87 @@ f32 JAIBasic::getMapInfoFxParameter(u32 param_1) {
|
||||
}
|
||||
|
||||
/* 80290DC4-80290E14 .text getSoundOffsetNumberFromID__8JAIBasicFUl */
|
||||
u16 JAIBasic::getSoundOffsetNumberFromID(u32) {
|
||||
u16 JAIBasic::getSoundOffsetNumberFromID(u32 param_1) {
|
||||
/* Nonmatching */
|
||||
if (JAInter::SoundTable::getInfoFormat(param_1) & 1) {
|
||||
SoundInfo* info = JAInter::SoundTable::getInfoPointer(param_1);
|
||||
return info->mOffsetNo;
|
||||
}
|
||||
return param_1 & 0x3FF;
|
||||
}
|
||||
|
||||
void JAIBasic::setSeCancelSwitch(u8, u8) {
|
||||
/* Nonmatching - debug only */
|
||||
}
|
||||
|
||||
/* 80290E14-80290E50 .text setSeCategoryVolume__8JAIBasicFUcUc */
|
||||
void JAIBasic::setSeCategoryVolume(u8, u8) {
|
||||
/* Nonmatching */
|
||||
void JAIBasic::setSeCategoryVolume(u8 param_1, u8 param_2) {
|
||||
JAInter::SeMgr::seCategoryVolume[param_1] = param_2 / 127.0f;
|
||||
}
|
||||
|
||||
/* 80290E50-80291034 .text setParameterSeqSync__8JAIBasicFPQ28JASystem6TTrackUs */
|
||||
u16 JAIBasic::setParameterSeqSync(JASystem::TTrack*, u16) {
|
||||
u16 JAIBasic::setParameterSeqSync(JASystem::TTrack* param_1, u16 param_2) {
|
||||
/* Nonmatching */
|
||||
u16 r30 = 0;
|
||||
switch (param_2) {
|
||||
case 0:
|
||||
for (int i = 0; i < JAIGlobalParameter::seqPlayTrackMax; i++) {
|
||||
if (!JAInter::SequenceMgr::getPlayTrackInfo(i)->field_0x48) {
|
||||
continue;
|
||||
}
|
||||
JAInter::SeqParameter* seqParam = JAInter::SequenceMgr::getPlayTrackInfo(i)->field_0x48->getSeqParameter();
|
||||
JASystem::TTrack* track = &seqParam->mTrack;
|
||||
if (track == (JAInter::SequenceMgr::getPlayTrackInfo(i)->field_0x48->mSoundID & 0x800 ? param_1->mParent->mParent : param_1->mParent)) {
|
||||
u32 r28 = JAInter::routeToTrack(param_1->field_0x36c);
|
||||
r30 = JAInter::SoundTable::getInfoPointer(JAInter::SequenceMgr::getPlayTrackInfo(i)->field_0x48->mSoundID)->mFlag >> 8;
|
||||
JAInter::SystemInterface::outerInit(JAInter::SequenceMgr::getPlayTrackInfo(i), param_1, r28, r30, param_2 & 1);
|
||||
JAInter::SequenceMgr::getPlayTrackInfo(i)->field_0x4 |= 1 << r28;
|
||||
r30 = 0;
|
||||
i = JAIGlobalParameter::seqPlayTrackMax;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
u8 tmp = param_1->field_0x36c;
|
||||
JAInter::SeMgr::seTrackUpdate_s* r31 = JAInter::SeMgr::seTrackUpdate;
|
||||
JASystem::TTrack::TOuterParam* r28 = param_1->mOuterParam;
|
||||
r28->setParam(1, r31[tmp].field_0x4);
|
||||
r28->setParam(8, r31[tmp].field_0x10);
|
||||
r28->setParam(2, r31[tmp].field_0x8);
|
||||
r28->setParam(4, r31[tmp].field_0xc);
|
||||
r28->setParam(16, msBasic->field_0xd != 2 ? 0.0f : r31[tmp].field_0x14);
|
||||
break;
|
||||
case 127:
|
||||
param_1->writePortApp(0, JAInter::SeMgr::seScene);
|
||||
break;
|
||||
}
|
||||
return r30;
|
||||
}
|
||||
|
||||
/* 80291034-80291114 .text setSeExtParameter__8JAIBasicFP8JAISound */
|
||||
void JAIBasic::setSeExtParameter(JAISound*) {
|
||||
void JAIBasic::setSeExtParameter(JAISound* param_1) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 80291114-802911A8 .text makeSound__8JAIBasicFUl */
|
||||
JAISound* JAIBasic::makeSound(u32) {
|
||||
/* Nonmatching */
|
||||
JAISound* JAIBasic::makeSound(u32 param_1) {
|
||||
if (field_0x8) {
|
||||
return new (field_0x8, 0) JAISound[param_1];
|
||||
} else {
|
||||
return new (JASDram, 0) JAISound[param_1];
|
||||
}
|
||||
}
|
||||
|
||||
/* 802911A8-80291200 .text allocStreamBuffer__8JAIBasicFPvl */
|
||||
bool JAIBasic::allocStreamBuffer(void*, s32) {
|
||||
/* Nonmatching */
|
||||
bool JAIBasic::allocStreamBuffer(void* param_1, s32 param_2) {
|
||||
if (JAInter::StreamLib::getNeedBufferSize() <= param_2) {
|
||||
JAInter::StreamLib::allocBuffer(param_1, param_2);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 80291200-80291220 .text deallocStreamBuffer__8JAIBasicFv */
|
||||
bool JAIBasic::deallocStreamBuffer() {
|
||||
/* Nonmatching */
|
||||
return JAInter::StreamLib::deallocBuffer();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
JAInter::LinkSound JAInter::SequenceMgr::seqControl;
|
||||
JAInter::SeqUpdateData* JAInter::SequenceMgr::seqTrackInfo;
|
||||
int* JAInter::SequenceMgr::FixSeqBufPointer;
|
||||
JAISound** JAInter::SequenceMgr::FixSeqBufPointer;
|
||||
JKRArchive* JAInter::SequenceMgr::arcPointer;
|
||||
|
||||
/* 80295684-802960A0 .text init__Q27JAInter11SequenceMgrFv */
|
||||
@@ -22,7 +22,7 @@ void JAInter::SequenceMgr::init() {
|
||||
JAIBasic* basic = JAIBasic::getInterface();
|
||||
JAISound* soundObjects = basic->makeSound(JAIGlobalParameter::getParamSeqControlBufferMax());
|
||||
JUT_ASSERT_MSG(41, soundObjects, "JAISequenceMgr::initHeap Cannot Alloc Heap!!\n");
|
||||
FixSeqBufPointer = new (JAIBasic::getCurrentJAIHeap(), 0x20) int[JAIGlobalParameter::getParamSeqPlayTrackMax()];
|
||||
FixSeqBufPointer = new (JAIBasic::getCurrentJAIHeap(), 0x20) JAISound*[JAIGlobalParameter::getParamSeqPlayTrackMax()];
|
||||
seqControl.init(soundObjects, JAIGlobalParameter::getParamSeqControlBufferMax());
|
||||
for (int i = 0; i < JAIGlobalParameter::getParamSeqControlBufferMax(); i++) {
|
||||
SeqParameter* _para = new (JAIBasic::getCurrentJAIHeap(), 0x20) SeqParameter();
|
||||
@@ -37,12 +37,12 @@ void JAInter::SequenceMgr::init() {
|
||||
_para->seqDolby = new (JAIBasic::getCurrentJAIHeap(), 0x20) MoveParaSet[JAIGlobalParameter::getParamSeqParameterLines()];
|
||||
JUT_ASSERT_MSG(56, _para->seqDolby, "JAISequenceMgr::initHeap Cannot Alloc Heap!!\n");
|
||||
}
|
||||
FixSeqBufPointer = new (JAIBasic::getCurrentJAIHeap(), 0x20) int[JAIGlobalParameter::getParamSeqPlayTrackMax()];
|
||||
FixSeqBufPointer = new (JAIBasic::getCurrentJAIHeap(), 0x20) JAISound*[JAIGlobalParameter::getParamSeqPlayTrackMax()];
|
||||
JUT_ASSERT_MSG(60, FixSeqBufPointer, "JAISequenceMgr::initHeap Cannot Alloc Heap!!\n");
|
||||
seqTrackInfo = new (JAIBasic::getCurrentJAIHeap(), 0x20) SeqUpdateData[JAIGlobalParameter::getParamSeqPlayTrackMax()];
|
||||
JUT_ASSERT_MSG(62, seqTrackInfo, "JAISequenceMgr::initHeap Cannot Alloc Heap!!\n");
|
||||
for (int i = 0; i < JAIGlobalParameter::getParamSeqPlayTrackMax(); i++) {
|
||||
FixSeqBufPointer[i] = 0;
|
||||
FixSeqBufPointer[i] = NULL;
|
||||
SeqUpdateData* update = &seqTrackInfo[i];
|
||||
update->mSeqVolume = 1.0f;
|
||||
update->mSeqPitch = 0.5f;
|
||||
|
||||
@@ -28,12 +28,12 @@ u8 JAISound::getSeCategoryNumber() {
|
||||
}
|
||||
|
||||
/* 802985E8-802985F4 .text getSwBit__8JAISoundFv */
|
||||
int JAISound::getSwBit() {
|
||||
u32 JAISound::getSwBit() {
|
||||
return ((u32*)field_0x40)[0];
|
||||
}
|
||||
|
||||
/* 802985F4-80298624 .text checkSwBit__8JAISoundFUl */
|
||||
int JAISound::checkSwBit(u32 param_1) {
|
||||
u32 JAISound::checkSwBit(u32 param_1) {
|
||||
return param_1 & getSwBit();
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ void JASystem::Kernel::mixExtraTrack(s16* dest, s32 size, s16* (*cb)(s32)) {
|
||||
probeStart(6,"MIXING");
|
||||
s16* destPtr = dest;
|
||||
s16* srcPtr = src;
|
||||
s16* srcPtr2 = src + gFrameSamples;
|
||||
s16* srcPtr2 = src + getFrameSamples();
|
||||
for (int i = 0; i < size; i++) {
|
||||
s32 var1 = destPtr[0] + srcPtr2[0];
|
||||
s16 var2;
|
||||
|
||||
@@ -45,7 +45,7 @@ bool JASystem::TBasicInst::getParam(int key, int velo, TInstParam* param) const
|
||||
continue;
|
||||
}
|
||||
f32 y = effect->getY(key, velo);
|
||||
switch (effect->mTarget) {
|
||||
switch (effect->getTarget()) {
|
||||
case 0:
|
||||
param->field_0x18 *= y;
|
||||
break;
|
||||
@@ -76,7 +76,7 @@ bool JASystem::TBasicInst::getParam(int key, int velo, TInstParam* param) const
|
||||
if (!keymap) {
|
||||
return false;
|
||||
}
|
||||
for (int i = 0; i < keymap->mVeloRegionCount; i++) {
|
||||
for (int i = 0; i < keymap->getVeloRegionCount(); i++) {
|
||||
const JASystem::TBasicInst::TVeloRegion * region = keymap->getVeloRegion(i);
|
||||
if (velo <= region->mBaseVel) {
|
||||
param->field_0x10 *= region->field_0x08;
|
||||
|
||||
@@ -64,7 +64,7 @@ void JASystem::TBasicWaveBank::setWaveTableSize(u32 param_1) {
|
||||
void JASystem::TBasicWaveBank::incWaveTable(const TWaveGroup* param_1) {
|
||||
/* Nonmatching */
|
||||
OSLockMutex(&mMutex);
|
||||
for (int i = 0; i < param_1->mWaveCount; i++) {
|
||||
for (int i = 0; i < param_1->getWaveCount(); i++) {
|
||||
u32 waveID = param_1->getWaveID(i);
|
||||
TWaveInfo** table = mWaveTable;
|
||||
TWaveInfo* waveInfo = ¶m_1->mCtrlWaveArray[i];
|
||||
@@ -79,8 +79,28 @@ void JASystem::TBasicWaveBank::incWaveTable(const TWaveGroup* param_1) {
|
||||
}
|
||||
|
||||
/* 80285D54-80285E28 .text decWaveTable__Q28JASystem14TBasicWaveBankFPCQ38JASystem14TBasicWaveBank10TWaveGroup */
|
||||
void JASystem::TBasicWaveBank::decWaveTable(const TWaveGroup*) {
|
||||
void JASystem::TBasicWaveBank::decWaveTable(const TWaveGroup* param_1) {
|
||||
/* Nonmatching */
|
||||
OSLockMutex(&mMutex);
|
||||
for (int i = 0; i < param_1->getWaveCount(); i++) {
|
||||
u32 waveID = param_1->getWaveID(i);
|
||||
TWaveInfo* waveInfo = mWaveTable[waveID];
|
||||
TWaveInfo* waveInfo2 = ¶m_1->mCtrlWaveArray[i];
|
||||
for (; waveInfo; waveInfo = waveInfo->mPrev) {
|
||||
if (waveInfo == waveInfo2) {
|
||||
if (!waveInfo->mNext) {
|
||||
mWaveTable[waveID] = waveInfo->mPrev;
|
||||
} else {
|
||||
waveInfo->mNext->mPrev = waveInfo->mPrev;
|
||||
}
|
||||
if (waveInfo->mPrev) {
|
||||
waveInfo->mPrev->mNext = waveInfo->mNext;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
OSUnlockMutex(&mMutex);
|
||||
}
|
||||
|
||||
/* 80285E28-80285E58 .text getWaveHandle__Q28JASystem14TBasicWaveBankCFUl */
|
||||
|
||||
@@ -48,8 +48,8 @@ void JASystem::TDSPQueue::deQueue() {
|
||||
/* 8028B224-8028B288 .text enQueue__Q28JASystem9TDSPQueueFPQ28JASystem8TChannel */
|
||||
void JASystem::TDSPQueue::enQueue(TChannel* param_1) {
|
||||
JSUListIterator<TChannel> it;
|
||||
for (it = sDspQueueList.getFirst(); it != sDspQueueList.getEnd(); it++) {
|
||||
if (param_1->getNoteOnPriority() > it->getNoteOnPriority()) {
|
||||
for (it = sDspQueueList.getFirst(); it != sDspQueueList.getEnd(); ++it) {
|
||||
if (param_1->getNoteOnPriority() > (*it).getNoteOnPriority()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
|
||||
/* 8027D6F4-8027D70C .text __ct__Q38JASystem6Kernel8TPortCmdFv */
|
||||
JASystem::Kernel::TPortCmd::TPortCmd() {
|
||||
field_0x0 = NULL;
|
||||
field_0x4 = NULL;
|
||||
field_0x8 = NULL;
|
||||
field_0xc = NULL;
|
||||
mHead = NULL;
|
||||
mNext = NULL;
|
||||
mFunc = NULL;
|
||||
mArgs = NULL;
|
||||
}
|
||||
|
||||
JASystem::Kernel::TPortHead cmd_once;
|
||||
@@ -26,32 +26,31 @@ bool JASystem::Kernel::TPortCmd::addPortCmdOnce() {
|
||||
}
|
||||
|
||||
/* 8027D730-8027D7E8 .text setPortCmd__Q38JASystem6Kernel8TPortCmdFPFPQ38JASystem6Kernel9TPortArgs_vPQ38JASystem6Kernel9TPortArgs */
|
||||
bool JASystem::Kernel::TPortCmd::setPortCmd(void (*func)(JASystem::Kernel::TPortArgs*), JASystem::Kernel::TPortArgs* pargs) {
|
||||
bool JASystem::Kernel::TPortCmd::setPortCmd(JASystem::Kernel::TPortFunc func, JASystem::Kernel::TPortArgs* pargs) {
|
||||
JUT_ASSERT(83, func != NULL);
|
||||
JUT_ASSERT(84, pargs != NULL);
|
||||
field_0x8 = func;
|
||||
field_0xc = pargs;
|
||||
field_0x0 = NULL;
|
||||
mFunc = func;
|
||||
mArgs = pargs;
|
||||
mHead = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 8027D7E8-8027D8A4 .text addPortCmd__Q38JASystem6Kernel8TPortCmdFPQ38JASystem6Kernel9TPortHead */
|
||||
bool JASystem::Kernel::TPortCmd::addPortCmd(JASystem::Kernel::TPortHead* phead) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(105, phead != NULL);
|
||||
BOOL enable = OSDisableInterrupts();
|
||||
if (field_0x0) {
|
||||
if (mHead) {
|
||||
OSRestoreInterrupts(enable);
|
||||
return false;
|
||||
}
|
||||
if (phead->field_0x4) {
|
||||
phead->field_0x4->field_0x4 = this;
|
||||
if (phead->mLast) {
|
||||
phead->mLast->mNext = this;
|
||||
} else {
|
||||
phead->field_0x0 = this;
|
||||
phead->mFirst = this;
|
||||
}
|
||||
phead->field_0x4 = this;
|
||||
field_0x4 = NULL;
|
||||
field_0x0 = phead;
|
||||
phead->mLast = this;
|
||||
mNext = NULL;
|
||||
mHead = phead;
|
||||
OSRestoreInterrupts(enable);
|
||||
return true;
|
||||
}
|
||||
@@ -64,28 +63,28 @@ void JASystem::Kernel::portCmdProcOnce(JASystem::Kernel::TPortHead* phead) {
|
||||
if (!cmd) {
|
||||
break;
|
||||
}
|
||||
cmd->field_0x8(cmd->field_0xc);
|
||||
cmd->getFunc()(cmd->getArgs());
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027D924-8027D9A4 .text portCmdProcStay__Q28JASystem6KernelFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::portCmdProcStay(JASystem::Kernel::TPortHead* phead) {
|
||||
JUT_ASSERT(245, phead != NULL);
|
||||
TPortCmd* cmd = phead->field_0x0;
|
||||
TPortCmd* cmd = phead->mFirst;
|
||||
while (true) {
|
||||
if (!cmd) {
|
||||
break;
|
||||
}
|
||||
cmd->field_0x8(cmd->field_0xc);
|
||||
cmd = cmd->field_0x4;
|
||||
cmd->getFunc()(cmd->getArgs());
|
||||
cmd = cmd->getNext();
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027D9A4-8027DA0C .text portHeadInit__Q28JASystem6KernelFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::portHeadInit(JASystem::Kernel::TPortHead* phead) {
|
||||
JUT_ASSERT(267, phead != NULL);
|
||||
phead->field_0x0 = NULL;
|
||||
phead->field_0x4 = NULL;
|
||||
phead->mFirst = NULL;
|
||||
phead->mLast = NULL;
|
||||
}
|
||||
|
||||
JASystem::Kernel::TPortHead cmd_stay;
|
||||
@@ -102,17 +101,17 @@ JASystem::Kernel::TPortCmd* JASystem::Kernel::getPortCmd(JASystem::Kernel::TPort
|
||||
TPortCmd* r31;
|
||||
TPortCmd* r30 = NULL;
|
||||
JUT_ASSERT(311, phead != NULL);
|
||||
r31 = phead->field_0x0;
|
||||
r31 = phead->mFirst;
|
||||
if (r31) {
|
||||
r30 = r31;
|
||||
phead->field_0x0 = r31->field_0x4;
|
||||
if (!phead->field_0x0) {
|
||||
phead->field_0x4 = NULL;
|
||||
phead->mFirst = r31->getNext();
|
||||
if (!phead->mFirst) {
|
||||
phead->mLast = NULL;
|
||||
}
|
||||
if (phead != r31->field_0x0) {
|
||||
if (phead != r31->getHead()) {
|
||||
OSReport("[JASKernel::getPortCmd] 不正な登録データブロックです。\n");
|
||||
}
|
||||
r31->field_0x0 = NULL;
|
||||
r31->setHead(NULL);
|
||||
}
|
||||
return r30;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ bool JASystem::TDrumSet::getParam(int key, int param_2, JASystem::TInstParam* pa
|
||||
TInstEffect* effect = perc->mEffect[i];
|
||||
if (effect) {
|
||||
f32 y = effect->getY(key, param_2);
|
||||
switch (effect->mTarget) {
|
||||
switch (effect->getTarget()) {
|
||||
case 0:
|
||||
param_3->field_0x18 *= y;
|
||||
break;
|
||||
|
||||
@@ -68,7 +68,7 @@ JASTaskThread* JASystem::Dvd::sThread;
|
||||
|
||||
/* 8027B72C-8027B7E8 .text createThread__Q28JASystem3DvdFiiUl */
|
||||
bool JASystem::Dvd::createThread(int param_1, int param_2, u32 param_3) {
|
||||
sThread = new (JASDram, 0) JASTaskThread(param_3, param_2, param_1);
|
||||
sThread = new (JASDram, 0) JASTaskThread(param_1, param_2, param_3);
|
||||
JUT_ASSERT(136, sThread);
|
||||
return true;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ bool JASystem::Dvd::createThread(int param_1, int param_2, u32 param_3) {
|
||||
/* 8027B7E8-8027B84C .text resumeThread__Q28JASystem3DvdFv */
|
||||
void JASystem::Dvd::resumeThread() {
|
||||
JUT_ASSERT(143, sThread);
|
||||
OSResumeThread(sThread->getThreadRecord());
|
||||
sThread->resume();
|
||||
}
|
||||
|
||||
/* 8027B84C-8027B8D4 .text sendCmdMsg__Q28JASystem3DvdFPFPv_lPvUl */
|
||||
|
||||
@@ -56,7 +56,7 @@ bool JASystem::Kernel::THeap::alloc(THeap* mother, u32 param_2) {
|
||||
bool local_43 = false;
|
||||
THeap* local_30 = NULL;
|
||||
void* local_34;
|
||||
for (JSUTreeIterator<THeap> it = mother->mTree.getFirstChild(); it != mother->mTree.getEndChild(); it++) {
|
||||
for (JSUTreeIterator<THeap> it = mother->mTree.getFirstChild(); it != mother->mTree.getEndChild(); ++it) {
|
||||
if (r29 >= mother->mBase + local_2c) {
|
||||
break;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ bool JASystem::Kernel::THeap::free() {
|
||||
JSUTreeIterator<THeap> stack_20;
|
||||
for (JSUTreeIterator<THeap> it(mTree.getFirstChild()); it != mTree.getEndChild(); it = stack_20) {
|
||||
stack_20 = it;
|
||||
stack_20++;
|
||||
++stack_20;
|
||||
it->free();
|
||||
}
|
||||
JSUTree<THeap>* parentTree = mTree.getParent();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAudio/JASRegisterParam.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
|
||||
/* 8027E2C0-8027E310 .text __ct__Q28JASystem14TRegisterParamFv */
|
||||
JASystem::TRegisterParam::TRegisterParam() {
|
||||
@@ -74,10 +74,10 @@ void JASystem::TRegisterParam::inherit(const JASystem::TRegisterParam& param_1)
|
||||
|
||||
/* 8027E3E0-8027E3EC .text getBankNumber__Q28JASystem14TRegisterParamCFv */
|
||||
u8 JASystem::TRegisterParam::getBankNumber() const {
|
||||
return field_0xc >> 8 & 0xff;
|
||||
return JSUHiByte(field_0xc);
|
||||
}
|
||||
|
||||
/* 8027E3EC-8027E3F8 .text getProgramNumber__Q28JASystem14TRegisterParamCFv */
|
||||
u8 JASystem::TRegisterParam::getProgramNumber() const {
|
||||
return field_0xc & 0xff;
|
||||
return JSULoByte(field_0xc);
|
||||
}
|
||||
|
||||
@@ -10,16 +10,6 @@
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "dolphin/os/OSMessage.h"
|
||||
|
||||
struct LoadResourceMsg {
|
||||
/* 0x00 */ JKRArchive* mArchive;
|
||||
/* 0x04 */ u16 mId;
|
||||
/* 0x08 */ u8* mBuffer;
|
||||
/* 0x0C */ u32 mSize;
|
||||
/* 0x10 */ void (*mCallback)(u32, u32);
|
||||
/* 0x14 */ u32 mCallbackParam;
|
||||
/* 0x18 */ OSMessageQueue* mMessageQueue;
|
||||
};
|
||||
|
||||
/* 8027D4C8-8027D4FC .text getResSize__Q28JASystem12ResArcLoaderFP10JKRArchiveUs */
|
||||
u32 JASystem::ResArcLoader::getResSize(JKRArchive* archive, u16 param_2) {
|
||||
JKRArchive::SDIFileEntry* entry = archive->findIdResource(param_2);
|
||||
@@ -31,7 +21,7 @@ u32 JASystem::ResArcLoader::getResSize(JKRArchive* archive, u16 param_2) {
|
||||
|
||||
/* 8027D4FC-8027D5A0 .text loadResourceCallback__Q28JASystem12ResArcLoaderFPv */
|
||||
s32 JASystem::ResArcLoader::loadResourceCallback(void* param_1) {
|
||||
LoadResourceMsg* msg = (LoadResourceMsg*)param_1;
|
||||
TLoadResInfo* msg = (TLoadResInfo*)param_1;
|
||||
u32 var1 = msg->mArchive->readResource(msg->mBuffer, msg->mSize, msg->mId);
|
||||
if (msg->mCallback) {
|
||||
msg->mCallback(var1, msg->mCallbackParam);
|
||||
@@ -52,19 +42,12 @@ s32 JASystem::ResArcLoader::loadResourceCallback(void* param_1) {
|
||||
/* 8027D5A0-8027D658 .text loadResource__Q28JASystem12ResArcLoaderFP10JKRArchiveUsPUcUl */
|
||||
u32 JASystem::ResArcLoader::loadResource(JKRArchive* archive, u16 id, u8* buffer, u32 size) {
|
||||
OSMessageQueue queue;
|
||||
LoadResourceMsg msg;
|
||||
OSMessage queueMsg;
|
||||
OSMessage receiveMsg;
|
||||
OSInitMessageQueue(&queue, &queueMsg, 1);
|
||||
msg.mArchive = archive;
|
||||
msg.mId = id;
|
||||
msg.mBuffer = buffer;
|
||||
msg.mSize = size;
|
||||
msg.mCallback = NULL;
|
||||
msg.mCallbackParam = 0;
|
||||
msg.mMessageQueue = NULL;
|
||||
TLoadResInfo msg(archive, id, buffer, size);
|
||||
msg.mMessageQueue = &queue;
|
||||
if (!Dvd::sendCmdMsg(loadResourceCallback, &msg, sizeof(LoadResourceMsg))) {
|
||||
if (!Dvd::sendCmdMsg(loadResourceCallback, &msg, sizeof(TLoadResInfo))) {
|
||||
return 0;
|
||||
}
|
||||
OSReceiveMessage(&queue, &receiveMsg, OS_MESSAGE_BLOCK);
|
||||
@@ -73,15 +56,8 @@ u32 JASystem::ResArcLoader::loadResource(JKRArchive* archive, u16 id, u8* buffer
|
||||
|
||||
/* 8027D658-8027D6B0 .text loadResourceAsync__Q28JASystem12ResArcLoaderFP10JKRArchiveUsPUcUlPFUlUl_vUl */
|
||||
void JASystem::ResArcLoader::loadResourceAsync(JKRArchive* archive, u16 id, u8* buffer, u32 size, void (*cb)(u32, u32), u32 cbParam) {
|
||||
LoadResourceMsg msg;
|
||||
msg.mArchive = archive;
|
||||
msg.mId = id;
|
||||
msg.mBuffer = buffer;
|
||||
msg.mSize = size;
|
||||
msg.mCallback = NULL;
|
||||
msg.mCallbackParam = 0;
|
||||
msg.mMessageQueue = NULL;
|
||||
TLoadResInfo msg(archive, id, buffer, size);
|
||||
msg.mCallback = cb;
|
||||
msg.mCallbackParam = cbParam;
|
||||
Dvd::sendCmdMsg(loadResourceCallback, &msg, sizeof(LoadResourceMsg));
|
||||
Dvd::sendCmdMsg(loadResourceCallback, &msg, sizeof(TLoadResInfo));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ void JASystem::Kernel::sysDramSetup(JKRSolidHeap* heap) {
|
||||
return;
|
||||
}
|
||||
OSReport("[JASKernel::sysDramSetup] メモリ指定がありませんので、システムからオーディオヒープを取得します。\n");
|
||||
JASDram = JKRSolidHeap::create(audioDramSize, JKRStdHeap::create(audioDramSize + 0x100, NULL, false), false);
|
||||
JASDram = JKRCreateSolidHeap(audioDramSize, JKRCreateStdHeap(audioDramSize + 0x100, NULL, false), false);
|
||||
}
|
||||
|
||||
/* 8027DB9C-8027DC30 .text allocFromSysDram__Q28JASystem6KernelFUl */
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "JSystem/JAudio/JASSystemHeap.h"
|
||||
#include "JSystem/JAudio/JASRate.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "JSystem/JSupport/JSupport.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
/* 80280960-80280A34 .text __ct__Q28JASystem6TTrackFv */
|
||||
@@ -1012,7 +1013,7 @@ int JASystem::TTrack::exchangeRegisterValue(u8 target) {
|
||||
}
|
||||
|
||||
u8 index = target - 0x40;
|
||||
return mTrackPort.mValue[index];
|
||||
return mTrackPort.get(index);
|
||||
}
|
||||
|
||||
/* 80282DC0-80282ED4 .text readReg32__Q28JASystem6TTrackFUc */
|
||||
@@ -1089,7 +1090,7 @@ void JASystem::TTrack::writeRegDirect(u8 target, u16 value) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
val_u8 = value & 0xFF;
|
||||
val_u8 = JSULoByte(value);
|
||||
value = val_u8;
|
||||
r4 = Player::extend8to16(val_u8);
|
||||
break;
|
||||
@@ -1097,10 +1098,10 @@ void JASystem::TTrack::writeRegDirect(u8 target, u16 value) {
|
||||
case 0x21:
|
||||
return;
|
||||
case 0x22:
|
||||
writeRegDirect(0, value >> 8);
|
||||
writeRegDirect(0, JSUHiByte(value));
|
||||
target = 1;
|
||||
r4 = value;
|
||||
value = value & 0xFF;
|
||||
value = JSULoByte(value);
|
||||
break;
|
||||
default:
|
||||
r4 = value;
|
||||
@@ -1196,8 +1197,8 @@ void JASystem::TTrack::writeRegParam(u8 param) {
|
||||
break;
|
||||
case 0x2:
|
||||
extended_sVar1 *= sVar0;
|
||||
writeRegDirect(4, extended_sVar1 >> 16);
|
||||
writeRegDirect(5, extended_sVar1 & 0xFFFF);
|
||||
writeRegDirect(4, JSUHiHalf(extended_sVar1));
|
||||
writeRegDirect(5, JSULoHalf(extended_sVar1));
|
||||
return;
|
||||
case 0x3:
|
||||
mRegisterParam.setFlag(sVar1 - sVar0);
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JGadget/define.h"
|
||||
|
||||
JGadget_outMessage::JGadget_outMessage(MessageFunc fn, const char* file, int line) {
|
||||
mMsgFunc = fn;
|
||||
mFile = file;
|
||||
mLine = line;
|
||||
|
||||
mWrite_p = mBuffer;
|
||||
*mWrite_p = 0;
|
||||
}
|
||||
|
||||
JGadget_outMessage::~JGadget_outMessage() {}
|
||||
|
||||
JGadget_outMessage& JGadget_outMessage::operator<<(const char* sz) {
|
||||
JUT_ASSERT(99, sz!=NULL);
|
||||
|
||||
while (*sz != 0 && mWrite_p < mBuffer + (256 - 1)) {
|
||||
*mWrite_p = *sz;
|
||||
mWrite_p++;
|
||||
sz++;
|
||||
}
|
||||
|
||||
*mWrite_p = 0;
|
||||
return *this;
|
||||
}
|
||||
|
||||
JGadget_outMessage& JGadget_outMessage::operator<<(char c) {
|
||||
char sz[2];
|
||||
sz[0] = c;
|
||||
sz[1] = 0;
|
||||
|
||||
return *this << sz;
|
||||
}
|
||||
JGadget_outMessage& JGadget_outMessage::operator<<(s32 value) {
|
||||
char sz[64];
|
||||
snprintf(sz, 64, "%d", value);
|
||||
|
||||
return *this << sz;
|
||||
}
|
||||
|
||||
JGadget_outMessage& JGadget_outMessage::operator<<(u32 value) {
|
||||
char sz[64];
|
||||
snprintf(sz, 64, "%u", value);
|
||||
|
||||
return *this << sz;
|
||||
}
|
||||
|
||||
JGadget_outMessage& JGadget_outMessage::operator<<(const void* data) {
|
||||
char sz[64];
|
||||
snprintf(sz, 64, "%p", data);
|
||||
|
||||
return *this << sz;
|
||||
}
|
||||
|
||||
void JGadget_outMessage::warning(const char* file, int line, const char* message) {
|
||||
JUTAssertion::setWarningMessage(3, (char*)file, line, message);
|
||||
}
|
||||
@@ -46,21 +46,22 @@ JStudio::TCreateObject::~TCreateObject() {}
|
||||
JStudio::TFactory::~TFactory() {}
|
||||
|
||||
/* 8026E314-8026E360 .text appendCreateObject__Q27JStudio8TFactoryFPQ27JStudio13TCreateObject */
|
||||
void JStudio::TFactory::appendCreateObject(JStudio::TCreateObject* param_0) {
|
||||
mList.Push_back(param_0);
|
||||
void JStudio::TFactory::appendCreateObject(JStudio::TCreateObject* p) {
|
||||
// JUT_ASSERT(227, p!=NULL);
|
||||
mList.Push_back(p);
|
||||
}
|
||||
|
||||
/* 8026E360-8026E438 .text create__Q27JStudio8TFactoryFRCQ47JStudio3stb4data20TParse_TBlock_object */
|
||||
JStudio::TObject* JStudio::TFactory::create(const JStudio::stb::data::TParse_TBlock_object& param_0) {
|
||||
JStudio::TObject* JStudio::TFactory::create(const JStudio::stb::data::TParse_TBlock_object& rParse) {
|
||||
JGadget::TContainerEnumerator<JGadget::TLinkList<TCreateObject, -4> > aTStack_368(mList);
|
||||
while(aTStack_368) {
|
||||
TCreateObject& piVar1 = *aTStack_368;
|
||||
JStudio::TObject* obj = NULL;
|
||||
if (piVar1.create(&obj, param_0)) {
|
||||
if (piVar1.create(&obj, rParse)) {
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
return stb::TFactory::create(param_0);
|
||||
return stb::TFactory::create(rParse);
|
||||
}
|
||||
|
||||
/* 8026E438-8026E48C .text __ct__Q27JStudio6TParseFPQ27JStudio8TControl */
|
||||
@@ -73,12 +74,15 @@ JStudio::TParse::~TParse() {}
|
||||
bool JStudio::TParse::parseHeader(const JStudio::stb::data::TParse_THeader& param_0, u32 param_1) {
|
||||
const JStudio::stb::data::THeader::Target& target = param_0.get_target();
|
||||
if (memcmp(target.name, JStudio::data::ga8cSignature, sizeof(JStudio::data::ga8cSignature)) != 0) {
|
||||
JGADGET_WARNMSG(304, "unknown target-system");
|
||||
return false;
|
||||
}
|
||||
if (target.target_version < 2) {
|
||||
JGADGET_WARNMSG1(312, "obsolete version : ", target.target_version);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (target.target_version > 3) {
|
||||
JGADGET_WARNMSG1(317, "unknown version : ", target.target_version);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user