Compare commits

..

1 Commits

Author SHA1 Message Date
coah
356d499c14 cleanup(eZiText): rename work unk_0x01 to countOnly
Assigned/compared with options->countOnly in zi8getc2.
2026-10-02 13:59:28 -05:00
12 changed files with 59 additions and 59 deletions

View File

@@ -145,7 +145,7 @@ namespace ipl {
ANIM_MAX, ANIM_MAX,
}; };
int mAnimWait; int unk_0x54;
layout::Object* mpLayout; // 0x58 layout::Object* mpLayout; // 0x58
nand::LayoutFile* mpLayoutFile; // 0x5C nand::LayoutFile* mpLayoutFile; // 0x5C

View File

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

View File

@@ -205,7 +205,7 @@ typedef struct _ziUwdNode {
struct __zi8_work_data_s { struct __zi8_work_data_s {
ziU8 unk_0x00; ziU8 unk_0x00;
ziU8 unk_0x01; ziU8 countOnly; // 0x01
ziU8 unk_0x02[2]; ziU8 unk_0x02[2];
ziLanguageEntry* langEntries; // 0x04 ziLanguageEntry* langEntries; // 0x04
ziU8 unk_0x08; ziU8 unk_0x08;
@@ -219,7 +219,7 @@ struct __zi8_work_data_s {
ziU8 unk_0x17; ziU8 unk_0x17;
ziU8 subLanguage; // 0x18 ziU8 subLanguage; // 0x18
ziU8 unk_0x19; ziU8 unk_0x19;
ziU16 separator; // 0x1A ziU16 unk_0x1A;
ziU8 unk_0x1C[3]; ziU8 unk_0x1C[3];
ziU8 unk_0x1F; ziU8 unk_0x1F;
ziU16 unk_0x20[0x40]; 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) { 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; ++spelling;
} }
if (!*spelling || spelling == end) { if (!*spelling || spelling == end) {
@@ -37,8 +37,8 @@ int ZiPartialMatch(ziWChar* spelling, ziWChar* spellingEnd,
if (spelling == spellingEnd || candidate == candidateEnd || !*spelling || !*candidate) { if (spelling == spellingEnd || candidate == candidateEnd || !*spelling || !*candidate) {
return 1; return 1;
} }
while (*spelling != ZI_WORK->separator && *spelling != 0xF360) { while (*spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360) {
if (*candidate == ZI_WORK->separator || *candidate == 0xF360) { if (*candidate == ZI_WORK->unk_0x1A || *candidate == 0xF360) {
break; break;
} }
if (*spelling != *candidate) { if (*spelling != *candidate) {
@@ -2868,7 +2868,7 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_
ziU8 count; ziU8 count;
ziWChar spacedElements[256]; ziWChar spacedElements[256];
struct { ziWChar separator; } savedState; struct { ziWChar separator; } savedState;
savedState.separator = ZI_WORK->separator; savedState.separator = ZI_WORK->unk_0x1A;
if (elementCount <= 1 || !charCount) { if (elementCount <= 1 || !charCount) {
return elementCount; return elementCount;
} }
@@ -2881,9 +2881,9 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_
if (spacedIndex == elementCount) { if (spacedIndex == elementCount) {
return elementCount; return elementCount;
} }
ZI_WORK->separator = 0xF360; ZI_WORK->unk_0x1A = 0xF360;
Zi8ZHaddSpace(elements, elementCount, spacedElements, 256, __zi8_work_data); Zi8ZHaddSpace(elements, elementCount, spacedElements, 256, __zi8_work_data);
ZI_WORK->separator = savedState.separator; ZI_WORK->unk_0x1A = savedState.separator;
spacedIndex = elementIndex = count = 0; spacedIndex = elementIndex = count = 0;
while (charCount && elementIndex < elementCount) { while (charCount && elementIndex < elementCount) {
if (spacedElements[spacedIndex] == 0xF360) { if (spacedElements[spacedIndex] == 0xF360) {

View File

@@ -339,11 +339,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) { if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) {
switch (parameters->language) { switch (parameters->language) {
case 1: case 1:
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) { if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
switch(ZI_WORK->unk_0x00) { switch(ZI_WORK->unk_0x00) {
case '\0': case '\0':
if (parameters->elements[0] == 0xEF04) { if (parameters->elements[0] == 0xEF04) {
ZI_WORK->unk_0x01 = options->countOnly; ZI_WORK->countOnly = options->countOnly;
ZI_WORK->unk_0x00 = '\x01'; ZI_WORK->unk_0x00 = '\x01';
} }
break; break;
@@ -400,11 +400,11 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option
break; break;
case 0x11: case 0x11:
default: default:
if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->unk_0x01 == options->countOnly)) { if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) {
switch(ZI_WORK->unk_0x00) { switch(ZI_WORK->unk_0x00) {
case '\0': case '\0':
if (parameters->elements[0] == 0xEFF2) { if (parameters->elements[0] == 0xEFF2) {
ZI_WORK->unk_0x01 = options->countOnly; ZI_WORK->countOnly = options->countOnly;
ZI_WORK->unk_0x00 = '\x01'; ZI_WORK->unk_0x00 = '\x01';
} }
break; break;

View File

@@ -21,7 +21,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
ZI_WORK->unk_0x0A = 0xFF; ZI_WORK->unk_0x0A = 0xFF;
ZI_WORK->unk_0x10 = 0x64; ZI_WORK->unk_0x10 = 0x64;
*(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF; *(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF;
ZI_WORK->separator = 0x20; ZI_WORK->unk_0x1A = 0x20;
ZI_WORK->unk_0x1C[2] = 0; ZI_WORK->unk_0x1C[2] = 0;
ZI_WORK->unk_0x1B30 = 0; ZI_WORK->unk_0x1B30 = 0;
ZI_WORK->unk_0x1B3A = 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 && if (pdst[k - 1] != 0xF360 &&
(pdst[k - 1] < 0xF331 || pdst[k - 1] > 0xF335)) { (pdst[k - 1] < 0xF331 || pdst[k - 1] > 0xF335)) {
pdst[k++] = ZI_WORK->separator; pdst[k++] = ZI_WORK->unk_0x1A;
} }
psrc += i; psrc += i;
n -= i; n -= i;

View File

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

View File

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

View File

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

View File

@@ -31,7 +31,7 @@ namespace ipl {
}; };
// clang-format on // clang-format on
SDButton::SDButton(EGG::Heap* heap) : Base(heap), mAnimWait(0) { SDButton::SDButton(EGG::Heap* heap) : Base(heap), unk_0x54(0) {
setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW); setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW);
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
@@ -114,10 +114,10 @@ namespace ipl {
} }
void SDButton::calc() { void SDButton::calc() {
if (mAnimWait == 1) { if (unk_0x54 == 1) {
if (!mpLayout->isPlaying(ANIM_HELP_BTN_ROLL_ON)) { if (!mpLayout->isPlaying(ANIM_HELP_BTN_ROLL_ON)) {
reset_gui(); reset_gui();
mAnimWait = 0; unk_0x54 = 0;
} }
} }
@@ -347,7 +347,7 @@ namespace ipl {
switch (animNo) { switch (animNo) {
case IDANIM_HELP_BTN_CLICK: { case IDANIM_HELP_BTN_CLICK: {
anim = mpLayout->getAnim(ANIM_HELP_BTN_ROLL_ON); anim = mpLayout->getAnim(ANIM_HELP_BTN_ROLL_ON);
mAnimWait = 1; unk_0x54 = 1;
break; break;
} }
case IDANIM_ARROW_RIGHT_CLICK: { case IDANIM_ARROW_RIGHT_CLICK: {

View File

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