mirror of
https://github.com/zeldaret/tp
synced 2026-08-05 01:30:02 -04:00
JASSeqCtrl OK + misc functions (#346)
* JASSeqCtrl OK + misc functions * Work on JASAudioThread
This commit is contained in:
@@ -2,17 +2,27 @@
|
||||
#define JASAUDIOTHREAD_H
|
||||
|
||||
#include "JSystem/JAudio2/JASGadget.h"
|
||||
#include "JSystem/JKernel/JKRThread.h"
|
||||
|
||||
struct JASAudioThread : public JASGlobalInstance<JASAudioThread> {
|
||||
enum JASAudioMessage {
|
||||
AUDIOMSG_DMA = 0,
|
||||
AUDIOMSG_DSP = 1,
|
||||
AUDIOMSG_STOP = 2,
|
||||
};
|
||||
|
||||
struct JASAudioThread : public JKRThread, public JASGlobalInstance<JASAudioThread> {
|
||||
/* 8029CCDC */ JASAudioThread(int, int, u32);
|
||||
/* 8029CD4C */ void create(s32);
|
||||
/* 8029CD4C */ static void create(s32);
|
||||
/* 8029CDC0 */ void stop();
|
||||
/* 8029CDEC */ void run();
|
||||
/* 8029CF68 */ void DMACallback();
|
||||
/* 8029CFBC */ void DSPCallback(void*);
|
||||
/* 8029D028 */ ~JASAudioThread();
|
||||
/* 8029CDEC */ virtual void* run();
|
||||
/* 8029CF68 */ static void DMACallback();
|
||||
/* 8029CFBC */ static void DSPCallback(void*);
|
||||
/* 8029D028 */ virtual ~JASAudioThread() {}
|
||||
|
||||
static u8 snIntCount[4 + 4 /* padding */];
|
||||
/* 0x7c */ OSThreadQueue sThreadQueue;
|
||||
/* 0x84 */ bool sbPauseFlag; // type unsure
|
||||
|
||||
static volatile int snIntCount; // type unsure
|
||||
};
|
||||
|
||||
#endif /* JASAUDIOTHREAD_H */
|
||||
|
||||
@@ -19,6 +19,13 @@ struct JASDriver {
|
||||
/* 8029E2D0 */ void DSPSyncCallback();
|
||||
/* 8029E2F8 */ void updateDacCallback();
|
||||
/* 8029C9F0 */ static u32 getSubFrames();
|
||||
static void initAI(void (*)());
|
||||
static void startDMA();
|
||||
static void stopDMA();
|
||||
static void updateDac();
|
||||
static void updateDacCallback();
|
||||
static void finishDSPFrame();
|
||||
static void updateDSP();
|
||||
|
||||
static u8 sDspSyncCallback[256];
|
||||
static u8 sSubFrameCallback[256];
|
||||
|
||||
@@ -10,8 +10,12 @@ public:
|
||||
sInstance = inst;
|
||||
}
|
||||
|
||||
JASGlobalInstance(bool param_1) {
|
||||
sInstance = (T*)this;
|
||||
}
|
||||
|
||||
~JASGlobalInstance() {
|
||||
if (this == sInstance) {
|
||||
if (sInstance == (T*)this) {
|
||||
sInstance = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,21 @@ public:
|
||||
/* 8029627C */ bool ret();
|
||||
/* 802962B0 */ int readMidiValue();
|
||||
|
||||
void jump(u32 param_1) {
|
||||
field_0x04 = (u8*)field_0x00 + param_1;
|
||||
}
|
||||
|
||||
void jump(void* param_1) {
|
||||
field_0x04 = (u8*)param_1;
|
||||
}
|
||||
|
||||
u32 get24(int param_0) {
|
||||
return (*(u32*)((int)field_0x00 + param_0 - 1)) & 0xffffff;
|
||||
}
|
||||
|
||||
u32* getBase() { return field_0x00; }
|
||||
u8* getCur() { return field_0x04; }
|
||||
|
||||
u8 readByte() {
|
||||
u8* tmp = field_0x04;
|
||||
field_0x04 += 1;
|
||||
|
||||
@@ -70,7 +70,7 @@ struct JASTrack {
|
||||
/* 80291F38 */ void noteOn(u32, u32, u32);
|
||||
/* 80292008 */ void gateOn(u32, u32, f32, u32);
|
||||
/* 80292198 */ void noteOff(u32, u16);
|
||||
/* 80292220 */ void checkNoteStop(u32) const;
|
||||
/* 80292220 */ bool checkNoteStop(u32) const;
|
||||
/* 8029226C */ void overwriteOsc(JASChannel*);
|
||||
/* 802922D8 */ void updateTimedParam();
|
||||
/* 80292348 */ void updateTrack(f32);
|
||||
|
||||
@@ -72,11 +72,7 @@ public:
|
||||
s32 getCurrentHeapError() const { return mCurrentHeapError; }
|
||||
|
||||
void setCurrentHeap(JKRHeap* heap) {
|
||||
if (!heap) {
|
||||
heap = JKRHeap::getCurrentHeap();
|
||||
}
|
||||
|
||||
mCurrentHeap = heap;
|
||||
mCurrentHeap = heap ? heap : JKRHeap::getCurrentHeap();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
@@ -18,6 +18,9 @@ public:
|
||||
/* 8003FB70 */ static void create();
|
||||
/* 8003FBD0 */ static void reset();
|
||||
/* 8003FC70 */ static void remove();
|
||||
static dDrawPath_c::room_class* getRoomPointer(int layerNo, int roomNo) {
|
||||
return (mLayerList + 0x40*layerNo)[roomNo];
|
||||
}
|
||||
|
||||
static dDrawPath_c::room_class** mLayerList; // this doesn't seem right, but can't figure it out atm
|
||||
static f32 mMinX;
|
||||
@@ -92,7 +95,7 @@ public:
|
||||
/* 8003FFC4 */ virtual void postDrawPath();
|
||||
/* 800402C0 */ virtual bool isDrawPath();
|
||||
/* 8003FE4C */ virtual GXColor* getBackColor() const;
|
||||
/* 800402E0 */ virtual bool getFirstDrawLayerNo();
|
||||
/* 800402E0 */ virtual int getFirstDrawLayerNo();
|
||||
/* 800402E8 */ virtual int getNextDrawLayerNo(int);
|
||||
/* 800409E0 */ virtual bool isDrawIconSingle(dTres_c::data_s const*, int, int, bool, bool,
|
||||
Vec const*) const;
|
||||
|
||||
Reference in New Issue
Block a user