Compare commits

...

3 Commits

Author SHA1 Message Date
coah
df3d79b4a1 cleanup(iplChannelScriptManager): name CSData mbHasNewMessage
unk_0x1A -> mbHasNewMessage

Set true when starting channel script, cleared when the title has no new
NWC24 message (isNewMessageThere).

Touched channelSelect / channelTitle / sdChannelTitle writers.

Matching 100% before/after; DOL sha1 unchanged.
2026-10-02 14:15:16 -05:00
coah
8476c93f00 cleanup(eZiText): rename work unk_0x17EA to matchOffset (#878)
Offset into match elements / result buffer during Zi8MatchROMdata1.
2026-10-02 14:14:57 -05:00
coah
9b375e1e50 cleanup(eZiText): rename work unk_0x1764 to groupPtr (#876)
Cursor into DAWG group table (from group / Zi8GetTableAddress).
2026-10-02 14:14:04 -05:00
6 changed files with 34 additions and 34 deletions

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 unk_0x1A; bool mbHasNewMessage; // 0x1A
EGG::ExpHeap* getHeap() { return heap; } EGG::ExpHeap* getHeap() { return heap; }
} CSData; } CSData;

View File

@@ -277,10 +277,10 @@ struct __zi8_work_data_s {
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* unk_0x1764; // 0x1764 ziU8* groupPtr; // 0x1764
ziU8 unk_0x1768; ziU8 unk_0x1768;
ziU8 unk_0x1769[0x81]; ziU8 unk_0x1769[0x81];
ziU16 unk_0x17EA; ziU16 matchOffset; // 0x17EA
ziU8 unk_0x17EC; ziU8 unk_0x17EC;
ziU8 unk_0x17ED[3]; ziU8 unk_0x17ED[3];
ziU8* dawgGroup; // 0x17F0 ziU8* dawgGroup; // 0x17F0

View File

@@ -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->unk_0x1764 = (ziU8*)group; ZI_WORK->groupPtr = (ziU8*)group;
if (ZI_WORK->unk_0x1764 == 0) { if (ZI_WORK->groupPtr == 0) {
if (Zi8GetTableSize(language & 0xff,0xb,ZI_WORK) != 0) { if (Zi8GetTableSize(language & 0xff,0xb,ZI_WORK) != 0) {
ZI_WORK->unk_0x1764 = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK)); ZI_WORK->groupPtr = (ziU8*)(tableAddress = Zi8GetTableAddress(language & 0xff,0xb,ZI_WORK));
} }
} }
if (ZI_WORK->unk_0x1764 != 0) { if (ZI_WORK->groupPtr != 0) {
for (; (*ZI_WORK->unk_0x1764 != 0xff && ((groupIndex & 0xff) != 0)); for (; (*ZI_WORK->groupPtr != 0xff && ((groupIndex & 0xff) != 0));
groupIndex = groupIndex - 1) { groupIndex = groupIndex - 1) {
while (*ZI_WORK->unk_0x1764 != 0xff) { while (*ZI_WORK->groupPtr != 0xff) {
ZI_WORK->unk_0x1764 += 2; ZI_WORK->groupPtr += 2;
} }
ZI_WORK->unk_0x1764++; ZI_WORK->groupPtr++;
} }
} }
} }
if (ZI_WORK->unk_0x1764 == 0) { if (ZI_WORK->groupPtr == 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->unk_0x1764 != 0xff) { while (*ZI_WORK->groupPtr != 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->unk_0x1764, *ZI_WORK->groupPtr,
ZI_WORK->unk_0x1764[1],acceptPrefix,0, ZI_WORK->groupPtr[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->unk_0x1764 += 2; ZI_WORK->groupPtr += 2;
status = 0; status = 0;
} }
} }
@@ -230,7 +230,7 @@ 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->unk_0x17EA = 0; ZI_WORK->matchOffset = 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->unk_0x141E = 0x10;
} else { } else {
@@ -239,22 +239,22 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language,
} }
search_segment: search_segment:
ZI_WORK->maxCnt = 1; ZI_WORK->maxCnt = 1;
result = Zi8MatchROMdata1(elements + ZI_WORK->unk_0x17EA, result = Zi8MatchROMdata1(elements + ZI_WORK->matchOffset,
count - ZI_WORK->unk_0x17EA, language, count - ZI_WORK->matchOffset, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity, &ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], 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->unk_0x17EA + result); index != 0; index--) { for (index = (ziU8)(ZI_WORK->matchOffset + 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->unk_0x17EA); result = (ziU8)(result + ZI_WORK->matchOffset);
} 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->unk_0x17EA, (ziU8)Zi8MatchROMdata1(elements + ZI_WORK->matchOffset,
count - ZI_WORK->unk_0x17EA, language, count - ZI_WORK->matchOffset, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity, &ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], 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,18 +264,18 @@ 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->unk_0x17EA, index, language, result = Zi8MatchROMdata1(elements + ZI_WORK->matchOffset, index, language,
&ZI_WORK->unk_0x17F4[ZI_WORK->unk_0x17EA], capacity, &ZI_WORK->unk_0x17F4[ZI_WORK->matchOffset], 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->unk_0x17EA += (ziU8)result; ZI_WORK->matchOffset += (ziU8)result;
if (ZI_WORK->unk_0x17EA == count) return 0; if (ZI_WORK->matchOffset == count) return 0;
ZI_WORK->unk_0x1768++; ZI_WORK->unk_0x1768++;
status = 0; status = 0;
ZI_WORK->unk_0x141E = 0; ZI_WORK->unk_0x141E = 0;
if (ZI_WORK->dawgCtx.key == 0 && language == 10) { if (ZI_WORK->dawgCtx.key == 0 && language == 10) {
for (index = 0; index < ZI_WORK->unk_0x17EA; index++) { for (index = 0; index < ZI_WORK->matchOffset; index++) {
switch (ZI_WORK->unk_0x17F4[index]) { switch (ZI_WORK->unk_0x17F4[index]) {
case 0x61: case 0x61:
case 0x6f: case 0x6f:

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.unk_0x1A = true; data.mbHasNewMessage = 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.unk_0x1A = false; data.mbHasNewMessage = false;
} }
System::getCSManager()->setData(data); System::getCSManager()->setData(data);

View File

@@ -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.unk_0x1A = false; data.mbHasNewMessage = false;
} }
System::getCSManager()->setData(data); System::getCSManager()->setData(data);
if (!System::getCSManager()->init(mpModuleFile, mpModuleThread)) { if (!System::getCSManager()->init(mpModuleFile, mpModuleThread)) {

View File

@@ -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.unk_0x1A = false; data.mbHasNewMessage = 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)) {