mirror of
https://github.com/zeldaret/tp
synced 2026-06-24 01:31:37 -04:00
JAHostIO and friends (#3131)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
#include <JSystem/JAHostIO/JAHioMessage.h>
|
||||
|
||||
void dummy(JAHControl* cont) {
|
||||
cont->makeSlider(NULL, (f32*)NULL, (f32)0, (f32)0, 0);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <JSystem/JAHostIO/JAHioMessage.h>
|
||||
|
||||
void dummy(JAHControl* cont, u16 s) {
|
||||
cont->startRadioButton(NULL, (u8*)NULL, (u8)0, 0);
|
||||
cont->makeRadioButtonItem(NULL, (u8)0);
|
||||
cont->endRadioButton();
|
||||
cont->makeButton(NULL, 0, (u8)0, 0);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "JSystem/JAHostIO/JAHUTableEdit.h"
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
|
||||
static void dummy(JAHUSeBox* box, JAHControl* ctrl) {
|
||||
box->getId();
|
||||
ctrl->makeCheckBox(NULL, (u8*)NULL, 0, false, 0);
|
||||
box->~JAHUSeBox();
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
#include "JSystem/JAHNodeLib/JAHSoundPlayerNode.h"
|
||||
#include "JSystem/JAHostIO/JAHUpdate.h"
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAudio2/JAISoundStarter.h"
|
||||
|
||||
void JAHPlayBox::onCurrentNodeFrame() {
|
||||
JAHSoundPlayerNode* master = (JAHSoundPlayerNode*)getMaster();
|
||||
if (!master)
|
||||
return;
|
||||
u8 b = master->getContMode() & 2;
|
||||
if (!b) {
|
||||
JAHUSeBox::onCurrentNodeFrame();
|
||||
} else if (unk48 != unk85) {
|
||||
if (unk48) {
|
||||
JAHUpdate::buttonOff(getMaster(), unk4C);
|
||||
JAHUpdate::buttonOn(getMaster(), unk50);
|
||||
} else {
|
||||
JAHUpdate::buttonOn(getMaster(), unk4C);
|
||||
JAHUpdate::buttonOff(getMaster(), unk50);
|
||||
}
|
||||
}
|
||||
|
||||
unk85 = unk48;
|
||||
}
|
||||
|
||||
u8 JAHSoundPlayerNode::getContMode() const {
|
||||
return unk7C;
|
||||
}
|
||||
|
||||
JAHSoundPlayerNode::JAHSoundPlayerNode() : JAHFrameNode("SOUND PLAYER"), unk122(16) {
|
||||
unk70 = 30;
|
||||
unk74 = 60;
|
||||
unk78 = 10;
|
||||
unk7C = 0;
|
||||
unk7D = 0;
|
||||
unk7E = 1;
|
||||
unk80 = 0;
|
||||
unk84 = 0;
|
||||
unk7F = 2;
|
||||
unk120 = 0;
|
||||
appendVirNode(&unk98);
|
||||
}
|
||||
|
||||
JAHPlayBox::JAHPlayBox() : JAHUSeBox(-1, NULL) {
|
||||
unk85 = 0;
|
||||
}
|
||||
|
||||
void JAHSoundPlayerNode::message(JAHControl& param_1) {
|
||||
param_1.returnY(1);
|
||||
param_1.makeCheckBox("ID順に連続再生する", &unk7C, 2, false, 0);
|
||||
param_1.returnY(1);
|
||||
param_1.makeComment("--連続再生モード設定--", 0, 5, 0);
|
||||
param_1.indent(1);
|
||||
param_1.makeSlider("最大再生時間(1=0.1sec)", &unk70, 0, 60000, 0);
|
||||
param_1.makeSlider("空白時間(1=0.1sec)", &unk78, 0, 6000, 0);
|
||||
param_1.returnY(1);
|
||||
param_1.startRadioButton("ダミーデータの挙動", &unk7E, 2, 0);
|
||||
param_1.makeRadioButtonItem("スキップする", 1);
|
||||
param_1.makeRadioButtonItem("再生する", 0);
|
||||
param_1.endRadioButton();
|
||||
param_1.startRadioButton("トリガーSEまたはBGM系の挙動", &unk7D, 2, 0);
|
||||
param_1.makeRadioButtonItem("フル再生", 0);
|
||||
param_1.makeRadioButtonItem("最大再生時間以上はフェードアウト", 1);
|
||||
param_1.endRadioButton();
|
||||
param_1.returnY(1);
|
||||
param_1.makeSlider("フェードアウト時間(単位:ゲームフレーム)", &unk74, 0, 3600, 0);
|
||||
}
|
||||
|
||||
void JAHSoundPlayerNode::onCurrentNodeFrame() {
|
||||
if (!(unk7C & 2))
|
||||
return;
|
||||
|
||||
u8 attr = unk122.getAttribute(unk98.getId());
|
||||
|
||||
switch (unk98.unk48) {
|
||||
case true:
|
||||
switch (unk7F) {
|
||||
case 0:
|
||||
if (!unk98.unk40) {
|
||||
unk90 = OSGetTime();
|
||||
unk84 = 0;
|
||||
unk7F = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if (unk80 > unk70) {
|
||||
unk84 = 0;
|
||||
unk7F = 2;
|
||||
} else {
|
||||
JASGlobalInstance<JAISoundStarter>::getInstance()->startSound(unk98.getId(),
|
||||
&unk98.unk40, NULL);
|
||||
unk80 = OSTicksToMilliseconds(OSGetTime() - unk88) / 100;
|
||||
}
|
||||
|
||||
if (unk7D == 1) {
|
||||
if (unk80 > unk70) {
|
||||
unk98.unk40->stop(unk74);
|
||||
unk84 = 0;
|
||||
unk90 = OSGetTime();
|
||||
unk7F = 1;
|
||||
} else {
|
||||
unk80 = OSTicksToMilliseconds(OSGetTime() - unk88) / 100;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!unk98.unk40) {
|
||||
unk7F = 2;
|
||||
unk90 = OSGetTime();
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
if (unk120) {
|
||||
if (unk84 <= unk78) {
|
||||
if (unk84 < 0)
|
||||
JASGlobalInstance<JAISoundStarter>::getInstance()->startSound(
|
||||
unk98.getId(), &unk98.unk40, NULL);
|
||||
|
||||
unk84 = OSTicksToMilliseconds(OSGetTime() - unk90) / 100;
|
||||
break;
|
||||
}
|
||||
|
||||
u32 id = unk122.getNextId(unk98.getId(), unk7E != 0 ? true : false);
|
||||
unk98.setId(id, true, this);
|
||||
}
|
||||
|
||||
JASGlobalInstance<JAISoundStarter>::getInstance()->startSound(unk98.getId(),
|
||||
&unk98.unk40, NULL);
|
||||
unk7F = 0;
|
||||
unk80 = 0;
|
||||
unk88 = OSGetTime();
|
||||
unk84 = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case false:
|
||||
if (unk120) {
|
||||
unk80 = 0;
|
||||
unk84 = 0;
|
||||
unk7F = 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
unk120 = unk98.unk48;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JSupport/JSUMemoryStream.h"
|
||||
#include "JSystem/JSupport/JSUOutputStream.h"
|
||||
|
||||
static void dummy(JSUMemoryInputStream& in, JSUOutputStream& out, JAHControl& ctrl) {
|
||||
out << s16(0);
|
||||
s16 b;
|
||||
in >> b;
|
||||
ctrl.makeSlider("", (u8*)NULL, (u8)0, (u8)0, 0);
|
||||
u16 a;
|
||||
in >> a;
|
||||
in.getPointer();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
#include "JSystem/JAHostIO/JAHUGlobal.h"
|
||||
|
||||
static void dummy(JSUInputStream& input) {
|
||||
JSUMemoryOutputStream stream(NULL, 0);
|
||||
stream.getPosition();
|
||||
stream << u8(0);
|
||||
u8 b;
|
||||
input >> b;
|
||||
u32 a;
|
||||
input >> a;
|
||||
JAHUDialog_OK("", "", "");
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
#include <JSystem/JAHostIO/JAHFrameNode.h>
|
||||
#include <JSystem/JAHostIO/JAHVirtualNode.h>
|
||||
#include <JSystem/JAHostIO/JAHioMessage.h>
|
||||
#include <JSystem/JAHostIO/JAHioMgr.h>
|
||||
|
||||
JAHFrameNode::JAHFrameNode(const char* name)
|
||||
: JAHioNode(name), mTree((JAHVirtualNode*)this), mFrameNodeLink(this) {}
|
||||
|
||||
void JAHFrameNode::genMessage(JORMContext* context) {
|
||||
JAHControl control(context, this);
|
||||
callAllVirtualMessages(control);
|
||||
message(control);
|
||||
if (JAHSingletonBase<JAHioMgr>::getIns()->getNodeSysType() == 0)
|
||||
generateTempChildren(context);
|
||||
else
|
||||
generateRealChildren(context);
|
||||
}
|
||||
|
||||
void JAHFrameNode::callAllVirtualMessages(JAHControl& control) {
|
||||
if (mTree.getNumChildren() == 0)
|
||||
return;
|
||||
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild(); iter != mTree.getEndChild();
|
||||
++iter)
|
||||
{
|
||||
iter->message(control);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHFrameNode::appendVirNode(JAHVirtualNode* node) {
|
||||
mTree.appendChild(node->getVirTree());
|
||||
}
|
||||
|
||||
void JAHFrameNode::listenPropertyEvent(const JORPropertyEvent* event) {
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild(); iter != mTree.getEndChild();
|
||||
++iter)
|
||||
{
|
||||
iter->listenVirtualPropertyEvent(JAH_P_EVENT0, (u32)event->id);
|
||||
}
|
||||
|
||||
JAHioNode::listenPropertyEvent(event);
|
||||
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild(); iter != mTree.getEndChild();
|
||||
++iter)
|
||||
{
|
||||
iter->listenVirtualPropertyEvent(JAH_P_EVENT1, (u32)event->id);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHFrameNode::listenNodeEvent(const JORNodeEvent* event) {
|
||||
JAHioNode::listenNodeEvent(event);
|
||||
if (event->field_0x0 == 3) {
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild();
|
||||
iter != mTree.getEndChild(); ++iter)
|
||||
iter->listenVirtualNodeEvent(JAH_N_EVENT0);
|
||||
} else if (event->field_0x0 == 4) {
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild();
|
||||
iter != mTree.getEndChild(); ++iter)
|
||||
iter->listenVirtualNodeEvent(JAH_N_EVENT1);
|
||||
} else if (event->field_0x0 == 5) {
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild();
|
||||
iter != mTree.getEndChild(); ++iter)
|
||||
iter->listenVirtualNodeEvent(JAH_N_EVENT2);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHFrameNode::framework() {
|
||||
onFrame();
|
||||
if (mTree.getNumChildren() != 0) {
|
||||
int i = 0; // unused?
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild();
|
||||
iter != mTree.getEndChild(); ++iter)
|
||||
{
|
||||
iter->framework();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JAHFrameNode::onFrame() {}
|
||||
|
||||
void JAHFrameNode::currentFramework() {
|
||||
onCurrentNodeFrame();
|
||||
if (mTree.getNumChildren() != 0) {
|
||||
int i = 0; // unused?
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild();
|
||||
iter != mTree.getEndChild(); ++iter)
|
||||
{
|
||||
iter->currentFramework();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JAHFrameNode::onCurrentNodeFrame() {}
|
||||
@@ -0,0 +1,172 @@
|
||||
#include <JSystem/JAHostIO/JAHUAsnData.h>
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAudio2/JAUSoundTable.h"
|
||||
#include "JSystem/JHostIO/JORServer.h"
|
||||
|
||||
u8 JAHUAsn::getAttribute(u32 param_1) {
|
||||
u8 a = (param_1 & 0x800) >> 11;
|
||||
u8 b = (param_1 & 0xC0000000) >> 24;
|
||||
return a | (b << 4);
|
||||
}
|
||||
|
||||
u16 JAHUAsn::getSubNum(s32 param_1, s32 param_2) {
|
||||
JAUSoundNameTable* table = JASGlobalInstance<JAUSoundNameTable>::getInstance();
|
||||
int num = table->getNumItems_inGroup(param_1, param_2);
|
||||
int uVar2 = (u16)(num / unk0);
|
||||
if (num % unk0 > 0)
|
||||
uVar2++;
|
||||
return uVar2 <= 64 ? (u16)uVar2 : (u16)64;
|
||||
}
|
||||
|
||||
u16 JAHUAsn::getDataNum(s32 param_1, s32 param_2, s32 param_3) {
|
||||
JAUSoundNameTable* table = JASGlobalInstance<JAUSoundNameTable>::getInstance();
|
||||
int uVar1 = getSubNum(param_1, param_2);
|
||||
int iVar2 = table->getNumItems_inGroup(param_1, param_2);
|
||||
|
||||
if (iVar2 == 0)
|
||||
return 0;
|
||||
|
||||
if (iVar2 % unk0 == 0)
|
||||
return unk0;
|
||||
|
||||
if (param_3 == uVar1 - 1)
|
||||
return iVar2 % unk0;
|
||||
|
||||
return unk0;
|
||||
}
|
||||
|
||||
const char* JAHUAsn::getName(s32 param_1, s32 param_2, s32 param_3, s32 param_4) {
|
||||
JAUSoundNameTable* table = JASGlobalInstance<JAUSoundNameTable>::getInstance();
|
||||
return table->getName((param_1 << 24) + (param_2 << 16) + (param_4 + param_3 * unk0));
|
||||
}
|
||||
|
||||
u32 JAHUAsn::getDataId(s32 param_1, s32 param_2, s32 param_3, s32 param_4) {
|
||||
return (param_1 << 24) + (param_2 << 16) + (param_4 + param_3 * unk0);
|
||||
}
|
||||
|
||||
void JAHUAsn::createComboBoxCategory(JAHControl& control) {
|
||||
int totalItems = 0;
|
||||
|
||||
JAUSoundNameTable* table = JASGlobalInstance<JAUSoundNameTable>::getInstance();
|
||||
for (u32 i = 0; i < 3; ++i) {
|
||||
for (u32 j = 0; j < table->getNumGroups_inSection(i); ++j) {
|
||||
if (table->getNumItems_inGroup(i, j) > 0) {
|
||||
const char* name = table->getGroupName((i << 24) + (j << 16));
|
||||
control.getContext()->genComboBoxItem(name, totalItems);
|
||||
++totalItems;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JAHUAsn::createComboBoxSub(JAHControl& control, s32 param_2, s32 param_3) {
|
||||
int uVar1 = getSubNum(param_2, param_3);
|
||||
for (int i = 0; i < uVar1; ++i) {
|
||||
char buffer[4];
|
||||
sprintf(buffer, "%2x\0", i);
|
||||
control.getContext()->genComboBoxItem(buffer, i);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHUAsn::createComboBoxData(JAHControl& control, s32 param_2, s32 param_3, s32 param_4) {
|
||||
int uVar1 = getDataNum(param_2, param_3, param_4);
|
||||
for (int i = 0; i < uVar1; ++i) {
|
||||
const char* name = getName(param_2, param_3, param_4, i);
|
||||
control.getContext()->genComboBoxItem(name, i);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHUAsn::checkAndUpdateNameBox(s32* param_1, s32* param_2, s32* param_3, s32* param_4,
|
||||
s32 param_5, s32 param_6, s32 param_7, JORReflexible* param_8) {
|
||||
if (*param_1 != param_5 || *param_2 != param_6 || *param_3 != param_7) {
|
||||
if (*param_2 != param_6 || *param_1 != param_5) {
|
||||
*param_3 = 0;
|
||||
__updateNameBoxSub(*param_1, *param_2, param_3, param_8);
|
||||
}
|
||||
|
||||
if (*param_3 != param_7 || *param_2 != param_6 || *param_1 != param_5) {
|
||||
*param_4 = 0;
|
||||
__updateNameBoxData(*param_1, *param_2, *param_3, param_4, param_8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JAHUAsn::updateNameBoxAll(s32* param_1, s32* param_2, s32* param_3, s32* param_4,
|
||||
JORReflexible* param_5) {
|
||||
__updateNameBoxCategory(param_2, param_5);
|
||||
__updateNameBoxSub(*param_1, *param_2, param_3, param_5);
|
||||
__updateNameBoxData(*param_1, *param_2, *param_3, param_4, param_5);
|
||||
}
|
||||
|
||||
void JAHUAsn::__updateNameBoxCategory(s32* param_1, JORReflexible* param_2) {
|
||||
JORMContext* ctx = attachJORMContext(8);
|
||||
ctx->startUpdateNode(param_2);
|
||||
ctx->updateComboBox(2, param_1, 0);
|
||||
ctx->endUpdateNode();
|
||||
releaseJORMContext(ctx);
|
||||
}
|
||||
|
||||
void JAHUAsn::__updateNameBoxSub(s32 param_1, s32 param_2, s32* param_3, JORReflexible* param_4) {
|
||||
JORMContext* ctx = attachJORMContext(8);
|
||||
ctx->startUpdateNode(param_4);
|
||||
ctx->removeComboBoxItem(5, param_3, 0);
|
||||
int num = getSubNum(param_1, param_2);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
char buf[4];
|
||||
sprintf(buf, "%2x\0", i);
|
||||
ctx->addComboBoxItem(1, param_3, buf, i, 0);
|
||||
}
|
||||
ctx->updateComboBox(2, param_3, 0);
|
||||
ctx->endUpdateNode();
|
||||
releaseJORMContext(ctx);
|
||||
}
|
||||
|
||||
void JAHUAsn::__updateNameBoxData(s32 param_1, s32 param_2, s32 param_3, s32* param_4,
|
||||
JORReflexible* param_5) {
|
||||
JORMContext* ctx = attachJORMContext(8);
|
||||
ctx->startUpdateNode(param_5);
|
||||
ctx->removeComboBoxItem(5, param_4, 0);
|
||||
ctx->endUpdateNode();
|
||||
releaseJORMContext(ctx);
|
||||
|
||||
ctx = attachJORMContext(8);
|
||||
ctx->startUpdateNode(param_5);
|
||||
int num = getDataNum(param_1, param_2, param_3);
|
||||
for (int i = 0; i < num; ++i) {
|
||||
ctx->addComboBoxItem(1, param_4, getName(param_1, param_2, param_3, i), i, 0);
|
||||
}
|
||||
ctx->updateComboBox(2, param_4, 0);
|
||||
ctx->endUpdateNode();
|
||||
releaseJORMContext(ctx);
|
||||
}
|
||||
|
||||
u32 JAHUAsn::__GetSubNo(s32 param_1) {
|
||||
return param_1 / unk0;
|
||||
}
|
||||
|
||||
u32 JAHUAsn::__GetDataNo(s32 param_1) {
|
||||
return param_1 % unk0;
|
||||
}
|
||||
|
||||
u8 JAHUAsn::getCategory(u32 param_1) {
|
||||
return (param_1 & 0xF0000) >> 0x10;
|
||||
}
|
||||
|
||||
u8 JAHUAsn::getSub(u32 param_1) {
|
||||
int perCat = getDataPerCat(param_1);
|
||||
return __GetSubNo(perCat);
|
||||
}
|
||||
|
||||
u16 JAHUAsn::getDataPerCat(u32 param_1) {
|
||||
return param_1;
|
||||
}
|
||||
|
||||
u16 JAHUAsn::getDataPerSub(u32 param_1) {
|
||||
u16 perCat = getDataPerCat(param_1);
|
||||
return __GetDataNo(perCat);
|
||||
}
|
||||
|
||||
u32 JAHUAsn::getNextId(u32 param_1, bool param_2) {
|
||||
JUT_ASSERT(490, 0L);
|
||||
return param_1;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <JSystem/JAHostIO/JAHioMessage.h>
|
||||
|
||||
void dummy(JAHControl* cont, u16 s) {
|
||||
cont->makeSlider(NULL, (s16*)NULL, (s16)0, (s16)0, 0);
|
||||
cont->makeSlider(NULL, (s32*)NULL, (s32)0, (s32)0, 0);
|
||||
cont->returnYDirectSize(s);
|
||||
cont->startRadioButton(NULL, (u8*)NULL, (u8)0, 0);
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
#include "JSystem/JAHostIO/JAHUTableEdit.h"
|
||||
#include "JSystem/JAHostIO/JAHUAsnData.h"
|
||||
#include "JSystem/JAHostIO/JAHUpdate.h"
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAHostIO/JAHioUtil.h"
|
||||
#include "JSystem/JAudio2/JAISoundStarter.h"
|
||||
#include "JSystem/JAudio2/JAUSoundTable.h"
|
||||
|
||||
JAHUSeBox::JAHUSeBox(u32 param_1, u32* param_2) : JAHVirtualNode(NULL) {
|
||||
unk4C = getVirNodeNum() | 0x12000000;
|
||||
unk50 = getVirNodeNum() | 0x13000000;
|
||||
unk54 = getVirNodeNum() | 0x14000000;
|
||||
unk5C = param_2;
|
||||
mAsnCalc = NULL;
|
||||
|
||||
mAsnCalc = new JAHUAsn(0x10);
|
||||
JUT_ASSERT(611, mAsnCalc);
|
||||
|
||||
unk48 = false;
|
||||
if (param_1 == -1)
|
||||
unk58 = mAsnCalc->getDataId(0, 0, 0, 0);
|
||||
else
|
||||
unk58 = param_1;
|
||||
|
||||
unk84 = 0;
|
||||
}
|
||||
|
||||
void JAHUSeBox::trigPlayButton() {
|
||||
unk48 = true;
|
||||
JAHUpdate::buttonOff(getMaster(), unk4C);
|
||||
JAHUpdate::buttonOn(getMaster(), unk50);
|
||||
}
|
||||
|
||||
void JAHUSeBox::trigStopButton() {
|
||||
unk48 = false;
|
||||
JAHUpdate::buttonOn(getMaster(), unk4C);
|
||||
JAHUpdate::buttonOff(getMaster(), unk50);
|
||||
soundStop();
|
||||
}
|
||||
|
||||
void JAHUSeBox::soundStop() {
|
||||
if (unk40)
|
||||
unk40->stop();
|
||||
}
|
||||
|
||||
void JAHUSeBox::onCurrentNodeFrame() {
|
||||
if (unk48) {
|
||||
soundPlay();
|
||||
unk48 = false;
|
||||
}
|
||||
|
||||
if (unk44 && !unk40) {
|
||||
JAHUpdate::buttonOn(getMaster(), unk4C);
|
||||
JAHUpdate::buttonOff(getMaster(), unk50);
|
||||
} else if (!unk44 && unk40) {
|
||||
JAHUpdate::buttonOff(getMaster(), unk4C);
|
||||
JAHUpdate::buttonOn(getMaster(), unk50);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHUSeBox::soundPlay() {
|
||||
JAISoundStarter* starter = JASGlobalInstance<JAISoundStarter>::getInstance();
|
||||
if (starter) {
|
||||
starter->startSound(unk58, &unk40, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHUSeBox::message(JAHControl& control) {
|
||||
if (!unk84 && JASGlobalInstance<JAUSoundNameTable>::getInstance()) {
|
||||
if (unk58 == -1) {
|
||||
unk64 = 0;
|
||||
unk68 = 0;
|
||||
unk6C = 0;
|
||||
unk70 = 0;
|
||||
unk74 = 0;
|
||||
unk78 = 0;
|
||||
unk7C = 0;
|
||||
unk80 = 0;
|
||||
unk58 = 0;
|
||||
} else {
|
||||
unk64 = unk58 >> 24;
|
||||
unk68 = mAsnCalc->getCategory(unk58);
|
||||
unk6C = mAsnCalc->getSub(unk58);
|
||||
unk70 = mAsnCalc->getDataPerSub(unk58);
|
||||
unk74 = unk64;
|
||||
unk78 = unk68;
|
||||
unk7C = unk6C;
|
||||
unk80 = unk70;
|
||||
}
|
||||
|
||||
unk84 = true;
|
||||
}
|
||||
|
||||
control.startComboBoxL(NULL, &unk68, 0, 200, 0);
|
||||
mAsnCalc->createComboBoxCategory(control);
|
||||
control.endComboBox();
|
||||
control.startComboBoxL(NULL, &unk6C, 0, 0x2d, 0);
|
||||
mAsnCalc->createComboBoxSub(control, unk64, unk68);
|
||||
control.endComboBox();
|
||||
control.startComboBoxL(NULL, &unk70, 0, 200, 0);
|
||||
mAsnCalc->createComboBoxData(control, unk64, unk68, unk6C);
|
||||
control.endComboBox();
|
||||
control.makeCommentL(JAHioUtil::getString("%08x", unk58), unk54, 0x37, 0);
|
||||
control.makeButtonL(">", unk4C, 0x32, 0);
|
||||
control.makeButtonL("■", unk50, 0x32, 0x40000000);
|
||||
control.returnY(1);
|
||||
}
|
||||
|
||||
void JAHUSeBox::nodeEvent(JAH_N_Event) {}
|
||||
|
||||
void JAHUSeBox::propertyEvent(JAH_P_Event param_1, u32 param_2) {
|
||||
if (param_1 == 0) {
|
||||
unk74 = unk64;
|
||||
unk78 = unk68;
|
||||
unk7C = unk6C;
|
||||
unk80 = unk70;
|
||||
return;
|
||||
}
|
||||
|
||||
if (param_2 != unk4C && param_2 != unk50 &&
|
||||
((unk7C == unk6C && unk80 == unk70) || unk68 != unk78))
|
||||
{
|
||||
JAUSoundNameTable* table = JASGlobalInstance<JAUSoundNameTable>::getInstance();
|
||||
int groups = table->getNumGroups_inSection(0);
|
||||
if (unk68 >= groups) {
|
||||
groups += table->getNumGroups_inSection(1);
|
||||
if (unk68 < groups) {
|
||||
unk64 = 1;
|
||||
unk68 -= table->getNumGroups_inSection(0);
|
||||
} else {
|
||||
unk64 = 2;
|
||||
unk68 -= groups;
|
||||
}
|
||||
} else {
|
||||
unk64 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mAsnCalc->checkAndUpdateNameBox(&unk64, &unk68, &unk6C, &unk70, unk74, unk78, unk7C,
|
||||
getMaster());
|
||||
if (checkNameSetChange()) {
|
||||
unk58 = mAsnCalc->getDataId(unk64, unk68, unk6C, unk70);
|
||||
if (unk5C != NULL)
|
||||
*unk5C = unk58;
|
||||
char buf[9];
|
||||
sprintf(buf, "%08x", unk58);
|
||||
JORMContext* ctx = attachJORMContext(8);
|
||||
ctx->startUpdateNode(getMaster());
|
||||
ctx->updateLabel(2, unk54, buf);
|
||||
ctx->endUpdateNode();
|
||||
releaseJORMContext(ctx);
|
||||
}
|
||||
|
||||
if (param_2 == unk4C) {
|
||||
trigPlayButton();
|
||||
} else if (param_2 == unk50) {
|
||||
trigStopButton();
|
||||
}
|
||||
}
|
||||
|
||||
u8 JAHUSeBox::checkNameSetChange() {
|
||||
u8 iVar1 = 0;
|
||||
|
||||
if (unk74 != unk64)
|
||||
iVar1++;
|
||||
|
||||
if (unk78 != unk68)
|
||||
iVar1++;
|
||||
|
||||
if (unk7C != unk6C)
|
||||
iVar1++;
|
||||
|
||||
if (unk80 != unk70)
|
||||
iVar1++;
|
||||
|
||||
return iVar1;
|
||||
}
|
||||
|
||||
void JAHUSeBox::updateNameSet(JORReflexible* param_1) {
|
||||
mAsnCalc->updateNameBoxAll(&unk64, &unk68, &unk6C, &unk70, param_1);
|
||||
JORMContext* ctx = attachJORMContext(8);
|
||||
ctx->startUpdateNode(param_1);
|
||||
ctx->updateLabel(2, unk54, JAHioUtil::getString("%08x", unk58));
|
||||
ctx->endUpdateNode();
|
||||
releaseJORMContext(ctx);
|
||||
}
|
||||
|
||||
void JAHUSeBox::setId(u32 param_1, bool param_2, JORReflexible* param_3) {
|
||||
unk58 = param_1;
|
||||
unk64 = unk58 >> 24;
|
||||
unk68 = (param_1 >> 16) & 0xff;
|
||||
unk6C = mAsnCalc->getSub(param_1);
|
||||
unk70 = mAsnCalc->getDataPerSub(param_1);
|
||||
if (param_2)
|
||||
updateNameSet(param_3);
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
#include <JSystem/JAHostIO/JAHVirtualNode.h>
|
||||
#include <JSystem/JUtility/JUTAssert.h>
|
||||
#include <cstring>
|
||||
|
||||
u32 JAHVirtualNode::smVirNodeNum;
|
||||
|
||||
void JAHVirtualNode::virtualMessage(JAHControl& control) {
|
||||
message(control);
|
||||
callAllVirtualMessages(control);
|
||||
}
|
||||
|
||||
void JAHVirtualNode::callAllVirtualMessages(JAHControl& control) {
|
||||
if (mTree.getNumChildren() == 0)
|
||||
return;
|
||||
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild(); iter != mTree.getEndChild();
|
||||
++iter)
|
||||
{
|
||||
iter->message(control);
|
||||
}
|
||||
}
|
||||
|
||||
JAHioNode* JAHVirtualNode::getMaster() {
|
||||
JSUTree<JAHVirtualNode>* it = mTree.getParent();
|
||||
while (it->getParent())
|
||||
it = it->getParent();
|
||||
return (JAHioNode*)it->getObject();
|
||||
}
|
||||
|
||||
void JAHVirtualNode::framework() {
|
||||
onFrame();
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = getVirTree()->getFirstChild();
|
||||
iter != getVirTree()->getEndChild(); ++iter)
|
||||
{
|
||||
iter->framework();
|
||||
}
|
||||
}
|
||||
|
||||
void JAHVirtualNode::onFrame() {}
|
||||
|
||||
void JAHVirtualNode::currentFramework() {
|
||||
onCurrentNodeFrame();
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = getVirTree()->getFirstChild();
|
||||
iter != getVirTree()->getEndChild(); ++iter)
|
||||
{
|
||||
iter->framework();
|
||||
}
|
||||
}
|
||||
|
||||
void JAHVirtualNode::onCurrentNodeFrame() {}
|
||||
|
||||
void JAHVirtualNode::listenVirtualPropertyEvent(JAH_P_Event param_1, u32 param_2) {
|
||||
propertyEvent(param_1, param_2);
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild(); iter != mTree.getEndChild();
|
||||
++iter)
|
||||
{
|
||||
iter->listenVirtualPropertyEvent(param_1, param_2);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHVirtualNode::propertyEvent(JAH_P_Event, u32) {}
|
||||
|
||||
void JAHVirtualNode::listenVirtualNodeEvent(JAH_N_Event param_1) {
|
||||
nodeEvent(param_1);
|
||||
for (JSUTreeIterator<JAHVirtualNode> iter = mTree.getFirstChild(); iter != mTree.getEndChild();
|
||||
++iter)
|
||||
{
|
||||
iter->listenVirtualNodeEvent(param_1);
|
||||
}
|
||||
}
|
||||
|
||||
void JAHVirtualNode::nodeEvent(JAH_N_Event) {}
|
||||
|
||||
void JAHVirtualNode::setVirNodeName(const char* name) {
|
||||
JUT_ASSERT(139, name);
|
||||
size_t size = strlen(name) + 1;
|
||||
// clang-format off
|
||||
JUT_ASSERT(141, size<32);
|
||||
// clang-format on
|
||||
strcpy(mName, name);
|
||||
}
|
||||
|
||||
JAHVirtualNode::JAHVirtualNode(const char* name) : mTree(this) {
|
||||
if (name)
|
||||
setVirNodeName(name);
|
||||
else
|
||||
setVirNodeName("no name");
|
||||
smVirNodeNum += 1;
|
||||
}
|
||||
|
||||
void JAHVirtualNode::updateNode() {
|
||||
getMaster()->updateNode();
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
u16 JAHControl::smButtonWidth[] = {20, 50, 100, 150, 300, 600};
|
||||
u16 JAHControl::smCommentWidth[] = {20, 50, 100, 200, 400, 800};
|
||||
u16 JAHControl::smComboWidth[] = { 50, 100, 150, 200, 300, 600};
|
||||
u16 JAHControl::smComboWidth[] = {50, 100, 150, 200, 300, 600};
|
||||
u16 JAHControl::smYTop = 5;
|
||||
u16 JAHControl::smXLeft = 5;
|
||||
u16 JAHControl::smIndentSize = 30;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioMgr.h"
|
||||
#include "JSystem/JAHostIO/JAHFrameNode.h"
|
||||
#include "JSystem/JAHostIO/JAHioMgr.h"
|
||||
#include "JSystem/JHostIO/JORServer.h"
|
||||
|
||||
template <>
|
||||
JAHioMgr* JAHSingletonBase<JAHioMgr>::sInstance = NULL;
|
||||
|
||||
JAHioMgr::JAHioMgr() : field_0x4(0), field_0x8(0) {}
|
||||
|
||||
void JAHioMgr::init_OnGame() {
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
#include <cstring>
|
||||
#include "JSystem/JAHostIO/JAHioMessage.h"
|
||||
#include "JSystem/JAHostIO/JAHioMgr.h"
|
||||
#include "JSystem/JAHostIO/JAHioNode.h"
|
||||
#include "JSystem/JHostIO/JORServer.h"
|
||||
#include <cstring>
|
||||
|
||||
JAHioNode* JAHioNode::smCurrentNode;
|
||||
|
||||
JAHioNode::JAHioNode(const char* name) : mTree(this) {
|
||||
mLastChild = NULL;
|
||||
@@ -86,7 +88,9 @@ void JAHioNode::generateTempChildren(JORMContext* mctx) {
|
||||
}
|
||||
}
|
||||
|
||||
u32 JAHioNode::getNodeKind() const { return 0; }
|
||||
u32 JAHioNode::getNodeKind() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
JAHioNode* JAHioNode::getParent() {
|
||||
if (mTree.getParent()) {
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JAHostIO/JAHioUtil.h"
|
||||
#include <cstdio>
|
||||
#include "JSystem/JAHostIO/JAHUpdate.h"
|
||||
#include "JSystem/JAHostIO/JAHioUtil.h"
|
||||
#include "JSystem/JHostIO/JORFile.h"
|
||||
|
||||
char JAHioUtil::mStringBuffer[256];
|
||||
|
||||
JAHioNode* JAHUpdate::spNode;
|
||||
JORMContext* JAHUpdate::spMc;
|
||||
|
||||
static char* dummy(JORDir* dir) {
|
||||
return std::strrchr(dir->getFilename(), '\n');
|
||||
}
|
||||
|
||||
char* JAHioUtil::getString(const char* msg, ...) {
|
||||
va_list args;
|
||||
va_start(msg, args);
|
||||
|
||||
Reference in New Issue
Block a user