mirror of
https://github.com/zeldaret/tww.git
synced 2026-05-30 00:46:29 -04:00
JASCmdStack
This commit is contained in:
+1
-1
@@ -660,7 +660,7 @@ config.libs = [
|
||||
Object(NonMatching, "JSystem/JAudio/JASResArcLoader.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASProbe.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASKernelDebug.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASCmdStack.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASCmdStack.cpp"),
|
||||
Object(Matching, "JSystem/JAudio/JASSystemHeap.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASNoteMgr.cpp"),
|
||||
Object(NonMatching, "JSystem/JAudio/JASOuterParam.cpp"),
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
#ifndef JASCMDSTACK_H
|
||||
#define JASCMDSTACK_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
namespace JASystem {
|
||||
namespace Kernel {
|
||||
class TPortArgs;
|
||||
class TPortCmd;
|
||||
class TPortHead {
|
||||
public:
|
||||
/* 0x00 */ TPortCmd* field_0x0;
|
||||
/* 0x04 */ TPortCmd* field_0x4;
|
||||
};
|
||||
|
||||
class TPortCmd {
|
||||
public:
|
||||
TPortCmd();
|
||||
bool addPortCmdOnce();
|
||||
bool setPortCmd(void (*)(TPortArgs*), TPortArgs*);
|
||||
bool addPortCmd(TPortHead*);
|
||||
|
||||
/* 0x00 */ TPortHead* field_0x0;
|
||||
/* 0x04 */ TPortCmd* field_0x4;
|
||||
/* 0x08 */ void (*field_0x8)(TPortArgs*);
|
||||
/* 0x0C */ TPortArgs* field_0xc;
|
||||
};
|
||||
|
||||
void portCmdProcOnce(TPortHead*);
|
||||
void portCmdProcStay(TPortHead*);
|
||||
void portHeadInit(TPortHead*);
|
||||
void portCmdInit();
|
||||
TPortCmd* getPortCmd(TPortHead*);
|
||||
s32 portCmdMain(void*);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* JASCMDSTACK_H */
|
||||
@@ -3,56 +3,121 @@
|
||||
// Translation Unit: JASCmdStack.cpp
|
||||
//
|
||||
|
||||
#include "JASCmdStack.h"
|
||||
#include "JSystem/JAudio/JASCmdStack.h"
|
||||
#include "JSystem/JAudio/JASCallback.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
/* 8027D6F4-8027D70C .text __ct__Q38JASystem6Kernel8TPortCmdFv */
|
||||
JASystem::Kernel::TPortCmd::TPortCmd() {
|
||||
/* Nonmatching */
|
||||
field_0x0 = NULL;
|
||||
field_0x4 = NULL;
|
||||
field_0x8 = NULL;
|
||||
field_0xc = NULL;
|
||||
}
|
||||
|
||||
JASystem::Kernel::TPortHead cmd_once;
|
||||
|
||||
/* 8027D70C-8027D730 .text addPortCmdOnce__Q38JASystem6Kernel8TPortCmdFv */
|
||||
void JASystem::Kernel::TPortCmd::addPortCmdOnce() {
|
||||
/* Nonmatching */
|
||||
bool JASystem::Kernel::TPortCmd::addPortCmdOnce() {
|
||||
return addPortCmd(&cmd_once);
|
||||
}
|
||||
|
||||
/* 8027D730-8027D7E8 .text setPortCmd__Q38JASystem6Kernel8TPortCmdFPFPQ38JASystem6Kernel9TPortArgs_vPQ38JASystem6Kernel9TPortArgs */
|
||||
void JASystem::Kernel::TPortCmd::setPortCmd(void (*)(JASystem::Kernel::TPortArgs*), JASystem::Kernel::TPortArgs*) {
|
||||
/* Nonmatching */
|
||||
bool JASystem::Kernel::TPortCmd::setPortCmd(void (*func)(JASystem::Kernel::TPortArgs*), JASystem::Kernel::TPortArgs* pargs) {
|
||||
JUT_ASSERT(83, func != 0);
|
||||
JUT_ASSERT(84, pargs != 0);
|
||||
field_0x8 = func;
|
||||
field_0xc = pargs;
|
||||
field_0x0 = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 8027D7E8-8027D8A4 .text addPortCmd__Q38JASystem6Kernel8TPortCmdFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::TPortCmd::addPortCmd(JASystem::Kernel::TPortHead*) {
|
||||
bool JASystem::Kernel::TPortCmd::addPortCmd(JASystem::Kernel::TPortHead* phead) {
|
||||
/* Nonmatching */
|
||||
JUT_ASSERT(105, phead != 0);
|
||||
BOOL enable = OSDisableInterrupts();
|
||||
if (field_0x0) {
|
||||
OSRestoreInterrupts(enable);
|
||||
return false;
|
||||
}
|
||||
if (phead->field_0x4) {
|
||||
phead->field_0x4->field_0x4 = this;
|
||||
} else {
|
||||
phead->field_0x0 = this;
|
||||
}
|
||||
phead->field_0x4 = this;
|
||||
field_0x4 = NULL;
|
||||
field_0x0 = phead;
|
||||
OSRestoreInterrupts(enable);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 8027D8A4-8027D924 .text portCmdProcOnce__Q28JASystem6KernelFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::portCmdProcOnce(JASystem::Kernel::TPortHead*) {
|
||||
/* Nonmatching */
|
||||
void JASystem::Kernel::portCmdProcOnce(JASystem::Kernel::TPortHead* phead) {
|
||||
JUT_ASSERT(223, phead != 0);
|
||||
while (true) {
|
||||
TPortCmd* cmd = getPortCmd(phead);
|
||||
if (!cmd) {
|
||||
break;
|
||||
}
|
||||
cmd->field_0x8(cmd->field_0xc);
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027D924-8027D9A4 .text portCmdProcStay__Q28JASystem6KernelFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::portCmdProcStay(JASystem::Kernel::TPortHead*) {
|
||||
/* Nonmatching */
|
||||
void JASystem::Kernel::portCmdProcStay(JASystem::Kernel::TPortHead* phead) {
|
||||
JUT_ASSERT(245, phead != 0);
|
||||
TPortCmd* cmd = phead->field_0x0;
|
||||
while (true) {
|
||||
if (!cmd) {
|
||||
break;
|
||||
}
|
||||
cmd->field_0x8(cmd->field_0xc);
|
||||
cmd = cmd->field_0x4;
|
||||
}
|
||||
}
|
||||
|
||||
/* 8027D9A4-8027DA0C .text portHeadInit__Q28JASystem6KernelFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::portHeadInit(JASystem::Kernel::TPortHead*) {
|
||||
/* Nonmatching */
|
||||
void JASystem::Kernel::portHeadInit(JASystem::Kernel::TPortHead* phead) {
|
||||
JUT_ASSERT(267, phead != 0);
|
||||
phead->field_0x0 = NULL;
|
||||
phead->field_0x4 = NULL;
|
||||
}
|
||||
|
||||
JASystem::Kernel::TPortHead cmd_stay;
|
||||
|
||||
/* 8027DA0C-8027DA48 .text portCmdInit__Q28JASystem6KernelFv */
|
||||
void JASystem::Kernel::portCmdInit() {
|
||||
/* Nonmatching */
|
||||
portHeadInit(&cmd_once);
|
||||
portHeadInit(&cmd_stay);
|
||||
registerDspCallback(portCmdMain, NULL);
|
||||
}
|
||||
|
||||
/* 8027DA48-8027DB08 .text getPortCmd__Q28JASystem6KernelFPQ38JASystem6Kernel9TPortHead */
|
||||
void JASystem::Kernel::getPortCmd(JASystem::Kernel::TPortHead*) {
|
||||
/* Nonmatching */
|
||||
JASystem::Kernel::TPortCmd* JASystem::Kernel::getPortCmd(JASystem::Kernel::TPortHead* phead) {
|
||||
TPortCmd* r31;
|
||||
TPortCmd* r30 = NULL;
|
||||
JUT_ASSERT(311, phead != 0);
|
||||
r31 = phead->field_0x0;
|
||||
if (r31) {
|
||||
r30 = r31;
|
||||
phead->field_0x0 = r31->field_0x4;
|
||||
if (!phead->field_0x0) {
|
||||
phead->field_0x4 = NULL;
|
||||
}
|
||||
if (phead != r31->field_0x0) {
|
||||
OSReport("[JASKernel::getPortCmd] 不正な登録データブロックです。\n");
|
||||
}
|
||||
r31->field_0x0 = NULL;
|
||||
}
|
||||
return r30;
|
||||
}
|
||||
|
||||
/* 8027DB08-8027DB38 .text portCmdMain__Q28JASystem6KernelFPv */
|
||||
void JASystem::Kernel::portCmdMain(void*) {
|
||||
/* Nonmatching */
|
||||
s32 JASystem::Kernel::portCmdMain(void*) {
|
||||
portCmdProcOnce(&cmd_once);
|
||||
portCmdProcStay(&cmd_stay);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user