Compare commits

..

1 Commits

Author SHA1 Message Date
coah
7cdb804e8c cleanup(eZiText): rename work unk_0x141E to graphTableId
Passed to Zi8GetTableAddress / Zi8GetTableSize (often 0x10).
2026-10-02 14:08:29 -05:00
23 changed files with 136 additions and 136 deletions

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 mQueueCapacity; int unk_0x264;
int mQueueCount; int unk_0x268;
int mQueueRead; int unk_0x26C;
int mQueueWrite; int unk_0x270;
int mSettingArg; // 0x274 int mSettingArg; // 0x274

View File

@@ -33,7 +33,7 @@ namespace ipl {
u64 titleId; // 0x10 u64 titleId; // 0x10
bool threadTerminated; // 0x18 bool threadTerminated; // 0x18
bool unk_0x19; bool unk_0x19;
bool mbHasNewMessage; // 0x1A bool unk_0x1A;
EGG::ExpHeap* getHeap() { return heap; } EGG::ExpHeap* getHeap() { return heap; }
} CSData; } CSData;

View File

@@ -60,9 +60,9 @@ namespace ipl {
int mMessageID; // 0x08 int mMessageID; // 0x08
int mArg2; int unk_0x0C;
int mArg3; int unk_0x10;
char mArg1[4]; char unk_0x14[4];
u8* mpArcData; // 0x18 u8* mpArcData; // 0x18
u32 mArcSize; // 0x1C u32 mArcSize; // 0x1C

View File

@@ -139,7 +139,7 @@ namespace ipl {
bool received() { return mbReviecedMsg; } bool received() { return mbReviecedMsg; }
void prepNextReceive() { mbReviecedMsg = false; } void prepNextReceive() { mbReviecedMsg = false; }
volatile bool isReceivingIdle() { return mbReceiving == false; } volatile bool isUnk0xA31() { return unk_0xA31 == false; }
BOOL isAppDlEnableLock(u32 appId) { BOOL isAppDlEnableLock(u32 appId) {
utility::autoMutexLock lock(mAutoLock); utility::autoMutexLock lock(mAutoLock);
@@ -175,9 +175,9 @@ namespace ipl {
OSMutex mAutoLock; // 0xA18 OSMutex mAutoLock; // 0xA18
bool mbReviecedMsg; bool mbReviecedMsg;
bool mbReceiving; bool unk_0xA31;
bool mbReceivePaused; // 0xA32 bool mbReceivePaused; // 0xA32
bool mbNewTitleTblReady; bool unk_0xA33;
static Arg smArg; static Arg smArg;

View File

@@ -267,20 +267,20 @@ struct __zi8_work_data_s {
ziU8 unk_0x140C[4]; ziU8 unk_0x140C[4];
ziU32 formats; // 0x1410 ziU32 formats; // 0x1410
ziU8 unk_0x1414[4]; ziU8 unk_0x1414[4];
ziU8 formatCount; ziU8 unk_0x1418;
ziU8 unk_0x1419; ziU8 unk_0x1419;
ziU16 unk_0x141A; ziU16 unk_0x141A;
ziU8 unk_0x141C; ziU8 unk_0x141C;
ziU8 unk_0x141D; ziU8 unk_0x141D;
ziU8 unk_0x141E; ziU8 graphTableId; // 0x141E
ziU8 maxCnt; // 0x141F ziU8 maxCnt; // 0x141F
ziU8 unk_0x1420[4]; ziU8 unk_0x1420[4];
zi8DawgCtx dawgCtx; // 0x1424 zi8DawgCtx dawgCtx; // 0x1424
ziU8 unk_0x1760[4]; // 0x1760 ziU8 unk_0x1760[4]; // 0x1760
ziU8* groupPtr; // 0x1764 ziU8* unk_0x1764; // 0x1764
ziU8 unk_0x1768; ziU8 unk_0x1768;
ziU8 unk_0x1769[0x81]; ziU8 unk_0x1769[0x81];
ziU16 matchOffset; // 0x17EA ziU16 unk_0x17EA;
ziU8 unk_0x17EC; ziU8 unk_0x17EC;
ziU8 unk_0x17ED[3]; ziU8 unk_0x17ED[3];
ziU8* dawgGroup; // 0x17F0 ziU8* dawgGroup; // 0x17F0

View File

@@ -39,10 +39,10 @@ ziU32 Zi8MatchROMdata0(ziWChar* elements, ziU8 count, ziU8 language,
} }
if (mode == 1) acceptPrefix = 0; if (mode == 1) acceptPrefix = 0;
} else { } else {
if (ZI_WORK->unk_0x141E != 0 && graphTable == 0xc && if (ZI_WORK->graphTableId != 0 && graphTable == 0xc &&
Zi8GetTableSize(language, ZI_WORK->unk_0x141E, ZI_WORK) != 0) { Zi8GetTableSize(language, ZI_WORK->graphTableId, ZI_WORK) != 0) {
graphData = (ziU8*)Zi8GetTableAddress(language, ZI_WORK->unk_0x141E, ZI_WORK); graphData = (ziU8*)Zi8GetTableAddress(language, ZI_WORK->graphTableId, ZI_WORK);
keyTable = ZI_WORK->unk_0x141E + 1; keyTable = ZI_WORK->graphTableId + 1;
} else { } else {
if (Zi8GetTableSize(language, graphTable, ZI_WORK) == 0) { if (Zi8GetTableSize(language, graphTable, ZI_WORK) == 0) {
Zi8LogError(0x961, ZI_WORK); Zi8LogError(0x961, ZI_WORK);
@@ -184,36 +184,36 @@ unsigned int Zi8MatchROMdata1(ziWChar *elements, ziU8 count, ziU8 language, ziWC
result = 0; result = 0;
if (status == 0) { if (status == 0) {
ZI_WORK->groupPtr = (ziU8*)group; ZI_WORK->unk_0x1764 = (ziU8*)group;
if (ZI_WORK->groupPtr == 0) { if (ZI_WORK->unk_0x1764 == 0) {
if (Zi8GetTableSize(language & 0xff,0xb,ZI_WORK) != 0) { if (Zi8GetTableSize(language & 0xff,0xb,ZI_WORK) != 0) {
ZI_WORK->groupPtr = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK)); ZI_WORK->unk_0x1764 = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK));
} }
} }
if (ZI_WORK->groupPtr != 0) { if (ZI_WORK->unk_0x1764 != 0) {
for (; (*ZI_WORK->groupPtr != 0xff && ((groupIndex & 0xff) != 0)); for (; (*ZI_WORK->unk_0x1764 != 0xff && ((groupIndex & 0xff) != 0));
groupIndex = groupIndex - 1) { groupIndex = groupIndex - 1) {
while (*ZI_WORK->groupPtr != 0xff) { while (*ZI_WORK->unk_0x1764 != 0xff) {
ZI_WORK->groupPtr += 2; ZI_WORK->unk_0x1764 += 2;
} }
ZI_WORK->groupPtr++; ZI_WORK->unk_0x1764++;
} }
} }
} }
if (ZI_WORK->groupPtr == 0) { if (ZI_WORK->unk_0x1764 == 0) {
result = Zi8MatchROMdata0(elements,count,language & 0xff,output,capacity & 0xffff, result = Zi8MatchROMdata0(elements,count,language & 0xff,output,capacity & 0xffff,
mode & 0xff,status & 0xff,0,1,acceptPrefix,0,&ZI_WORK->dawgCtx, mode & 0xff,status & 0xff,0,1,acceptPrefix,0,&ZI_WORK->dawgCtx,
ZI_WORK->unk_0x1760,ZI_WORK); ZI_WORK->unk_0x1760,ZI_WORK);
} }
else { else {
while (*ZI_WORK->groupPtr != 0xff) { while (*ZI_WORK->unk_0x1764 != 0xff) {
result = Zi8MatchROMdata0(elements,count,language & 0xff,output, result = Zi8MatchROMdata0(elements,count,language & 0xff,output,
capacity & 0xffff,mode & 0xff,status & 0xff, capacity & 0xffff,mode & 0xff,status & 0xff,
*ZI_WORK->groupPtr, *ZI_WORK->unk_0x1764,
ZI_WORK->groupPtr[1],acceptPrefix,0, ZI_WORK->unk_0x1764[1],acceptPrefix,0,
&ZI_WORK->dawgCtx,ZI_WORK->unk_0x1760,ZI_WORK); &ZI_WORK->dawgCtx,ZI_WORK->unk_0x1760,ZI_WORK);
if ((result & 0xff) != 0) break; if ((result & 0xff) != 0) break;
ZI_WORK->groupPtr += 2; ZI_WORK->unk_0x1764 += 2;
status = 0; status = 0;
} }
} }
@@ -230,31 +230,31 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language,
if (reservedMode != 0) return 0; if (reservedMode != 0) return 0;
if (status == 0) { if (status == 0) {
ZI_WORK->unk_0x1768 = 0; ZI_WORK->unk_0x1768 = 0;
ZI_WORK->matchOffset = 0; ZI_WORK->unk_0x17EA = 0;
if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->unk_0x141C != 0) { if (group != 0 && *group == 0xc && language == 10 && ZI_WORK->unk_0x141C != 0) {
ZI_WORK->unk_0x141E = 0x10; ZI_WORK->graphTableId = 0x10;
} else { } else {
ZI_WORK->unk_0x141E = 0; ZI_WORK->graphTableId = 0;
} }
} }
search_segment: search_segment:
ZI_WORK->maxCnt = 1; ZI_WORK->maxCnt = 1;
result = Zi8MatchROMdata1(elements + ZI_WORK->matchOffset, result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA,
count - ZI_WORK->matchOffset, language, count - ZI_WORK->unk_0x17EA, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], capacity, &ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
mode, status, ZI_WORK->unk_0x1768, (char*)group, mode, status, ZI_WORK->unk_0x1768, (char*)group,
acceptPrefix, ZI_WORK); acceptPrefix, ZI_WORK);
if ((ziU8)result != 0) { if ((ziU8)result != 0) {
for (index = (ziU8)(ZI_WORK->matchOffset + result); index != 0; index--) { for (index = (ziU8)(ZI_WORK->unk_0x17EA + result); index != 0; index--) {
output[index - 1] = ZI_WORK->unk_0x17F4[index - 1]; output[index - 1] = ZI_WORK->unk_0x17F4[index - 1];
} }
result = (ziU8)(result + ZI_WORK->matchOffset); result = (ziU8)(result + ZI_WORK->unk_0x17EA);
} else { } else {
if (status != 0 || count == 1) goto finish_segments; if (status != 0 || count == 1) goto finish_segments;
if (mode == 1 && ZI_WORK->unk_0x1768 == 0 && if (mode == 1 && ZI_WORK->unk_0x1768 == 0 &&
(ziU8)Zi8MatchROMdata1(elements + ZI_WORK->matchOffset, (ziU8)Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA,
count - ZI_WORK->matchOffset, language, count - ZI_WORK->unk_0x17EA, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], capacity, &ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
0, status, ZI_WORK->unk_0x1768, (char*)group, 0, status, ZI_WORK->unk_0x1768, (char*)group,
acceptPrefix, ZI_WORK) != 0) goto finish_segments; acceptPrefix, ZI_WORK) != 0) goto finish_segments;
if ((Zi8GetTableCount(language, 0x1f, ZI_WORK) & 4) == 0) { if ((Zi8GetTableCount(language, 0x1f, ZI_WORK) & 4) == 0) {
@@ -264,23 +264,23 @@ search_segment:
} }
if (ZI_WORK->maxCnt > capacity) goto finish_segments; if (ZI_WORK->maxCnt > capacity) goto finish_segments;
for (index = ZI_WORK->maxCnt; index != 0; index--) { for (index = ZI_WORK->maxCnt; index != 0; index--) {
result = Zi8MatchROMdata1(elements + ZI_WORK->matchOffset, index, language, result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA, index, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], capacity, &ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity,
1, 0, ZI_WORK->unk_0x1768, (char*)group, 1, 0, ZI_WORK->unk_0x1768, (char*)group,
acceptPrefix, ZI_WORK); acceptPrefix, ZI_WORK);
if ((ziU8)result != 0) { if ((ziU8)result != 0) {
ZI_WORK->matchOffset += (ziU8)result; ZI_WORK->unk_0x17EA += (ziU8)result;
if (ZI_WORK->matchOffset == count) return 0; if (ZI_WORK->unk_0x17EA == count) return 0;
ZI_WORK->unk_0x1768++; ZI_WORK->unk_0x1768++;
status = 0; status = 0;
ZI_WORK->unk_0x141E = 0; ZI_WORK->graphTableId = 0;
if (ZI_WORK->dawgCtx.key == 0 && language == 10) { if (ZI_WORK->dawgCtx.key == 0 && language == 10) {
for (index = 0; index < ZI_WORK->matchOffset; index++) { for (index = 0; index < ZI_WORK->unk_0x17EA; index++) {
switch (ZI_WORK->unk_0x17F4[index]) { switch (ZI_WORK->unk_0x17F4[index]) {
case 0x61: case 0x61:
case 0x6f: case 0x6f:
case 0x75: case 0x75:
ZI_WORK->unk_0x141E = 0x10; ZI_WORK->graphTableId = 0x10;
goto search_segment; goto search_segment;
} }
} }

View File

@@ -51,10 +51,10 @@ ziBool Zi8ZHsetZYfuzzyPairs(ziFuzzyZYPairs pairs ZI_NEED_WORK) {
ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) { ziBool Zi8SetLatinSearchOrder(ziU8* searchArray, ziU8 searchSize ZI_NEED_WORK) {
if (searchArray == 0 || *searchArray == 0) { if (searchArray == 0 || *searchArray == 0) {
ZI_WORK->formats = (ziU32)Zi8SOdefaultArray; ZI_WORK->formats = (ziU32)Zi8SOdefaultArray;
ZI_WORK->formatCount = 9; ZI_WORK->unk_0x1418 = 9;
} else { } else {
ZI_WORK->formats = (ziU32)searchArray; ZI_WORK->formats = (ziU32)searchArray;
ZI_WORK->formatCount = searchSize; ZI_WORK->unk_0x1418 = searchSize;
} }
return 1; return 1;
} }

View File

@@ -46,7 +46,7 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
ziU8* data; ziU8* data;
ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0}; ziU8 formats[8] = {1, 5, 0, 0, 0, 0, 0, 0};
ziU32 savedFormats = ZI_WORK->formats; ziU32 savedFormats = ZI_WORK->formats;
ziU8 savedCount = ZI_WORK->formatCount; ziU8 savedCount = ZI_WORK->unk_0x1418;
ziSearchState search = {0}; ziSearchState search = {0};
Zi8LogError(100, __zi8_work_data); Zi8LogError(100, __zi8_work_data);
if (word == 0 || *word == 0) { if (word == 0 || *word == 0) {
@@ -75,20 +75,20 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
request.firstCandidate = 0; request.firstCandidate = 0;
ZI_WORK->formats = (ziU32)formats; ZI_WORK->formats = (ziU32)formats;
if (ZI_WORK->unk_0x1C[0] == 2) { if (ZI_WORK->unk_0x1C[0] == 2) {
ZI_WORK->formatCount = 0; ZI_WORK->unk_0x1418 = 0;
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->formatCount++] = 1; if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 1;
if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->formatCount++] = 2; if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->unk_0x1418++] = 2;
if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->formatCount++] = 3; if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->unk_0x1418++] = 3;
if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->formatCount++] = 4; if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->unk_0x1418++] = 4;
if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->formatCount++] = 5; if (ZI_WORK->unk_0x09 & 1) formats[ZI_WORK->unk_0x1418++] = 5;
if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->formatCount++] = 6; if (ZI_WORK->unk_0x09 & 4) formats[ZI_WORK->unk_0x1418++] = 6;
if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->formatCount++] = 7; if (ZI_WORK->unk_0x09 & 2) formats[ZI_WORK->unk_0x1418++] = 7;
if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->formatCount++] = 8; if (ZI_WORK->unk_0x09 & 8) formats[ZI_WORK->unk_0x1418++] = 8;
} else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->formatCount = 2; } else if (ZI_WORK->unk_0x1C[0] != 0) ZI_WORK->unk_0x1418 = 2;
else ZI_WORK->formatCount = 1; else ZI_WORK->unk_0x1418 = 1;
count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data); count = Zi8GetCandidatesOrCount(&request, &search, __zi8_work_data);
ZI_WORK->formats = savedFormats; ZI_WORK->formats = savedFormats;
ZI_WORK->formatCount = savedCount; ZI_WORK->unk_0x1418 = savedCount;
if (count != 0) return 1; if (count != 0) return 1;
} }
if (language != 1) { if (language != 1) {

View File

@@ -19,7 +19,7 @@ typedef struct _CDBRecordFile {
#else #else
u8 unk_0x00[0x1C - 0x00]; u8 unk_0x00[0x1C - 0x00];
#endif #endif
int allocFlag; // 0x1C int unk_0x1C;
CDBAttr attr; // 0x20 CDBAttr attr; // 0x20
CDBBridgeFile bridgeFile; // 0x42C CDBBridgeFile bridgeFile; // 0x42C
u8 unk_0x434[0x438 - 0x434]; u8 unk_0x434[0x438 - 0x434];

View File

@@ -24,7 +24,7 @@ typedef struct NWC24MsgObjPrivate {
#ifdef NWC24_MSG_READ #ifdef NWC24_MSG_READ
u32 headerSize; u32 headerSize;
#elif defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT) #elif defined(NWC24_MBOX_CTRL) || defined(NWC24_MSG_COMMIT)
u32 headerSize; // 0x10 u32 flags; // 0x10
#else #else
u8 unk_0x10[0x4]; u8 unk_0x10[0x4];
#endif #endif
@@ -46,8 +46,8 @@ typedef struct NWC24MsgObjPrivate {
#endif #endif
u32 date; // 0x28 u32 date; // 0x28
u32 receivedDate; // 0x2C u32 receivedDate; // 0x2C
NWC24Data fromData; // 0x30 NWC24Data unk_0x30;
NWC24Data toData; // 0x38 NWC24Data unk_0x38;
NWC24Data subject; // 0x40 NWC24Data subject; // 0x40
NWC24Data text; // 0x48 NWC24Data text; // 0x48
NWC24Data unk_0x50; NWC24Data unk_0x50;

View File

@@ -57,7 +57,7 @@ void CDBRecordInstanceInit(CDBRecordFile* recordFile, CDBRecord* record, int typ
OSLockMutex((OSMutex*)recordFile); OSLockMutex((OSMutex*)recordFile);
recordFile->used = 1; recordFile->used = 1;
OSUnlockMutex((OSMutex*)recordFile); OSUnlockMutex((OSMutex*)recordFile);
recordFile->allocFlag = type; recordFile->unk_0x1C = type;
recordFile->database = record->unk_0x00; recordFile->database = record->unk_0x00;
CDBAttrInit(&recordFile->attr); CDBAttrInit(&recordFile->attr);
CDBRecordKeyCopy(&recordFile->key, &record->key); CDBRecordKeyCopy(&recordFile->key, &record->key);
@@ -310,7 +310,7 @@ CDBErr CDBRecordWrite_(CDBRecord* record, void* buffer, u32 size) {
CDBReportError("can't write data in the record; the record is closed\n"); CDBReportError("can't write data in the record; the record is closed\n");
return CDB_ERROR_27; return CDB_ERROR_27;
} }
if ((recordFile->allocFlag & 2) == 0) { if ((recordFile->unk_0x1C & 2) == 0) {
CDBReportError("can't write data in the record; the record is opened as READONLY\n"); CDBReportError("can't write data in the record; the record is opened as READONLY\n");
return CDB_ERROR_27; return CDB_ERROR_27;
} }
@@ -687,7 +687,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
if ((s32)recordFile == 0) { if ((s32)recordFile == 0) {
return CDB_ERROR_27; return CDB_ERROR_27;
} }
if (recordFile->allocFlag == 1) { if (recordFile->unk_0x1C == 1) {
return CDB_ERROR_26; return CDB_ERROR_26;
} }
if ((s32)buffer == 0) { if ((s32)buffer == 0) {
@@ -699,7 +699,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
tempFile = record->file; tempFile = record->file;
if ((s32)tempFile == 0) { if ((s32)tempFile == 0) {
result = CDB_ERROR_27; result = CDB_ERROR_27;
} else if (tempFile->allocFlag == 1) { } else if (tempFile->unk_0x1C == 1) {
result = CDB_ERROR_26; result = CDB_ERROR_26;
} else { } else {
CDBAttrSetWiiId(&tempFile->attr, CDBGetWiiId()); CDBAttrSetWiiId(&tempFile->attr, CDBGetWiiId());
@@ -713,7 +713,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBErr result; CDBErr result;
if ((s32)record->file == 0) { if ((s32)record->file == 0) {
result = CDB_ERROR_27; result = CDB_ERROR_27;
} else if (((CDBRecordFile*)record->file)->allocFlag == 1) { } else if (((CDBRecordFile*)record->file)->unk_0x1C == 1) {
result = CDB_ERROR_26; result = CDB_ERROR_26;
} else { } else {
CDBAttrInitIV(&((CDBRecordFile*)record->file)->attr); CDBAttrInitIV(&((CDBRecordFile*)record->file)->attr);
@@ -727,7 +727,7 @@ CDBErr CDBRecordEncrypt(CDBRecord* record, void* buffer, CDBRecordKey* key, u32
CDBErr result; CDBErr result;
if ((s32)record->file == 0) { if ((s32)record->file == 0) {
result = CDB_ERROR_27; result = CDB_ERROR_27;
} else if (((CDBRecordFile*)record->file)->allocFlag == 1) { } else if (((CDBRecordFile*)record->file)->unk_0x1C == 1) {
result = CDB_ERROR_26; result = CDB_ERROR_26;
} else { } else {
CDBAttrSetKeyStr(&((CDBRecordFile*)record->file)->attr, key); CDBAttrSetKeyStr(&((CDBRecordFile*)record->file)->attr, key);

View File

@@ -265,7 +265,7 @@ CDBErr CDBRecordFree(CDBRecord* record) {
OSLockMutex((OSMutex*)recordFile); OSLockMutex((OSMutex*)recordFile);
*(u32*)&recordFile->unk_0x00[0x18] = 0; *(u32*)&recordFile->unk_0x00[0x18] = 0;
OSUnlockMutex((OSMutex*)recordFile); OSUnlockMutex((OSMutex*)recordFile);
recordFile->allocFlag = 0; recordFile->unk_0x1C = 0;
record->file = NULL; record->file = NULL;
OSUnlockMutex(&s_mutex); OSUnlockMutex(&s_mutex);
} }

View File

@@ -783,7 +783,7 @@ static NWC24Err DuplicationCheck(MBCHeader* header, const NWC24MsgObjPrivate* ms
continue; continue;
} }
if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length && if (msg->unk_0x1C != 0 && entry->crc == msg->unk_0x1C && entry->type == msg->type && entry->length == msg->length &&
entry->flags == msg->headerSize && (s32)entry->date == (s32)msg->date) { entry->flags == msg->flags && (s32)entry->date == (s32)msg->date) {
duplicateId = entry->msgId; duplicateId = entry->msgId;
duplicateOffset = offset; duplicateOffset = offset;
continue; continue;
@@ -947,8 +947,8 @@ static NWC24Err MountVFMBox(NWC24MBoxType type) {
} }
static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entry) { static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entry) {
u32 field1 = ((u32)msg->fromData.ptr & 0xFFFFF) | (msg->fromData.size << 20); u32 field1 = ((u32)msg->unk_0x30.ptr & 0xFFFFF) | (msg->unk_0x30.size << 20);
u32 field2 = ((u32)msg->toData.ptr & 0xFFFFF) | (msg->toData.size << 20); u32 field2 = ((u32)msg->unk_0x38.ptr & 0xFFFFF) | (msg->unk_0x38.size << 20);
u32 field3 = ((u32)msg->subject.ptr & 0xFFFFF) | (msg->subject.size << 20); u32 field3 = ((u32)msg->subject.ptr & 0xFFFFF) | (msg->subject.size << 20);
u32 field4 = ((u32)msg->unk_0x50.ptr & 0xFFFFF) | (msg->unk_0x50.size << 20); u32 field4 = ((u32)msg->unk_0x50.ptr & 0xFFFFF) | (msg->unk_0x50.size << 20);
u32 field5 = ((u32)msg->unk_0x58.ptr & 0xFFFFF) | (msg->unk_0x58.size << 20); u32 field5 = ((u32)msg->unk_0x58.ptr & 0xFFFFF) | (msg->unk_0x58.size << 20);
@@ -956,7 +956,7 @@ static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entr
entry->type = msg->type; entry->type = msg->type;
entry->length = msg->length; entry->length = msg->length;
entry->appId = msg->appId; entry->appId = msg->appId;
entry->flags = msg->headerSize; entry->flags = msg->flags;
entry->tag = msg->tag; entry->tag = msg->tag;
entry->ledPattern = msg->ledPattern; entry->ledPattern = msg->ledPattern;
entry->crc = msg->unk_0x1C; entry->crc = msg->unk_0x1C;
@@ -1003,7 +1003,7 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->type = entry->type; msg->type = entry->type;
msg->length = entry->length; msg->length = entry->length;
msg->appId = entry->appId; msg->appId = entry->appId;
msg->headerSize = entry->flags; msg->flags = entry->flags;
msg->tag = entry->tag; msg->tag = entry->tag;
msg->ledPattern = entry->ledPattern; msg->ledPattern = entry->ledPattern;
msg->unk_0x1C = entry->crc; msg->unk_0x1C = entry->crc;
@@ -1019,10 +1019,10 @@ static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* ms
msg->textSize = entry->textSize; msg->textSize = entry->textSize;
msg->dwcId = entry->dwcId; msg->dwcId = entry->dwcId;
msg->iconNew = entry->iconNew; msg->iconNew = entry->iconNew;
msg->fromData.ptr = (void*)offset1; msg->unk_0x30.ptr = (void*)offset1;
msg->fromData.size = size1; msg->unk_0x30.size = size1;
msg->toData.ptr = (void*)offset2; msg->unk_0x38.ptr = (void*)offset2;
msg->toData.size = size2; msg->unk_0x38.size = size2;
msg->subject.ptr = (void*)offset3; msg->subject.ptr = (void*)offset3;
msg->subject.size = size3; msg->subject.size = size3;
msg->unk_0x50.ptr = (void*)offset4; msg->unk_0x50.ptr = (void*)offset4;

View File

@@ -330,7 +330,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
} }
CHECK_WRITE(WriteString(msg, buffer)); CHECK_WRITE(WriteString(msg, buffer));
if (msg->type & 0x10000) { if (msg->type & 0x10000) {
msg->headerSize = msg->length; msg->flags = msg->length;
buffer = NWC24WorkP->stringWork; buffer = NWC24WorkP->stringWork;
Mail_memset(buffer, 0, 1024); Mail_memset(buffer, 0, 1024);
Mail_sprintf(buffer, "\r\n--%s", MultiPartDivider); Mail_sprintf(buffer, "\r\n--%s", MultiPartDivider);
@@ -339,7 +339,7 @@ static NWC24Err NWC24CommitMsgInternal(NWC24MsgObjPrivate* msg, NWC24MBoxType ty
} }
CHECK_WRITE(WriteContentTypeField(msg)); CHECK_WRITE(WriteContentTypeField(msg));
if (!(msg->type & 0x10000)) if (!(msg->type & 0x10000))
msg->headerSize = msg->length; msg->flags = msg->length;
text.ptr = (const void*)msg->length; text.ptr = (const void*)msg->length;
{ NWC24Err textResult = WritePlainText(msg); { NWC24Err textResult = WritePlainText(msg);
err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; } err = textResult == NWC24_ERR_NULL ? NWC24_OK : textResult; }
@@ -577,7 +577,7 @@ static NWC24Err WriteFromField(NWC24MsgObjPrivate* msg) {
Mail_memset(buffer, 0, 1024); Mail_memset(buffer, 0, 1024);
Mail_strncat(buffer, "From: ", 1022); Mail_strncat(buffer, "From: ", 1022);
address = buffer + 6; address = buffer + 6;
msg->fromData.ptr = (const void*)(msg->length + 6); msg->unk_0x30.ptr = (const void*)(msg->length + 6);
type = 1; type = 1;
if (msg->type & 0x100000) if (msg->type & 0x100000)
type = 2; type = 2;
@@ -596,7 +596,7 @@ static NWC24Err WriteFromField(NWC24MsgObjPrivate* msg) {
err = NWC24FWrite(NWC24WorkP->stringWork, total, m_pFile); err = NWC24FWrite(NWC24WorkP->stringWork, total, m_pFile);
if (err == NWC24_OK) { if (err == NWC24_OK) {
msg->length += total; msg->length += total;
msg->fromData.size = msg->length - (u32)msg->fromData.ptr - 2; msg->unk_0x30.size = msg->length - (u32)msg->unk_0x30.ptr - 2;
} }
} }
return err; return err;
@@ -612,7 +612,7 @@ static NWC24Err WriteToField(NWC24MsgObjPrivate* msg) {
cursor += 4; cursor += 4;
index = 0; index = 0;
total = 4; total = 4;
msg->toData.ptr = (const void*)(msg->length + 4); msg->unk_0x38.ptr = (const void*)(msg->length + 4);
remaining = 1018; remaining = 1018;
for (; index < msg->numTo; ++index) { for (; index < msg->numTo; ++index) {
err = SynthesizeAddrStr(&msg->toAddrs[index], msg->type, cursor, remaining, &length); err = SynthesizeAddrStr(&msg->toAddrs[index], msg->type, cursor, remaining, &length);
@@ -641,7 +641,7 @@ static NWC24Err WriteToField(NWC24MsgObjPrivate* msg) {
err = NWC24FWrite(NWC24WorkP->stringWork, total + 2, m_pFile); err = NWC24FWrite(NWC24WorkP->stringWork, total + 2, m_pFile);
if (err == NWC24_OK) { if (err == NWC24_OK) {
msg->length += total + 2; msg->length += total + 2;
msg->toData.size = msg->length - (u32)msg->toData.ptr - 2; msg->unk_0x38.size = msg->length - (u32)msg->unk_0x38.ptr - 2;
} }
} }
return err; return err;

View File

@@ -73,8 +73,8 @@ NWC24Err NWC24InitMsgObj(NWC24MsgObj* msg, NWC24MsgType type) {
msgObj->attachedType[i] = NWC24_TEXT_PLAIN; msgObj->attachedType[i] = NWC24_TEXT_PLAIN;
} }
NWC24Data_Init(&msgObj->fromData); NWC24Data_Init(&msgObj->unk_0x30);
NWC24Data_Init(&msgObj->toData); NWC24Data_Init(&msgObj->unk_0x38);
NWC24Data_Init(&msgObj->unk_0x50); NWC24Data_Init(&msgObj->unk_0x50);
NWC24Data_Init(&msgObj->unk_0x58); NWC24Data_Init(&msgObj->unk_0x58);
NWC24Data_Init(&msgObj->unk_0xD0); NWC24Data_Init(&msgObj->unk_0xD0);

View File

@@ -289,7 +289,7 @@ NWC24Err NWC24ReadMsgFromAddr(const NWC24MsgObj* msg, char* address, u32 capacit
default: default:
return result; return result;
} }
if (privateMsg->fromData.size == 0) if (privateMsg->unk_0x30.size == 0)
return NWC24_ERR_NULL; return NWC24_ERR_NULL;
result = NWC24iMBoxOpenStoredMsg(type, privateMsg->msgId, &file); result = NWC24iMBoxOpenStoredMsg(type, privateMsg->msgId, &file);
switch (result) { switch (result) {
@@ -300,9 +300,9 @@ NWC24Err NWC24ReadMsgFromAddr(const NWC24MsgObj* msg, char* address, u32 capacit
} }
result = NWC24FStreamInit(&stream, &file, 0, privateMsg->length, buffer, 1024); result = NWC24FStreamInit(&stream, &file, 0, privateMsg->length, buffer, 1024);
if (result == NWC24_OK) { if (result == NWC24_OK) {
result = NWC24FStreamSeek(&stream, (u32)privateMsg->fromData.ptr); result = NWC24FStreamSeek(&stream, (u32)privateMsg->unk_0x30.ptr);
if (result == NWC24_OK) if (result == NWC24_OK)
result = NWC24iExtractAddrSpec(&stream, privateMsg->fromData.size, 0, address, capacity); result = NWC24iExtractAddrSpec(&stream, privateMsg->unk_0x30.size, 0, address, capacity);
} }
closeResult = NWC24iMBoxCloseMsg(&file); closeResult = NWC24iMBoxCloseMsg(&file);
if (result != NWC24_OK) if (result != NWC24_OK)

View File

@@ -436,10 +436,10 @@ namespace ipl {
data.titleId = System::getChannelManager()->getTitleID(mChanPage, mChanIndex); data.titleId = System::getChannelManager()->getTitleID(mChanPage, mChanIndex);
data.threadTerminated = mbModuleTerminated; data.threadTerminated = mbModuleTerminated;
data.unk_0x19 = true; data.unk_0x19 = true;
data.mbHasNewMessage = true; data.unk_0x1A = true;
if (!(System::getNwc24Manager() != NULL && System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.titleId)))) { if (!(System::getNwc24Manager() != NULL && System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.titleId)))) {
data.mbHasNewMessage = false; data.unk_0x1A = false;
} }
System::getCSManager()->setData(data); System::getCSManager()->setData(data);

View File

@@ -648,7 +648,7 @@ namespace ipl {
} }
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped()) { if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped()) {
if (System::getNwc24Manager() && !System::getNwc24Manager()->isReceivingIdle()) { if (System::getNwc24Manager() && !System::getNwc24Manager()->isUnk0xA31()) {
goto scn_continue; goto scn_continue;
} }
@@ -1767,7 +1767,7 @@ namespace ipl {
data.threadTerminated = mbModuleTerminated; data.threadTerminated = mbModuleTerminated;
if (System::getNwc24Manager() == NULL || !System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.titleId))) { if (System::getNwc24Manager() == NULL || !System::getNwc24Manager()->isNewMessageThere(ES_TITLE_CODE(data.titleId))) {
data.mbHasNewMessage = false; data.unk_0x1A = false;
} }
System::getCSManager()->setData(data); System::getCSManager()->setData(data);
if (!System::getCSManager()->init(mpModuleFile, mpModuleThread)) { if (!System::getCSManager()->init(mpModuleFile, mpModuleThread)) {

View File

@@ -353,7 +353,7 @@ FaderSceneCommand SDChannelTitle::calcFadeout() {
mWpadStopTick = OSGetTick(); mWpadStopTick = OSGetTick();
} }
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped() && if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped() &&
(!System::getNwc24Manager() || System::getNwc24Manager()->isReceivingIdle())) { (!System::getNwc24Manager() || System::getNwc24Manager()->isUnk0xA31())) {
OSReport("NWC24 Scheduler stopped.\n"); OSReport("NWC24 Scheduler stopped.\n");
NandSDWorker* worker = mpChannelSelect->getWorker(); NandSDWorker* worker = mpChannelSelect->getWorker();
if (mNextScene == 17) { if (mNextScene == 17) {
@@ -1118,7 +1118,7 @@ extern "C" void iplSDChannelTitle_updateScriptLoad(SDChannelTitle* scene) {
data.titleId = scene->mTitleId; data.titleId = scene->mTitleId;
data.threadTerminated = scene->mbScriptFailed; data.threadTerminated = scene->mbScriptFailed;
if (!System::getNwc24Manager() || !System::getNwc24Manager()->isNewMessageThere(static_cast<u32>(data.titleId & 0xffffffffULL))) { if (!System::getNwc24Manager() || !System::getNwc24Manager()->isNewMessageThere(static_cast<u32>(data.titleId & 0xffffffffULL))) {
data.mbHasNewMessage = false; data.unk_0x1A = false;
} }
System::getCSManager()->setData(data); System::getCSManager()->setData(data);
if (!System::getCSManager()->init(scene->mpScriptFile, scene->mpRsoThread)) { if (!System::getCSManager()->init(scene->mpScriptFile, scene->mpRsoThread)) {

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() {
mQueueCapacity = 64; unk_0x264 = 64;
mQueueCount = 0; unk_0x268 = 0;
mQueueRead = 0; unk_0x26C = 0;
mQueueWrite = 0; unk_0x270 = 0;
mSettingArg = arg; mSettingArg = arg;
mpLayout = NULL; mpLayout = NULL;
mpLayoutFile = NULL; mpLayoutFile = NULL;
@@ -81,9 +81,9 @@ 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() && mQueueCount != 0) { !mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && unk_0x268 != 0) {
CmdEntry entry = mCmdQueue[mQueueRead]; Unk unk = unk_0x64[unk_0x26C];
switch (entry.command) { switch (unk.command) {
case CMD_SHOW_BTN: { case CMD_SHOW_BTN: {
showBtn(); showBtn();
break; break;
@@ -93,16 +93,16 @@ namespace ipl {
break; break;
} }
case CMD_SET_TEXT: { case CMD_SET_TEXT: {
setText(entry.msgID); setText(unk.msgID);
break; break;
} }
} }
if (mQueueCount != 0) { if (unk_0x268 != 0) {
if (++mQueueRead >= mQueueCapacity) { if (++unk_0x26C >= unk_0x264) {
mQueueRead = 0; unk_0x26C = 0;
} }
mQueueCount--; unk_0x268--;
} }
} }
@@ -225,16 +225,16 @@ namespace ipl {
} }
void SettingButton::reserve(int command, u32 msgId) { void SettingButton::reserve(int command, u32 msgId) {
if (mQueueCapacity != mQueueCount) { if (unk_0x264 != unk_0x268) {
int writeIdx = mQueueWrite; int unk = unk_0x270;
mCmdQueue[writeIdx].command = command; unk_0x64[unk].command = command;
mCmdQueue[writeIdx].msgID = msgId; unk_0x64[unk].msgID = msgId;
mQueueWrite++; unk_0x270++;
if (mQueueWrite >= mQueueCapacity) { if (unk_0x270 >= unk_0x264) {
mQueueWrite = 0; unk_0x270 = 0;
} }
mQueueCount++; unk_0x268++;
} }
} }

View File

@@ -43,13 +43,13 @@ namespace ipl {
mMessageID = msgId; mMessageID = msgId;
// Debug related? (seems to be incomplete; unused) // Debug related? (seems to be incomplete; unused)
mArg2 = arg2; unk_0x0C = arg2;
mArg3 = arg3; unk_0x10 = arg3;
if (arg1) { if (arg1) {
strncpy(mArg1, arg1, sizeof(mArg1)); strncpy(unk_0x14, arg1, sizeof(unk_0x14));
mArg1[sizeof(mArg1) - 1] = 0; unk_0x14[sizeof(unk_0x14) - 1] = 0;
} else { } else {
memset(mArg1, 0, sizeof(mArg1)); memset(unk_0x14, 0, sizeof(unk_0x14));
} }
curThread = OSGetCurrentThread(); curThread = OSGetCurrentThread();

View File

@@ -47,7 +47,7 @@ namespace ipl {
(((mLastError > NWC24_ERR_FILE_OPEN || mLastError < NWC24_ERR_FILE_OTHER) && mLastError != NWC24_ERR_NAND_CORRUPT) && \ (((mLastError > NWC24_ERR_FILE_OPEN || mLastError < NWC24_ERR_FILE_OTHER) && mLastError != NWC24_ERR_NAND_CORRUPT) && \
(mLastError != NWC24_ERR_FILE_EXISTS && mLastError != NWC24_ERR_INTERNAL_VF && mLastError != NWC24_ERR_FILE_BROKEN)) (mLastError != NWC24_ERR_FILE_EXISTS && mLastError != NWC24_ERR_INTERNAL_VF && mLastError != NWC24_ERR_FILE_BROKEN))
Manager::Manager(EGG::Heap* heap) : mbReviecedMsg(false), mbReceiving(false), mbReceivePaused(false), mbNewTitleTblReady(false) { Manager::Manager(EGG::Heap* heap) : mbReviecedMsg(false), unk_0xA31(false), mbReceivePaused(false), unk_0xA33(false) {
OSInitMutex(&mLock); OSInitMutex(&mLock);
OSInitMutex(&mAutoLock); OSInitMutex(&mAutoLock);
@@ -526,7 +526,7 @@ namespace ipl {
return; return;
} }
mbReceiving = true; unk_0xA31 = true;
NWC24UserId myUserId; NWC24UserId myUserId;
getMyUserId(&myUserId); getMyUserId(&myUserId);
@@ -910,8 +910,8 @@ namespace ipl {
close(); close();
mbNewTitleTblReady = true; unk_0xA33 = true;
mbReceiving = false; unk_0xA31 = false;
} }
void Manager::addDlTask() { void Manager::addDlTask() {
@@ -996,7 +996,7 @@ namespace ipl {
} }
BOOL Manager::getNewTitleTbl(u32* titleTbl) const { BOOL Manager::getNewTitleTbl(u32* titleTbl) const {
if (!mbNewTitleTblReady) { if (!unk_0xA33) {
return FALSE; return FALSE;
} }

View File

@@ -61,7 +61,7 @@ namespace ipl {
if (System::getPostmanManager()->IsUnknown() || if (System::getPostmanManager()->IsUnknown() ||
(System::getSceneManager() != NULL && System::getScene(SCENE_ADDRESS) != NULL)) { (System::getSceneManager() != NULL && System::getScene(SCENE_ADDRESS) != NULL)) {
if (System::getNwc24Manager() != NULL && !System::isNandFull()) { if (System::getNwc24Manager() != NULL && !System::isNandFull()) {
if (System::createdAfterAndLibMgr() && !System::getNwc24Manager()->isReceivingIdle()) { if (System::createdAfterAndLibMgr() && !System::getNwc24Manager()->isUnk0xA31()) {
return; return;
} }
} }