From e059ea063216e92a950bfdbf4e7101a94fcb9898 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:33:04 -0500 Subject: [PATCH 1/3] cleanup(puh_ker_tsk): rename entry unk_0x00/04 to thread/stack (#912) OSThread* used with OSSetThreadPriority; following buffer is task stack. --- libs/RVL_SDK/src/usbcmn/puh_ker_tsk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/RVL_SDK/src/usbcmn/puh_ker_tsk.c b/libs/RVL_SDK/src/usbcmn/puh_ker_tsk.c index 103e450f..5cbc5933 100644 --- a/libs/RVL_SDK/src/usbcmn/puh_ker_tsk.c +++ b/libs/RVL_SDK/src/usbcmn/puh_ker_tsk.c @@ -6,8 +6,8 @@ static struct { struct { - OSThread* unk_0x00; - u8 unk_0x04[0x33C]; + OSThread* thread; // 0x00 + u8 stack[0x33C]; // 0x04 } entries[MAX_PUH_TSK]; // 0x00 u32 unk_0x680; u32 unk_0x684; @@ -24,9 +24,9 @@ s32 uhf_ker_set_priority(int tsk, int priority) { return -5; } - if (st_uhs_ker_tsk_mng.entries[tsk - 1].unk_0x00 == NULL) { + if (st_uhs_ker_tsk_mng.entries[tsk - 1].thread == NULL) { return -1; } - return OSSetThreadPriority(st_uhs_ker_tsk_mng.entries[tsk - 1].unk_0x00, priority) ? 0 : -20; + return OSSetThreadPriority(st_uhs_ker_tsk_mng.entries[tsk - 1].thread, priority) ? 0 : -20; } -- 2.49.1 From 26e90aa9885225f62a436a213adeddc7a4020e6a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:33:31 -0500 Subject: [PATCH 2/3] cleanup(eZiText): rename work unk_0x1B30 to koAltTables (#913) Korean path selects alternate hangul tables when non-zero. --- libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h | 2 +- libs/RVLMiddleware/eZiText/src/clib/zi8initd.c | 2 +- libs/RVLMiddleware/eZiText/src/clib/zikorean.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h index b1bbe34a..080a7e3b 100644 --- a/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h +++ b/libs/RVLMiddleware/eZiText/include/zi8clib/zitypes.h @@ -328,7 +328,7 @@ struct __zi8_work_data_s { ziU32 msb : 1; } bits; } unk_0x1B2C; - ziU8 unk_0x1B30; + ziU8 koAltTables; // 0x1B30 ziU8 unk_0x1B31; ziU16 unk_0x1B32; ziU16 unk_0x1B34; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c index 16507372..22333039 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zi8initd.c @@ -23,7 +23,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) { *(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF; ZI_WORK->separator = 0x20; ZI_WORK->unk_0x1C[2] = 0; - ZI_WORK->unk_0x1B30 = 0; + ZI_WORK->koAltTables = 0; ZI_WORK->unk_0x1B3A = 0; ZI_WORK->unk_0x1B36 = 0; ZI_WORK->unk_0x1B32 = 0; diff --git a/libs/RVLMiddleware/eZiText/src/clib/zikorean.c b/libs/RVLMiddleware/eZiText/src/clib/zikorean.c index 4363220f..e038d8a3 100644 --- a/libs/RVLMiddleware/eZiText/src/clib/zikorean.c +++ b/libs/RVLMiddleware/eZiText/src/clib/zikorean.c @@ -104,7 +104,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, state.characterIndex, (state.elementIndex - currentCharacter) - 1, workData); - if ((((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 1)) { + if ((((struct __zi8_work_data_s*)workData)->koAltTables == 1)) { switch (state.characterIndex) { case 1: selectedTable = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 0x1E, workData); @@ -179,7 +179,7 @@ ziU32 Zi8GetKoreanCandidates(ziGetParam* params, ziU8* argument, } else { params->candidates[(ziU8)result] = ((ziU16)selectedTable[state.nextIndex * 2] << 8) | (selectedTable + state.nextIndex * 2)[1]; - if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 0)) { + if ((state.tableCount6 != 0) && (((struct __zi8_work_data_s*)workData)->koAltTables == 0)) { params->candidates[(ziU8)result] += state.inputIndex * state.tableCount3; } result++; @@ -249,7 +249,7 @@ ziU8 Zi8MatchKoreanSequence(ziU16* resultIndex, ziU16* input, ziU8 type, ziU16 c firstCharacter = input[0]; mappedCharacter = 0xFF; - if (((struct __zi8_work_data_s*)workData)->unk_0x1B30 == 0) { + if (((struct __zi8_work_data_s*)workData)->koAltTables == 0) { table = (ziU8*)Zi8GetTableAddress(ZI8_LANG_KO, 3, workData); tableCount = Zi8GetTableCount(ZI8_LANG_KO, 3, workData); } else { -- 2.49.1 From 1e55443f20b5dc6cf0abfe50bcb10413b7660cc8 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Fri, 2 Oct 2026 14:33:35 -0500 Subject: [PATCH 3/3] cleanup(uusb_ppc): name outstanding counters and intrEndpoint2 at_0x38/48 track in-flight bulk/intr USB reads (cap 5); at_0x13 sits with the other endpoint bytes and is only cleared. --- libs/RVL_SDK/src/bte/uusb_ppc.c | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/libs/RVL_SDK/src/bte/uusb_ppc.c b/libs/RVL_SDK/src/bte/uusb_ppc.c index ed9c023f..af41c5ba 100644 --- a/libs/RVL_SDK/src/bte/uusb_ppc.c +++ b/libs/RVL_SDK/src/bte/uusb_ppc.c @@ -33,7 +33,7 @@ typedef struct u8 bulkEndpoint1; u8 bulkEndpoint2; u8 intrEndpoint1; - char at_0x13; // intrEndpoint2? + u8 intrEndpoint2; int vid; int pid; UINT8 cmd_buffer_pool; @@ -46,9 +46,9 @@ typedef struct char pad4_[1]; UINT8 reading_intr_data; BUFFER_Q bulk_buffer_q; - UINT8 at_0x38; + UINT8 bulk_outstanding; BUFFER_Q intr_buffer_q; - UINT8 at_0x48; + UINT8 intr_outstanding; char pad8_[3]; } tUUSB_CB; @@ -158,7 +158,7 @@ static void uusb_CloseDeviceCB(long result, void *p_data) usb.bulkEndpoint1 = 0; usb.bulkEndpoint2 = 0; usb.intrEndpoint1 = 0; - usb.at_0x13 = 0; + usb.intrEndpoint2 = 0; usb.fd = 0; @@ -363,12 +363,12 @@ static void uusb_WriteCtrlDataCB(long result, void *p_data) GKI_disable(); - --usb.at_0x48; + --usb.intr_outstanding; GKI_enable(); } - if (usb.at_0x48 >= 5) + if (usb.intr_outstanding >= 5) return; if (usb.intr_buffer_q.count == 0) @@ -389,7 +389,7 @@ static void uusb_WriteCtrlDataCB(long result, void *p_data) { GKI_disable(); - ++usb.at_0x48; + ++usb.intr_outstanding; GKI_enable(); } @@ -411,12 +411,12 @@ static void uusb_WriteBulkDataCB(long result, void *p_data) GKI_disable(); - --usb.at_0x38; + --usb.bulk_outstanding; GKI_enable(); } - if (usb.at_0x38 >= 5) + if (usb.bulk_outstanding >= 5) return; if (usb.bulk_buffer_q.count == 0) @@ -436,7 +436,7 @@ static void uusb_WriteBulkDataCB(long result, void *p_data) { GKI_disable(); - ++usb.at_0x38; + ++usb.bulk_outstanding; GKI_enable(); } @@ -504,7 +504,7 @@ void UUSB_Register(tUUSB *uusb) usb.bulkEndpoint1 = 0; usb.bulkEndpoint2 = 0; usb.intrEndpoint1 = 0; - usb.at_0x13 = 0; + usb.intrEndpoint2 = 0; if (uusb_get_devId(usb.vid, usb.pid) < 0) return; @@ -512,13 +512,13 @@ void UUSB_Register(tUUSB *uusb) usb.bulkEndpoint1 = 2; usb.bulkEndpoint2 = 130; usb.intrEndpoint1 = 129; - usb.at_0x13 = 0; + usb.intrEndpoint2 = 0; GKI_init_q(&usb.bulk_buffer_q); - usb.at_0x38 = 0; + usb.bulk_outstanding = 0; GKI_init_q(&usb.intr_buffer_q); - usb.at_0x48 = 0; + usb.intr_outstanding = 0; usb.cmd_buffer_pool = GKI_create_pool(660, 45, 1, NULL); usb.acl_buffer_pool = GKI_create_pool(1800, 30, 1, NULL); @@ -607,7 +607,7 @@ UINT16 UUSB_Write(UINT8 pipe, void *p_data, UINT16 len, void *unused) memcpy(p_buffer, p_data, len); - if (usb.at_0x48 < 5 && usb.intr_buffer_q.count == 0) + if (usb.intr_outstanding < 5 && usb.intr_buffer_q.count == 0) { ret = IUSB_WriteCtrlMsgAsync(usb.fd, 0x20, 0, 0, 0, len, p_buffer, uusb_WriteCtrlDataCB, p_buf); @@ -634,7 +634,7 @@ UINT16 UUSB_Write(UINT8 pipe, void *p_data, UINT16 len, void *unused) { GKI_disable(); - ++usb.at_0x48; + ++usb.intr_outstanding; GKI_enable(); } @@ -658,7 +658,7 @@ UINT16 UUSB_Write(UINT8 pipe, void *p_data, UINT16 len, void *unused) if (len > 190) UUSBDBG(" woah ! thats pretty Big ! :%d", len); - if (usb.at_0x38 < 5 && usb.bulk_buffer_q.count == 0) + if (usb.bulk_outstanding < 5 && usb.bulk_buffer_q.count == 0) { ret = IUSB_WriteBlkMsgAsync(usb.fd, usb.bulkEndpoint1, len, p_buffer, uusb_WriteBulkDataCB, p_buf); @@ -685,7 +685,7 @@ UINT16 UUSB_Write(UINT8 pipe, void *p_data, UINT16 len, void *unused) { GKI_disable(); - ++usb.at_0x38; + ++usb.bulk_outstanding; GKI_enable(); } -- 2.49.1