mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-29 16:44:40 -04:00
+1
-1
@@ -691,7 +691,7 @@ config.libs = [
|
||||
Object(NonMatching, "JSystem/JAudio/JASDSPChannel.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASDSPInterface.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASDriverIF.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASChGlobal.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASChGlobal.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASChAllocQueue.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASChannel.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASChannelMgr.cpp"),
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef JASCHALLOCQUEUE_H
|
||||
#define JASCHALLOCQUEUE_H
|
||||
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
namespace JASystem {
|
||||
class TChannel;
|
||||
namespace TDSPQueue {
|
||||
void deQueue();
|
||||
void enQueue(JASystem::TChannel*);
|
||||
int deleteQueue(JASystem::TChannel*);
|
||||
void checkQueue();
|
||||
|
||||
}
|
||||
|
||||
extern JSUList<TChannel> sDspQueueList;
|
||||
}
|
||||
|
||||
#endif /* JASCHALLOCQUEUE_H */
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef JASCHGLOBAL_H
|
||||
#define JASCHGLOBAL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JASystem {
|
||||
class TChannel;
|
||||
class TChannelMgr;
|
||||
class TOscillator;
|
||||
|
||||
namespace TGlobalChannel {
|
||||
TChannel* getChannelHandle(u32);
|
||||
void init();
|
||||
int alloc(TChannelMgr*, u32);
|
||||
int release(TChannel*);
|
||||
int releaseAll(TChannelMgr*);
|
||||
|
||||
extern TChannelMgr* sChannelMgr;
|
||||
extern TChannel* sChannel;
|
||||
extern TOscillator* sOscillator;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* JASCHGLOBAL_H */
|
||||
@@ -0,0 +1,105 @@
|
||||
#ifndef JASCHANNEL_H
|
||||
#define JASCHANNEL_H
|
||||
|
||||
#include "JSystem/JAudio/JASDriverIF.h"
|
||||
#include "JSystem/JAudio/JASOscillator.h"
|
||||
#include "JSystem/JSupport/JSUList.h"
|
||||
|
||||
namespace JASystem {
|
||||
class TChannelMgr;
|
||||
class TDSPChannel;
|
||||
namespace Driver {
|
||||
struct Wave_;
|
||||
}
|
||||
|
||||
class TChannel {
|
||||
public:
|
||||
TChannel() : field_0x4(NULL), field_0x8(NULL), field_0x20(NULL), field_0x24(NULL), field_0xd8(this) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
osc[i] = NULL;
|
||||
}
|
||||
}
|
||||
~TChannel() {}
|
||||
void init();
|
||||
void setOscillator(u32, TOscillator*);
|
||||
void setOscInit(u32, const TOscillator::Osc_*);
|
||||
bool forceStopOsc(u32);
|
||||
bool releaseOsc(u32);
|
||||
void directReleaseOsc(u32, u16);
|
||||
f32 bankOscToOfs(u32);
|
||||
void effectOsc(u32, f32);
|
||||
int getOscState(u32) const;
|
||||
bool isOsc(u32);
|
||||
void copyOsc(u32, TOscillator::Osc_*);
|
||||
void overwriteOsc(u32, TOscillator::Osc_*);
|
||||
void setKeySweepTarget(u8, u32);
|
||||
void setPauseFlag(u8);
|
||||
void setPauseFlagReq(u8);
|
||||
void setPanPower(f32, f32, f32, f32);
|
||||
BOOL checkLogicalChannel();
|
||||
bool play(u32);
|
||||
void stop(u16);
|
||||
void updateJcToDSP();
|
||||
bool forceStopLogicalChannel();
|
||||
bool stopLogicalChannel();
|
||||
int playLogicalChannel();
|
||||
void updateEffectorParam();
|
||||
static void killBrokenLogicalChannels(TDSPChannel*);
|
||||
static void updatecallDSPChannel(TDSPChannel*, u32);
|
||||
static f32 calcEffect(const Driver::PanMatrix_*, const Driver::PanMatrix_*, u8);
|
||||
static f32 calcPan(const Driver::PanMatrix_*, const Driver::PanMatrix_*, u8);
|
||||
void updateJcToDSPInit();
|
||||
void updateAutoMixer(f32, f32, f32, f32);
|
||||
void updateMixer(f32, f32, f32, f32);
|
||||
void extraUpdate(TChannel*, u32);
|
||||
static void updatecallLogicalChannel(TChannel*, u32);
|
||||
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x01 */ u8 field_0x1;
|
||||
/* 0x02 */ u8 mPauseFlag;
|
||||
/* 0x03 */ u8 field_0x3;
|
||||
/* 0x04 */ TChannelMgr* field_0x4;
|
||||
/* 0x08 */ TChannel** field_0x8;
|
||||
/* 0x0C */ u8 field_0xc;
|
||||
/* 0x10 */ Driver::Wave_* field_0x10;
|
||||
/* 0x14 */ int field_0x14;
|
||||
/* 0x18 */ int field_0x18;
|
||||
/* 0x1C */ int field_0x1c;
|
||||
/* 0x20 */ TDSPChannel* field_0x20;
|
||||
/* 0x24 */ TChannel* field_0x24;
|
||||
/* 0x28 */ void (*field_0x28)(TChannel*, u32);
|
||||
/* 0x2C */ int field_0x2c;
|
||||
/* 0x30 */ int field_0x30;
|
||||
/* 0x34 */ int field_0x34;
|
||||
/* 0x38 */ TOscillator* osc[4];
|
||||
/* 0x48 */ u32 field_0x48;
|
||||
/* 0x4C */ short field_0x4c;
|
||||
/* 0x50 */ f32 field_0x50;
|
||||
/* 0x54 */ int field_0x54;
|
||||
/* 0x58 */ f32 field_0x58;
|
||||
/* 0x5C */ f32 field_0x5c;
|
||||
/* 0x60 */ u8 field_0x60[3];
|
||||
/* 0x64 */ Driver::PanMatrix_ field_0x64;
|
||||
/* 0x70 */ Driver::PanMatrix_ field_0x70;
|
||||
/* 0x7C */ Driver::PanMatrix_ field_0x7c;
|
||||
/* 0x88 */ Driver::PanMatrix_ field_0x88;
|
||||
/* 0x94 */ f32 field_0x94;
|
||||
/* 0x98 */ f32 field_0x98;
|
||||
/* 0x9C */ f32 field_0x9c;
|
||||
/* 0xA0 */ u16 field_0xa0;
|
||||
/* 0xA2 */ u16 field_0xa2;
|
||||
/* 0xA4 */ TChannelMgr* field_0xa4;
|
||||
/* 0xA8 */ f32 field_0xa8;
|
||||
/* 0xAC */ f32 field_0xac;
|
||||
/* 0xB0 */ u16 field_0xb0[6];
|
||||
/* 0xBC */ u16 field_0xbc[6];
|
||||
/* 0xC8 */ u16 field_0xc8;
|
||||
/* 0xCC */ int field_0xcc;
|
||||
/* 0xD0 */ int field_0xd0;
|
||||
/* 0xD4 */ int field_0xd4;
|
||||
/* 0xD8 */ JSULink<TChannel> field_0xd8;
|
||||
/* 0xE8 */ int field_0xe8;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* JASCHANNEL_H */
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef JASCHANNELMGR_H
|
||||
#define JASCHANNELMGR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JASystem {
|
||||
class TChannel;
|
||||
|
||||
class TChannelMgr {
|
||||
public:
|
||||
void init();
|
||||
void stopAll();
|
||||
void stopAllRelease();
|
||||
void initAllocChannel(u32);
|
||||
TChannel* getLogicalChannel(u32);
|
||||
bool moveListHead(TChannel*, u32);
|
||||
bool moveListTail(TChannel*, u32);
|
||||
void addListHead(TChannel*, u32);
|
||||
void addListTail(TChannel*, u32);
|
||||
TChannel* getListHead(u32);
|
||||
int cutList(TChannel*);
|
||||
void receiveAllChannels(TChannelMgr*);
|
||||
int checkLimitStart(u32);
|
||||
void checkLimitStop(TChannel*, u32);
|
||||
|
||||
u32 field_0x0;
|
||||
int field_0x4;
|
||||
TChannel* field_0x8;
|
||||
TChannel* field_0xc;
|
||||
TChannel* field_0x10;
|
||||
TChannel* field_0x14;
|
||||
f32 field_0x18;
|
||||
f32 field_0x1c;
|
||||
f32 field_0x20;
|
||||
f32 field_0x24;
|
||||
f32 field_0x28;
|
||||
s16 field_0x2c[8];
|
||||
s16 field_0x3c[4];
|
||||
int field_0x44;
|
||||
int field_0x48;
|
||||
s16 field_0x4c;
|
||||
u16 field_0x4e[6];
|
||||
u8 field_0x5a[6];
|
||||
u8 field_0x60;
|
||||
u8 field_0x61;
|
||||
u8 field_0x62[3];
|
||||
int field_0x68;
|
||||
u16 field_0x6c;
|
||||
int field_0x70;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* JASCHANNELMGR_H */
|
||||
@@ -14,6 +14,11 @@ namespace JASystem {
|
||||
|
||||
class TDSPChannel {
|
||||
public:
|
||||
TDSPChannel() {
|
||||
field_0xc = NULL;
|
||||
mCallback = NULL;
|
||||
}
|
||||
~TDSPChannel() {}
|
||||
void init(u8);
|
||||
int allocate(u32);
|
||||
void free();
|
||||
@@ -26,13 +31,11 @@ namespace JASystem {
|
||||
static int free(TDSPChannel*, u32);
|
||||
static TDSPChannel* getLower();
|
||||
static TDSPChannel* getLowerActive();
|
||||
static bool breakLower(u8);
|
||||
static BOOL breakLower(u8);
|
||||
static bool breakLowerActive(u8);
|
||||
static void updateAll();
|
||||
void onUpdate(u32);
|
||||
static int getNumBreak();
|
||||
~TDSPChannel();
|
||||
TDSPChannel();
|
||||
|
||||
u8 getNumber() { return mNumber; }
|
||||
// TODO: inlines
|
||||
@@ -54,11 +57,11 @@ namespace JASystem {
|
||||
/* 0x01 */ u8 field_0x1;
|
||||
/* 0x02 */ u8 field_0x2;
|
||||
/* 0x03 */ u8 field_0x3;
|
||||
/* 0x04 */ short field_0x4;
|
||||
/* 0x06 */ short field_0x6;
|
||||
/* 0x04 */ u16 field_0x4;
|
||||
/* 0x06 */ u16 field_0x6;
|
||||
/* 0x08 */ int field_0x8;
|
||||
/* 0x0C */ DSPInterface::DSPBuffer* field_0xc;
|
||||
/* 0x10 */ void* mCallback;
|
||||
/* 0x10 */ int (*mCallback)(TDSPChannel*, u32);
|
||||
|
||||
static int smnFree;
|
||||
static TDSPChannel* DSPCH;
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace JASystem {
|
||||
/* 0x106 */ short field_0x106;
|
||||
/* 0x108 */ short field_0x108;
|
||||
/* 0x10A */ u16 field_0x10a;
|
||||
/* 0x10C */ int field_0x10c;
|
||||
/* 0x10C */ u32 field_0x10c;
|
||||
/* 0x110 */ int field_0x110;
|
||||
/* 0x114 */ int field_0x114;
|
||||
/* 0x118 */ int field_0x118;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#ifndef JASOSCILLATOR_H
|
||||
#define JASOSCILLATOR_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JASystem {
|
||||
class TOscillator {
|
||||
public:
|
||||
struct Osc_ {
|
||||
/* 0x00 */ u8 field_0x0;
|
||||
/* 0x04 */ f32 field_0x4;
|
||||
/* 0x08 */ u32 table;
|
||||
/* 0x0C */ int rel_table;
|
||||
/* 0x10 */ f32 field_0x10;
|
||||
/* 0x14 */ f32 field_0x14;
|
||||
};
|
||||
|
||||
TOscillator() { init(); }
|
||||
~TOscillator() {}
|
||||
void init();
|
||||
void initStart();
|
||||
f32 getOffset();
|
||||
bool forceStop();
|
||||
bool release();
|
||||
void calc(s16*);
|
||||
|
||||
/* 0x00 */ const Osc_* field_0x0;
|
||||
/* 0x04 */ u8 field_0x4;
|
||||
/* 0x05 */ u8 field_0x5;
|
||||
/* 0x06 */ short field_0x6;
|
||||
/* 0x08 */ f32 field_0x8;
|
||||
/* 0x0C */ f32 field_0xc;
|
||||
/* 0x10 */ f32 field_0x10;
|
||||
/* 0x14 */ f32 field_0x14;
|
||||
/* 0x18 */ u16 field_0x18;
|
||||
/* 0x1C */ f32 field_0x1c;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* JASOSCILLATOR_H */
|
||||
@@ -3,31 +3,76 @@
|
||||
// Translation Unit: JASChAllocQueue.cpp
|
||||
//
|
||||
|
||||
#include "JASChAllocQueue.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAudio/JASChAllocQueue.h"
|
||||
#include "JSystem/JAudio/JASChannel.h"
|
||||
#include "JSystem/JAudio/JASChannelMgr.h"
|
||||
#include "JSystem/JAudio/JASDSPChannel.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
JSUList<JASystem::TChannel> JASystem::sDspQueueList;
|
||||
|
||||
/* 8028B0C4-8028B224 .text deQueue__Q28JASystem9TDSPQueueFv */
|
||||
void JASystem::TDSPQueue::deQueue() {
|
||||
/* Nonmatching */
|
||||
JSULink<TChannel>* link;
|
||||
JSULink<TChannel>* next;
|
||||
u32 r31 = TDSPChannel::getNumBreak();
|
||||
for (link = sDspQueueList.getFirst(); link; link = next) {
|
||||
next = link->getNext();
|
||||
TChannel* channel = link->getObject();
|
||||
TDSPChannel* dspChannel = TDSPChannel::alloc(0, u32(channel));
|
||||
if (!dspChannel) {
|
||||
if (r31) {
|
||||
r31--;
|
||||
continue;
|
||||
}
|
||||
if (TDSPChannel::breakLower(channel->field_0x48)) {
|
||||
continue;
|
||||
}
|
||||
channel->field_0x28(channel, 6);
|
||||
sDspQueueList.remove(&channel->field_0xd8);
|
||||
} else {
|
||||
channel->field_0x20 = dspChannel;
|
||||
int status = channel->playLogicalChannel();
|
||||
JUT_ASSERT(69, status);
|
||||
int sst = channel->field_0x4->cutList(channel);
|
||||
JUT_ASSERT(72, sst >= 0);
|
||||
channel->field_0x4->addListTail(channel, 1);
|
||||
sDspQueueList.remove(&channel->field_0xd8);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028B224-8028B288 .text enQueue__Q28JASystem9TDSPQueueFPQ28JASystem8TChannel */
|
||||
void JASystem::TDSPQueue::enQueue(JASystem::TChannel*) {
|
||||
void JASystem::TDSPQueue::enQueue(TChannel* param_1) {
|
||||
/* Nonmatching */
|
||||
JSUListIterator<TChannel> it;
|
||||
for (it = sDspQueueList.getFirst(); it != sDspQueueList.getEnd(); it++) {
|
||||
if ((it->field_0x48 & 0xff) <= (param_1->field_0x48 & 0xff)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
sDspQueueList.insert(it.mLink, ¶m_1->field_0xd8);
|
||||
}
|
||||
|
||||
/* 8028B288-8028B2BC .text deleteQueue__Q28JASystem9TDSPQueueFPQ28JASystem8TChannel */
|
||||
void JASystem::TDSPQueue::deleteQueue(JASystem::TChannel*) {
|
||||
/* Nonmatching */
|
||||
int JASystem::TDSPQueue::deleteQueue(TChannel* param_1) {
|
||||
return sDspQueueList.remove(¶m_1->field_0xd8);
|
||||
}
|
||||
|
||||
/* 8028B2BC-8028B350 .text checkQueue__Q28JASystem9TDSPQueueFv */
|
||||
void JASystem::TDSPQueue::checkQueue() {
|
||||
/* Nonmatching */
|
||||
deQueue();
|
||||
JSULink<TChannel>* next;
|
||||
for (JSULink<TChannel>* link = sDspQueueList.getFirst(); link; link = next) {
|
||||
next = link->getNext();
|
||||
TChannel* channel = link->getObject();
|
||||
if (channel->field_0x30 > 0) {
|
||||
channel->field_0x30--;
|
||||
}
|
||||
if (channel->field_0x30 == 0) {
|
||||
channel->field_0x28(channel, 6);
|
||||
sDspQueueList.remove(&channel->field_0xd8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028B394-8028B3E8 .text __dt__29JSUList<Q28JASystem8TChannel>Fv */
|
||||
JSUList<JASystem::TChannel>::~JSUList() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
@@ -3,51 +3,114 @@
|
||||
// Translation Unit: JASChGlobal.cpp
|
||||
//
|
||||
|
||||
#include "JASChGlobal.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAudio/JASChGlobal.h"
|
||||
#include "JSystem/JAudio/JASChAllocQueue.h"
|
||||
#include "JSystem/JAudio/JASChannel.h"
|
||||
#include "JSystem/JAudio/JASChannelMgr.h"
|
||||
#include "JSystem/JAudio/JASSystemHeap.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
JASystem::TChannelMgr* JASystem::TGlobalChannel::sChannelMgr;
|
||||
JASystem::TChannel* JASystem::TGlobalChannel::sChannel;
|
||||
JASystem::TOscillator* JASystem::TGlobalChannel::sOscillator;
|
||||
|
||||
/* 8028AAEC-8028AB58 .text getChannelHandle__Q28JASystem14TGlobalChannelFUl */
|
||||
void JASystem::TGlobalChannel::getChannelHandle(unsigned long) {
|
||||
/* Nonmatching */
|
||||
JASystem::TChannel* JASystem::TGlobalChannel::getChannelHandle(u32 ch_num) {
|
||||
JUT_ASSERT(34, ch_num < (256));
|
||||
return sChannel + ch_num;
|
||||
}
|
||||
|
||||
/* 8028AB58-8028AD50 .text init__Q28JASystem14TGlobalChannelFv */
|
||||
void JASystem::TGlobalChannel::init() {
|
||||
/* Nonmatching */
|
||||
sChannelMgr = new (JASDram, 32) TChannelMgr();
|
||||
JUT_ASSERT(44, sChannelMgr);
|
||||
TChannelMgr* mgr = sChannelMgr;
|
||||
mgr->init();
|
||||
sChannel = new (JASDram, 32) TChannel[256];
|
||||
JUT_ASSERT(50, sChannel);
|
||||
sOscillator = new (JASDram, 32) TOscillator[1024];
|
||||
JUT_ASSERT(52, sOscillator);
|
||||
for (int i = 0; i < 256; i++) {
|
||||
for (u32 j = 0; j < 4; j++) {
|
||||
sChannel[i].setOscillator(j, &sOscillator[i * 4 + j]);
|
||||
}
|
||||
sChannel[i].init();
|
||||
mgr->addListHead(&sChannel[i], 0);
|
||||
sChannel[i].field_0x4 = mgr;
|
||||
}
|
||||
mgr->field_0x0 = 256;
|
||||
OSReport("----- JASChannel size : %d\n", sizeof(TChannel));
|
||||
}
|
||||
|
||||
/* 8028AD50-8028ADE8 .text alloc__Q28JASystem14TGlobalChannelFPQ28JASystem11TChannelMgrUl */
|
||||
void JASystem::TGlobalChannel::alloc(JASystem::TChannelMgr*, unsigned long) {
|
||||
/* Nonmatching */
|
||||
int JASystem::TGlobalChannel::alloc(TChannelMgr* param_1, u32 param_2) {
|
||||
int i;
|
||||
for (i = 0; i < param_2; i++) {
|
||||
TChannel* channel = sChannelMgr->getListHead(0);
|
||||
if (!channel) {
|
||||
break;
|
||||
}
|
||||
param_1->addListHead(channel, 0);
|
||||
channel->field_0x4 = param_1;
|
||||
channel->init();
|
||||
}
|
||||
param_1->field_0x0 += i;
|
||||
sChannelMgr->field_0x0 -= i;
|
||||
return i;
|
||||
}
|
||||
|
||||
/* 8028ADE8-8028AE4C .text release__Q28JASystem14TGlobalChannelFPQ28JASystem8TChannel */
|
||||
void JASystem::TGlobalChannel::release(JASystem::TChannel*) {
|
||||
/* Nonmatching */
|
||||
int JASystem::TGlobalChannel::release(TChannel* param_1) {
|
||||
sChannelMgr->addListHead(param_1, 0);
|
||||
param_1->field_0x4->field_0x0--;
|
||||
sChannelMgr->field_0x0++;
|
||||
param_1->field_0x4 = sChannelMgr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 8028AE4C-8028AF8C .text releaseAll__Q28JASystem14TGlobalChannelFPQ28JASystem11TChannelMgr */
|
||||
void JASystem::TGlobalChannel::releaseAll(JASystem::TChannelMgr*) {
|
||||
/* Nonmatching */
|
||||
int JASystem::TGlobalChannel::releaseAll(TChannelMgr* param_1) {
|
||||
TChannel* channel;
|
||||
while (true) {
|
||||
channel = param_1->getListHead(0);
|
||||
if (!channel) {
|
||||
break;
|
||||
}
|
||||
sChannelMgr->addListHead(channel, 0);
|
||||
channel->field_0x4 = sChannelMgr;
|
||||
};
|
||||
while (true) {
|
||||
channel = param_1->getListHead(1);
|
||||
if (!channel) {
|
||||
break;
|
||||
}
|
||||
sChannelMgr->addListHead(channel, 1);
|
||||
channel->field_0x4 = sChannelMgr;
|
||||
channel->field_0xd4 = 1;
|
||||
}
|
||||
while (true) {
|
||||
channel = param_1->getListHead(2);
|
||||
if (!channel) {
|
||||
break;
|
||||
}
|
||||
sChannelMgr->addListHead(channel, 2);
|
||||
channel->field_0x4 = sChannelMgr;
|
||||
channel->field_0xd4 = 1;
|
||||
}
|
||||
while (true) {
|
||||
channel = param_1->getListHead(3);
|
||||
if (!channel) {
|
||||
break;
|
||||
}
|
||||
if (TDSPQueue::deleteQueue(channel)) {
|
||||
sChannelMgr->addListHead(channel, 0);
|
||||
} else {
|
||||
sChannelMgr->addListHead(channel, 3);
|
||||
}
|
||||
channel->field_0x4 = sChannelMgr;
|
||||
}
|
||||
sChannelMgr->field_0x0 += param_1->field_0x0;
|
||||
param_1->field_0x0 = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* 8028AF8C-8028AFC8 .text __dt__Q28JASystem11TOscillatorFv */
|
||||
JASystem::TOscillator::~TOscillator() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028AFC8-8028AFF8 .text __ct__Q28JASystem11TOscillatorFv */
|
||||
JASystem::TOscillator::TOscillator() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028AFF8-8028B058 .text __dt__Q28JASystem8TChannelFv */
|
||||
JASystem::TChannel::~TChannel() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028B058-8028B0C4 .text __ct__Q28JASystem8TChannelFv */
|
||||
JASystem::TChannel::TChannel() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
@@ -3,121 +3,263 @@
|
||||
// Translation Unit: JASChannel.cpp
|
||||
//
|
||||
|
||||
#include "JASChannel.h"
|
||||
#include "JSystem/JAudio/JASChannel.h"
|
||||
#include "JSystem/JAudio/JASChAllocQueue.h"
|
||||
#include "JSystem/JAudio/JASChannelMgr.h"
|
||||
#include "JSystem/JAudio/JASDSPChannel.h"
|
||||
#include "JSystem/JAudio/JASDSPInterface.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 8028B3E8-8028B5A4 .text init__Q28JASystem8TChannelFv */
|
||||
void JASystem::TChannel::init() {
|
||||
/* Nonmatching */
|
||||
field_0x28 = 0;
|
||||
field_0x2c = 0;
|
||||
field_0x30 = 0;
|
||||
field_0x34 = 0;
|
||||
field_0x10 = NULL;
|
||||
field_0xc = 0;
|
||||
field_0x14 = 0;
|
||||
field_0x18 = 0;
|
||||
field_0x1c = 0;
|
||||
field_0xd4 = 0;
|
||||
if (!field_0x4) {
|
||||
field_0xb0[0] = 0x150;
|
||||
field_0xb0[1] = 0x210;
|
||||
field_0xb0[2] = 0x352;
|
||||
field_0xb0[3] = 0x412;
|
||||
field_0xb0[4] = 0;
|
||||
field_0xb0[5] = 0;
|
||||
field_0x48 = 0x10101;
|
||||
field_0x4c = 600;
|
||||
field_0x60[0] = 0x1a;
|
||||
field_0x60[1] = 1;
|
||||
field_0x60[2] = 1;
|
||||
} else {
|
||||
for (int i = 0; i < 6; i++) {
|
||||
field_0xb0[i] = field_0x4->field_0x4e[i];
|
||||
}
|
||||
field_0x48 = field_0x4->field_0x68;
|
||||
field_0x4c = field_0x4->field_0x6c;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
field_0x60[i] = field_0x4->field_0x62[i];
|
||||
}
|
||||
}
|
||||
for (u32 i = 0; i < 4; i++) {
|
||||
JUT_ASSERT(155, osc[i]);
|
||||
osc[i]->field_0x0 = NULL;
|
||||
osc[i]->init();
|
||||
}
|
||||
mPauseFlag = 0;
|
||||
field_0xc8++;
|
||||
if (s32(field_0xc8) == 0) {
|
||||
field_0xc8 = 1;
|
||||
}
|
||||
field_0xe8 = 0;
|
||||
}
|
||||
|
||||
/* 8028B5A4-8028B620 .text setOscillator__Q28JASystem8TChannelFUlPQ28JASystem11TOscillator */
|
||||
void JASystem::TChannel::setOscillator(unsigned long, JASystem::TOscillator*) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::setOscillator(u32 oscnum, TOscillator* param_2) {
|
||||
JUT_ASSERT(173, oscnum < (4));
|
||||
osc[oscnum] = param_2;
|
||||
}
|
||||
|
||||
/* 8028B620-8028B6A8 .text setOscInit__Q28JASystem8TChannelFUlPCQ38JASystem11TOscillator4Osc_ */
|
||||
void JASystem::TChannel::setOscInit(unsigned long, const JASystem::TOscillator::Osc_*) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::setOscInit(u32 oscnum, const TOscillator::Osc_* param_2) {
|
||||
JUT_ASSERT(183, oscnum < (4));
|
||||
osc[oscnum]->field_0x0 = param_2;
|
||||
osc[oscnum]->initStart();
|
||||
}
|
||||
|
||||
/* 8028B6A8-8028B73C .text forceStopOsc__Q28JASystem8TChannelFUl */
|
||||
void JASystem::TChannel::forceStopOsc(unsigned long) {
|
||||
bool JASystem::TChannel::forceStopOsc(u32 numosc) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(195, numosc < (4));
|
||||
return osc[numosc]->field_0x0 != NULL ? osc[numosc]->forceStop() : false;
|
||||
}
|
||||
|
||||
/* 8028B73C-8028B7D0 .text releaseOsc__Q28JASystem8TChannelFUl */
|
||||
void JASystem::TChannel::releaseOsc(unsigned long) {
|
||||
bool JASystem::TChannel::releaseOsc(u32 numosc) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(209, numosc < (4));
|
||||
return osc[numosc]->field_0x0 ? osc[numosc]->release() : false;
|
||||
}
|
||||
|
||||
/* 8028B7D0-8028B850 .text directReleaseOsc__Q28JASystem8TChannelFUlUs */
|
||||
void JASystem::TChannel::directReleaseOsc(unsigned long, unsigned short) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::directReleaseOsc(u32 oscnum, u16 param_2) {
|
||||
JUT_ASSERT(224, oscnum < (4));
|
||||
osc[oscnum]->field_0x18 = param_2;
|
||||
}
|
||||
|
||||
/* 8028B850-8028B8E4 .text bankOscToOfs__Q28JASystem8TChannelFUl */
|
||||
void JASystem::TChannel::bankOscToOfs(unsigned long) {
|
||||
f32 JASystem::TChannel::bankOscToOfs(u32 oscnum) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(234, oscnum < (4));
|
||||
return osc[oscnum]->field_0x0 ? osc[oscnum]->getOffset() : 1.0f;
|
||||
}
|
||||
|
||||
/* 8028B8E4-8028BA98 .text effectOsc__Q28JASystem8TChannelFUlf */
|
||||
void JASystem::TChannel::effectOsc(unsigned long, float) {
|
||||
void JASystem::TChannel::effectOsc(u32 oscnum, f32 param_2) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028BA98-8028BB14 .text getOscState__Q28JASystem8TChannelCFUl */
|
||||
void JASystem::TChannel::getOscState(unsigned long) const {
|
||||
int JASystem::TChannel::getOscState(u32 oscnum) const {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(274, oscnum < (4));
|
||||
return osc[oscnum]->field_0x4;
|
||||
}
|
||||
|
||||
/* 8028BB14-8028BB98 .text isOsc__Q28JASystem8TChannelFUl */
|
||||
void JASystem::TChannel::isOsc(unsigned long) {
|
||||
bool JASystem::TChannel::isOsc(u32 oscnum) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(284, oscnum < (4));
|
||||
return osc[oscnum]->field_0x0 != 0;
|
||||
}
|
||||
|
||||
/* 8028BB98-8028BC78 .text copyOsc__Q28JASystem8TChannelFUlPQ38JASystem11TOscillator4Osc_ */
|
||||
void JASystem::TChannel::copyOsc(unsigned long, JASystem::TOscillator::Osc_*) {
|
||||
void JASystem::TChannel::copyOsc(u32 oscnum, TOscillator::Osc_* param_2) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(295, oscnum < (4));
|
||||
if (isOsc(oscnum)) {
|
||||
*param_2 = *osc[oscnum]->field_0x0;
|
||||
} else {
|
||||
OSReport("osc[%d] is NULL\n", oscnum);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028BC78-8028BD10 .text overwriteOsc__Q28JASystem8TChannelFUlPQ38JASystem11TOscillator4Osc_ */
|
||||
void JASystem::TChannel::overwriteOsc(unsigned long, JASystem::TOscillator::Osc_*) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::overwriteOsc(u32 oscnum, TOscillator::Osc_* param_2) {
|
||||
JUT_ASSERT(308, oscnum < (4));
|
||||
setOscInit(oscnum, param_2);
|
||||
effectOsc(oscnum, bankOscToOfs(oscnum));
|
||||
}
|
||||
|
||||
/* 8028BD10-8028BDA4 .text setKeySweepTarget__Q28JASystem8TChannelFUcUl */
|
||||
void JASystem::TChannel::setKeySweepTarget(unsigned char, unsigned long) {
|
||||
void JASystem::TChannel::setKeySweepTarget(u8, u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028BDA4-8028BDAC .text setPauseFlag__Q28JASystem8TChannelFUc */
|
||||
void JASystem::TChannel::setPauseFlag(unsigned char) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::setPauseFlag(u8 param_1) {
|
||||
mPauseFlag = param_1;
|
||||
}
|
||||
|
||||
/* 8028BDAC-8028BDBC .text setPauseFlagReq__Q28JASystem8TChannelFUc */
|
||||
void JASystem::TChannel::setPauseFlagReq(unsigned char) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::setPauseFlagReq(u8 param_1) {
|
||||
mPauseFlag = param_1;
|
||||
field_0x3 = 1;
|
||||
}
|
||||
|
||||
/* 8028BDBC-8028BE64 .text setPanPower__Q28JASystem8TChannelFffff */
|
||||
void JASystem::TChannel::setPanPower(float, float, float, float) {
|
||||
void JASystem::TChannel::setPanPower(f32 param_1, f32 param_2, f32 param_3, f32 param_4) {
|
||||
/* Nonmatching */
|
||||
f32 px = param_1 + param_2 + param_3;
|
||||
if (px == 0.0f) {
|
||||
OSReport("----- JASChannel::setPanPower : px == 0.0\n");
|
||||
px = 1.0f;
|
||||
}
|
||||
field_0x64.field_0x0 = param_1 / px;
|
||||
field_0x64.field_0x4 = param_2 / px;
|
||||
field_0x64.field_0x8 = param_3 / px;
|
||||
}
|
||||
|
||||
/* 8028BE64-8028BEB8 .text checkLogicalChannel__Q28JASystem8TChannelFv */
|
||||
void JASystem::TChannel::checkLogicalChannel() {
|
||||
BOOL JASystem::TChannel::checkLogicalChannel() {
|
||||
/* Nonmatching */
|
||||
if (!field_0x10 && field_0xc == 0) {
|
||||
OSReport("----- checkLC : 波形がアサインされていません\n");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028BEB8-8028BF40 .text play__Q28JASystem8TChannelFUl */
|
||||
void JASystem::TChannel::play(unsigned long) {
|
||||
bool JASystem::TChannel::play(u32 param_1) {
|
||||
/* Nonmatching */
|
||||
if (param_1 == 0) {
|
||||
param_1 = -1;
|
||||
}
|
||||
field_0x30 = param_1;
|
||||
field_0x34 = field_0x30;
|
||||
field_0x28 = &updatecallLogicalChannel;
|
||||
field_0x20 = NULL;
|
||||
if (!checkLogicalChannel()) {
|
||||
return false;
|
||||
}
|
||||
TDSPQueue::enQueue(this);
|
||||
field_0x4->addListTail(this, 3);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028BF40-8028BFAC .text stop__Q28JASystem8TChannelFUs */
|
||||
void JASystem::TChannel::stop(unsigned short) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TChannel::stop(u16 param_1) {
|
||||
if (!field_0x20) {
|
||||
updatecallLogicalChannel(this, 6);
|
||||
} else if (param_1 == 0) {
|
||||
updatecallLogicalChannel(this, 0);
|
||||
} else {
|
||||
directReleaseOsc(0, param_1);
|
||||
updatecallLogicalChannel(this, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028BFAC-8028C108 .text updateJcToDSP__Q28JASystem8TChannelFv */
|
||||
void JASystem::TChannel::updateJcToDSP() {
|
||||
/* Nonmatching */
|
||||
DSPInterface::DSPBuffer* dspBuffer = field_0x20->field_0xc;
|
||||
if (field_0xd4) {
|
||||
for (u8 i = 0; i < 6; i++) {
|
||||
dspBuffer->setMixerVolumeOnly(i, field_0xbc[i]);
|
||||
}
|
||||
dspBuffer->setPitch(field_0xa0);
|
||||
dspBuffer->setPauseFlag(mPauseFlag);
|
||||
dspBuffer->flushChannel();
|
||||
} else {
|
||||
for (u8 i = 0; i < 6; i++) {
|
||||
dspBuffer->setMixerVolume(i, field_0xbc[i], field_0x4->field_0x5a[i]);
|
||||
}
|
||||
dspBuffer->setPitch(field_0xa0);
|
||||
if (field_0x4->field_0x61 & 0x20) {
|
||||
dspBuffer->setIIRFilterParam(field_0x4->field_0x3c);
|
||||
}
|
||||
if (field_0x4->field_0x61 & 0x1f) {
|
||||
dspBuffer->setFIR8FilterParam(field_0x4->field_0x2c);
|
||||
}
|
||||
dspBuffer->setFilterMode(field_0x4->field_0x61);
|
||||
dspBuffer->setDistFilter(field_0x4->field_0x4c);
|
||||
dspBuffer->setPauseFlag(mPauseFlag);
|
||||
field_0x20->field_0xc->flushChannel();
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028C108-8028C140 .text forceStopLogicalChannel__Q28JASystem8TChannelFv */
|
||||
void JASystem::TChannel::forceStopLogicalChannel() {
|
||||
/* Nonmatching */
|
||||
bool JASystem::TChannel::forceStopLogicalChannel() {
|
||||
if (!field_0x20) {
|
||||
return false;
|
||||
}
|
||||
field_0x20->forceStop();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028C140-8028C1C0 .text stopLogicalChannel__Q28JASystem8TChannelFv */
|
||||
void JASystem::TChannel::stopLogicalChannel() {
|
||||
bool JASystem::TChannel::stopLogicalChannel() {
|
||||
/* Nonmatching */
|
||||
if (!field_0x20) {
|
||||
OSReport("----- stopLC : DSP Ch is not assigned\n");
|
||||
return false;
|
||||
}
|
||||
field_0x20->mCallback = NULL;
|
||||
field_0x20->field_0x6 = 0;
|
||||
field_0x20->stop();
|
||||
TDSPChannel::free(field_0x20, u32(this));
|
||||
field_0x20 = NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028C1C0-8028C3A8 .text playLogicalChannel__Q28JASystem8TChannelFv */
|
||||
void JASystem::TChannel::playLogicalChannel() {
|
||||
int JASystem::TChannel::playLogicalChannel() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
@@ -127,22 +269,22 @@ void JASystem::TChannel::updateEffectorParam() {
|
||||
}
|
||||
|
||||
/* 8028C62C-8028C6C4 .text killBrokenLogicalChannels__Q28JASystem8TChannelFPQ28JASystem11TDSPChannel */
|
||||
void JASystem::TChannel::killBrokenLogicalChannels(JASystem::TDSPChannel*) {
|
||||
void JASystem::TChannel::killBrokenLogicalChannels(TDSPChannel*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028C6C4-8028CABC .text updatecallDSPChannel__Q28JASystem8TChannelFPQ28JASystem11TDSPChannelUl */
|
||||
void JASystem::TChannel::updatecallDSPChannel(JASystem::TDSPChannel*, unsigned long) {
|
||||
void JASystem::TChannel::updatecallDSPChannel(TDSPChannel*, u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028CABC-8028CB88 .text calcEffect__Q28JASystem8TChannelFPCQ38JASystem6Driver10PanMatrix_PCQ38JASystem6Driver10PanMatrix_Uc */
|
||||
void JASystem::TChannel::calcEffect(const JASystem::Driver::PanMatrix_*, const JASystem::Driver::PanMatrix_*, unsigned char) {
|
||||
f32 JASystem::TChannel::calcEffect(const Driver::PanMatrix_*, const JASystem::Driver::PanMatrix_*, u8) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028CB88-8028CC90 .text calcPan__Q28JASystem8TChannelFPCQ38JASystem6Driver10PanMatrix_PCQ38JASystem6Driver10PanMatrix_Uc */
|
||||
void JASystem::TChannel::calcPan(const JASystem::Driver::PanMatrix_*, const JASystem::Driver::PanMatrix_*, unsigned char) {
|
||||
f32 JASystem::TChannel::calcPan(const Driver::PanMatrix_*, const Driver::PanMatrix_*, u8) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
@@ -152,22 +294,29 @@ void JASystem::TChannel::updateJcToDSPInit() {
|
||||
}
|
||||
|
||||
/* 8028CD90-8028CEA8 .text updateAutoMixer__Q28JASystem8TChannelFffff */
|
||||
void JASystem::TChannel::updateAutoMixer(float, float, float, float) {
|
||||
void JASystem::TChannel::updateAutoMixer(f32 param_1, f32 param_2, f32 param_3, f32 param_4) {
|
||||
/* Nonmatching */
|
||||
f32 f31 = 0.0f;
|
||||
if (param_1 > f31) {
|
||||
f31 = 1.0f;
|
||||
if (param_1 >= f31) {
|
||||
f31 = param_1;
|
||||
}
|
||||
}
|
||||
field_0x20->field_0xc->setAutoMixer(f31 * Driver::getAutoLevel(), param_2 * 127.5f, param_4 * 127.5f, param_3 * 127.5f, field_0xb0[1]);
|
||||
}
|
||||
|
||||
/* 8028CEA8-8028D128 .text updateMixer__Q28JASystem8TChannelFffff */
|
||||
void JASystem::TChannel::updateMixer(float, float, float, float) {
|
||||
void JASystem::TChannel::updateMixer(f32, f32, f32, f32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028D128-8028D218 .text extraUpdate__Q28JASystem8TChannelFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannel::extraUpdate(JASystem::TChannel*, unsigned long) {
|
||||
void JASystem::TChannel::extraUpdate(TChannel*, u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028D218-8028D3C0 .text updatecallLogicalChannel__Q28JASystem8TChannelFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannel::updatecallLogicalChannel(JASystem::TChannel*, unsigned long) {
|
||||
void JASystem::TChannel::updatecallLogicalChannel(TChannel*, u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
@@ -3,76 +3,222 @@
|
||||
// Translation Unit: JASChannelMgr.cpp
|
||||
//
|
||||
|
||||
#include "JASChannelMgr.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAudio/JASChannelMgr.h"
|
||||
#include "JSystem/JAudio/JASChGlobal.h"
|
||||
#include "JSystem/JAudio/JASChannel.h"
|
||||
#include "dolphin/os/OS.h"
|
||||
|
||||
/* 8028D3C0-8028D4D0 .text init__Q28JASystem11TChannelMgrFv */
|
||||
void JASystem::TChannelMgr::init() {
|
||||
/* Nonmatching */
|
||||
field_0x8 = NULL;
|
||||
field_0xc = NULL;
|
||||
field_0x10 = NULL;
|
||||
field_0x14 = NULL;
|
||||
field_0x4 = 0;
|
||||
field_0x0 = 0;
|
||||
field_0x70 = 1;
|
||||
field_0x18 = 1.0f;
|
||||
field_0x1c = 1.0f;
|
||||
field_0x20 = 0.5f;
|
||||
field_0x24 = 0.0f;
|
||||
field_0x28 = 0.0f;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
field_0x2c[i] = 0;
|
||||
}
|
||||
field_0x2c[0] = 0x7fff;
|
||||
field_0x4c = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x3c[i] = 0;
|
||||
}
|
||||
for (int i = 0; i < 6; i++) {
|
||||
field_0x5a[i] = 0;
|
||||
}
|
||||
field_0x60 = 0;
|
||||
field_0x3c[0] = 0x7fff;
|
||||
field_0x61 = 0;
|
||||
field_0x4e[0] = 0x150;
|
||||
field_0x4e[1] = 0x210;
|
||||
field_0x4e[2] = 0x352;
|
||||
field_0x4e[3] = 0x412;
|
||||
field_0x4e[4] = 0;
|
||||
field_0x4e[5] = 0;
|
||||
field_0x68 = 0x20103;
|
||||
field_0x6c = 600;
|
||||
field_0x62[0] = 13;
|
||||
field_0x62[1] = 13;
|
||||
field_0x62[2] = 13;
|
||||
}
|
||||
|
||||
/* 8028D4D0-8028D514 .text stopAll__Q28JASystem11TChannelMgrFv */
|
||||
void JASystem::TChannelMgr::stopAll() {
|
||||
/* Nonmatching */
|
||||
TChannel* channel = field_0xc;
|
||||
while (channel) {
|
||||
TChannel* r31 = channel->field_0x24;
|
||||
channel->stop(0);
|
||||
channel = r31;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028D514-8028D558 .text stopAllRelease__Q28JASystem11TChannelMgrFv */
|
||||
void JASystem::TChannelMgr::stopAllRelease() {
|
||||
/* Nonmatching */
|
||||
for (TChannel* channel = field_0x10; channel; channel = channel->field_0x24) {
|
||||
channel->forceStopOsc(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028D558-8028D5D0 .text initAllocChannel__Q28JASystem11TChannelMgrFUl */
|
||||
void JASystem::TChannelMgr::initAllocChannel(unsigned long) {
|
||||
void JASystem::TChannelMgr::initAllocChannel(u32 param_1) {
|
||||
/* Nonmatching */
|
||||
if (field_0x0) {
|
||||
OSReport("----- Warning JCSにボイスが %d 残っているのでグローバルに返却します\n", field_0x0);
|
||||
TGlobalChannel::releaseAll(this);
|
||||
}
|
||||
init();
|
||||
TGlobalChannel::alloc(this, param_1);
|
||||
field_0x70 = param_1 != 0;
|
||||
}
|
||||
|
||||
/* 8028D5D0-8028D778 .text getLogicalChannel__Q28JASystem11TChannelMgrFUl */
|
||||
void JASystem::TChannelMgr::getLogicalChannel(unsigned long) {
|
||||
JASystem::TChannel* JASystem::TChannelMgr::getLogicalChannel(u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028D778-8028D7D8 .text moveListHead__Q28JASystem11TChannelMgrFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannelMgr::moveListHead(JASystem::TChannel*, unsigned long) {
|
||||
/* Nonmatching */
|
||||
bool JASystem::TChannelMgr::moveListHead(TChannel* param_1, u32 param_2) {
|
||||
if (cutList(param_1) == -1) {
|
||||
return false;
|
||||
}
|
||||
addListHead(param_1, param_2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028D7D8-8028D838 .text moveListTail__Q28JASystem11TChannelMgrFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannelMgr::moveListTail(JASystem::TChannel*, unsigned long) {
|
||||
/* Nonmatching */
|
||||
bool JASystem::TChannelMgr::moveListTail(TChannel* param_1, u32 param_2) {
|
||||
if (cutList(param_1) == -1) {
|
||||
return false;
|
||||
}
|
||||
addListTail(param_1, param_2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028D838-8028D8E4 .text addListHead__Q28JASystem11TChannelMgrFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannelMgr::addListHead(JASystem::TChannel*, unsigned long) {
|
||||
void JASystem::TChannelMgr::addListHead(TChannel* param_1, u32 param_2) {
|
||||
/* Nonmatching */
|
||||
TChannel** r31;
|
||||
switch (param_2) {
|
||||
case 0:
|
||||
r31 = &field_0x8;
|
||||
break;
|
||||
case 1:
|
||||
r31 = &field_0xc;
|
||||
break;
|
||||
case 2:
|
||||
r31 = &field_0x10;
|
||||
break;
|
||||
case 3:
|
||||
r31 = &field_0x14;
|
||||
break;
|
||||
default:
|
||||
r31 = NULL;
|
||||
break;
|
||||
}
|
||||
TChannel* r30 = *r31;
|
||||
if (param_1->field_0x8) {
|
||||
OSReport("RootJc Error 2\n");
|
||||
}
|
||||
param_1->field_0x8 = r31;
|
||||
*r31 = param_1;
|
||||
param_1->field_0x24 = r30;
|
||||
}
|
||||
|
||||
/* 8028D8E4-8028D9C4 .text addListTail__Q28JASystem11TChannelMgrFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannelMgr::addListTail(JASystem::TChannel*, unsigned long) {
|
||||
void JASystem::TChannelMgr::addListTail(TChannel*param_1, u32 param_2) {
|
||||
/* Nonmatching */
|
||||
TChannel** r31;
|
||||
switch (param_2) {
|
||||
case 0:
|
||||
r31 = &field_0x8;
|
||||
break;
|
||||
case 1:
|
||||
r31 = &field_0xc;
|
||||
break;
|
||||
case 2:
|
||||
r31 = &field_0x10;
|
||||
break;
|
||||
case 3:
|
||||
r31 = &field_0x14;
|
||||
break;
|
||||
default:
|
||||
r31 = NULL;
|
||||
break;
|
||||
}
|
||||
TChannel* r30 = *r31;
|
||||
if (param_1->field_0x8) {
|
||||
OSReport("ROOTJC Error\n");
|
||||
}
|
||||
param_1->field_0x8 = r31;
|
||||
if (!r30) {
|
||||
*r31 = param_1;
|
||||
param_1->field_0x24 = NULL;
|
||||
return;
|
||||
}
|
||||
while (true) {
|
||||
TChannel* tmp = r30->field_0x24;
|
||||
if (!tmp) {
|
||||
r30->field_0x24 = param_1;
|
||||
param_1->field_0x24 = NULL;
|
||||
break;
|
||||
}
|
||||
r30 = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028D9C4-8028DA38 .text getListHead__Q28JASystem11TChannelMgrFUl */
|
||||
void JASystem::TChannelMgr::getListHead(unsigned long) {
|
||||
/* Nonmatching */
|
||||
JASystem::TChannel* JASystem::TChannelMgr::getListHead(u32 param_1) {
|
||||
TChannel** r31;
|
||||
switch (param_1) {
|
||||
case 0:
|
||||
r31 = &field_0x8;
|
||||
break;
|
||||
case 1:
|
||||
r31 = &field_0xc;
|
||||
break;
|
||||
case 2:
|
||||
r31 = &field_0x10;
|
||||
break;
|
||||
case 3:
|
||||
r31 = &field_0x14;
|
||||
break;
|
||||
default:
|
||||
r31 = NULL;
|
||||
break;
|
||||
}
|
||||
TChannel* r30 = *r31;
|
||||
if (!r30) {
|
||||
return NULL;
|
||||
}
|
||||
*r31 = r30->field_0x24;
|
||||
r30->field_0x8 = NULL;
|
||||
return r30;
|
||||
}
|
||||
|
||||
/* 8028DA38-8028DAF0 .text cutList__Q28JASystem11TChannelMgrFPQ28JASystem8TChannel */
|
||||
void JASystem::TChannelMgr::cutList(JASystem::TChannel*) {
|
||||
int JASystem::TChannelMgr::cutList(TChannel*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028DAF0-8028DC34 .text receiveAllChannels__Q28JASystem11TChannelMgrFPQ28JASystem11TChannelMgr */
|
||||
void JASystem::TChannelMgr::receiveAllChannels(JASystem::TChannelMgr*) {
|
||||
void JASystem::TChannelMgr::receiveAllChannels(TChannelMgr*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028DC34-8028DDD0 .text checkLimitStart__Q28JASystem11TChannelMgrFUl */
|
||||
void JASystem::TChannelMgr::checkLimitStart(unsigned long) {
|
||||
int JASystem::TChannelMgr::checkLimitStart(u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028DDD0-8028DE94 .text checkLimitStop__Q28JASystem11TChannelMgrFPQ28JASystem8TChannelUl */
|
||||
void JASystem::TChannelMgr::checkLimitStop(JASystem::TChannel*, unsigned long) {
|
||||
void JASystem::TChannelMgr::checkLimitStop(TChannel*, u32) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JAudio/JASDSPChannel.h"
|
||||
#include "JSystem/JAudio/JASAudioThread.h"
|
||||
#include "JSystem/JAudio/JASChAllocQueue.h"
|
||||
#include "JSystem/JAudio/JASDSPInterface.h"
|
||||
#include "JSystem/JAudio/JASRate.h"
|
||||
#include "JSystem/JAudio/JASSystemHeap.h"
|
||||
#include "JSystem/JAudio/dspproc.h"
|
||||
#include "JSystem/JKernel/JKRSolidHeap.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
|
||||
@@ -202,7 +205,7 @@ JASystem::TDSPChannel* JASystem::TDSPChannel::getLowerActive() {
|
||||
}
|
||||
|
||||
/* 80289D10-80289DC8 .text breakLower__Q28JASystem11TDSPChannelFUc */
|
||||
bool JASystem::TDSPChannel::breakLower(u8 param_1) {
|
||||
BOOL JASystem::TDSPChannel::breakLower(u8 param_1) {
|
||||
TDSPChannel* dspch = getLower();
|
||||
if (dspch->field_0x3 > param_1) {
|
||||
return false;
|
||||
@@ -239,6 +242,8 @@ bool JASystem::TDSPChannel::breakLowerActive(u8 param_1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
OSTick JASystem::history[10];
|
||||
OSTick JASystem::old_time;
|
||||
f32 JASystem::DSP_LIMIT_RATIO = 1.1f;
|
||||
|
||||
/* 80289E68-8028A04C .text updateAll__Q28JASystem11TDSPChannelFv */
|
||||
@@ -246,30 +251,74 @@ void JASystem::TDSPChannel::updateAll() {
|
||||
/* Nonmatching */
|
||||
if (Kernel::gSubFrames <= 10) {
|
||||
OSTick time = OSGetTick();
|
||||
OSTick tmp = time - old_time;
|
||||
OSTick var3 = time - old_time;
|
||||
old_time = time;
|
||||
history[Kernel::gSubFrames - TAudioThread::snIntCount] = tmp;
|
||||
u32 var2 = Kernel::gSubFrames - TAudioThread::snIntCount;
|
||||
history[var2] = var3;
|
||||
if (var2) {
|
||||
if (f32(history[0]) / var3 < DSP_LIMIT_RATIO) {
|
||||
breakLowerActive(126);
|
||||
}
|
||||
}
|
||||
}
|
||||
TDSPQueue::checkQueue();
|
||||
for (u32 i = 0; i < 64; i++) {
|
||||
if ((i & 0x0f) == 0 && i != 0) {
|
||||
DSPReleaseHalt2(i - 1 >> 4);
|
||||
}
|
||||
TDSPChannel* dspChannel = DSPCH + i;
|
||||
DSPInterface::DSPBuffer* dspBuffer = dspChannel->field_0xc;
|
||||
if (dspChannel->field_0x1 == 1) {
|
||||
continue;
|
||||
}
|
||||
if (dspBuffer->field_0x2 != 0) {
|
||||
if (dspChannel->mCallback) {
|
||||
dspChannel->onUpdate(2);
|
||||
}
|
||||
dspBuffer->field_0x2 = 0;
|
||||
dspBuffer->field_0x0 = 0;
|
||||
dspBuffer->flushChannel();
|
||||
if (dspChannel->field_0x1 == 1) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (dspBuffer->field_0x10a == 0) {
|
||||
dspBuffer->field_0x10c++;
|
||||
if (dspBuffer->field_0x10c == dspChannel->field_0x4 && dspChannel->mCallback) {
|
||||
dspChannel->mCallback(dspChannel, 4);
|
||||
}
|
||||
}
|
||||
if (dspChannel->mCallback) {
|
||||
if (dspChannel->field_0x6) {
|
||||
dspChannel->field_0x6--;
|
||||
}
|
||||
if (dspChannel->field_0x6 == 0) {
|
||||
dspChannel->onUpdate(0);
|
||||
if (dspChannel->field_0x6 == 0) {
|
||||
dspBuffer->field_0x2 = 0;
|
||||
dspBuffer->field_0x0 = 0;
|
||||
dspBuffer->flushChannel();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DSPReleaseHalt2(3);
|
||||
}
|
||||
|
||||
/* 8028A04C-8028A08C .text onUpdate__Q28JASystem11TDSPChannelFUl */
|
||||
void JASystem::TDSPChannel::onUpdate(u32) {
|
||||
/* Nonmatching */
|
||||
void JASystem::TDSPChannel::onUpdate(u32 param_1) {
|
||||
if (mCallback) {
|
||||
field_0x6 = mCallback(this, param_1);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8028A08C-8028A0C0 .text getNumBreak__Q28JASystem11TDSPChannelFv */
|
||||
int JASystem::TDSPChannel::getNumBreak() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028A0C0-8028A0FC .text __dt__Q28JASystem11TDSPChannelFv */
|
||||
JASystem::TDSPChannel::~TDSPChannel() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028A0FC-8028A10C .text __ct__Q28JASystem11TDSPChannelFv */
|
||||
JASystem::TDSPChannel::TDSPChannel() {
|
||||
/* Nonmatching */
|
||||
field_0xc = NULL;
|
||||
mCallback = NULL;
|
||||
int count = 0;
|
||||
for (int i = 0; i < 64; i++) {
|
||||
if (DSPCH[i].field_0x1 == 2) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ void JASystem::DSPInterface::DSPBuffer::playStart() {
|
||||
field_0x10c = 0;
|
||||
field_0x60 = 0;
|
||||
field_0x8 = 1;
|
||||
field_0x66 = 1;
|
||||
field_0x66 = 0;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
field_0x78[i] = 0;
|
||||
field_0xa8[i] = 0;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//
|
||||
|
||||
#include "JSystem/JAudio/JASDriverIF.h"
|
||||
#include "JSystem/JAudio/JASChGlobal.h"
|
||||
#include "JSystem/JAudio/JASDSPChannel.h"
|
||||
#include "JSystem/JAudio/JASDSPInterface.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
@@ -13,7 +14,7 @@ void JASystem::Driver::init() {
|
||||
/* Nonmatching */
|
||||
DSPInterface::initBuffer();
|
||||
TDSPChannel::initAll();
|
||||
//TGlobalChannel::init();
|
||||
TGlobalChannel::init();
|
||||
}
|
||||
|
||||
u16 JASystem::Driver::MAX_MIXERLEVEL = 0x2ee0;
|
||||
|
||||
@@ -3,36 +3,60 @@
|
||||
// Translation Unit: JASOscillator.cpp
|
||||
//
|
||||
|
||||
#include "JASOscillator.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JAudio/JASOscillator.h"
|
||||
|
||||
/* 8028DE94-8028DECC .text init__Q28JASystem11TOscillatorFv */
|
||||
void JASystem::TOscillator::init() {
|
||||
/* Nonmatching */
|
||||
field_0x0 = NULL;
|
||||
field_0x4 = 1;
|
||||
field_0x5 = 0;
|
||||
field_0x6 = 0;
|
||||
field_0x8 = 0.0f;
|
||||
field_0xc = 0.0f;
|
||||
field_0x10 = 0.0f;
|
||||
field_0x14 = 0.0f;
|
||||
field_0x18 = 0;
|
||||
field_0x1c = 0.0f;
|
||||
}
|
||||
|
||||
/* 8028DECC-8028DF2C .text initStart__Q28JASystem11TOscillatorFv */
|
||||
void JASystem::TOscillator::initStart() {
|
||||
/* Nonmatching */
|
||||
field_0x4 = 2;
|
||||
field_0x18 = 0;
|
||||
if (!field_0x0 || !field_0x0->table) {
|
||||
field_0xc = 0.0f;
|
||||
return;
|
||||
}
|
||||
field_0x6 = 0;
|
||||
field_0x8 = 0.0f;
|
||||
field_0x10 = 0.0f;
|
||||
field_0x18 = 0;
|
||||
field_0x8 -= field_0x0->field_0x4;
|
||||
}
|
||||
|
||||
/* 8028DF2C-8028E070 .text getOffset__Q28JASystem11TOscillatorFv */
|
||||
void JASystem::TOscillator::getOffset() {
|
||||
f32 JASystem::TOscillator::getOffset() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028E070-8028E0AC .text forceStop__Q28JASystem11TOscillatorFv */
|
||||
void JASystem::TOscillator::forceStop() {
|
||||
/* Nonmatching */
|
||||
bool JASystem::TOscillator::forceStop() {
|
||||
if (field_0x4 == 5) {
|
||||
return false;
|
||||
}
|
||||
field_0x6 = 0;
|
||||
field_0x8 = 0.0f;
|
||||
field_0x10 = field_0xc;
|
||||
field_0x4 = 5;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8028E0AC-8028E238 .text release__Q28JASystem11TOscillatorFv */
|
||||
void JASystem::TOscillator::release() {
|
||||
bool JASystem::TOscillator::release() {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
/* 8028E238-8028E5EC .text calc__Q28JASystem11TOscillatorFPs */
|
||||
void JASystem::TOscillator::calc(short*) {
|
||||
void JASystem::TOscillator::calc(s16*) {
|
||||
/* Nonmatching */
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user