Compare commits
1 Commits
cleanup/ut
...
cleanup/ip
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
657911d5a9 |
@@ -53,9 +53,9 @@ Progress
|
||||
<!-- progress:start -->
|
||||
| Decompiled | Matched | Linked | Data |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 99.59% | 90.94% | 73.37% | 99.37% |
|
||||
| 99.59% | 90.92% | 73.37% | 99.37% |
|
||||
|
||||
units 960/1027 complete, functions 12369/12563 matched.
|
||||
units 960/1027 complete, functions 12368/12563 matched.
|
||||
|
||||
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
|
||||
<!-- progress:end -->
|
||||
|
||||
@@ -43,7 +43,7 @@ private:
|
||||
bool mIsPlaying; // 0xB2
|
||||
bool mIsSetBuf; // 0xB3
|
||||
bool mThreadRunning; // 0xB4
|
||||
bool mbFillInCallback; // 0xB5
|
||||
bool unk_0xB5; // 0xB5
|
||||
|
||||
WaveFileAiff mAiff; // 0xB8
|
||||
WaveFileWav mWav; // 0xE8
|
||||
|
||||
@@ -32,8 +32,8 @@ namespace ipl {
|
||||
void set_arw_param();
|
||||
|
||||
int mState; // 0x04
|
||||
math::VEC2 mCurPos;
|
||||
math::VEC2 mStartPos;
|
||||
math::VEC2 unk_0x08;
|
||||
math::VEC2 unk_0x10;
|
||||
f32 mSpeed; // 0x18
|
||||
f32 mSoundFreq; // 0x1C
|
||||
};
|
||||
@@ -55,7 +55,7 @@ namespace ipl {
|
||||
void init() {
|
||||
mState = 0;
|
||||
mScroll = 0.0f;
|
||||
mVelocity = 0.0f;
|
||||
unk_0x3C = 0.0f;
|
||||
mUpLimit = 0.0f;
|
||||
mDownLimit = 0.0f;
|
||||
}
|
||||
@@ -92,11 +92,11 @@ namespace ipl {
|
||||
int mState; // 0x30
|
||||
f32 mDownLimit; // 0x34
|
||||
f32 mUpLimit; // 0x38
|
||||
f32 mVelocity;
|
||||
f32 unk_0x3C;
|
||||
f32 mScroll; // 0x40
|
||||
f32 mAnimFrom;
|
||||
f32 mFriction;
|
||||
f32 mAccel;
|
||||
f32 unk_0x44;
|
||||
f32 unk_0x48;
|
||||
f32 unk_0x4C;
|
||||
};
|
||||
} // namespace utility
|
||||
} // namespace ipl
|
||||
|
||||
@@ -195,7 +195,7 @@ typedef struct _zi8DawgCtx {
|
||||
ziU8* table; // 0x10
|
||||
ziU8* p14; // 0x14
|
||||
zi8DawgRec recs[0x32]; // 0x18
|
||||
ziU32 endNode; // 0x338
|
||||
ziU32 unk_0x338; // 0x338
|
||||
} zi8DawgCtx;
|
||||
|
||||
typedef struct _ziUwdNode {
|
||||
@@ -221,7 +221,7 @@ struct __zi8_work_data_s {
|
||||
ziU8 unk_0x19;
|
||||
ziU16 separator; // 0x1A
|
||||
ziU8 unk_0x1C[3];
|
||||
ziU8 ignoreCase;
|
||||
ziU8 unk_0x1F;
|
||||
ziU16 unk_0x20[0x40];
|
||||
ziU16 unk_0xA0[0x42];
|
||||
ziU16* unk_0x124[1];
|
||||
|
||||
@@ -32,7 +32,7 @@ ziU32 Zi8MatchROMdata0(ziWChar* elements, ziU8 count, ziU8 language,
|
||||
if (language != context->lang || graphTable != context->key) records[0].key = 0;
|
||||
if (count == 1 && mode != 0 && graphTable == 0xe) goto finish_graph;
|
||||
if (status != 0) {
|
||||
if (records[context->cnt - 1].node == (ziU8*)context->endNode) goto finish_graph;
|
||||
if (records[context->cnt - 1].node == (ziU8*)context->unk_0x338) goto finish_graph;
|
||||
for (index = 0; index < count; index++) {
|
||||
if (records[index].key != elements[index] &&
|
||||
(ziU16)records[index].attr != elements[index]) goto finish_graph;
|
||||
@@ -82,7 +82,7 @@ check_keys:
|
||||
records[0].node = ZiDAWGGetGraphInfo(context, keyData, (ziS16*)keys);
|
||||
} else {
|
||||
records[0].node = ZiDAWGGetGraph(context);
|
||||
context->endNode = 0;
|
||||
context->unk_0x338 = 0;
|
||||
context->p14 = 0;
|
||||
}
|
||||
records[0].key = 0;
|
||||
@@ -98,7 +98,7 @@ check_keys:
|
||||
}
|
||||
searching = 1;
|
||||
current = &records[context->cnt - 1];
|
||||
while (searching && context->cnt != 0 && current->node != (ziU8*)context->endNode) {
|
||||
while (searching && context->cnt != 0 && current->node != (ziU8*)context->unk_0x338) {
|
||||
if (capacity < context->cnt) goto finish_graph;
|
||||
current->attr = ZiDAWGgetCHARattribute(context, current->node, ZI_WORK);
|
||||
if (context->cnt <= count) {
|
||||
|
||||
@@ -126,7 +126,7 @@ matchText:
|
||||
if (pattern[index] != Zi8ConvertUC2Key(word[index], language, __zi8_work_data)) goto next;
|
||||
} else {
|
||||
folded = Zi8ConvertUC2WC(word[index], language, __zi8_work_data);
|
||||
if (folded != pattern[index] && (!ZI_WORK->ignoreCase || !Zi8ChangeCharCase(0, &folded, language, __zi8_work_data) || folded != pattern[index])) goto next;
|
||||
if (folded != pattern[index] && (!ZI_WORK->unk_0x1F || !Zi8ChangeCharCase(0, &folded, language, __zi8_work_data) || folded != pattern[index])) goto next;
|
||||
}
|
||||
}
|
||||
matched:
|
||||
|
||||
@@ -148,7 +148,7 @@ ziU8 Zi8MatchUWDdata(ziWChar* pattern, ziU8 length, ziWChar* currentWord, ziU16
|
||||
folded = currentWord[position];
|
||||
ZI_WORK->unk_0x141[previousOffset] = Zi8ConvertWC2UC(folded, language, __zi8_work_data);
|
||||
ZI_WORK->unk_0x184[previousOffset] = 0;
|
||||
if (ZI_WORK->ignoreCase != 0) {
|
||||
if (ZI_WORK->unk_0x1F != 0) {
|
||||
if (!Zi8ChangeCharCase(1, &folded, language, __zi8_work_data)) Zi8ChangeCharCase(0, &folded, language, __zi8_work_data);
|
||||
ZI_WORK->unk_0x184[previousOffset] = Zi8ConvertWC2UC(folded, language, __zi8_work_data);
|
||||
}
|
||||
@@ -192,7 +192,7 @@ next:
|
||||
if (pattern[position] != Zi8ConvertUC2Key(text[position], language, __zi8_work_data)) goto next;
|
||||
} else {
|
||||
folded = Zi8ConvertUC2WC(text[position], language, __zi8_work_data);
|
||||
if (folded != pattern[position] && (!ZI_WORK->ignoreCase || !Zi8ChangeCharCase(0, &folded, language, __zi8_work_data) || folded != pattern[position])) goto next;
|
||||
if (folded != pattern[position] && (!ZI_WORK->unk_0x1F || !Zi8ChangeCharCase(0, &folded, language, __zi8_work_data) || folded != pattern[position])) goto next;
|
||||
}
|
||||
}
|
||||
if (ZI_WORK->unk_0x140 != 0) {
|
||||
|
||||
@@ -199,10 +199,10 @@ checkEntry:
|
||||
}
|
||||
|
||||
result = graph + (ziU32)entry[4] * 0x10000 + (((ziU16)entry[5] << 8) + entry[6]);
|
||||
((zi8DawgCtx*)context)->endNode =
|
||||
((zi8DawgCtx*)context)->unk_0x338 =
|
||||
graph + (ziU32)entry[7] * 0x10000 + (((ziU16)entry[8] << 8) + entry[9]);
|
||||
if (((zi8DawgCtx*)context)->endNode == graph) {
|
||||
((zi8DawgCtx*)context)->endNode = 0;
|
||||
if (((zi8DawgCtx*)context)->unk_0x338 == graph) {
|
||||
((zi8DawgCtx*)context)->unk_0x338 = 0;
|
||||
}
|
||||
|
||||
if ((((ziU16)entry[0] << 8) + entry[1]) == 0) {
|
||||
|
||||
@@ -45,7 +45,7 @@ posEntry:
|
||||
if (pattern[position] == Zi8ConvertWC2Key(word[position], language, __zi8_work_data)) continue;
|
||||
break;
|
||||
} else if (word[position] != pattern[position]) {
|
||||
if (!ZI_WORK->ignoreCase || language == 1) break;
|
||||
if (!ZI_WORK->unk_0x1F || language == 1) break;
|
||||
folded = pattern[position];
|
||||
if (!Zi8ChangeCharCase(1, &folded, language, __zi8_work_data) || folded != word[position]) break;
|
||||
}
|
||||
|
||||
@@ -152,10 +152,10 @@ u32 __SCGetConfBufSize();
|
||||
|
||||
typedef struct SC_BT_DEV_INFO {
|
||||
u8 devName[20]; // 0x00
|
||||
u8 pad_0x14; // 0x14
|
||||
u8 pad_0x15[0xB]; // 0x15
|
||||
u8 unk_0x14;
|
||||
u8 unk_0x15[0xB];
|
||||
LINK_KEY linkKey; // 0x20
|
||||
u8 pad_0x30[0x10]; // 0x30
|
||||
u8 unk_0x30[0x10];
|
||||
} SC_BT_DEV_INFO;
|
||||
|
||||
typedef struct SCBtDeviceInfo {
|
||||
|
||||
@@ -26,7 +26,7 @@ typedef struct USBKBDCmdLED {
|
||||
|
||||
typedef struct USBKBDCmdLEDAsync {
|
||||
USBKBDCmdLED base; // 0x00
|
||||
u8 pad_0x08[0x10]; // 0x08
|
||||
u8 unk_0x08[0x10];
|
||||
USBKBDCmdLEDCallback cb; // 0x18
|
||||
void* cbArg; // 0x1C
|
||||
} USBKBDCmdLEDAsync;
|
||||
|
||||
@@ -64,13 +64,13 @@ void SimpleWavePlayer::wavePacketCallback(WavePacketCallbackStatus status, WaveP
|
||||
return;
|
||||
}
|
||||
|
||||
if (self->mbFillInCallback) {
|
||||
if (self->unk_0xB5) {
|
||||
MakeWave(player, packet, self);
|
||||
}
|
||||
}
|
||||
|
||||
SimpleWavePlayer::SimpleWavePlayer() : mSetupParam(1, nw4r::snd::SAMPLE_FORMAT_PCM_S16, 32000, 1.0f, 1) {
|
||||
mbFillInCallback = true;
|
||||
unk_0xB5 = true;
|
||||
unk_0xB0 = false;
|
||||
mIsSetData = false;
|
||||
mIsPlaying = false;
|
||||
@@ -196,7 +196,7 @@ void SimpleWavePlayer::stop() {
|
||||
|
||||
void SimpleWavePlayer::update() {
|
||||
if (mIsPlaying) {
|
||||
if (!mbFillInCallback) {
|
||||
if (!unk_0xB5) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (mWavePackets[i].GetAppendFlag()) {
|
||||
continue;
|
||||
|
||||
@@ -674,8 +674,7 @@ namespace ipl {
|
||||
|
||||
if (foundLangGroup) {
|
||||
nw4r::lyt::Group* group = layout->FindGroupByName(langGroup);
|
||||
nw4r::lyt::Group* const& groupView = group;
|
||||
for (nw4r::lyt::PaneLinkList::Iterator it = groupView->GetPaneList().GetBeginIter(); it != groupView->GetPaneList().GetEndIter(); it++) {
|
||||
for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++) {
|
||||
it->mTarget->SetVisible(true);
|
||||
}
|
||||
} else {
|
||||
@@ -686,8 +685,7 @@ namespace ipl {
|
||||
}
|
||||
if (strcmp(scModuleData.langGroupLookup[region][i], langCodeBuf[scLangLookup[region][i]]) == 0) {
|
||||
nw4r::lyt::Group* group = layout->FindGroupByName(scModuleData.langGroupLookup[region][i]);
|
||||
nw4r::lyt::Group* const& groupView = group;
|
||||
for (nw4r::lyt::PaneLinkList::Iterator it = groupView->GetPaneList().GetBeginIter(); it != groupView->GetPaneList().GetEndIter(); it++) {
|
||||
for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++) {
|
||||
it->mTarget->SetVisible(true);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -141,10 +141,10 @@ namespace ipl {
|
||||
|
||||
void BScroller::init() {
|
||||
mState = -1;
|
||||
mCurPos.x = 0.0f;
|
||||
mCurPos.y = 0.0f;
|
||||
mStartPos.x = 0.0f;
|
||||
mStartPos.y = 0.0f;
|
||||
unk_0x08.x = 0.0f;
|
||||
unk_0x08.y = 0.0f;
|
||||
unk_0x10.x = 0.0f;
|
||||
unk_0x10.y = 0.0f;
|
||||
mSpeed = 0.0f;
|
||||
mSoundFreq = 0.0f;
|
||||
}
|
||||
@@ -178,10 +178,10 @@ namespace ipl {
|
||||
|
||||
mState = chan;
|
||||
|
||||
mCurPos.x = math::abs_clamp<float>(ctrl->getDpdPos().x, 1.f);
|
||||
mCurPos.y = math::abs_clamp<float>(ctrl->getDpdPos().y, 1.f);
|
||||
unk_0x08.x = math::abs_clamp<float>(ctrl->getDpdPos().x, 1.f);
|
||||
unk_0x08.y = math::abs_clamp<float>(ctrl->getDpdPos().y, 1.f);
|
||||
|
||||
mStartPos = mCurPos;
|
||||
unk_0x10 = unk_0x08;
|
||||
|
||||
System::getPointer()->setState(mState, Pointer::STATE_SCROLL);
|
||||
System::getPointer()->setScrollState(mState);
|
||||
@@ -199,20 +199,20 @@ namespace ipl {
|
||||
System::getPointer()->setScrollState(Pointer::NO_SCROLL);
|
||||
init();
|
||||
} else if (ctrl->isValidDpd()) {
|
||||
mCurPos.x = math::abs_clamp<float>(ctrl->getDpdPos().x, 1.f);
|
||||
mCurPos.y = math::abs_clamp<float>(ctrl->getDpdPos().y, 1.f);
|
||||
unk_0x08.x = math::abs_clamp<float>(ctrl->getDpdPos().x, 1.f);
|
||||
unk_0x08.y = math::abs_clamp<float>(ctrl->getDpdPos().y, 1.f);
|
||||
|
||||
mSpeed = _get();
|
||||
set_arw_param();
|
||||
} else {
|
||||
if (math::abs<float>(mCurPos.x) < math::abs<float>(mCurPos.y)) {
|
||||
if (math::abs<float>(unk_0x08.x) < math::abs<float>(unk_0x08.y)) {
|
||||
f32 newVal;
|
||||
if (mCurPos.y < 0.0f) {
|
||||
if (unk_0x08.y < 0.0f) {
|
||||
newVal = -1.0f;
|
||||
} else {
|
||||
newVal = 1.0f;
|
||||
}
|
||||
mCurPos.y = newVal;
|
||||
unk_0x08.y = newVal;
|
||||
mSpeed = _get();
|
||||
set_arw_param();
|
||||
}
|
||||
@@ -234,7 +234,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
f32 BScroller::_get() {
|
||||
f32 diff = mCurPos.y - mStartPos.y;
|
||||
f32 diff = unk_0x08.y - unk_0x10.y;
|
||||
f32 result = 0.f;
|
||||
if (diff < -0.01f) {
|
||||
result = -10.0f * (diff * diff);
|
||||
@@ -259,7 +259,7 @@ namespace ipl {
|
||||
nw4r::ut::Rect rect;
|
||||
System::getProjectionRect(&rect);
|
||||
|
||||
f32 arrowLen = math::abs<float>(mStartPos.y - mCurPos.y) * rect.GetHeight();
|
||||
f32 arrowLen = math::abs<float>(unk_0x10.y - unk_0x08.y) * rect.GetHeight();
|
||||
System::getPointer()->setArrowLength(arrowLen);
|
||||
|
||||
System::getPointer()->setCursorScrolling(math::abs<float>(mSpeed) > 0.0f);
|
||||
@@ -291,11 +291,11 @@ namespace ipl {
|
||||
mState = 0;
|
||||
mDownLimit = 0.0f;
|
||||
mUpLimit = 0.0f;
|
||||
mVelocity = 0.0f;
|
||||
unk_0x3C = 0.0f;
|
||||
mScroll = 0.0f;
|
||||
mAnimFrom = 0.0f;
|
||||
mFriction = 0.6f;
|
||||
mAccel = 1.5f;
|
||||
unk_0x44 = 0.0f;
|
||||
unk_0x48 = 0.6f;
|
||||
unk_0x4C = 1.5f;
|
||||
|
||||
anim.init(0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 0, 1.0f);
|
||||
}
|
||||
@@ -319,26 +319,26 @@ namespace ipl {
|
||||
|
||||
switch (mState) {
|
||||
case Pointer::SCROLL_CON_UP: {
|
||||
mVelocity = mVelocity * mFriction - mAccel;
|
||||
if (mVelocity > 0.0f) {
|
||||
mVelocity = 0.0f;
|
||||
unk_0x3C = unk_0x3C * unk_0x48 - unk_0x4C;
|
||||
if (unk_0x3C > 0.0f) {
|
||||
unk_0x3C = 0.0f;
|
||||
}
|
||||
mScroll += mVelocity;
|
||||
mScroll += unk_0x3C;
|
||||
mState = Pointer::SCROLL;
|
||||
break;
|
||||
}
|
||||
case Pointer::SCROLL_CON_DOWN: {
|
||||
mVelocity = mVelocity * mFriction;
|
||||
mVelocity += mAccel;
|
||||
if (mVelocity < 0.0f) {
|
||||
mVelocity = 0.0f;
|
||||
unk_0x3C = unk_0x3C * unk_0x48;
|
||||
unk_0x3C += unk_0x4C;
|
||||
if (unk_0x3C < 0.0f) {
|
||||
unk_0x3C = 0.0f;
|
||||
}
|
||||
mScroll += mVelocity;
|
||||
mScroll += unk_0x3C;
|
||||
mState = Pointer::SCROLL;
|
||||
break;
|
||||
}
|
||||
case Pointer::SCROLL_BTN_UP: {
|
||||
mAnimFrom = oldScroll;
|
||||
unk_0x44 = oldScroll;
|
||||
anim.init(0.0f, -300.0f, 20.0f, 0.0f, 0.0f, 0, 1.0f);
|
||||
anim.initFrame();
|
||||
anim.restart();
|
||||
@@ -346,7 +346,7 @@ namespace ipl {
|
||||
break;
|
||||
}
|
||||
case Pointer::SCROLL_BTN_DOWN: {
|
||||
mAnimFrom = oldScroll;
|
||||
unk_0x44 = oldScroll;
|
||||
anim.init(0.0f, 300.0f, 20.0f, 0.0f, 0.0f, 0, 1.0f);
|
||||
anim.initFrame();
|
||||
anim.restart();
|
||||
@@ -355,10 +355,10 @@ namespace ipl {
|
||||
}
|
||||
case Pointer::SCROLLING_BY_BTN: {
|
||||
anim.calc();
|
||||
mScroll = mAnimFrom + anim.get();
|
||||
mScroll = unk_0x44 + anim.get();
|
||||
|
||||
if (!anim.isPlaying()) {
|
||||
mVelocity = 0.0f;
|
||||
unk_0x3C = 0.0f;
|
||||
anim.initFrame();
|
||||
anim.calc();
|
||||
mState = Pointer::SCROLL;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user