From 128d7745421708642765baaef1a3813c410cef3f Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:40:41 -0500 Subject: [PATCH] cleanup(eZiText): rename zi8DawgCtx unk_0x338 to endNode Walk stops when the current node equals endNode; cleared on reset. --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c | 6 +++--- libs/RVLMiddleware/eZiText/src/clib/zidawg1.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index ce724428..365d32df 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -195,7 +195,7 @@ typedef struct _zi8DawgCtx { ziU8* table; // 0x10 ziU8* p14; // 0x14 zi8DawgRec recs[0x32]; // 0x18 - ziU32 unk_0x338; // 0x338 + ziU32 endNode; // 0x338 } zi8DawgCtx; typedef struct _ziUwdNode { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c index 35af1065..58b54db2 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8dawg.c @@ -32,7 +32,7 @@ ziU32 Zi8MatchROMdata0(ziWChar* elements, ziU8 count, ziU8 language, if (language != context->lang || graphTable != context->key) records[0].key = 0; if (count == 1 && mode != 0 && graphTable == 0xe) goto finish_graph; if (status != 0) { - if (records[context->cnt - 1].node == (ziU8*)context->unk_0x338) goto finish_graph; + if (records[context->cnt - 1].node == (ziU8*)context->endNode) goto finish_graph; for (index = 0; index < count; index++) { if (records[index].key != elements[index] && (ziU16)records[index].attr != elements[index]) goto finish_graph; @@ -82,7 +82,7 @@ check_keys: records[0].node = ZiDAWGGetGraphInfo(context, keyData, (ziS16*)keys); } else { records[0].node = ZiDAWGGetGraph(context); - context->unk_0x338 = 0; + context->endNode = 0; context->p14 = 0; } records[0].key = 0; @@ -98,7 +98,7 @@ check_keys: } searching = 1; current = &records[context->cnt - 1]; - while (searching && context->cnt != 0 && current->node != (ziU8*)context->unk_0x338) { + while (searching && context->cnt != 0 && current->node != (ziU8*)context->endNode) { if (capacity < context->cnt) goto finish_graph; current->attr = ZiDAWGgetCHARattribute(context, current->node, ZI_WORK); if (context->cnt <= count) { diff --git a/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c b/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c index 88442f84..5ef89ac4 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zidawg1.c @@ -199,10 +199,10 @@ checkEntry: } result = graph + (ziU32)entry[4] * 0x10000 + (((ziU16)entry[5] << 8) + entry[6]); - ((zi8DawgCtx*)context)->unk_0x338 = + ((zi8DawgCtx*)context)->endNode = graph + (ziU32)entry[7] * 0x10000 + (((ziU16)entry[8] << 8) + entry[9]); - if (((zi8DawgCtx*)context)->unk_0x338 == graph) { - ((zi8DawgCtx*)context)->unk_0x338 = 0; + if (((zi8DawgCtx*)context)->endNode == graph) { + ((zi8DawgCtx*)context)->endNode = 0; } if ((((ziU16)entry[0] << 8) + entry[1]) == 0) { -- 2.49.1