Compare commits

..

1 Commits

Author SHA1 Message Date
coah
d665517804 cleanup(iplSDButton): rename unk_0x54 to mAnimWait
Same pattern as Button: wait flag while help-button click anim plays.
2026-10-02 13:58:11 -05:00
9 changed files with 49 additions and 49 deletions

View File

@@ -62,17 +62,17 @@ namespace ipl {
void start_left_event(const char* paneName);
void start_trig_event(const char* paneName);
typedef struct CmdEntry {
typedef struct Unk {
int command; // 0x00
u32 msgID; // 0x04
} CmdEntry;
} Unk;
CmdEntry mCmdQueue[64];
Unk unk_0x64[64];
int mCmdCapacity;
int mCmdCount;
int mCmdReadIdx;
int mCmdWriteIdx;
int unk_0x264;
int unk_0x268;
int unk_0x26C;
int unk_0x270;
int mSettingArg; // 0x274

View File

@@ -219,7 +219,7 @@ struct __zi8_work_data_s {
ziU8 unk_0x17;
ziU8 subLanguage; // 0x18
ziU8 unk_0x19;
ziU16 separator; // 0x1A
ziU16 unk_0x1A;
ziU8 unk_0x1C[3];
ziU8 unk_0x1F;
ziU16 unk_0x20[0x40];

View File

@@ -18,7 +18,7 @@ static Zi8UInt Zi8SetFindCand(ziU8* foundCandidates, Zi8UInt ordinal, ziPtr work
}
ziWChar* ZiGetNextPhonetic(ziWChar* spelling, ziWChar* end ZI_NEED_WORK) {
while (*spelling && *spelling != ZI_WORK->separator && *spelling != 0xF360 && spelling < end) {
while (*spelling && *spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360 && spelling < end) {
++spelling;
}
if (!*spelling || spelling == end) {
@@ -37,8 +37,8 @@ int ZiPartialMatch(ziWChar* spelling, ziWChar* spellingEnd,
if (spelling == spellingEnd || candidate == candidateEnd || !*spelling || !*candidate) {
return 1;
}
while (*spelling != ZI_WORK->separator && *spelling != 0xF360) {
if (*candidate == ZI_WORK->separator || *candidate == 0xF360) {
while (*spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360) {
if (*candidate == ZI_WORK->unk_0x1A || *candidate == 0xF360) {
break;
}
if (*spelling != *candidate) {
@@ -2868,7 +2868,7 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_
ziU8 count;
ziWChar spacedElements[256];
struct { ziWChar separator; } savedState;
savedState.separator = ZI_WORK->separator;
savedState.separator = ZI_WORK->unk_0x1A;
if (elementCount <= 1 || !charCount) {
return elementCount;
}
@@ -2881,9 +2881,9 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_
if (spacedIndex == elementCount) {
return elementCount;
}
ZI_WORK->separator = 0xF360;
ZI_WORK->unk_0x1A = 0xF360;
Zi8ZHaddSpace(elements, elementCount, spacedElements, 256, __zi8_work_data);
ZI_WORK->separator = savedState.separator;
ZI_WORK->unk_0x1A = savedState.separator;
spacedIndex = elementIndex = count = 0;
while (charCount && elementIndex < elementCount) {
if (spacedElements[spacedIndex] == 0xF360) {

View File

@@ -21,7 +21,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
ZI_WORK->unk_0x0A = 0xFF;
ZI_WORK->unk_0x10 = 0x64;
*(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF;
ZI_WORK->separator = 0x20;
ZI_WORK->unk_0x1A = 0x20;
ZI_WORK->unk_0x1C[2] = 0;
ZI_WORK->unk_0x1B30 = 0;
ZI_WORK->unk_0x1B3A = 0;

View File

@@ -68,7 +68,7 @@ ziU8 Zi8ZHaddSpace(ziWChar* src, ziU8 count, ziWChar* dst,
}
if (pdst[k - 1] != 0xF360 &&
(pdst[k - 1] < 0xF331 || pdst[k - 1] > 0xF335)) {
pdst[k++] = ZI_WORK->separator;
pdst[k++] = ZI_WORK->unk_0x1A;
}
psrc += i;
n -= i;

View File

@@ -13,8 +13,8 @@ typedef struct _CDBCryptBuf {
u32 buffer32[0xFB00];
}; // 0x00
u32 size; // 0x3EC00
u32 offset; // 0x3EC04
u32 unk_0x3EC00;
u32 unk_0x3EC04;
BOOL allocated; // 0x3EC08
u8 unk_0x3EC0C[0x34];
} CDBCryptBuf;

View File

@@ -164,7 +164,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) {
goto open_result_ready;
open_location_ok:
if (CDBFSSDIsMounted()) {
err = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->size, NULL);
err = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->unk_0x3EC00, NULL);
} else {
err = CDB_ERROR_SD_IS_NOT_MOUNTED;
}
@@ -174,7 +174,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) {
CDBCryptBufFree((CDBCryptBuf**)&record->cryptBuf);
return err;
}
cryptBuf->offset = sizeof(CDBAttrBuf);
cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf);
}
return CDB_ERROR_OK;
}
@@ -223,7 +223,7 @@ CDBErr CDBRecordOpenReadOnly_(CDBRecord* record) {
goto result_ready;
location_ok:
if (CDBFSSDIsMounted()) {
result = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->size, NULL);
result = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->unk_0x3EC00, NULL);
} else {
result = CDB_ERROR_SD_IS_NOT_MOUNTED;
}
@@ -233,7 +233,7 @@ CDBErr CDBRecordOpenReadOnly_(CDBRecord* record) {
CDBCryptBufFree((CDBCryptBuf**)&record->cryptBuf);
return result;
}
cryptBuf->offset = sizeof(CDBAttrBuf);
cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf);
}
return CDB_ERROR_OK;
}

View File

@@ -264,8 +264,8 @@ CDBErr CDBRecordFileReadData(CDBRecord* record, void* buffer, u32 size, u32* rea
CDBCryptBuf* cryptBuf = record->cryptBuf;
if (cryptBuf != NULL) {
u32 unk = cryptBuf->size - cryptBuf->offset;
if (cryptBuf->size < unk) {
u32 unk = cryptBuf->unk_0x3EC00 - cryptBuf->unk_0x3EC04;
if (cryptBuf->unk_0x3EC00 < unk) {
unk = 0;
}
@@ -274,8 +274,8 @@ CDBErr CDBRecordFileReadData(CDBRecord* record, void* buffer, u32 size, u32* rea
}
if (unk != 0) {
memcpy(buffer, (u8*)&cryptBuf->buffer[cryptBuf->offset], unk);
cryptBuf->offset += unk;
memcpy(buffer, (u8*)&cryptBuf->buffer[cryptBuf->unk_0x3EC04], unk);
cryptBuf->unk_0x3EC04 += unk;
}
if (readSize != NULL) {
@@ -300,16 +300,16 @@ CDBErr CDBRecordFileSeekData(CDBRecord* record, u32 offset, CDBSeek seek) {
if (cryptBuf != NULL) {
switch (seek) {
case CDB_SEEK_BEGIN: {
cryptBuf->offset = sizeof(CDBAttrBuf);
cryptBuf->offset += offset;
cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf);
cryptBuf->unk_0x3EC04 += offset;
break;
}
case CDB_SEEK_END: {
cryptBuf->offset = (cryptBuf->size - 1) - offset;
cryptBuf->unk_0x3EC04 = (cryptBuf->unk_0x3EC00 - 1) - offset;
break;
}
case CDB_SEEK_CUR: {
cryptBuf->offset += offset;
cryptBuf->unk_0x3EC04 += offset;
break;
}
}
@@ -329,7 +329,7 @@ int CDBRecordFileTellData(CDBRecord* record) {
CDBCryptBuf* cryptBuf = record->cryptBuf;
if (cryptBuf != NULL) {
return cryptBuf->offset - sizeof(CDBAttrBuf);
return cryptBuf->unk_0x3EC04 - sizeof(CDBAttrBuf);
}
return CDBFTellData(&recordFile->bridgeFile, record->key.location);
}

View File

@@ -15,10 +15,10 @@ namespace ipl {
// clang-format on
SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() {
mCmdCapacity = 64;
mCmdCount = 0;
mCmdReadIdx = 0;
mCmdWriteIdx = 0;
unk_0x264 = 64;
unk_0x268 = 0;
unk_0x26C = 0;
unk_0x270 = 0;
mSettingArg = arg;
mpLayout = NULL;
mpLayoutFile = NULL;
@@ -81,8 +81,8 @@ namespace ipl {
FaderSceneCommand SettingButton::calcNormal() {
if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() &&
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mCmdCount != 0) {
CmdEntry unk = mCmdQueue[mCmdReadIdx];
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && unk_0x268 != 0) {
Unk unk = unk_0x64[unk_0x26C];
switch (unk.command) {
case CMD_SHOW_BTN: {
showBtn();
@@ -98,11 +98,11 @@ namespace ipl {
}
}
if (mCmdCount != 0) {
if (++mCmdReadIdx >= mCmdCapacity) {
mCmdReadIdx = 0;
if (unk_0x268 != 0) {
if (++unk_0x26C >= unk_0x264) {
unk_0x26C = 0;
}
mCmdCount--;
unk_0x268--;
}
}
@@ -225,16 +225,16 @@ namespace ipl {
}
void SettingButton::reserve(int command, u32 msgId) {
if (mCmdCapacity != mCmdCount) {
int unk = mCmdWriteIdx;
mCmdQueue[unk].command = command;
mCmdQueue[unk].msgID = msgId;
mCmdWriteIdx++;
if (unk_0x264 != unk_0x268) {
int unk = unk_0x270;
unk_0x64[unk].command = command;
unk_0x64[unk].msgID = msgId;
unk_0x270++;
if (mCmdWriteIdx >= mCmdCapacity) {
mCmdWriteIdx = 0;
if (unk_0x270 >= unk_0x264) {
unk_0x270 = 0;
}
mCmdCount++;
unk_0x268++;
}
}