mirror of
https://github.com/SMGCommunity/Petari.git
synced 2024-11-27 15:30:44 +00:00
Almost done with JASTrack.o
This commit is contained in:
parent
d061d32d5f
commit
9fade8f824
@ -117,67 +117,67 @@ setPauseFlag__Q28JASTrack11TChannelMgrFb,JASTrack.o,JAudio2.a,true
|
||||
__sinit_\JASTrack_cpp,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q27JGadget13TLinkListNodeFv,JASTrack.o,JAudio2.a,true
|
||||
Push_back__Q27JGadget25TLinkList<8JASTrack,-584>FP8JASTrack,JASTrack.o,JAudio2.a,true
|
||||
end__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,false
|
||||
end__Q27JGadget13TNodeLinkListFv,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q37JGadget13TNodeLinkList8iteratorFPQ27JGadget13TLinkListNode,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFQ37JGadget13TNodeLinkList8iterator,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q37JGadget13TNodeLinkList8iteratorFRCQ37JGadget13TNodeLinkList8iterator,JASTrack.o,JAudio2.a,false
|
||||
Insert__Q27JGadget25TLinkList<8JASTrack,-584>FQ37JGadget25TLinkList<8JASTrack,-584>8iteratorP8JASTrack,JASTrack.o,JAudio2.a,false
|
||||
Element_toNode__Q27JGadget25TLinkList<8JASTrack,-584>FP8JASTrack,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFv,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q37JGadget13TNodeLinkList8iteratorFv,JASTrack.o,JAudio2.a,false
|
||||
begin__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,false
|
||||
begin__Q27JGadget13TNodeLinkListFv,JASTrack.o,JAudio2.a,false
|
||||
getNext__Q27JGadget13TLinkListNodeCFv,JASTrack.o,JAudio2.a,false
|
||||
__as__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFRCQ37JGadget25TLinkList<8JASTrack,-584>8iterator,JASTrack.o,JAudio2.a,false
|
||||
__as__Q27JGadget79TIterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>FRCQ27JGadget79TIterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>,JASTrack.o,JAudio2.a,false
|
||||
__as__Q23std78iterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>FRCQ23std78iterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>,JASTrack.o,JAudio2.a,false
|
||||
__pp__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFv,JASTrack.o,JAudio2.a,false
|
||||
__pp__Q37JGadget13TNodeLinkList8iteratorFv,JASTrack.o,JAudio2.a,false
|
||||
__rf__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorCFv,JASTrack.o,JAudio2.a,false
|
||||
__rf__Q37JGadget13TNodeLinkList8iteratorCFv,JASTrack.o,JAudio2.a,false
|
||||
Element_toValue__Q27JGadget25TLinkList<8JASTrack,-584>FPQ27JGadget13TLinkListNode,JASTrack.o,JAudio2.a,false
|
||||
__ml__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorCFv,JASTrack.o,JAudio2.a,false
|
||||
Remove__Q27JGadget25TLinkList<8JASTrack,-584>FP8JASTrack,JASTrack.o,JAudio2.a,false
|
||||
__ne__7JGadgetFQ37JGadget25TLinkList<8JASTrack,-584>8iteratorQ37JGadget25TLinkList<8JASTrack,-584>8iterator,JASTrack.o,JAudio2.a,false
|
||||
__eq__7JGadgetFQ37JGadget25TLinkList<8JASTrack,-584>8iteratorQ37JGadget25TLinkList<8JASTrack,-584>8iterator,JASTrack.o,JAudio2.a,false
|
||||
__eq__7JGadgetFQ37JGadget13TNodeLinkList8iteratorQ37JGadget13TNodeLinkList8iterator,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q27JGadget13TNodeLinkListFv,JASTrack.o,JAudio2.a,false
|
||||
__dt__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,false
|
||||
__dt__Q28JASTrack5TListFv,JASTrack.o,JAudio2.a,false
|
||||
__dl__58JASPoolAllocObject_MultiThreaded<Q28JASTrack11TChannelMgr>FPvUl,JASTrack.o,JAudio2.a,false
|
||||
free__50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>FPvUl,JASTrack.o,JAudio2.a,false
|
||||
__dl__43JASPoolAllocObject_MultiThreaded<8JASTrack>FPvUl,JASTrack.o,JAudio2.a,false
|
||||
free__35JASMemPool_MultiThreaded<8JASTrack>FPvUl,JASTrack.o,JAudio2.a,false
|
||||
__nw__58JASPoolAllocObject_MultiThreaded<Q28JASTrack11TChannelMgr>FUl,JASTrack.o,JAudio2.a,false
|
||||
alloc__50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>FUl,JASTrack.o,JAudio2.a,false
|
||||
__nw__43JASPoolAllocObject_MultiThreaded<8JASTrack>FUl,JASTrack.o,JAudio2.a,false
|
||||
alloc__35JASMemPool_MultiThreaded<8JASTrack>FUl,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q317JASThreadingModel71InterruptsDisable<50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>>4LockFRC50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q317JASThreadingModel56InterruptsDisable<35JASMemPool_MultiThreaded<8JASTrack>>4LockFRC35JASMemPool_MultiThreaded<8JASTrack>,JASTrack.o,JAudio2.a,false
|
||||
__ct__18JASCriticalSectionFv,JASTrack.o,JAudio2.a,false
|
||||
end__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,true
|
||||
end__Q27JGadget13TNodeLinkListFv,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q37JGadget13TNodeLinkList8iteratorFPQ27JGadget13TLinkListNode,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFQ37JGadget13TNodeLinkList8iterator,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q37JGadget13TNodeLinkList8iteratorFRCQ37JGadget13TNodeLinkList8iterator,JASTrack.o,JAudio2.a,true
|
||||
Insert__Q27JGadget25TLinkList<8JASTrack,-584>FQ37JGadget25TLinkList<8JASTrack,-584>8iteratorP8JASTrack,JASTrack.o,JAudio2.a,true
|
||||
Element_toNode__Q27JGadget25TLinkList<8JASTrack,-584>FP8JASTrack,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFv,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q37JGadget13TNodeLinkList8iteratorFv,JASTrack.o,JAudio2.a,true
|
||||
begin__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,true
|
||||
begin__Q27JGadget13TNodeLinkListFv,JASTrack.o,JAudio2.a,true
|
||||
getNext__Q27JGadget13TLinkListNodeCFv,JASTrack.o,JAudio2.a,true
|
||||
__as__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFRCQ37JGadget25TLinkList<8JASTrack,-584>8iterator,JASTrack.o,JAudio2.a,true
|
||||
__as__Q27JGadget79TIterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>FRCQ27JGadget79TIterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>,JASTrack.o,JAudio2.a,true
|
||||
__as__Q23std78iterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>FRCQ23std78iterator<Q23std26bidirectional_iterator_tag,8JASTrack,l,P8JASTrack,R8JASTrack>,JASTrack.o,JAudio2.a,true
|
||||
__pp__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorFv,JASTrack.o,JAudio2.a,true
|
||||
__pp__Q37JGadget13TNodeLinkList8iteratorFv,JASTrack.o,JAudio2.a,true
|
||||
__rf__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorCFv,JASTrack.o,JAudio2.a,true
|
||||
__rf__Q37JGadget13TNodeLinkList8iteratorCFv,JASTrack.o,JAudio2.a,true
|
||||
Element_toValue__Q27JGadget25TLinkList<8JASTrack,-584>FPQ27JGadget13TLinkListNode,JASTrack.o,JAudio2.a,true
|
||||
__ml__Q37JGadget25TLinkList<8JASTrack,-584>8iteratorCFv,JASTrack.o,JAudio2.a,true
|
||||
Remove__Q27JGadget25TLinkList<8JASTrack,-584>FP8JASTrack,JASTrack.o,JAudio2.a,true
|
||||
__ne__7JGadgetFQ37JGadget25TLinkList<8JASTrack,-584>8iteratorQ37JGadget25TLinkList<8JASTrack,-584>8iterator,JASTrack.o,JAudio2.a,true
|
||||
__eq__7JGadgetFQ37JGadget25TLinkList<8JASTrack,-584>8iteratorQ37JGadget25TLinkList<8JASTrack,-584>8iterator,JASTrack.o,JAudio2.a,true
|
||||
__eq__7JGadgetFQ37JGadget13TNodeLinkList8iteratorQ37JGadget13TNodeLinkList8iterator,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q27JGadget13TNodeLinkListFv,JASTrack.o,JAudio2.a,true
|
||||
__dt__Q27JGadget25TLinkList<8JASTrack,-584>Fv,JASTrack.o,JAudio2.a,true
|
||||
__dt__Q28JASTrack5TListFv,JASTrack.o,JAudio2.a,true
|
||||
__dl__58JASPoolAllocObject_MultiThreaded<Q28JASTrack11TChannelMgr>FPvUl,JASTrack.o,JAudio2.a,true
|
||||
free__50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>FPvUl,JASTrack.o,JAudio2.a,true
|
||||
__dl__43JASPoolAllocObject_MultiThreaded<8JASTrack>FPvUl,JASTrack.o,JAudio2.a,true
|
||||
free__35JASMemPool_MultiThreaded<8JASTrack>FPvUl,JASTrack.o,JAudio2.a,true
|
||||
__nw__58JASPoolAllocObject_MultiThreaded<Q28JASTrack11TChannelMgr>FUl,JASTrack.o,JAudio2.a,true
|
||||
alloc__50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>FUl,JASTrack.o,JAudio2.a,true
|
||||
__nw__43JASPoolAllocObject_MultiThreaded<8JASTrack>FUl,JASTrack.o,JAudio2.a,true
|
||||
alloc__35JASMemPool_MultiThreaded<8JASTrack>FUl,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q317JASThreadingModel71InterruptsDisable<50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>>4LockFRC50JASMemPool_MultiThreaded<Q28JASTrack11TChannelMgr>,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q317JASThreadingModel56InterruptsDisable<35JASMemPool_MultiThreaded<8JASTrack>>4LockFRC35JASMemPool_MultiThreaded<8JASTrack>,JASTrack.o,JAudio2.a,true
|
||||
__ct__18JASCriticalSectionFv,JASTrack.o,JAudio2.a,true
|
||||
get__21JASPtrTable<7JASBank>CFUl,JASTrack.o,JAudio2.a,false
|
||||
__ct__25JASPtrArray<7JASBank,256>Fv,JASTrack.o,JAudio2.a,false
|
||||
__ct__21JASPtrTable<7JASBank>FPP7JASBankUl,JASTrack.o,JAudio2.a,false
|
||||
__ct__40JASGlobalInstance<19JASDefaultBankTable>Fb,JASTrack.o,JAudio2.a,false
|
||||
__dt__40JASGlobalInstance<19JASDefaultBankTable>Fv,JASTrack.o,JAudio2.a,false
|
||||
__dt__19JASDefaultBankTableFv,JASTrack.o,JAudio2.a,false
|
||||
setUpdateTimer__10JASChannelFUl,JASTrack.o,JAudio2.a,false
|
||||
setKey__10JASChannelFl,JASTrack.o,JAudio2.a,false
|
||||
setVelocity__10JASChannelFUl,JASTrack.o,JAudio2.a,false
|
||||
setVibrate__10JASChannelFff,JASTrack.o,JAudio2.a,false
|
||||
setTremolo__10JASChannelFff,JASTrack.o,JAudio2.a,false
|
||||
__ct__25JASPtrArray<7JASBank,256>Fv,JASTrack.o,JAudio2.a,true
|
||||
__ct__21JASPtrTable<7JASBank>FPP7JASBankUl,JASTrack.o,JAudio2.a,true
|
||||
__ct__40JASGlobalInstance<19JASDefaultBankTable>Fb,JASTrack.o,JAudio2.a,true
|
||||
__dt__40JASGlobalInstance<19JASDefaultBankTable>Fv,JASTrack.o,JAudio2.a,true
|
||||
__dt__19JASDefaultBankTableFv,JASTrack.o,JAudio2.a,true
|
||||
setUpdateTimer__10JASChannelFUl,JASTrack.o,JAudio2.a,true
|
||||
setKey__10JASChannelFl,JASTrack.o,JAudio2.a,true
|
||||
setVelocity__10JASChannelFUl,JASTrack.o,JAudio2.a,true
|
||||
setVibrate__10JASChannelFff,JASTrack.o,JAudio2.a,true
|
||||
setTremolo__10JASChannelFff,JASTrack.o,JAudio2.a,true
|
||||
__ct__16JASChannelParamsFv,JASTrack.o,JAudio2.a,true
|
||||
init__16JASChannelParamsFv,JASTrack.o,JAudio2.a,true
|
||||
setPauseFlag__10JASChannelFb,JASTrack.o,JAudio2.a,false
|
||||
setDepth__6JASLfoFf,JASTrack.o,JAudio2.a,false
|
||||
setPitch__6JASLfoFf,JASTrack.o,JAudio2.a,false
|
||||
getBank__17JASBankTable<256>CFUl,JASTrack.o,JAudio2.a,false
|
||||
__ct__19JASDefaultBankTableFv,JASTrack.o,JAudio2.a,false
|
||||
__ct__17JASBankTable<256>Fv,JASTrack.o,JAudio2.a,false
|
||||
__ct__11JASBankListFv,JASTrack.o,JAudio2.a,false
|
||||
__ct__Q28JASTrack5TListFv,JASTrack.o,JAudio2.a,false
|
||||
setPauseFlag__10JASChannelFb,JASTrack.o,JAudio2.a,true
|
||||
setDepth__6JASLfoFf,JASTrack.o,JAudio2.a,true
|
||||
setPitch__6JASLfoFf,JASTrack.o,JAudio2.a,true
|
||||
getBank__17JASBankTable<256>CFUl,JASTrack.o,JAudio2.a,true
|
||||
__ct__19JASDefaultBankTableFv,JASTrack.o,JAudio2.a,true
|
||||
__ct__17JASBankTable<256>Fv,JASTrack.o,JAudio2.a,true
|
||||
__ct__11JASBankListFv,JASTrack.o,JAudio2.a,true
|
||||
__ct__Q28JASTrack5TListFv,JASTrack.o,JAudio2.a,true
|
||||
init__12JASTrackPortFv,JASTrackPort.o,JAudio2.a,true
|
||||
readImport__12JASTrackPortFUl,JASTrackPort.o,JAudio2.a,true
|
||||
readExport__12JASTrackPortFUl,JASTrackPort.o,JAudio2.a,true
|
||||
|
|
@ -5,4 +5,4 @@ splice__Q27JGadget13TNodeLinkListFQ37JGadget13TNodeLinkList8iteratorRQ27JGadget1
|
||||
Insert__Q27JGadget13TNodeLinkListFQ37JGadget13TNodeLinkList8iteratorPQ27JGadget13TLinkListNode,linklist.o,JGadget.a,false
|
||||
Erase__Q27JGadget13TNodeLinkListFPQ27JGadget13TLinkListNode,linklist.o,JGadget.a,false
|
||||
Remove__Q27JGadget13TNodeLinkListFPQ27JGadget13TLinkListNode,linklist.o,JGadget.a,false
|
||||
Initialize___Q27JGadget13TNodeLinkListFv,linklist.o,JGadget.a,false
|
||||
Initialize___Q27JGadget13TNodeLinkListFv,linklist.o,JGadget.a,true
|
||||
|
|
@ -2,20 +2,31 @@
|
||||
|
||||
#include <revolution.h>
|
||||
#include "JSystem/JAudio2/JASOscillator.h"
|
||||
#include "JSystem/JAudio2/JASLfo.h"
|
||||
|
||||
class JASChannel {
|
||||
public:
|
||||
void setKey(s32);
|
||||
void setVelocity(u32);
|
||||
void setUpdateTimer(u32);
|
||||
void setKeySweepTarget(s32, u32);
|
||||
void setOscInit(u32, const JASOscillator::Data *);
|
||||
void setVibrate(f32, f32);
|
||||
void setTremolo(f32, f32);
|
||||
void setParams(const JASChannelParams &);
|
||||
void release(u16);
|
||||
void free();
|
||||
void setPauseFlag(bool);
|
||||
u8 _0[0xE1];
|
||||
void setKey(s32) NO_INLINE;
|
||||
void setVelocity(u32) NO_INLINE;
|
||||
void setUpdateTimer(u32) NO_INLINE;
|
||||
void setKeySweepTarget(s32, u32) NO_INLINE;
|
||||
void setOscInit(u32, const JASOscillator::Data *) NO_INLINE;
|
||||
void setVibrate(f32, f32) NO_INLINE;
|
||||
void setTremolo(f32, f32) NO_INLINE;
|
||||
void setParams(const JASChannelParams &) NO_INLINE;
|
||||
void release(u16) NO_INLINE;
|
||||
void free() NO_INLINE;
|
||||
void setPauseFlag(bool) NO_INLINE;
|
||||
u32 _0;
|
||||
bool _4;
|
||||
u8 _5[0xf];
|
||||
u32 _14;
|
||||
u8 _18[0x44];
|
||||
JASLfo _5C;
|
||||
JASLfo _74;
|
||||
u8 _8C[0x3C];
|
||||
s16 _C8;
|
||||
u16 _CA;
|
||||
u8 _CC[0x15];
|
||||
u8 _E1;
|
||||
};
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
#include <revolution.h>
|
||||
|
||||
#include "JSystem/JAudio2/JASTaskThread.h"
|
||||
|
||||
class JASGenericMemPool {
|
||||
public:
|
||||
JASGenericMemPool();
|
||||
@ -36,7 +38,18 @@ public:
|
||||
template<typename T>
|
||||
class JASMemPool_MultiThreaded : public JASGenericMemPool {
|
||||
public:
|
||||
void *alloc(u32);
|
||||
void *alloc(u32 size) NO_INLINE {
|
||||
{
|
||||
JASThreadingModel::InterruptsDisable<JASMemPool_MultiThreaded>::Lock lock(*this);
|
||||
return JASGenericMemPool::alloc(size);
|
||||
}
|
||||
}
|
||||
void free(void *addr, u32 size) NO_INLINE {
|
||||
{
|
||||
JASThreadingModel::InterruptsDisable<JASMemPool_MultiThreaded>::Lock lock(*this);
|
||||
JASGenericMemPool::free(addr, size);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
@ -44,6 +57,10 @@ class JASPoolAllocObject_MultiThreaded {
|
||||
public:
|
||||
static JASMemPool_MultiThreaded<T> memPool_;
|
||||
|
||||
static void* operator new(u32 size) {return memPool_.alloc(size);}
|
||||
static void operator delete(void *, u32);
|
||||
static void* operator new(u32 size) NO_INLINE {
|
||||
return memPool_.alloc(size);
|
||||
}
|
||||
static void operator delete(void *addr, u32 size) NO_INLINE {
|
||||
memPool_.free(addr, size);
|
||||
}
|
||||
};
|
17
libs/JSystem/include/JSystem/JAudio2/JASLfo.h
Normal file
17
libs/JSystem/include/JSystem/JAudio2/JASLfo.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution/types.h>
|
||||
|
||||
class JASLfo {
|
||||
public:
|
||||
void setDepth(f32) NO_INLINE;
|
||||
void setPitch(f32) NO_INLINE;
|
||||
|
||||
u32 _0;
|
||||
u32 _4;
|
||||
f32 _8;
|
||||
f32 _C;
|
||||
f32 _10;
|
||||
u16 _14;
|
||||
u16 _16;
|
||||
};
|
17
libs/JSystem/include/JSystem/JAudio2/JASTaskThread.h
Normal file
17
libs/JSystem/include/JSystem/JAudio2/JASTaskThread.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution/os.h>
|
||||
|
||||
namespace JASThreadingModel {
|
||||
template<typename T>
|
||||
class InterruptsDisable {
|
||||
public:
|
||||
struct Lock {
|
||||
Lock(const T &) NO_INLINE {
|
||||
success = OSDisableInterrupts();
|
||||
}
|
||||
~Lock() NO_INLINE;
|
||||
u32 success;
|
||||
};
|
||||
};
|
||||
}
|
@ -10,10 +10,73 @@
|
||||
#include "JSystem/JAudio2/JASBank.h"
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
#include "JSystem/JAudio2/JASHeapCtrl.h"
|
||||
#include <mem.h>
|
||||
|
||||
template<typename T>
|
||||
class JASGlobalInstance {
|
||||
public:
|
||||
static T *sInstance;
|
||||
|
||||
JASGlobalInstance(bool flag) NO_INLINE {
|
||||
if(!flag) return;
|
||||
/*T *instance = (T *)this;
|
||||
if(this) instance = (T *)((u8 *)this - sizeof(T));*/
|
||||
sInstance = (T *)this;
|
||||
}
|
||||
|
||||
~JASGlobalInstance() NO_INLINE {
|
||||
if(sInstance == (T *)this) sInstance = nullptr;
|
||||
};
|
||||
};
|
||||
|
||||
class JASSoundParams;
|
||||
class JASChannel;
|
||||
|
||||
template<typename T>
|
||||
class JASPtrTable {
|
||||
public:
|
||||
JASPtrTable(T **ptrTable, u32 len) NO_INLINE {
|
||||
mLen = len;
|
||||
mPtrTable = ptrTable;
|
||||
memset(mPtrTable, 0, len * sizeof(T *));
|
||||
}
|
||||
T* get(u32 idx) const NO_INLINE {
|
||||
if(idx >= mLen) return nullptr;
|
||||
return mPtrTable[idx];
|
||||
}
|
||||
|
||||
T **mPtrTable; // _0
|
||||
u32 mLen; // _4
|
||||
};
|
||||
|
||||
template<typename T, u32 LEN>
|
||||
class JASPtrArray : public JASPtrTable<T> {
|
||||
public:
|
||||
JASPtrArray() NO_INLINE : JASPtrTable(mPtrArray, LEN) {}
|
||||
T *mPtrArray[LEN];
|
||||
};
|
||||
|
||||
class JASBankList {
|
||||
public:
|
||||
JASBankList();
|
||||
|
||||
virtual JASBank* getBank(u32) const = 0;
|
||||
};
|
||||
|
||||
template<u32 LEN>
|
||||
class JASBankTable : public JASBankList {
|
||||
public:
|
||||
JASBankTable() NO_INLINE : JASBankList(), mBanks() {
|
||||
|
||||
}
|
||||
|
||||
virtual JASBank* getBank(u32 idx) const NO_INLINE {
|
||||
return mBanks.get(idx);
|
||||
}
|
||||
|
||||
JASPtrArray<JASBank, LEN> mBanks;
|
||||
};
|
||||
|
||||
class JASChannelParams {
|
||||
public:
|
||||
JASChannelParams();
|
||||
@ -23,15 +86,16 @@ public:
|
||||
|
||||
class JASCriticalSection {
|
||||
public:
|
||||
JASCriticalSection();
|
||||
~JASCriticalSection();
|
||||
u8 _0[8];
|
||||
JASCriticalSection() NO_INLINE;
|
||||
inline JASCriticalSection(const JASCriticalSection &rOther) : success(rOther.success) {}
|
||||
~JASCriticalSection() NO_INLINE;
|
||||
u32 success;
|
||||
};
|
||||
|
||||
struct JASDefaultBankTable {
|
||||
class JASDefaultBankTable : public JASBankTable<0x100>, public JASGlobalInstance<JASDefaultBankTable> {
|
||||
public:
|
||||
JASDefaultBankTable();
|
||||
~JASDefaultBankTable();
|
||||
u8 _40C[0x40C];
|
||||
};
|
||||
|
||||
class JASTrack : public JASSeqCtrl, public JASPoolAllocObject_MultiThreaded<JASTrack> {
|
||||
@ -197,17 +261,19 @@ public:
|
||||
static TList sTrackList;
|
||||
};
|
||||
|
||||
struct JASTrack::TList : public JGADGET_LINK_LIST(JASTrack, _248) {
|
||||
struct JASTrack::TList {
|
||||
TList();
|
||||
~TList();
|
||||
|
||||
static s32 cbSeqMain(void *);
|
||||
void append(JASTrack *);
|
||||
void seqMain();
|
||||
u8 _0[0xC];
|
||||
JGADGET_LINK_LIST(JASTrack, _248) _0;
|
||||
bool _C;
|
||||
};
|
||||
|
||||
namespace JGadget {
|
||||
bool operator!=(JGADGET_LINK_LIST(JASTrack, _248)::iterator, JGADGET_LINK_LIST(JASTrack, _248)::iterator);
|
||||
bool operator!=(JGADGET_LINK_LIST(JASTrack, _248)::iterator, JGADGET_LINK_LIST(JASTrack, _248)::iterator) NO_INLINE;
|
||||
bool operator==(JGADGET_LINK_LIST(JASTrack, _248)::iterator, JGADGET_LINK_LIST(JASTrack, _248)::iterator) NO_INLINE;
|
||||
bool operator==(TNodeLinkList::iterator, TNodeLinkList::iterator) NO_INLINE;
|
||||
}
|
@ -1,34 +1,146 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <revolution/types.h>
|
||||
|
||||
#define JGADGET_LINK_LIST(type, node) JGadget::TLinkList<type, -offsetof(type, node)>
|
||||
|
||||
namespace JGadget {
|
||||
template<typename T, int Offset>
|
||||
class TLinkList {
|
||||
namespace std {
|
||||
struct input_iterator_tag {};
|
||||
struct forward_iterator_tag : public input_iterator_tag {};
|
||||
struct bidirectional_iterator_tag : public forward_iterator_tag {};
|
||||
template<
|
||||
typename Category,
|
||||
typename T,
|
||||
typename Distance = s32,
|
||||
typename Pointer = T*,
|
||||
typename Reference = T&
|
||||
>
|
||||
class iterator {
|
||||
public:
|
||||
struct iterator {
|
||||
iterator();
|
||||
const iterator& operator=(const iterator &);
|
||||
iterator& operator++();
|
||||
T* operator->() const;
|
||||
T* operator*() const;
|
||||
u32 _0;
|
||||
};
|
||||
iterator begin();
|
||||
iterator end();
|
||||
void Push_back(T *element) NO_INLINE {
|
||||
Insert(end(), element);
|
||||
typedef Category iterator_category;
|
||||
typedef T value_type;
|
||||
typedef Distance difference_type;
|
||||
typedef Pointer pointer;
|
||||
typedef Reference reference;
|
||||
iterator& operator=(const iterator &rOther) NO_INLINE {return *this;}
|
||||
};
|
||||
}
|
||||
|
||||
namespace JGadget {
|
||||
template<
|
||||
typename Category,
|
||||
typename T,
|
||||
typename Distance = s32,
|
||||
typename Pointer = T*,
|
||||
typename Reference = T&
|
||||
>
|
||||
class TIterator : std::iterator<Category, T, Distance, Pointer, Reference> {
|
||||
public:
|
||||
const TIterator& operator=(const TIterator &rOther) NO_INLINE {
|
||||
std::iterator<Category, T, Distance, Pointer, Reference>::operator=(rOther);
|
||||
return *this;
|
||||
}
|
||||
void Insert(iterator, JASTrack *);
|
||||
void Remove(T*);
|
||||
};
|
||||
class TLinkListNode {
|
||||
public:
|
||||
TLinkListNode();
|
||||
|
||||
TLinkListNode *mPrev;
|
||||
TLinkListNode() NO_INLINE;
|
||||
TLinkListNode* getNext() const NO_INLINE;
|
||||
TLinkListNode *mNext;
|
||||
TLinkListNode *mPrev;
|
||||
};
|
||||
class TNodeLinkList {
|
||||
public:
|
||||
struct iterator {
|
||||
struct iteratorData {
|
||||
TLinkListNode *curr;
|
||||
inline iteratorData(TLinkListNode *curr) : curr(curr) {}
|
||||
};
|
||||
iterator() NO_INLINE;
|
||||
inline iterator(iteratorData data) : curr(data.curr) {}
|
||||
iterator(TLinkListNode *) NO_INLINE;
|
||||
iterator(const iterator &) NO_INLINE;
|
||||
iterator& operator++() NO_INLINE;
|
||||
TLinkListNode* operator->() const NO_INLINE;
|
||||
TLinkListNode *curr;
|
||||
};
|
||||
TNodeLinkList() NO_INLINE;
|
||||
~TNodeLinkList();
|
||||
void Initialize_() NO_INLINE;
|
||||
iterator::iteratorData begin() NO_INLINE;
|
||||
iterator::iteratorData end() NO_INLINE;
|
||||
iterator::iteratorData Insert(iterator, TLinkListNode *);
|
||||
void Remove(TLinkListNode *);
|
||||
u32 _0;
|
||||
TLinkListNode mEnd;
|
||||
};
|
||||
template<typename T, int NODE_OFFSET>
|
||||
class TLinkList : public TNodeLinkList {
|
||||
public:
|
||||
struct iterator :
|
||||
public TIterator<std::bidirectional_iterator_tag, T>,
|
||||
public TNodeLinkList::iterator
|
||||
{
|
||||
struct iteratorData : TNodeLinkList::iterator::iteratorData {
|
||||
inline iteratorData(TLinkListNode *curr) : TNodeLinkList::iterator::iteratorData(curr) {}
|
||||
};
|
||||
inline iterator(iteratorData data) : TNodeLinkList::iterator(data) {}
|
||||
iterator() NO_INLINE : TNodeLinkList::iterator() {}
|
||||
inline iterator(TLinkListNode *iter) : curr(iter) {}
|
||||
iterator(TNodeLinkList::iterator iter) NO_INLINE : TNodeLinkList::iterator(iter) {}
|
||||
iterator(const iterator &rOther) {
|
||||
curr = rOther.curr;
|
||||
}
|
||||
const iterator& operator=(const iterator &rOther) NO_INLINE {
|
||||
TIterator<std::bidirectional_iterator_tag, T>::operator=(rOther);
|
||||
curr = rOther.curr;
|
||||
return *this;
|
||||
}
|
||||
iterator& operator++() NO_INLINE {
|
||||
TNodeLinkList::iterator::operator++();
|
||||
return *this;
|
||||
}
|
||||
T* operator->() const NO_INLINE {
|
||||
return TLinkList<T, NODE_OFFSET>::Element_toValue (
|
||||
TNodeLinkList::iterator::operator->()
|
||||
);
|
||||
}
|
||||
T* operator*() const NO_INLINE {
|
||||
return operator->();
|
||||
}
|
||||
};
|
||||
|
||||
TLinkList() NO_INLINE : TNodeLinkList() {}
|
||||
|
||||
~TLinkList() NO_INLINE {};
|
||||
|
||||
iterator::iteratorData begin() NO_INLINE {
|
||||
return iterator::iteratorData(
|
||||
iterator(
|
||||
TNodeLinkList::iterator(
|
||||
TNodeLinkList::begin()
|
||||
)
|
||||
).curr
|
||||
);
|
||||
}
|
||||
|
||||
iterator::iteratorData end() NO_INLINE {
|
||||
return iterator::iteratorData(iterator(TNodeLinkList::end()).curr);
|
||||
}
|
||||
void Push_back(T *element) NO_INLINE {
|
||||
Insert(iterator(end()), element);
|
||||
}
|
||||
iterator::iteratorData Insert(iterator pos, T *element) NO_INLINE {
|
||||
return iterator::iteratorData(iterator(TNodeLinkList::iterator(TNodeLinkList::Insert(pos, Element_toNode(element)))).curr);
|
||||
}
|
||||
static TLinkListNode* Element_toNode(T *element) NO_INLINE {
|
||||
return (TLinkListNode *)((u8 *)element - NODE_OFFSET);
|
||||
}
|
||||
static T* Element_toValue(TLinkListNode *element) NO_INLINE {
|
||||
return (T *)((u8 *)element + NODE_OFFSET);
|
||||
}
|
||||
void Remove(T* element) NO_INLINE {
|
||||
TNodeLinkList::Remove(Element_toNode(element));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -3,7 +3,10 @@
|
||||
#include "JSystem/JAudio2/JASSoundParams.h"
|
||||
#include "JSystem/JAudio2/JASAiCtrl.h"
|
||||
#include "JSystem/JAudio2/JASDriverIF.h"
|
||||
#include "JSystem/JAudio2/JASLfo.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <revolution/os.h>
|
||||
|
||||
static const JASOscillator::Point data[4] = {
|
||||
{0, 0, 0x7fff},
|
||||
@ -644,16 +647,16 @@ void JASTrack::TList::append(JASTrack *track) {
|
||||
if(!JASDriver::registerSubFrameCallback(cbSeqMain, this)) return;
|
||||
_C = true;
|
||||
}
|
||||
Push_back(track);
|
||||
_0.Push_back(track);
|
||||
}
|
||||
|
||||
void JASTrack::TList::seqMain() {
|
||||
iterator iter, next;
|
||||
for(iter = begin(); iter != end(); iter = next) {
|
||||
JGADGET_LINK_LIST(JASTrack, _248)::iterator iter, next;
|
||||
for(iter = JGADGET_LINK_LIST(JASTrack, _248)::iterator(_0.begin()); iter != JGADGET_LINK_LIST(JASTrack, _248)::iterator(_0.end()); iter = next) {
|
||||
next = iter;
|
||||
++next;
|
||||
if(iter->seqMain() < 0) {
|
||||
Remove(*iter);
|
||||
_0.Remove(*iter);
|
||||
if(iter->_244._3) delete *iter;
|
||||
}
|
||||
}
|
||||
@ -717,11 +720,95 @@ template<typename T>
|
||||
JASMemPool_MultiThreaded<T> JASPoolAllocObject_MultiThreaded<T>::memPool_ = JASMemPool_MultiThreaded<T>();
|
||||
|
||||
namespace JGadget {
|
||||
|
||||
TLinkListNode::TLinkListNode() : mPrev(nullptr), mNext(nullptr) {}
|
||||
|
||||
TNodeLinkList::iterator::iteratorData TNodeLinkList::end() {
|
||||
return iterator::iteratorData(iterator(&mEnd).curr);
|
||||
}
|
||||
|
||||
TNodeLinkList::iterator::iterator(TLinkListNode *node) {
|
||||
curr = node;
|
||||
}
|
||||
|
||||
TNodeLinkList::iterator::iterator(const TNodeLinkList::iterator &rOther) : curr(rOther.curr) {}
|
||||
|
||||
TNodeLinkList::iterator::iterator() {}
|
||||
|
||||
TNodeLinkList::iterator::iteratorData TNodeLinkList::begin() {
|
||||
return iterator::iteratorData(iterator(mEnd.getNext()).curr);
|
||||
}
|
||||
|
||||
TLinkListNode* TLinkListNode::getNext() const {
|
||||
return mNext;
|
||||
}
|
||||
|
||||
TNodeLinkList::iterator& TNodeLinkList::iterator::operator++() {
|
||||
curr = curr->getNext();
|
||||
return *this;
|
||||
}
|
||||
|
||||
TLinkListNode* TNodeLinkList::iterator::operator->() const {
|
||||
return curr;
|
||||
}
|
||||
|
||||
bool operator!= (
|
||||
JGADGET_LINK_LIST(JASTrack, _248)::iterator a,
|
||||
JGADGET_LINK_LIST(JASTrack, _248)::iterator b
|
||||
) {
|
||||
return !(a == b);
|
||||
}
|
||||
|
||||
bool operator== (
|
||||
JGADGET_LINK_LIST(JASTrack, _248)::iterator a,
|
||||
JGADGET_LINK_LIST(JASTrack, _248)::iterator b
|
||||
) {
|
||||
return (TNodeLinkList::iterator)a == (TNodeLinkList::iterator)b;
|
||||
}
|
||||
|
||||
bool operator==(TNodeLinkList::iterator a, TNodeLinkList::iterator b) {
|
||||
return a.curr == b.curr;
|
||||
}
|
||||
|
||||
TNodeLinkList::TNodeLinkList() : mEnd() {
|
||||
Initialize_();
|
||||
}
|
||||
}
|
||||
namespace JGadget {
|
||||
template class TLinkList<JASTrack, -584>;
|
||||
|
||||
JASTrack::TList::~TList() {}
|
||||
|
||||
JASTrack::TList::TList() : _0(), _C(false) {}
|
||||
|
||||
JASCriticalSection::JASCriticalSection() {
|
||||
success = OSDisableInterrupts();
|
||||
}
|
||||
|
||||
JASDefaultBankTable::JASDefaultBankTable() : JASBankTable(), JASGlobalInstance(true) {}
|
||||
|
||||
JASDefaultBankTable::~JASDefaultBankTable() {}
|
||||
|
||||
void JASChannel::setUpdateTimer(u32 timer) {
|
||||
_14 = timer;
|
||||
}
|
||||
|
||||
void JASChannel::setKey(s32 key) {
|
||||
_C8 = key;
|
||||
}
|
||||
|
||||
void JASChannel::setVelocity(u32 velocity) {
|
||||
_CA = velocity;
|
||||
}
|
||||
|
||||
void JASChannel::setVibrate(f32 a, f32 b) {
|
||||
_5C.setDepth(a);
|
||||
_5C.setPitch(b);
|
||||
}
|
||||
|
||||
void JASChannel::setTremolo(f32 a, f32 b) {
|
||||
_74.setDepth(a);
|
||||
_74.setPitch(b);
|
||||
}
|
||||
|
||||
void JASChannelParams::init() {
|
||||
_0[0] = 1f;
|
||||
_0[1] = 1f;
|
||||
@ -740,3 +827,16 @@ JASChannelParams::JASChannelParams() {
|
||||
_0[5] = 0f;
|
||||
}
|
||||
|
||||
void JASChannel::setPauseFlag(bool flag) {
|
||||
_4 = flag;
|
||||
}
|
||||
|
||||
void JASLfo::setDepth(f32 depth) {
|
||||
_C = depth;
|
||||
}
|
||||
|
||||
void JASLfo::setPitch(f32 pitch) {
|
||||
_10 = pitch;
|
||||
}
|
||||
|
||||
JASBankList::JASBankList() {}
|
||||
|
9
libs/JSystem/source/JSystem/JGadget/linklist.cpp
Normal file
9
libs/JSystem/source/JSystem/JGadget/linklist.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "JSystem/JGadget/linklist.h"
|
||||
|
||||
namespace JGadget {
|
||||
void TNodeLinkList::Initialize_() {
|
||||
_0 = 0;
|
||||
mEnd.mNext = &mEnd;
|
||||
mEnd.mPrev = &mEnd;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user