From 7216fd527fee4db057af192c416f9d2fbe0e547a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:33:56 -0500 Subject: [PATCH 1/3] cleanup(eZiText): rename work unk_0x130/138 to uwdDicts/uwdDictCount (#914) User-word dictionary ptr stack + depth (mirrors pudTable/pudCount). --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 4 ++-- libs/RVLMiddleware/eZiText/src/clib/zi8uwd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 080a7e3b..8e36c867 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -230,8 +230,8 @@ struct __zi8_work_data_s { ziU8 unk_0x12D; ziU8 unk_0x12E; ziU8 unk_0x12F; - ziPtr unk_0x130[2]; - ziU8 unk_0x138; + ziPtr uwdDicts[2]; // 0x130 + ziU8 uwdDictCount; // 0x138 ziU8 unk_0x139[3]; ziU32 unk_0x13C; ziU8 unk_0x140; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8uwd.c b/libs/RVLMiddleware/eZiText/src/clib/zi8uwd.c index 133a3b09..525c2a8c 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8uwd.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8uwd.c @@ -105,11 +105,11 @@ ziU8 Zi8MatchUWDdata(ziWChar* pattern, ziU8 length, ziWChar* currentWord, ziU16 int position; int prefixLength; Zi8LogError(100, __zi8_work_data); - if (!(ZI_WORK->unk_0x138 <= 2 && ZI_WORK->unk_0x138 != 0 && ZI_WORK->unk_0x130[ZI_WORK->unk_0x138 - 1] != 0)) { + if (!(ZI_WORK->uwdDictCount <= 2 && ZI_WORK->uwdDictCount != 0 && ZI_WORK->uwdDicts[ZI_WORK->uwdDictCount - 1] != 0)) { Zi8ReplaceLastError(0x19C, __zi8_work_data); return 0; } - dictionary = ZI_WORK->unk_0x130[ZI_WORK->unk_0x138 - 1]; + dictionary = ZI_WORK->uwdDicts[ZI_WORK->uwdDictCount - 1]; if (continuation != 0) { text = (ziU8*)Zi8_814803F4(__zi8_work_data); entryLength = 0; -- 2.49.1 From f508371ca0f998358168ca25776d85a2c59f312a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:34:22 -0500 Subject: [PATCH 2/3] cleanup(eZiText): rename work unk_0x00 to getcPhase (#916) Multi-pass getc state (0..9 / tab) shared by Zi8punct and zi8getc2. --- .../eZiText/include/zi8clib/zitypes.h | 2 +- .../RVLMiddleware/eZiText/src/clib/Zi8punct.c | 4 +- .../RVLMiddleware/eZiText/src/clib/zi8getc2.c | 68 +++++++++---------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 8e36c867..bf56e953 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -204,7 +204,7 @@ typedef struct _ziUwdNode { } ziUwdNode; struct __zi8_work_data_s { - ziU8 unk_0x00; + ziU8 getcPhase; // 0x00 ziU8 countOnly; // 0x01 ziU8 unk_0x02[2]; ziLanguageEntry* langEntries; // 0x04 diff --git a/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c b/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c index dea4d6db..81f351bc 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c +++ b/libs/RVLMiddleware/eZiText/src/clib/Zi8punct.c @@ -21,7 +21,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) { } if (fc == 0) { count++; - if (ZI_WORK->unk_0x00 == 0) { + if (ZI_WORK->getcPhase == 0) { param->candidates[i++] = Zi8PunctTable[j]; if ((param->context & 0x10) != 0) { param->candidates[i++] = 0x20; @@ -42,7 +42,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) { } j++; } - if (ZI_WORK->unk_0x00 == 0) { + if (ZI_WORK->getcPhase == 0) { param->letters = count; } return count; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c index 7639cd3d..324b6e1e 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8getc2.c @@ -324,7 +324,7 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option saved.savedCandidates = 0; saved.restoreCandidates = 0; if (options->lookupMode == '\0') { - if (((ZI_WORK->unk_0x00 == '\t') && (parameters->elementCount != 0)) && + if (((ZI_WORK->getcPhase == '\t') && (parameters->elementCount != 0)) && (((parameters->elements[parameters->elementCount - 1] == 0xEFF8 && ((ziU8)Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK) != 0)) || ((parameters->elements[parameters->elementCount - 1] == 0xEF04 && @@ -339,22 +339,22 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option if ((parameters->elementCount == 1) && (parameters->firstCandidate == 0)) { switch (parameters->language) { case 1: - if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) { - switch(ZI_WORK->unk_0x00) { + if ((ZI_WORK->getcPhase == '\0') || (ZI_WORK->countOnly == options->countOnly)) { + switch(ZI_WORK->getcPhase) { case '\0': if (parameters->elements[0] == 0xEF04) { ZI_WORK->countOnly = options->countOnly; - ZI_WORK->unk_0x00 = '\x01'; + ZI_WORK->getcPhase = '\x01'; } break; case '\x02': case '\x04': case '\x06': if (parameters->elements[0] == 0xEF04) { - ++ZI_WORK->unk_0x00; + ++ZI_WORK->getcPhase; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\x01': @@ -362,17 +362,17 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option case '\x05': case '\a': if (parameters->elements[0] == 0xEF01) { - ++ZI_WORK->unk_0x00; + ++ZI_WORK->getcPhase; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\b': case '\t': if ((parameters->elements[0] == 0xEF04) && ((ziU8)Zi8ZhSignature(parameters,options->countOnly,ZI_WORK) != 0)) { - ZI_WORK->unk_0x00 = '\t'; + ZI_WORK->getcPhase = '\t'; candidateCount = (unsigned int)parameters->letters; if (options->countOnly != '\0') { parameters->letters = 0; @@ -381,10 +381,10 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option return candidateCount; } default: - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } - if ((ZI_WORK->unk_0x00 == '\0') && (parameters->elements[0] == 0xEF04)) { - ZI_WORK->unk_0x00 = '\x01'; + if ((ZI_WORK->getcPhase == '\0') && (parameters->elements[0] == 0xEF04)) { + ZI_WORK->getcPhase = '\x01'; } } break; @@ -400,75 +400,75 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option break; case 0x11: default: - if ((ZI_WORK->unk_0x00 == '\0') || (ZI_WORK->countOnly == options->countOnly)) { - switch(ZI_WORK->unk_0x00) { + if ((ZI_WORK->getcPhase == '\0') || (ZI_WORK->countOnly == options->countOnly)) { + switch(ZI_WORK->getcPhase) { case '\0': if (parameters->elements[0] == 0xEFF2) { ZI_WORK->countOnly = options->countOnly; - ZI_WORK->unk_0x00 = '\x01'; + ZI_WORK->getcPhase = '\x01'; } break; case '\x01': if (parameters->elements[0] == 0xEFF3) { - ZI_WORK->unk_0x00 = '\x02'; + ZI_WORK->getcPhase = '\x02'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\x02': if (parameters->elements[0] == 0xEFF5) { - ZI_WORK->unk_0x00 = '\x03'; + ZI_WORK->getcPhase = '\x03'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\x03': if (parameters->elements[0] == 0xEFF7) { - ZI_WORK->unk_0x00 = '\x04'; + ZI_WORK->getcPhase = '\x04'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\x04': if (parameters->elements[0] == 0xEFF8) { - ZI_WORK->unk_0x00 = '\x05'; + ZI_WORK->getcPhase = '\x05'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\x05': if (parameters->elements[0] == 0xEFF9) { - ZI_WORK->unk_0x00 = '\x06'; + ZI_WORK->getcPhase = '\x06'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\x06': if (parameters->elements[0] == 0xEFF2) { - ZI_WORK->unk_0x00 = '\a'; + ZI_WORK->getcPhase = '\a'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\a': if (parameters->elements[0] == 0xEFF5) { - ZI_WORK->unk_0x00 = '\b'; + ZI_WORK->getcPhase = '\b'; } else { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } break; case '\b': case '\t': if ((parameters->elements[0] == 0xEFF8) && ((ziU8)Zi8AlphaSignature(parameters,options->countOnly,ZI_WORK) != 0)) { - ZI_WORK->unk_0x00 = '\t'; + ZI_WORK->getcPhase = '\t'; candidateCount = (unsigned int)parameters->letters; if (options->countOnly != '\0') { parameters->letters = 0; @@ -477,17 +477,17 @@ ziU32 Zi8GetCandidatesOrCount(ziGetParam* parameters, ZiCandidateOptions* option return candidateCount; } default: - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } - if ((ZI_WORK->unk_0x00 == '\0') && (parameters->elements[0] == 0xEFF2)) { - ZI_WORK->unk_0x00 = '\x01'; + if ((ZI_WORK->getcPhase == '\0') && (parameters->elements[0] == 0xEFF2)) { + ZI_WORK->getcPhase = '\x01'; } } break; } } else if (1 < parameters->elementCount) { - ZI_WORK->unk_0x00 = '\0'; + ZI_WORK->getcPhase = '\0'; } } ZI_WORK->subLanguage = parameters->subLanguage; -- 2.49.1 From 53ad7f397b56c80c29e121eb209b64b4b70c4c4d Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:34:33 -0500 Subject: [PATCH 3/3] cleanup(eZiText): rename dawg flags forceAltGraph/advanceGroup unk_0x141C gates FI+group 0xC alternate graphTableId; unk_0x141D controls whether NextDawgGroup skips the first group. --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 4 ++-- libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index 080a7e3b..cd52e2a5 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -270,8 +270,8 @@ struct __zi8_work_data_s { ziU8 formatCount; ziU8 unk_0x1419; ziU16 capacity; // 0x141A - ziU8 unk_0x141C; - ziU8 unk_0x141D; + ziU8 forceAltGraph; // 0x141C (lang FI + group 0xC -> graphTableId 0x10) + ziU8 advanceGroup; // 0x141D (nonzero: skip first dawg group) ziU8 graphTableId; // 0x141E ziU8 maxCnt; // 0x141F ziU8 unk_0x1420[4]; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c index 35af1065..37ae1296 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c @@ -159,7 +159,7 @@ ziU8* NextDawgGroup(ziU8* group, ziU8 language, ziPtr __zi8_work_data) Zi8LogError(0x962,ZI_WORK); return 0; } - if (ZI_WORK->unk_0x141D == 0) { + if (ZI_WORK->advanceGroup == 0) { return group; } } @@ -231,7 +231,7 @@ unsigned int Zi8MatchROMdata2(ziWChar* elements, ziU8 count, ziU8 language, if (status == 0) { ZI_WORK->unk_0x1768 = 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->forceAltGraph != 0) { ZI_WORK->graphTableId = 0x10; } else { ZI_WORK->graphTableId = 0; -- 2.49.1