Compare commits
1 Commits
cleanup/co
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad632eeb40 |
@@ -1025,7 +1025,7 @@ config.libs = [
|
||||
Object(NonMatching, "cdb/CDBRecord.c"),
|
||||
Object(Matching, "cdb/CDBRecordFile.c"),
|
||||
Object(Matching, "cdb/CDBRecordKey.c"),
|
||||
Object(NonMatching, "cdb/CDBIntArray.c"),
|
||||
Object(Matching, "cdb/CDBIntArray.c"),
|
||||
Object(Matching, "cdb/CDBSystem.c"),
|
||||
Object(Matching, "cdb/CDBAttr.c"),
|
||||
Object(Matching, "cdb/CDBFBridge.c"),
|
||||
|
||||
@@ -225,6 +225,46 @@ namespace ipl {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef IPL_SD_CHANNEL_SELECT_CPP
|
||||
} // namespace math
|
||||
} // namespace ipl
|
||||
#include "math/iplMathTypes.h"
|
||||
namespace ipl {
|
||||
namespace math {
|
||||
template <>
|
||||
class HermiteIntp<VEC3> : public utility::FrameController {
|
||||
public:
|
||||
HermiteIntp() {}
|
||||
virtual ~HermiteIntp();
|
||||
void init(const VEC3& start, const VEC3& end, f32 maxFrame, f32 param_5, f32 param_6, int playback = ANIM_TYPE_FORWARD, f32 speed = 1.0f);
|
||||
VEC3 get() const {
|
||||
f32 frame = mFrame;
|
||||
f32 inverseDuration = 1.0f / mMaxFrame;
|
||||
VEC3 result =
|
||||
(mStart * (1.0f + (inverseDuration * (inverseDuration *
|
||||
(inverseDuration * (frame * (2.0f * frame * frame)))) -
|
||||
inverseDuration * (inverseDuration * (3.0f * frame * frame))))) -
|
||||
(mEnd * (inverseDuration * (inverseDuration *
|
||||
(inverseDuration * (frame * (2.0f * frame * frame)))) -
|
||||
inverseDuration * (inverseDuration * (3.0f * frame * frame))));
|
||||
f32 frameSquared = frame * frame;
|
||||
f32 cubic = inverseDuration * (inverseDuration * (frame * frameSquared));
|
||||
f32 tangent = unkVal0 * (frame + (cubic -
|
||||
inverseDuration * (2.0f * frame * frame))) +
|
||||
unkVal1 * (cubic - inverseDuration * frameSquared);
|
||||
result.x += tangent;
|
||||
result.y += tangent;
|
||||
result.z += tangent;
|
||||
return result;
|
||||
}
|
||||
protected:
|
||||
VEC3 mStart;
|
||||
VEC3 mEnd;
|
||||
f32 unkVal0;
|
||||
f32 unkVal1;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace math
|
||||
} // namespace ipl
|
||||
|
||||
|
||||
@@ -156,10 +156,10 @@ void KPRInitRegionUS(void) {
|
||||
}
|
||||
|
||||
void KPRInitQueue(KPRQueue* queue) {
|
||||
static u8 once;
|
||||
if (!once) {
|
||||
static union { u64 align; u8 flag; } once;
|
||||
if (!once.flag) {
|
||||
OSRegisterVersion(__KPRVersion);
|
||||
once = TRUE;
|
||||
once.flag = TRUE;
|
||||
}
|
||||
queue->mode = KPR_MODE_ALT_KEYPAD;
|
||||
queue->oCount = 0;
|
||||
@@ -244,10 +244,9 @@ u8 KPRLookAhead(KPRQueue* queue, u16* destination, u32 capacity) {
|
||||
|
||||
BOOL KPRProcessAltKeypad(KPRQueue* queue, u16 character) {
|
||||
if (queue->altVal != 0) {
|
||||
u32 leadingZero = queue->altVal & 0x80000000;
|
||||
u32 accumulator = queue->altVal;
|
||||
u32 accumulator = queue->altVal & 0x7FFFFFFF;
|
||||
u32 value;
|
||||
accumulator &= 0x7FFFFFFF;
|
||||
u32 leadingZero = queue->altVal & 0x80000000;
|
||||
queue->altVal = accumulator;
|
||||
if (character >= 0xF130 && character <= 0xF139) {
|
||||
if (accumulator > 0x6666666) {
|
||||
@@ -302,7 +301,7 @@ BOOL KPRProcessAltKeypad(KPRQueue* queue, u16 character) {
|
||||
void KPRProcessDeadKeys(KPRQueue* queue) {
|
||||
int index;
|
||||
int firstFallback;
|
||||
int secondFallback;
|
||||
u32 secondFallback;
|
||||
if (queue->iCount == 1) {
|
||||
for (index = 0; index < 107; ++index) {
|
||||
if (queue->text[queue->oCount] == kprDeadKeyMap[index].accent) {
|
||||
@@ -313,17 +312,15 @@ void KPRProcessDeadKeys(KPRQueue* queue) {
|
||||
queue->iCount = 0;
|
||||
return;
|
||||
}
|
||||
firstFallback = 0;
|
||||
secondFallback = 107;
|
||||
for (index = 0; index < 107; ++index) {
|
||||
u16 first = queue->text[queue->oCount];
|
||||
if (first == kprDeadKeyMap[index].accent && queue->text[queue->oCount + 1] == kprDeadKeyMap[index].base) {
|
||||
if (queue->text[queue->oCount] == kprDeadKeyMap[index].accent && queue->text[queue->oCount + 1] == kprDeadKeyMap[index].base) {
|
||||
queue->text[queue->oCount] = kprDeadKeyMap[index].composed;
|
||||
queue->iCount = 0;
|
||||
++queue->oCount;
|
||||
return;
|
||||
}
|
||||
if (first == kprDeadKeyMap[index].accent && first == kprDeadKeyMap[index].base) {
|
||||
if (queue->text[queue->oCount] == kprDeadKeyMap[index].accent && queue->text[queue->oCount] == kprDeadKeyMap[index].base) {
|
||||
firstFallback = index;
|
||||
}
|
||||
if (queue->text[queue->oCount + 1] == kprDeadKeyMap[index].accent && queue->text[queue->oCount + 1] == kprDeadKeyMap[index].base) {
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace ipl {
|
||||
void writeFourFlagBytes(u8* flags, u8 first, u8 second, u8 third, u8 fourth);
|
||||
|
||||
void setTitleRowColors(nw4r::lyt::TextBox* textBox, const nw4r::ut::Color& first,
|
||||
const nw4r::ut::Color& second);
|
||||
const nw4r::ut::Color& second) NO_INLINE;
|
||||
|
||||
static const char* sControlPaneNames[] = {
|
||||
"A", "B", "B_BtnA",
|
||||
@@ -1141,13 +1141,15 @@ namespace ipl {
|
||||
|
||||
void SDMemory::onDialogState21() {
|
||||
const wchar_t* message = System::getMessage(mMessageId);
|
||||
const wchar_t* blockCountMarker = wcsstr(message, L"***\n");
|
||||
const wchar_t* blockCountMarker = wcsstr(message, L"****");
|
||||
wchar_t* format = new (System::getMem2App(), -32) wchar_t[0x400];
|
||||
wchar_t* dialogMessage = new (System::getMem2App(), -32) wchar_t[0x400];
|
||||
|
||||
if (blockCountMarker != NULL && message != NULL) {
|
||||
format[0] = L'\0';
|
||||
wcsncat(format, message, static_cast<u32>(blockCountMarker - message));
|
||||
memset(format + 1, 1, 0);
|
||||
wcsncat(format, message,
|
||||
(reinterpret_cast<u32>(blockCountMarker) - reinterpret_cast<u32>(message)) >> 1);
|
||||
wcscat(format, L"%d");
|
||||
wcscat(format, blockCountMarker + 4);
|
||||
|
||||
@@ -1251,7 +1253,10 @@ namespace ipl {
|
||||
|
||||
void SDMemory::drawTransferTitles() {
|
||||
const nw4r::math::VEC3& translation = mpDialogLayout->FindPaneByName("N_Memo")->GetTranslate();
|
||||
nw4r::math::VEC3 memoPosition(translation.x, translation.y, translation.z);
|
||||
nw4r::math::VEC3 memoPosition;
|
||||
memoPosition.x = translation.x;
|
||||
memoPosition.y = translation.y;
|
||||
memoPosition.z = translation.z;
|
||||
mpDialogLayout->FindPaneByName("header_header");
|
||||
nw4r::lyt::Pane* bodyPane = mpDialogLayout->FindPaneByName("header_body");
|
||||
|
||||
@@ -1284,7 +1289,8 @@ namespace ipl {
|
||||
mpDialogLayout->FindPaneByName("T_Header_body"));
|
||||
s32 totalLines = lineCount + 1;
|
||||
s32 lineIndex = 0;
|
||||
while (lineIndex < totalLines) {
|
||||
if (lineIndex < totalLines) {
|
||||
do {
|
||||
const wchar_t* lineEnd = wcsstr(messageLine, L"\n");
|
||||
if (lineEnd == NULL) {
|
||||
utility::layout::set_string(messageText, messageLine);
|
||||
@@ -1305,6 +1311,7 @@ namespace ipl {
|
||||
|
||||
messageOffset -= bodyHeight;
|
||||
++lineIndex;
|
||||
} while (lineIndex < totalLines);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1328,14 +1335,20 @@ namespace ipl {
|
||||
for (u32 titleIndex = 0; titleIndex < mTitleCount; ++titleIndex) {
|
||||
utility::layout::set_string(titleText, mTitleNames[titleIndex]);
|
||||
if (nandTitleIndex < mNandTitleCount && mTitleIds[titleIndex] == mNandTitleIds[nandTitleIndex]) {
|
||||
nw4r::ut::Color activeTitleColor;
|
||||
writeFourFlagBytes(&activeTitleColor.r, 0x34, 0xBE, 0xED, 0xFF);
|
||||
GXColor gxActive;
|
||||
writeFourFlagBytes(&gxActive.r, 0x34, 0xBE, 0xED, 0xFF);
|
||||
++nandTitleIndex;
|
||||
setTitleRowColors(titleText, activeTitleColor, activeTitleColor);
|
||||
nw4r::ut::Color active0 = *reinterpret_cast<const nw4r::ut::Color*>(&gxActive);
|
||||
setTitleRowColors(titleText,
|
||||
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxActive)),
|
||||
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxActive)));
|
||||
} else {
|
||||
nw4r::ut::Color inactiveTitleColor;
|
||||
writeFourFlagBytes(&inactiveTitleColor.r, 0x64, 0x64, 0x64, 0xFF);
|
||||
setTitleRowColors(titleText, inactiveTitleColor, inactiveTitleColor);
|
||||
GXColor gxInactive;
|
||||
writeFourFlagBytes(&gxInactive.r, 0x64, 0x64, 0x64, 0xFF);
|
||||
nw4r::ut::Color inactive0 = *reinterpret_cast<const nw4r::ut::Color*>(&gxInactive);
|
||||
setTitleRowColors(titleText,
|
||||
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxInactive)),
|
||||
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxInactive)));
|
||||
}
|
||||
|
||||
nw4r::ut::Rect textRect = mpDialogLayout->getTextDrawRect("T_Letter");
|
||||
@@ -1343,7 +1356,7 @@ namespace ipl {
|
||||
s32 visibleRows = static_cast<s32>(static_cast<f32>(ceil(-rowTop / titleSizePane->GetSize().height)));
|
||||
for (s32 row = 0; row < visibleRows; ++row) {
|
||||
f32 rowY = bodyY + backgroundOffset;
|
||||
if (rowY > -500.0f && rowY < 500.0f) {
|
||||
if (-500.0f < rowY && rowY < 500.0f) {
|
||||
nw4r::math::VEC2 translation(0.0f, backgroundOffset);
|
||||
titleSizePane->SetTranslate(translation);
|
||||
titleSizePane->CalculateMtx(*mpDialogLayout->getDrawInfo());
|
||||
@@ -1351,7 +1364,7 @@ namespace ipl {
|
||||
}
|
||||
backgroundOffset -= rowHeight;
|
||||
}
|
||||
if (bodyY + titleOffset > -500.0f && bodyY + titleOffset < 500.0f) {
|
||||
if (-500.0f < bodyY + titleOffset && bodyY + titleOffset < 500.0f) {
|
||||
nw4r::math::VEC2 translation(0.0f, titleOffset);
|
||||
titleText->SetTranslate(translation);
|
||||
titleText->CalculateMtx(*mpDialogLayout->getDrawInfo());
|
||||
@@ -1368,7 +1381,7 @@ namespace ipl {
|
||||
++footerChild;
|
||||
}
|
||||
|
||||
if (bodyY + backgroundOffset > -500.0f) {
|
||||
if (-500.0f < bodyY + backgroundOffset) {
|
||||
nw4r::math::VEC2 translation(0.0f, backgroundOffset);
|
||||
footerPane->SetTranslate(translation);
|
||||
footerPane->CalculateMtx(*mpDialogLayout->getDrawInfo());
|
||||
@@ -1388,7 +1401,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void setTitleRowColors(nw4r::lyt::TextBox* textBox, const nw4r::ut::Color& first,
|
||||
const nw4r::ut::Color& second) {
|
||||
const nw4r::ut::Color& second) NO_INLINE {
|
||||
textBox->SetTextColors(first, second);
|
||||
}
|
||||
|
||||
|
||||
@@ -264,7 +264,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = 0;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = 0;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
}
|
||||
|
||||
@@ -274,7 +273,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = 0;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = 0;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -289,7 +287,6 @@ namespace ipl {
|
||||
notice.arguments.values[0] = argument0;
|
||||
notice.arguments.values[1] = argument1;
|
||||
notice.titleId = titleId;
|
||||
notice.arguments.values[2] = 0;
|
||||
if (mNoticeQueue.capacity != mNoticeQueue.count) {
|
||||
mNoticeQueue.notices[mNoticeQueue.writeIndex].copyFrom(notice);
|
||||
++mNoticeQueue.writeIndex;
|
||||
@@ -311,7 +308,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = 0;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = 0;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -326,7 +322,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = 0;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = 0;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -341,7 +336,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = 0;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = result;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -356,7 +350,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = value;
|
||||
command.arguments.values[1] = (u32)&mFirstTitleCount;
|
||||
command.titleId = ((u64)page << 32) | index;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -371,7 +364,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = 0;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = ((u64)page << 32) | index;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -386,7 +378,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = state;
|
||||
command.arguments.values[1] = 0;
|
||||
command.titleId = ((u64)page << 32) | index;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -401,7 +392,6 @@ namespace ipl {
|
||||
command.arguments.values[0] = page;
|
||||
command.arguments.values[1] = index;
|
||||
command.titleId = 0;
|
||||
command.arguments.values[2] = 0;
|
||||
mCommandQueue.push(command);
|
||||
return true;
|
||||
}
|
||||
@@ -1301,7 +1291,10 @@ namespace ipl {
|
||||
blocks += mpNandTitleInfo[index].inode;
|
||||
}
|
||||
|
||||
return bytes >= usage[0] && blocks >= usage[1];
|
||||
if (bytes >= usage[0] && blocks >= usage[1]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SDChannelSelect::getCurrentTitleUsage(s32* bytes, s32* blocks) const {
|
||||
@@ -1456,6 +1449,7 @@ namespace ipl {
|
||||
s32 bytes;
|
||||
s32 blocks;
|
||||
getCurrentTitleUsage(&bytes, &blocks);
|
||||
|
||||
int hateUsageIndex = -1;
|
||||
int hatePage = -1;
|
||||
int hateChannelIndex = -1;
|
||||
@@ -1464,45 +1458,48 @@ namespace ipl {
|
||||
int hadeChannelIndex = -1;
|
||||
|
||||
for (u32 usageIndex = 0; usageIndex < mNandTitleCount; ++usageIndex) {
|
||||
const ESTitleId titleId = mpNandTitleInfo[usageIndex].curTitleId;
|
||||
ESTitleId titleId = mpNandTitleInfo[usageIndex].curTitleId;
|
||||
if (titleId == ES_TITLE_ID(0x00010001, 0x48415445)) {
|
||||
int page;
|
||||
int channelIndex;
|
||||
hateUsageIndex = usageIndex;
|
||||
int foundPage = -1;
|
||||
int foundIndex = -1;
|
||||
System::getChannelManager()->hasChannel(
|
||||
ES_TITLE_ID(0x00010001, 0x48415445), &foundPage, &foundIndex);
|
||||
hatePage = foundPage;
|
||||
hateChannelIndex = foundIndex;
|
||||
ES_TITLE_ID(0x00010001, 0x48415445), &page, &channelIndex);
|
||||
hatePage = page;
|
||||
hateChannelIndex = channelIndex;
|
||||
} else if (titleId == ES_TITLE_ID(0x00010001, 0x48414445)) {
|
||||
int page;
|
||||
int channelIndex;
|
||||
hadeUsageIndex = usageIndex;
|
||||
int foundPage = -1;
|
||||
int foundIndex = -1;
|
||||
System::getChannelManager()->hasChannel(
|
||||
ES_TITLE_ID(0x00010001, 0x48414445), &foundPage, &foundIndex);
|
||||
hadePage = foundPage;
|
||||
hadeChannelIndex = foundIndex;
|
||||
ES_TITLE_ID(0x00010001, 0x48414445), &page, &channelIndex);
|
||||
hadePage = page;
|
||||
hadeChannelIndex = channelIndex;
|
||||
}
|
||||
}
|
||||
|
||||
*titleCount = 0;
|
||||
for (int usageIndex = mNandTitleCount - 1; usageIndex >= 0; --usageIndex) {
|
||||
const ESTitleId titleId = mpNandTitleInfo[usageIndex].curTitleId;
|
||||
if (titleId == 0x48415A41 || titleId == ES_TITLE_ID(0x00010001, 0x48415445) || titleId == ES_TITLE_ID(0x00010001, 0x48414445)) {
|
||||
if (mpNandTitleInfo[usageIndex].curTitleId == 0x48415A41 ||
|
||||
mpNandTitleInfo[usageIndex].curTitleId == ES_TITLE_ID(0x00010001, 0x48415445) ||
|
||||
mpNandTitleInfo[usageIndex].curTitleId == ES_TITLE_ID(0x00010001, 0x48414445)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
int page;
|
||||
int channelIndex;
|
||||
if (System::getChannelManager()->hasChannel(titleId, &page, &channelIndex) == 0) {
|
||||
if (System::getChannelManager()->hasChannel(
|
||||
mpNandTitleInfo[usageIndex].curTitleId, &page, &channelIndex) == 0) {
|
||||
continue;
|
||||
}
|
||||
if (iplSavedata_813597A0(System::getSaveData(), titleId) != FALSE) {
|
||||
if (iplSavedata_813597A0(System::getSaveData(),
|
||||
mpNandTitleInfo[usageIndex].curTitleId) != FALSE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bytes += mpNandTitleInfo[usageIndex].size;
|
||||
blocks += mpNandTitleInfo[usageIndex].inode;
|
||||
titleIds[*titleCount] = titleId;
|
||||
titleIds[*titleCount] = mpNandTitleInfo[usageIndex].curTitleId;
|
||||
wchar_t* titleName = System::getChannelManager()->getTitleName(
|
||||
page, channelIndex, 0);
|
||||
memcpy(titleNames + *titleCount * 0x2a, titleName, 0x2a);
|
||||
@@ -1543,7 +1540,7 @@ namespace ipl {
|
||||
if (hadeUsageIndex >= 0) {
|
||||
bytes += mpNandTitleInfo[hadeUsageIndex].size;
|
||||
blocks += mpNandTitleInfo[hadeUsageIndex].inode;
|
||||
titleIds[*titleCount] = ES_TITLE_ID(0x00010001, 0x48414445);
|
||||
titleIds[*titleCount] = mpNandTitleInfo[hadeUsageIndex].curTitleId;
|
||||
wchar_t* titleName =
|
||||
System::getChannelManager()->getTitleName(
|
||||
hadePage, hadeChannelIndex, 0);
|
||||
@@ -1558,7 +1555,7 @@ namespace ipl {
|
||||
if (hateUsageIndex >= 0) {
|
||||
bytes += mpNandTitleInfo[hateUsageIndex].size;
|
||||
blocks += mpNandTitleInfo[hateUsageIndex].inode;
|
||||
titleIds[*titleCount] = ES_TITLE_ID(0x00010001, 0x48415445);
|
||||
titleIds[*titleCount] = mpNandTitleInfo[hateUsageIndex].curTitleId;
|
||||
wchar_t* titleName =
|
||||
System::getChannelManager()->getTitleName(
|
||||
hatePage, hateChannelIndex, 0);
|
||||
@@ -1570,7 +1567,10 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
return bytes >= firstUsage[0] && blocks >= firstUsage[1];
|
||||
if (bytes >= firstUsage[0] && blocks >= firstUsage[1]) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SDChannelSelect::collectTitlesForMode(
|
||||
@@ -1696,7 +1696,7 @@ namespace ipl {
|
||||
if (mState == 2 && !mpLayout->isPlaying(0)) {
|
||||
SDButton* button = static_cast<SDButton*>(System::getSceneManager()->getScene(0x24));
|
||||
if (button != NULL) {
|
||||
button->setEventHandler(mpButtonEventHandler, NULL);
|
||||
button->setEventHandler(mpButtonEventHandler);
|
||||
mState = 3;
|
||||
if (mCurrentPage > 0) {
|
||||
button->initArrowAppearance(1, true);
|
||||
@@ -2244,7 +2244,7 @@ namespace ipl {
|
||||
mbRightArrowVisible = false;
|
||||
}
|
||||
|
||||
button->setEventHandler(mpButtonEventHandler, NULL);
|
||||
button->setEventHandler(mpButtonEventHandler);
|
||||
TVRCManager::getHandle()->setEnable(TRUE);
|
||||
snd::getSystem()->startBGM("WIPL_BGM_MENU");
|
||||
clearNoticeQueue();
|
||||
@@ -3463,7 +3463,7 @@ namespace ipl {
|
||||
|
||||
if (strcmp(paneName,
|
||||
SDButton::smButtonName[SDButton::BTN_WII_MENU]) == 0) {
|
||||
button->setEventHandler(NULL, NULL);
|
||||
button->setEventHandler(NULL);
|
||||
mpScene->mState = 4;
|
||||
snd::getSystem()->startSE("WIPL_SE_DECIDE");
|
||||
return;
|
||||
|
||||
@@ -86,8 +86,15 @@ static inline void setMemoryTitleLists(SDMemory* memory, SDMemory::TitleRange sd
|
||||
memory->setTitleLists(sdRange, nandRange);
|
||||
}
|
||||
|
||||
extern "C" char lbl_81696E30[];
|
||||
extern "C" char lbl_81696E37[];
|
||||
|
||||
static const char* sButtonNames[2] = {lbl_81696E30, lbl_81696E37};
|
||||
|
||||
static const int sCaptureSizes[2][2] = {{128, 96}, {176, 96}};
|
||||
|
||||
static const wchar_t sMissingTitle[] = L"???";
|
||||
|
||||
static const char* sButtonGroups[7] = {
|
||||
"G_FocusBtnA", "G_FocusBtnB", "G_SelectBtnA", "G_SelectBtnB",
|
||||
"G_OnOffBtnA", "G_OnOffBtnB", "G_OutBtn"
|
||||
@@ -103,28 +110,27 @@ static const char* sButtonAnimationNames[6] = {
|
||||
static const char* sBannerAnimationNames[3] = {
|
||||
"banner.brlan", "banner_Start.brlan", "banner_Loop.brlan"
|
||||
};
|
||||
static const char* sTextNames[2] = {"T_BtnA", "T_BtnB"};
|
||||
static const char* sButtonNames[2] = {"B_BtnA", "B_BtnB"};
|
||||
static const char* sTexturePaneNames[3][4] = {
|
||||
{"Fre_a", "Fre_d", "Fre_i", "Fre_l"},
|
||||
{"Fre_e", "Fre_f", "Fre_g", "Fre_h"},
|
||||
{"Fre_b", "Fre_c", "Fre_j", "Fre_k"}
|
||||
};
|
||||
static const char* sTextNames[2] = {"T_BtnA", "T_BtnB"};
|
||||
|
||||
class SDTitleButtonEventHandler : public SDButtonEventHandlerBase {
|
||||
class SDTitlePaneEventHandler : public ::gui::EventHandler {
|
||||
public:
|
||||
SDTitleButtonEventHandler(SDChannelTitle* scene) : mpScene(scene) {}
|
||||
virtual void onEventDerived(u32 component, u32 event, const controller::Interface* controller);
|
||||
SDTitlePaneEventHandler(SDChannelTitle* scene) : mpScene(scene) {}
|
||||
virtual void onEvent(u32 component, u32 event, void* data);
|
||||
nw4r::lyt::Pane* getPane(u32 component) {
|
||||
return static_cast< ::gui::PaneComponent*>(mpManager->getComponent(component))->getPane();
|
||||
}
|
||||
SDChannelTitle* mpScene;
|
||||
};
|
||||
|
||||
class SDTitlePaneEventHandler : public ::gui::EventHandler {
|
||||
class SDTitleButtonEventHandler : public SDButtonEventHandlerBase {
|
||||
public:
|
||||
SDTitlePaneEventHandler(SDChannelTitle* scene) : mpScene(scene) {}
|
||||
virtual void onEvent(u32 component, u32 event, void* data);
|
||||
SDTitleButtonEventHandler(SDChannelTitle* scene) : mpScene(scene) {}
|
||||
virtual void onEventDerived(u32 component, u32 event, const controller::Interface* controller);
|
||||
nw4r::lyt::Pane* getPane(u32 component) {
|
||||
return static_cast< ::gui::PaneComponent*>(mpManager->getComponent(component))->getPane();
|
||||
}
|
||||
@@ -222,9 +228,8 @@ void SDChannelTitle::create() {
|
||||
comment->SetString(System::getMessage(0xad));
|
||||
iplSDChannelTitle_813E630C(this);
|
||||
mpFade = new math::HermiteIntp<f32>();
|
||||
const f32 fadeStart = 0.0f;
|
||||
const f32 fadeEnd = 255.0f;
|
||||
mpFade->init(fadeStart, fadeEnd, 10.0f, 0.0f, 0.0f);
|
||||
static f32 fadeRange[2] = {0.0f, 255.0f};
|
||||
mpFade->init(fadeRange[0], fadeRange[1], 28.0f, 0.0f, 0.0f);
|
||||
mpFade->setAnmType(ANIM_TYPE_FORWARD);
|
||||
mpScreenCapture = new (System::getTreasureHeap(), 32) utility::Capture(System::getTreasureHeap(), 0, 0,
|
||||
System::getRenderModeObj()->fbWidth, System::getRenderModeObj()->efbHeight, GX_TF_RGB565);
|
||||
@@ -560,7 +565,7 @@ extern "C" void iplSDChannelTitle_813E6424(SDChannelTitle* scene) {
|
||||
if (channel->mStateFlags == 0) {
|
||||
static_cast<nw4r::lyt::TextBox*>(scene->mpProgressLayout->FindPaneByName("T_title"))->SetString(iplSDChannelObj_813E4060(channel, 0));
|
||||
} else {
|
||||
static_cast<nw4r::lyt::TextBox*>(scene->mpProgressLayout->FindPaneByName("T_title"))->SetString(L"");
|
||||
static_cast<nw4r::lyt::TextBox*>(scene->mpProgressLayout->FindPaneByName("T_title"))->SetString(sMissingTitle);
|
||||
}
|
||||
scene->mpProgressLayout->getAnim(0)->stop();
|
||||
scene->mpProgressLayout->getAnim(0)->initAnmFrame();
|
||||
@@ -1014,9 +1019,8 @@ extern "C" void iplSDChannelTitle_813E7A18(SDChannelTitle* scene) {
|
||||
if (!scene->mScriptEnabled || scene->mScriptState == 4) {
|
||||
if (scene->mpChannelSelect->prepareRestarting(scene->mPage)) {
|
||||
scene->mpChannelSelect->startPageTransition(scene->mPage, scene->mIndex);
|
||||
const f32 fadeStart = 255.0f;
|
||||
const f32 fadeEnd = 0.0f;
|
||||
scene->mpFade->init(fadeStart, fadeEnd, 10.0f, 0.0f, 0.0f);
|
||||
static f32 fadeRange[2] = {0.0f, 255.0f};
|
||||
scene->mpFade->init(fadeRange[0], fadeRange[1], 28.0f, 0.0f, 0.0f);
|
||||
scene->mpFade->setAnmType(ANIM_TYPE_BACKWARD);
|
||||
scene->mpFade->play();
|
||||
scene->mState = 6;
|
||||
@@ -1556,13 +1560,13 @@ void SDChannelTitle::startResetting() {
|
||||
snd::getSystem()->resetAllSound();
|
||||
}
|
||||
|
||||
void SDTitlePaneEventHandler::onEvent(u32 component, u32 event, void* data) {
|
||||
iplSDChannelTitle_813E9004(this, component, event, static_cast<const controller::Interface*>(data));
|
||||
}
|
||||
|
||||
void SDTitleButtonEventHandler::onEventDerived(u32 component, u32 event, const controller::Interface* controller) {
|
||||
iplSDChannelTitle_813E92EC(this, component, event, controller);
|
||||
}
|
||||
|
||||
void SDTitlePaneEventHandler::onEvent(u32 component, u32 event, void* data) {
|
||||
iplSDChannelTitle_813E9004(this, component, event, static_cast<const controller::Interface*>(data));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
9
tools/decomp-assist/iplSDChannelSelect.attempts.md
Normal file
9
tools/decomp-assist/iplSDChannelSelect.attempts.md
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
## 2026-09-30 session (scene2 continued)
|
||||
|
||||
- collectTitlesBySpecialChannels: 361/361 exact via separate out-param temps + decl-after-call + per-use reloads. (committed earlier)
|
||||
- 12/12 enqueue* fns matched by removing `values[2] = 0` stores — orig leaves SDChannelSelectCommand.values[2] uninit except in delete/command notices.
|
||||
- findAdjacentChannel: tried `step`-first decl order — regressed (bne moved earlier); scheduler tie, reverted.
|
||||
- **setEventHandler r5 mystery (documented):** orig calls `setEventHandler__Q33ipl5scene8SDButtonFPQ23gui12EventHandlerPQ23gui12EventHandler` (2-param) at 4 sites in iplSDChannelSelect + 2 in iplSDChannelTitle with r5 NEVER materialized (no li/lwz/mr r5 in the 4-insn window before bl; callee is non-static so this=r3, event=r4, optOutEvent=r5 garbage). MWCC always emits `li r5,0` for the =NULL default (verified: both `(h, NULL)` and `(h)` call forms emit it in mine). iplAddress.o Button callers DO emit `li r5,0` for the analogous Button decl. No C++ source model reproduces a 2-param bl with unset r5 (1-arg call to a defaulted 2-param decl emits the default; a 1-param decl would mangle differently). Left as `(h, NULL)` explicit; ~4 insn residual across create/selectChannel/initializeNormalPage/calcCommon/onEventDerived.
|
||||
- kpr_lib: orig's `once$2281` is an 8-byte fn-local accessed via lbz/stb → decoded as `static union { u64 align; u8 flag; }` inside KPRInitQueue — gives size-8 `once$` + .sbss 0x10 and .sbss scored 100%. Orig's .sbss ordering [DeadKeys@0,Romaji@4,once@8] vs mine [once@0,Romaji@4,DeadKeys@8] is MWCC reverse-decl-order emission; objdiff .sbss scores 100 anyway. kpr_lib now 8/9 fns, all data 100.
|
||||
- iplSDMemory: removed dead `#pragma inline_max_total_size` (no effect). drawTransferTitles: orig re-materializes f32 consts from sdata (`lfs f0,const@sda21`) where mine spills/reloads stack copies — frame-lever not found. create: 1064 vs 1060, mostly lbl_/@N symbol-name + r30/r31 data-base home.
|
||||
Reference in New Issue
Block a user