Compare commits

...

1 Commits

Author SHA1 Message Date
coah
19f4355e46 cleanup(eZiText): rename work unk_0x17EA to matchOffset
Offset into match elements / result buffer during Zi8MatchROMdata1.
2026-10-02 14:07:11 -05:00
2 changed files with 15 additions and 15 deletions

View File

@@ -280,7 +280,7 @@ struct __zi8_work_data_s {
ziU8* unk_0x1764; // 0x1764 ziU8* unk_0x1764; // 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

@@ -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: