Compare commits

...

1 Commits

Author SHA1 Message Date
coah
169a5f1e79 sweep: kbd_lib, tiZiString, exif closer (worker 374f661e) 2026-09-30 22:57:34 +00:00
9 changed files with 4045 additions and 93 deletions

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 98.83% | 86.03% | 60.25% | 90.87% |
| 98.84% | 86.05% | 60.25% | 90.87% |
units 899/1027 complete, functions 12120/12563 matched.
units 899/1027 complete, functions 12121/12563 matched.
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
<!-- progress:end -->

View File

@@ -244,6 +244,11 @@ _error:
static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData* pInfo) {
u16 byteOrder;
u32 ifdOffset;
const u8* entries;
u16 remaining;
u16 count;
s32 entriesSize;
u16 index;
pInfo->thumbnailData = (u8*)data;
pInfo->dataEnd = (u8*)data + size;
pInfo->nextIfdOffset = 0;
@@ -262,11 +267,8 @@ static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData*
return -161;
}
{
const u8* entries = data + ifdOffset;
u16 remaining = size - (u16)ifdOffset;
u16 count;
s32 entriesSize;
u16 index;
entries = data + ifdOffset;
remaining = size - (u16)ifdOffset;
if (remaining < 2) {
return -161;
}
@@ -294,11 +296,8 @@ static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData*
return -161;
}
{
const u8* entries = data + ifdOffset;
u16 remaining = size - (u16)ifdOffset;
u16 count;
s32 entriesSize;
u16 index;
entries = data + ifdOffset;
remaining = size - (u16)ifdOffset;
if (remaining < 2) {
return -161;
}
@@ -319,11 +318,8 @@ static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData*
return -161;
}
{
const u8* entries = data + ifdOffset;
u16 remaining = size - (u16)ifdOffset;
u16 count;
s32 entriesSize;
u16 index;
entries = data + ifdOffset;
remaining = size - (u16)ifdOffset;
if (remaining < 2) {
return -161;
}
@@ -354,7 +350,7 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
case 0x0111:
case 0x0201:
case 0x0202: {
return;
break;
}
case 0x0112: {
pInfo->orientation = readU16(entry + 8, byteOrder);
@@ -474,21 +470,19 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
return;
}
case 0xA002: {
u32 offset = readU32(entry + 8, byteOrder);
if (type == 4) {
pInfo->pixelXDim = offset;
} else if (type == 3) {
if (type == 3) {
pInfo->pixelXDim = readU16(entry + 8, byteOrder);
} else if (type == 4) {
pInfo->pixelXDim = readU32(entry + 8, byteOrder);
}
return;
}
case 0xA003: {
u32 offset = readU32(entry + 8, byteOrder);
if (type == 4) {
pInfo->pixelYDim = offset;
} else if (type == 3) {
if (type == 3) {
pInfo->pixelYDim = readU16(entry + 8, byteOrder);
} else if (type == 4) {
pInfo->pixelYDim = readU32(entry + 8, byteOrder);
}
return;
}
@@ -508,7 +502,7 @@ static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
case 0x9000:
case 0x9101:
case 0xA003: {
return;
break;
}
case 0x011A: {
u32 offset;

View File

@@ -404,84 +404,85 @@ static void kbdProcMod(u32 key, u32 pressed, u32 channel) {
KBDChannel* data;
s32 delta;
u8 flags;
KBDModifierState state;
u32 modifiers;
KBDModifierState* state = (KBDModifierState*)&modifiers;
u32 finalState;
s8 value;
data = &kbdData[channel];
delta = (pressed & 1) != 0 ? 1 : -1;
flags = kbdKeyMaps.maps[data->country].flags;
state.value = data->modState;
kbdGetModState(channel, &state.value);
if (kbdGetModState(channel, &modifiers) != 0) {
modifiers = data->modState;
}
switch (key) {
case 0xF001:
if (data->lockState != 0) {
if ((pressed & 1) != 0) {
state.value ^= 2;
modifiers ^= 2;
}
} else {
value = data->lockCount[1] + delta;
data->lockCount[1] = value;
state.keys.rightControl = (u8)value != 0;
state->keys.rightControl = (u8)value != 0;
}
break;
case 0xF005:
if (data->lockState != 0) {
if ((pressed & 1) != 0) {
state.value ^= 0x20;
modifiers ^= 0x20;
}
} else {
value = data->lockCount[4] + delta;
data->lockCount[4] = value;
state.keys.rightAlt = (u8)value != 0;
modifiers = (modifiers & ~0x20) | (((u8)value != 0) << 5);
}
break;
case 0xF000:
if (data->lockState != 0) {
if ((pressed & 1) != 0) {
state.value ^= 1;
modifiers ^= 1;
}
} else {
value = data->lockCount[0] + delta;
data->lockCount[0] = value;
state.keys.leftControl = (u8)value != 0;
state->keys.leftControl = (u8)value != 0;
}
break;
case 0xF008:
if (((pressed & 1) != 0) && (data->lockProcessing != 0)) {
state.value ^= 0x200;
modifiers ^= 0x200;
}
break;
case 0xF007:
if (((pressed & 1) != 0) && (data->lockProcessing != 0)) {
state.value ^= 0x100;
modifiers ^= 0x100;
}
break;
case 0xF006:
if (((pressed & 1) != 0) && (data->lockProcessing != 0)) {
u32 oldState;
u32 lockState;
oldState = state.value;
oldState = modifiers;
lockState = oldState & 0xC0;
switch (lockState) {
case 0:
if ((flags & 1) == 1) {
state.value = oldState | 0x40;
modifiers = oldState | 0x40;
}
break;
case 0x40:
{
state.value = oldState & 0xFFFFFFBF;
modifiers = oldState & 0xFFFFFFBF;
if ((flags & 4) == 4) {
state.value = oldState & 0xFFFFFFBF | 0x80;
modifiers = oldState & 0xFFFFFFBF | 0x80;
}
}
break;
case 0x80:
state.value = oldState & 0xFFFFFF7F;
modifiers = oldState & 0xFFFFFF7F;
break;
case 0xC0:
state.value = oldState & 0xFFFFFF3F;
modifiers = oldState & 0xFFFFFF3F;
break;
}
}
@@ -489,43 +490,43 @@ static void kbdProcMod(u32 key, u32 pressed, u32 channel) {
case 0xF002:
if (data->lockState != 0) {
if ((pressed & 1) != 0) {
state.value ^= 4;
modifiers ^= 4;
}
} else {
value = data->lockCount[2] + delta;
data->lockCount[2] = value;
state.keys.leftShift = (u8)value != 0;
modifiers = (modifiers & ~4) | (((u8)value != 0) << 2);
}
break;
case 0xF003:
if (data->lockState != 0) {
if ((pressed & 1) != 0) {
state.value ^= 8;
modifiers ^= 8;
}
} else {
value = data->lockCount[3] + delta;
data->lockCount[3] = value;
state.keys.rightShift = (u8)value != 0;
state->keys.rightShift = (u8)value != 0;
}
break;
case 0xF004:
if (data->lockState != 0) {
if ((pressed & 1) != 0) {
state.value ^= 0x10;
modifiers ^= 0x10;
}
} else {
value = data->lockCount[5] + delta;
data->lockCount[5] = value;
state.keys.leftAlt = (u8)value != 0;
state->keys.leftAlt = (u8)value != 0;
}
break;
case 0xF021:
if (((pressed & 1) != 0) && (data->lockProcessing != 0)) {
state.value ^= 0x400;
modifiers ^= 0x400;
}
break;
}
finalState = state.value | 0x1000;
finalState = modifiers | 0x1000;
KBDSetModState(channel, finalState);
}
@@ -627,6 +628,7 @@ USBKBDErr KBDSetLeds(u32 channel, u32 leds) {
u32 index;
BOOL interrupts;
USBKBDErr result;
u8 ledBits;
if (!kbdInitialized) {
return 2;
}
@@ -636,7 +638,7 @@ USBKBDErr KBDSetLeds(u32 channel, u32 leds) {
if ((s32)kbdChannelFlags(channel) == 1 || (s32)kbdChannelFlags(channel) == 4) {
return 5;
}
leds &= 0xff;
ledBits = leds;
interrupts = OSDisableInterrupts();
index = 0;
while (index < 12) {
@@ -650,7 +652,7 @@ USBKBDErr KBDSetLeds(u32 channel, u32 leds) {
if (index == 12) {
return 7;
}
result = USBKBDSetLED((u32)kbdData[channel].device, leds,
result = USBKBDSetLED((u32)kbdData[channel].device, ledBits,
(USBKBDCmdLED*)&kbdCmdBuf[index]);
kbdCmdBuf[index].device = 0;
switch (result) {
@@ -843,7 +845,7 @@ USBKBDErr KBDSetModState(u32 channel, u32 value) {
interrupts = OSDisableInterrupts();
state = (KBDModifierState*)&kbdData[channel].modState;
newState.value = value & 0xfc0;
oldState = *state;
oldState.value = kbdData[channel].modState;
newState.bits.physical = oldState.bits.physical;
*state = newState;
OSRestoreInterrupts(interrupts);

View File

@@ -922,7 +922,8 @@ static s32 __nupGetTitleSize(NUPTitleInfo* title) {
title->installedContentSize += 0x4000;
for (contentIndex = 0; contentIndex < ((ESTmdView*)title->tmdView)->head.numContents; contentIndex++) {
ESCmdView* content = &((ESTmdView*)title->tmdView)->contents[contentIndex];
if (!__nupHasContent(title, content->cid) ||
ESContentId contentId = content->cid;
if (!__nupHasContent(title, contentId) ||
title->titleId == 0x0000000100000001ULL) {
if (content->size > 0xffffffefULL) {
result = -0x1394;
@@ -1171,10 +1172,9 @@ static inline s32 __nupGetBoot2Version(u16* version) {
u32 bootVersion;
s32 result = ES_GetBoot2Version(&bootVersion);
if (result == 0) {
*version = bootVersion;
if (*version != bootVersion) {
result = -0x1389;
}
u16 checkedVersion = bootVersion;
*version = checkedVersion;
result = checkedVersion == bootVersion ? result : -0x1389;
}
return result;
}
@@ -1349,11 +1349,12 @@ extern "C" void* __nupOp(void* argument) {
OSUnlockMutex(&context->mutex);
for (i = 0; i < context->titleCount; i++) {
NUPTitleInfo* title = &context->titles[i];
if (title->titleId == 0x0000000100000001ULL) {
ESTitleId titleId = title->titleId;
if (titleId == 0x0000000100000001ULL) {
bootTitle = title;
} else if (title->titleId == 0x0000000100000002ULL) {
} else if (titleId == 0x0000000100000002ULL) {
menuTitle = title;
} else if (title->titleId == currentTitleId) {
} else if (titleId == currentTitleId) {
systemTitle = title;
}
if (bootTitle != 0 && menuTitle != 0 && systemTitle != 0) {

View File

@@ -254,6 +254,13 @@ wchar_t* WithZi::getCurrentInput() {
return (wchar_t*)CandidatesBuffer;
}
static inline bool IsKoreanLeadingLetter(wchar_t value) {
for (s32 index = 0; index < 14; ++index) {
if (value == kKoreanLeadingLetters[index]) return true;
}
return false;
}
void WithZi::partialConfirmForKR() {
if (mInputLength <= 1) return;
bool match;
@@ -272,18 +279,7 @@ void WithZi::partialConfirmForKR() {
finalLetterChecked:
if (!match) goto keepLastLetter;
value = util::toWLower(CandidatesBuffer[mInputLength - 2]);
index = 0;
letters = kKoreanLeadingLetters;
for (; index < 14; ++index) {
if (value == *letters) {
match = true;
goto leadingLetterChecked;
}
++letters;
}
match = false;
leadingLetterChecked:
if (!match) goto keepLastLetter;
if (!IsKoreanLeadingLetter(value)) goto keepLastLetter;
CandidatesBuffer[0] = CandidatesBuffer[mInputLength - 2];
CandidatesBuffer[1] = CandidatesBuffer[mInputLength - 1];
mInputLength = 2;
@@ -301,6 +297,7 @@ void WithZi::update() {
return;
}
wchar_t* candidateOutput = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
mSelectedCandidate = 0;
s32 elementCount = static_cast<u16>(setElementBuffer());
mSearch.language = getPredictLanguage();
@@ -309,7 +306,7 @@ void WithZi::update() {
mSearch.context = 1;
mSearch.getOptions = 0x81;
mSearch.elements = reinterpret_cast<wchar_t*>(ElementBuffer);
mSearch.candidates = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
mSearch.candidates = candidateOutput;
mSearch.maxCandidates = 0x28;
mSearch.elementCount = static_cast<u8>(elementCount);
mSearch.firstCandidate = 0;
@@ -363,7 +360,7 @@ void WithZi::update() {
count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
mSearch.firstCandidate = 0;
count += 0x61;
mSearch.candidates = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
mSearch.candidates = candidateOutput;
}
if (static_cast<s32>(count) > 0x28) {
count = 0x28;
@@ -514,10 +511,10 @@ scanDone:
u32 WithZi::setElementBuffer() {
u32 count = 0;
memset(ElementBuffer, 0, 0x1fe);
memset(&CandidatesBuffer[0x100], 0, 0x1fe);
u16* elements = ElementBuffer;
u16* candidates = CandidatesBuffer;
memset(elements, 0, 0x1fe);
memset(candidates + 0x100, 0, 0x1fe);
u16 inputCharacter;
while ((inputCharacter = candidates[static_cast<u16>(count)]) != 0 && static_cast<u16>(count) < 0xff) {
u16 index = count;
@@ -562,7 +559,6 @@ void WithZi::setCurrentWord(const wchar_t* word) {
}
mbContextChanged = 1;
wchar_t* currentWord;
u32 sourceOffset;
u32 length;
s32 copied;
length = 0;
@@ -575,15 +571,14 @@ void WithZi::setCurrentWord(const wchar_t* word) {
}
}
copied = 0;
sourceOffset = 0;
currentWord = const_cast<wchar_t*>(word);
for (; *currentWord != 0 && length < 0x3f;) {
wchar_t character = word[sourceOffset];
const wchar_t* source = word;
u32 destinationOffset = length;
for (; *source != 0 && length < 0x3f;) {
wchar_t character = word[copied];
++length;
++currentWord;
++source;
++copied;
LatestWord[length - 1] = character;
++sourceOffset;
LatestWord[destinationOffset++] = character;
}
LatestWord[length] = 0;
mCurrentWordLength = copied;

View File

@@ -158,7 +158,7 @@ bool MemoryCardManager::isMoveEnable(u8 slot, u32 index, long* code) {
result = -0x15;
enabled = true;
} else {
long destinationState = 0;
long destinationState;
if (!isDistSlot(slot, &destinationState)) {
if (destinationState == 0) {
result = -0x17;
@@ -199,7 +199,7 @@ bool MemoryCardManager::isCopyEnable(u8 slot, u32 index, long* code) {
result = -0x15;
enabled = true;
} else {
long destinationState = 0;
long destinationState;
if (!isDistSlot(slot, &destinationState)) {
if (destinationState == 0) {
result = -0x17;
@@ -254,11 +254,11 @@ void MemoryCardManager::update_icon_anm() {
u32 file = mFile[slot][index].fileNo;
if (file < 0x7f && dirs[slot][file].fileNo != 0) {
memorycard::IconState* icon = &icons[slot][file];
s16 frame = mFileCell[slot][file].iconAnmCounter + icon->anmDelta;
s32 frame = mFileCell[slot][file].iconAnmCounter + icon->anmDelta;
mFileCell[slot][file].iconAnmCounter = frame;
if (frame >= icon->anmMax) {
if ((s16)frame >= icon->anmMax) {
if (icon->anmType == 4) {
mFileCell[slot][file].iconAnmCounter = icon->anmMax - icon->unk_0x07 - 1;
mFileCell[slot][file].iconAnmCounter = icons[slot][file].anmMax - icon->unk_0x07 - 1;
icon->anmDelta = -1;
} else {
mFileCell[slot][file].iconAnmCounter = 0;

View File

@@ -0,0 +1,210 @@
# Structural matching continuation
43U only. Initial full build and DOL SHA1 pass, pools identical, regressions zero. pool_diff.py cannot inspect absent .data in memoryCard and exif; gate confirms both empty pools. Shared keyboard headers are preserved. Every entry records a compiled distinct source experiment and ctxdiff, with full diagnostics in /tmp/sol-low-attempts. Exact symbol names remain unchanged.
## libs/RVL_SDK/src/nup/nup __nupGetBootVersion__FP14ESTitleVersion
__nupGetBootVersion__FP14ESTitleVersion attempt 1: stack-frame block uses explicit local boot-version validation instead of inline helper. objdiff None%; Cross-name diagnostic only: source __nupGetBootVersion__FP14NUPContextInfoP14ESTitleVersion; target __nupGetBootVersion__FP14ESTitleVersion; insns 163/163; discarded
__nupGetBootVersion__FP14ESTitleVersion attempt 2: content traversal advances typed entry pointer in target address order. objdiff None%; Cross-name diagnostic only: source __nupGetBootVersion__FP14NUPContextInfoP14ESTitleVersion; target __nupGetBootVersion__FP14ESTitleVersion; insns 164/163; discarded
__nupGetBootVersion__FP14ESTitleVersion attempt 3: owned-title scan saves count before loop and checks that count at join. objdiff None%; Cross-name diagnostic only: source __nupGetBootVersion__FP14NUPContextInfoP14ESTitleVersion; target __nupGetBootVersion__FP14ESTitleVersion; insns 163/163; discarded
## libs/RVL_SDK/src/nup/nup __nupOp
__nupOp attempt 1: entry block initializes title pointers together after context and API buffers. objdiff 96.906395%; src 0x6d4 base 0x6d8 insns 437/438; --- replace mine 6:7 base 6:7; retained
__nupOp attempt 2: second API block tests narrowed version through explicit temporary and ternary error. objdiff 97.72831%; src 0x6e0 base 0x6d8 insns 440/438; --- replace mine 6:7 base 6:7; retained
__nupOp attempt 3: title selection uses loop-local id at each comparison. objdiff 98.8242%; src 0x6e0 base 0x6d8 insns 440/438; --- delete mine 8:9 base 8:8; retained
## libs/RVL_SDK/src/nup/nup __nupParseServerInfo__FP14NUPContextInfoPcPcUx
__nupParseServerInfo__FP14NUPContextInfoPcPcUx attempt 1: tag extraction keeps after-end cursor local to each version block. objdiff 98.108406%; src 0x710 base 0x710 insns 452/452; diffs 148: [13, 14, 15, 18, 21, 23, 26, 30, 32, 33, 34, 36, 41, 43, 44, 49, 52, 53, 56, 59]; discarded
__nupParseServerInfo__FP14NUPContextInfoPcPcUx attempt 2: parsed title version checks truncation directly without cached narrow temporary. objdiff 97.97566%; src 0x710 base 0x710 insns 452/452; diffs 157: [13, 14, 15, 18, 21, 23, 26, 30, 32, 33, 34, 36, 41, 43, 44, 49, 52, 53, 56, 59]; discarded
__nupParseServerInfo__FP14NUPContextInfoPcPcUx attempt 3: title result fields use a typed entry reference after parser calls. objdiff 97.22345%; src 0x700 base 0x710 insns 448/452; --- replace mine 13:16 base 13:16; discarded
## libs/RVL_SDK/src/nup/nup __nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 1: request size addition follows target operand order. objdiff 99.10345%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 2: request allocation size has separately named country length. objdiff 99.10345%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 3: request size uses left-to-right ordinary length sum. objdiff 99.793106%; src 0x244 base 0x244 insns 145/145; diffs 5: [49, 52, 54, 58, 59]; discarded
## libs/RVL_SDK/src/nup/nup __nupBase64Encode__FPUcPUcUl
__nupBase64Encode__FPUcPUcUl attempt 1: encode blocks load first character before second to follow target schedule. objdiff 94.20635%; src 0xfc base 0xfc insns 63/63; diffs 21: [5, 9, 11, 16, 17, 18, 20, 21, 22, 23, 25, 31, 35, 38, 42, 44, 48, 52, 55, 58]; discarded
__nupBase64Encode__FPUcPUcUl attempt 2: encode loop writes first character before third lookup and resets group count after store. objdiff 94.20635%; src 0xfc base 0xfc insns 63/63; diffs 21: [5, 9, 11, 16, 17, 18, 20, 21, 22, 23, 25, 31, 35, 38, 42, 44, 48, 52, 55, 58]; discarded
__nupBase64Encode__FPUcPUcUl attempt 3: encode loop uses preincrement counter and direct first-character store. objdiff 92.22222%; src 0xfc base 0xfc insns 63/63; diffs 19: [5, 9, 11, 17, 19, 21, 23, 25, 27, 31, 35, 38, 42, 44, 48, 52, 55, 58, 59]; discarded
## libs/RVL_SDK/src/nup/nup __nupGetTitleSize__FP12NUPTitleInfo
__nupGetTitleSize__FP12NUPTitleInfo attempt 1: content block copies cid before content-presence test. objdiff 99.100716%; src 0x22c base 0x22c insns 139/139; diffs 22: [39, 40, 42, 43, 56, 57, 58, 59, 61, 62, 67, 68, 69, 71, 74, 75, 78, 80, 90, 91]; retained
__nupGetTitleSize__FP12NUPTitleInfo attempt 2: installed allocation arithmetic uses named aligned TMD size. objdiff 98.884895%; src 0x22c base 0x22c insns 139/139; diffs 25: [39, 40, 42, 43, 56, 57, 58, 59, 61, 62, 66, 67, 68, 69, 71, 72, 74, 75, 76, 78]; discarded
__nupGetTitleSize__FP12NUPTitleInfo attempt 3: title size loop advances typed TMD content cursor. objdiff 79.992805%; src 0x234 base 0x22c insns 141/139; --- replace mine 24:26 base 24:30; discarded
## libs/RVL_SDK/src/nup/nup __nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 4: request size expression adds running sum before country call result, matching target add operands. objdiff 99.10345%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
## libs/RVL_SDK/src/kbd/kbd_lib kbdProcKey
kbdProcKey attempt 1: stack event initializes modifiers only on getter error, avoiding redundant success store. objdiff 94.62209%; src 0x2d4 base 0x2b0 insns 181/172; --- replace mine 16:19 base 16:17; discarded
kbdProcKey attempt 2: translation block takes event modifier directly and uses event result for dispatch. objdiff 93.808136%; src 0x2ac base 0x2b0 insns 171/172; --- replace mine 6:9 base 6:9; discarded
kbdProcKey attempt 3: repeat lookup has signed bounded counter in address-order loop. objdiff 97.15116%; src 0x2b8 base 0x2b0 insns 174/172; --- replace mine 6:9 base 6:9; discarded
## libs/RVL_SDK/src/kbd/kbd_lib kbdProcMod
kbdProcMod attempt 1: stack modifier word and typed bitfield view preserve separate load/store blocks. objdiff 78.90625%; src 0x3a0 base 0x400 insns 232/256; --- replace mine 2:3 base 2:3; discarded
kbdProcMod attempt 2: getter failure fallback initializes stack modifier word while success follows target entry. objdiff 85.3125%; src 0x400 base 0x400 insns 256/256; diffs 235: [3, 5, 6, 8, 9, 10, 13, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]; retained
kbdProcMod attempt 3: right-alt and left-shift blocks clear destination masks before inserting boolean bit. objdiff 88.18359%; src 0x408 base 0x400 insns 258/256; --- replace mine 3:4 base 3:4; retained
## libs/RVL_SDK/src/kbd/kbd_lib kbd_led_handler
kbd_led_handler attempt 1: callback status uses target conditional branch instead of switch. objdiff 39.36%; src 0x58 base 0x64 insns 22/25; --- replace mine 2:4 base 2:4; discarded
kbd_led_handler attempt 2: callback result local is passed through ternary status conversion. objdiff 39.36%; src 0x58 base 0x64 insns 22/25; --- replace mine 2:4 base 2:4; discarded
kbd_led_handler attempt 3: callback address is reloaded directly after status block, retains typed index. objdiff 39.36%; src 0x58 base 0x64 insns 22/25; --- replace mine 2:4 base 2:4; discarded
## libs/RVL_SDK/src/kbd/kbd_lib KBDSetLedsAsync
KBDSetLedsAsync attempt 1: validation block keeps full channel after bounds check, matching target multiply. objdiff 82.48148%; src 0x140 base 0x144 insns 80/81; --- replace mine 7:9 base 7:9; discarded
KBDSetLedsAsync attempt 2: return block follows target error-then-success join. objdiff 79.604935%; src 0x138 base 0x144 insns 78/81; --- replace mine 7:9 base 7:9; discarded
KBDSetLedsAsync attempt 3: reservation blocks advance typed command cursor and keep separate index. BUILD FAILED: ninja: build stopped: subcommand failed.
## libs/RVL_SDK/src/kbd/kbd_lib KBDSetLeds
KBDSetLeds attempt 1: stack/register lifetime narrows LED bits before interrupt call, keeps channel separately. objdiff 81.48101%; src 0x138 base 0x13c insns 78/79; --- insert mine 4:4 base 4:5; retained
KBDSetLeds attempt 2: clear-command block directly reloads command array after USB call and returns error first. objdiff 72.620255%; src 0x134 base 0x13c insns 77/79; --- insert mine 4:4 base 4:5; discarded
KBDSetLeds attempt 3: reservation blocks use target counted loop form and direct array at each use. objdiff 72.620255%; src 0x134 base 0x13c insns 77/79; --- insert mine 4:4 base 4:5; discarded
## libs/RVL_SDK/src/kbd/kbd_lib kbdEventHandler
kbdEventHandler attempt 1: report status is loaded once before error guard, uses named status in branch. objdiff 99.22043%; src 0x2e4 base 0x2e8 insns 185/186; --- replace mine 34:40 base 34:40; discarded
kbdEventHandler attempt 2: report status initialized before channel pointer, matching target load lifetime. objdiff 99.38172%; src 0x2e4 base 0x2e8 insns 185/186; --- replace mine 34:36 base 34:36; discarded
kbdEventHandler attempt 3: channel pointer is formed by indexed array expression rather than compound pointer addition. objdiff 99.78494%; src 0x2e8 base 0x2e8 insns 186/186; diffs 6: [35, 36, 37, 38, 39, 42]; discarded
## libs/RVL_SDK/src/kbd/kbd_lib KBDSetModState
KBDSetModState attempt 1: modifier update loads physical bitfields directly from typed channel view. objdiff 98.690475%; src 0xa8 base 0xa8 insns 42/42; diffs 7: [26, 27, 29, 30, 31, 32, 33]; discarded
KBDSetModState attempt 2: modifier update builds next flags before forming state pointer. objdiff 98.690475%; src 0xa8 base 0xa8 insns 42/42; diffs 7: [26, 27, 29, 30, 31, 32, 33]; discarded
KBDSetModState attempt 3: modifier update uses explicit union source word then physical bits. objdiff 99.40476%; src 0xa8 base 0xa8 insns 42/42; diffs 4: [30, 31, 32, 33]; retained
## libs/RVL_SDK/src/kbd/kbd_lib KBDTranslateHidCode
KBDTranslateHidCode attempt 1: lookup entry and mask have word-sized locals to match separate target registers. objdiff 99.63415%; src 0x290 base 0x290 insns 164/164; diffs 9: [44, 45, 46, 79, 81, 83, 88, 91, 102]; discarded
KBDTranslateHidCode attempt 2: key flag mask is explicitly unsigned while comparison remains identical. objdiff 98.07927%; src 0x288 base 0x290 insns 162/164; --- replace mine 44:47 base 44:48; discarded
KBDTranslateHidCode attempt 3: entry flag test computes activeFlag directly from shiftFlag and offset. objdiff 99.63415%; src 0x290 base 0x290 insns 164/164; diffs 9: [44, 45, 46, 79, 81, 83, 88, 91, 102]; discarded
## libs/RVL_SDK/src/kbd/kbd_lib KBDSetLedsAsync
KBDSetLedsAsync attempt 4: command cursor declared with other C locals, target bounded reservation loop. objdiff 84.234566%; src 0x138 base 0x144 insns 78/81; --- insert mine 7:7 base 7:8; discarded
## libs/RVL_SDK/src/nup/nup __nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 5: country length is accumulated before adding fixed request overhead. objdiff 99.93104%; src 0x244 base 0x244 insns 145/145; diffs 2: [58, 59]; discarded
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 6: country length plus parenthesized running sum keeps target final add order. objdiff 99.10345%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
## src/scene/memoryCard/iplMemoryCardManager isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl
isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 1: failure-state output is initialized by isDistSlot before all reads; no redundant stack store. objdiff 93.13559%; src 0x1d8 base 0x1d8 insns 118/118; diffs 41: [13, 14, 17, 19, 26, 28, 29, 33, 34, 35, 36, 37, 38, 41, 42, 45, 48, 51, 52, 63]; retained
isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 2: entry computes file before initializing enabled result, matching target register reuse. objdiff 93.13559%; src 0x1d8 base 0x1d8 insns 118/118; diffs 41: [13, 14, 17, 19, 26, 28, 29, 33, 34, 35, 36, 37, 38, 41, 42, 45, 48, 51, 52, 63]; discarded
isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 3: success and failure key blocks form destination pointer before source-key load. objdiff 86.73729%; src 0x1e8 base 0x1d8 insns 122/118; --- insert mine 13:13 base 13:14; discarded
isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 4: retranslate success guards as address-ordered basic blocks with shared failure join. objdiff 91.65254%; src 0x1d8 base 0x1d8 insns 118/118; diffs 38: [13, 14, 17, 19, 26, 28, 34, 35, 36, 37, 38, 39, 41, 45, 51, 52, 63, 71, 73, 76]; discarded
## src/scene/memoryCard/iplMemoryCardManager isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl
isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 1: failure-state output is initialized by isDistSlot before all reads; no redundant stack store. objdiff 93.13559%; src 0x1d8 base 0x1d8 insns 118/118; diffs 41: [13, 14, 17, 19, 26, 28, 29, 33, 34, 35, 36, 37, 38, 41, 42, 45, 48, 51, 52, 63]; retained
isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 2: entry computes file before initializing enabled result, matching target register reuse. objdiff 93.13559%; src 0x1d8 base 0x1d8 insns 118/118; diffs 41: [13, 14, 17, 19, 26, 28, 29, 33, 34, 35, 36, 37, 38, 41, 42, 45, 48, 51, 52, 63]; discarded
isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 3: success and failure key blocks form destination pointer before source-key load. objdiff 86.73729%; src 0x1e8 base 0x1d8 insns 122/118; --- insert mine 13:13 base 13:14; discarded
isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl attempt 4: retranslate success guards as address-ordered basic blocks with shared failure join. objdiff 91.65254%; src 0x1d8 base 0x1d8 insns 118/118; diffs 38: [13, 14, 17, 19, 26, 28, 34, 35, 36, 37, 38, 39, 41, 45, 51, 52, 63, 71, 73, 76]; discarded
## src/scene/memoryCard/iplMemoryCardManager update_icon_anm__Q33ipl5scene17MemoryCardManagerFv
update_icon_anm__Q33ipl5scene17MemoryCardManagerFv attempt 1: counter block retains word sum until signed halfword comparison. objdiff 96.96429%; src 0x14c base 0x150 insns 83/84; --- replace mine 10:11 base 10:11; retained
update_icon_anm__Q33ipl5scene17MemoryCardManagerFv attempt 2: upper-bound ping-pong block reads max directly from original icon array. objdiff 98.27381%; src 0x14c base 0x150 insns 83/84; --- replace mine 29:30 base 29:30; retained
update_icon_anm__Q33ipl5scene17MemoryCardManagerFv attempt 3: wrap and lower-bound blocks share typed cell pointer after counter sum. objdiff 91.940475%; src 0x154 base 0x150 insns 85/84; --- replace mine 0:1 base 0:1; discarded
## src/scene/memoryCard/iplMemoryCardManager create_icon__Q33ipl5scene17MemoryCardManagerFUcs
create_icon__Q33ipl5scene17MemoryCardManagerFUcs attempt 1: frame blocks load counter once before loop and sign-extend frame for duration shift. objdiff 86.17647%; src 0xcc base 0xcc insns 51/51; diffs 19: [16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 34, 36, 38, 39, 42]; discarded
create_icon__Q33ipl5scene17MemoryCardManagerFUcs attempt 2: duration block uses signed postincrement frame directly as target. objdiff 86.17647%; src 0xcc base 0xcc insns 51/51; diffs 19: [16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 34, 36, 38, 39, 42]; discarded
create_icon__Q33ipl5scene17MemoryCardManagerFUcs attempt 3: loop retains typed icon state and counter across duration accumulation. objdiff 86.17647%; src 0xcc base 0xcc insns 51/51; diffs 19: [16, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 34, 36, 38, 39, 42]; discarded
## src/scene/memoryCard/iplMemoryCardManager isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs
isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs attempt 1: banner flag read directly as return expression. objdiff 92.30769%; src 0x68 base 0x68 insns 26/26; diffs 8: [11, 12, 13, 14, 15, 16, 17, 18]; discarded
isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs attempt 2: banner flag local widens to word before bool return. objdiff 92.30769%; src 0x68 base 0x68 insns 26/26; diffs 8: [11, 12, 13, 14, 15, 16, 17, 18]; discarded
isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs attempt 3: banner flag lookup uses typed row then direct file index. objdiff 92.30769%; src 0x68 base 0x68 insns 26/26; diffs 8: [11, 12, 13, 14, 15, 16, 17, 18]; discarded
## src/scene/memoryCard/iplMemoryCardManager update_file_array__Q33ipl5scene17MemoryCardManagerFUc
update_file_array__Q33ipl5scene17MemoryCardManagerFUc attempt 1: range guard uses separately declared unsigned command. objdiff 99.72222%; src 0x168 base 0x168 insns 90/90; diffs 4: [15, 16, 17, 20]; discarded
update_file_array__Q33ipl5scene17MemoryCardManagerFUc attempt 2: range guard is inline member expression with preserved subtraction form. objdiff 99.72222%; src 0x168 base 0x168 insns 90/90; diffs 4: [15, 16, 17, 20]; discarded
update_file_array__Q33ipl5scene17MemoryCardManagerFUc attempt 3: range guard follows explicit signed upper and lower bounds. objdiff 97.5%; src 0x16c base 0x168 insns 91/90; --- replace mine 16:20 base 16:19; discarded
## src/scene/memoryCard/iplMemoryCardManager _create_icon__Q33ipl5scene17MemoryCardManagerFUcsl
_create_icon__Q33ipl5scene17MemoryCardManagerFUcsl attempt 1: format block retains loaded signed format value across mutually exclusive checks. objdiff 87.55%; src 0x190 base 0x190 insns 100/100; diffs 37: [19, 20, 22, 23, 24, 34, 39, 40, 42, 44, 45, 46, 47, 48, 57, 59, 63, 64, 65, 66]; discarded
_create_icon__Q33ipl5scene17MemoryCardManagerFUcsl attempt 2: RGB and CI blocks share texture destination while palette reload stays direct. objdiff 65.63%; src 0x178 base 0x190 insns 94/100; --- replace mine 0:1 base 0:1; discarded
_create_icon__Q33ipl5scene17MemoryCardManagerFUcsl attempt 3: CI block names palette destination after texture initializer call. objdiff 87.55%; src 0x190 base 0x190 insns 100/100; diffs 37: [19, 20, 22, 23, 24, 34, 39, 40, 42, 44, 45, 46, 47, 48, 57, 59, 63, 64, 65, 66]; discarded
## src/scene/memoryCard/iplMemoryCardManager getComment__Q33ipl5scene17MemoryCardManagerFUcsi
getComment__Q33ipl5scene17MemoryCardManagerFUcsi attempt 1: comment entry uses signed short file index then full typed destination. objdiff 89.9187%; src 0x1f0 base 0x1ec insns 124/123; --- replace mine 5:12 base 5:15; discarded
getComment__Q33ipl5scene17MemoryCardManagerFUcsi attempt 2: ASCII trim uses single decrementing read/write pointer. objdiff 97.34146%; src 0x1e4 base 0x1ec insns 121/123; --- replace mine 10:11 base 10:11; discarded
getComment__Q33ipl5scene17MemoryCardManagerFUcsi attempt 3: line-termination scan uses local character after count check. objdiff 98.94309%; src 0x1ec base 0x1ec insns 123/123; diffs 20: [10, 12, 14, 19, 20, 21, 23, 24, 45, 46, 48, 49, 51, 62, 66, 67, 86, 90, 91, 117]; discarded
## src/scene/memoryCard/iplMemoryCardManager create_banner__Q33ipl5scene17MemoryCardManagerFUcs
create_banner__Q33ipl5scene17MemoryCardManagerFUcs attempt 1: banner format block retains one signed load before RGB and CI guards. objdiff 90.42453%; src 0x1a8 base 0x1a8 insns 106/106; diffs 70: [5, 6, 9, 11, 14, 16, 17, 18, 19, 23, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37]; discarded
create_banner__Q33ipl5scene17MemoryCardManagerFUcs attempt 2: banner initialization shares typed texture destination after validity checks. objdiff 62.792454%; src 0x178 base 0x1a8 insns 94/106; --- replace mine 0:1 base 0:1; discarded
create_banner__Q33ipl5scene17MemoryCardManagerFUcs attempt 3: banner CI block forms palette destination after initializer, reloads source offset directly. objdiff 90.42453%; src 0x1a8 base 0x1a8 insns 106/106; diffs 70: [5, 6, 9, 11, 14, 16, 17, 18, 19, 23, 24, 25, 26, 27, 32, 33, 34, 35, 36, 37]; discarded
## src/scene/memoryCard/iplMemoryCardManager getBlocks__Q33ipl5scene17MemoryCardManagerFUcs
getBlocks__Q33ipl5scene17MemoryCardManagerFUcs attempt 1: directory entry uses explicit signed file number local. objdiff 92.0%; src 0x64 base 0x64 insns 25/25; diffs 9: [11, 12, 13, 14, 15, 16, 17, 18, 19]; discarded
getBlocks__Q33ipl5scene17MemoryCardManagerFUcs attempt 2: directory entry uses row-local pointer and typed file reference. objdiff 92.0%; src 0x64 base 0x64 insns 25/25; diffs 9: [11, 12, 13, 14, 15, 16, 17, 18, 19]; discarded
getBlocks__Q33ipl5scene17MemoryCardManagerFUcs attempt 3: directory size uses word local before halfword return. objdiff 92.0%; src 0x64 base 0x64 insns 25/25; diffs 9: [11, 12, 13, 14, 15, 16, 17, 18, 19]; discarded
## src/keyboard/tiZiString clearCandidates__Q39textinput8tistring6WithZiFv
clearCandidates__Q39textinput8tistring6WithZiFv attempt 1: entry names real buffer pointers before dictionary guard, stack frame first. objdiff 83.34568%; src 0x140 base 0x144 insns 80/81; --- replace mine 3:6 base 3:4; discarded
clearCandidates__Q39textinput8tistring6WithZiFv attempt 2: clear blocks use typed indexed subarrays, search output indexes wchar view. objdiff 91.049385%; src 0x150 base 0x144 insns 84/81; --- insert mine 4:4 base 4:6; discarded
clearCandidates__Q39textinput8tistring6WithZiFv attempt 3: search-parameter block forms real buffer pointers before virtual language call. objdiff 91.049385%; src 0x150 base 0x144 insns 84/81; --- insert mine 4:4 base 4:6; discarded
## src/keyboard/tiZiString update__Q39textinput8tistring6WithZiFv
update__Q39textinput8tistring6WithZiFv attempt 1: entry retains real candidate output pointer before setElementBuffer call. objdiff 91.70852%; src 0x6fc base 0x6f8 insns 447/446; --- replace mine 7:8 base 7:8; retained
update__Q39textinput8tistring6WithZiFv attempt 2: phone-key blocks index true candidate slots directly and reload holding key after writes. objdiff 90.92601%; src 0x700 base 0x6f8 insns 448/446; --- replace mine 7:8 base 7:8; discarded
update__Q39textinput8tistring6WithZiFv attempt 3: context copy is explicit source/destination pointer loop in target block order. objdiff 89.53363%; src 0x6e4 base 0x6f8 insns 441/446; --- replace mine 7:8 base 7:8; discarded
## src/keyboard/tiZiString partialConfirmForKR__Q39textinput8tistring6WithZiFv
partialConfirmForKR__Q39textinput8tistring6WithZiFv attempt 1: leading-letter scan has its own initialized index separate from final scan. objdiff 99.4898%; src 0x24c base 0x24c insns 147/147; diffs 12: [63, 65, 67, 69, 74, 79, 84, 89, 94, 99, 104, 105]; discarded
partialConfirmForKR__Q39textinput8tistring6WithZiFv attempt 2: leading-letter scan initializes bounded index in loop initializer after table pointer. objdiff 99.4898%; src 0x24c base 0x24c insns 147/147; diffs 12: [63, 65, 67, 69, 74, 79, 84, 89, 94, 99, 104, 105]; discarded
partialConfirmForKR__Q39textinput8tistring6WithZiFv attempt 3: leading-letter scan uses indexed ordinary table access instead of moving pointer. objdiff 99.4898%; src 0x24c base 0x24c insns 147/147; diffs 12: [63, 65, 67, 69, 74, 79, 84, 89, 94, 99, 104, 105]; discarded
## src/keyboard/tiZiString setElementBuffer__Q39textinput8tistring6WithZiFv
setElementBuffer__Q39textinput8tistring6WithZiFv attempt 1: element copy pointers are formed after target clear blocks. objdiff 89.87692%; src 0x104 base 0x104 insns 65/65; diffs 22: [5, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 20, 29, 36, 46, 49, 50, 51, 52]; retained
setElementBuffer__Q39textinput8tistring6WithZiFv attempt 2: element copy index is zero-extended word while count remains full word. objdiff 87.815384%; src 0x104 base 0x104 insns 65/65; diffs 24: [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 29, 36, 46, 49, 50]; discarded
setElementBuffer__Q39textinput8tistring6WithZiFv attempt 3: element conversion block uses typed reference after loaded source character. objdiff 87.815384%; src 0x104 base 0x104 insns 65/65; diffs 24: [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 29, 36, 46, 49, 50]; discarded
## src/keyboard/tiZiString setCurrentWord__Q39textinput8tistring6WithZiFPCw
setCurrentWord__Q39textinput8tistring6WithZiFPCw attempt 1: word copy has target separate source pointer, source index and destination index. objdiff 94.82143%; src 0xdc base 0xe0 insns 55/56; --- replace mine 13:14 base 13:14; retained
setCurrentWord__Q39textinput8tistring6WithZiFPCw attempt 2: word copy retains typed destination array base and separate index. objdiff 94.64286%; src 0xdc base 0xe0 insns 55/56; --- replace mine 13:14 base 13:14; discarded
setCurrentWord__Q39textinput8tistring6WithZiFPCw attempt 3: word copy uses signed independent indices for target indexed accesses. objdiff 94.82143%; src 0xdc base 0xe0 insns 55/56; --- replace mine 13:14 base 13:14; discarded
## libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse TMCJPEGDEC_IFD0_tag_parse
TMCJPEGDEC_IFD0_tag_parse attempt 1: pixel dimensions retranslated as SHORT block then LONG block, decode only selected type. objdiff 93.60707%; src 0x790 base 0x784 insns 484/481; --- replace mine 0:1 base 0:1; retained
TMCJPEGDEC_IFD0_tag_parse attempt 2: ignored tags each terminate own switch block in target decision order. objdiff 92.75468%; src 0x7a0 base 0x784 insns 488/481; --- replace mine 0:1 base 0:1; discarded
TMCJPEGDEC_IFD0_tag_parse attempt 3: tag decoder keeps zero-extended signed selector for target compare tree. objdiff 93.29522%; src 0x7a0 base 0x784 insns 488/481; --- replace mine 0:1 base 0:1; discarded
## libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse TMCJPEGDEC_exif_parse
TMCJPEGDEC_exif_parse attempt 1: header and entry-count decode use common byte-order primitive like target load order. objdiff 98.113205%; src 0x350 base 0x350 insns 212/212; diffs 58: [7, 27, 28, 30, 31, 32, 34, 61, 69, 70, 72, 73, 74, 76, 77, 79, 80, 82, 86, 89]; discarded
TMCJPEGDEC_exif_parse attempt 2: three IFD traversal blocks share cursor/count locals to target stack register lifetimes. objdiff 98.679245%; src 0x350 base 0x350 insns 212/212; diffs 46: [7, 27, 28, 30, 31, 32, 34, 61, 69, 70, 72, 73, 74, 76, 77, 79, 80, 82, 86, 89]; retained
TMCJPEGDEC_exif_parse attempt 3: IFD setup subtracts count header before entry-size multiply in target schedule. objdiff 98.679245%; src 0x350 base 0x350 insns 212/212; diffs 46: [7, 27, 28, 30, 31, 32, 34, 61, 69, 70, 72, 73, 74, 76, 77, 79, 80, 82, 86, 89]; discarded
## libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse TMCJPEGDEC_IFD1_tag_parse
TMCJPEGDEC_IFD1_tag_parse attempt 1: decision tree explicitly accounts for ignored FlashPix color and dimension tags. objdiff 92.421486%; src 0x3d0 base 0x3c8 insns 244/242; --- replace mine 9:15 base 9:15; retained
TMCJPEGDEC_IFD1_tag_parse attempt 2: ignored thumbnail tags each end their own switch block before shared default. objdiff 86.818184%; src 0x41c base 0x3c8 insns 263/242; --- replace mine 9:15 base 9:15; discarded
TMCJPEGDEC_IFD1_tag_parse attempt 3: rational denominator blocks reload thumbnail base and add offset-plus-four. objdiff 87.024796%; src 0x41c base 0x3c8 insns 263/242; --- replace mine 9:15 base 9:15; discarded
## libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse TMCJPEGDEC_IFD0_tag_parse
TMCJPEGDEC_IFD0_tag_parse attempt 4: IFD0 selector widens after read to signed word, preserves existing ignored-tag group. objdiff 93.83576%; src 0x790 base 0x784 insns 484/481; --- replace mine 0:1 base 0:1; retained
TMCJPEGDEC_IFD0_tag_parse attempt 5: IFD0 SHORT/LONG type widens after read to unsigned word. objdiff 93.88566%; src 0x78c base 0x784 insns 483/481; --- replace mine 0:1 base 0:1; retained
TMCJPEGDEC_IFD0_tag_parse attempt 6: IFD0 ignored-tag group reaches common function exit through switch break. objdiff 94.241165%; src 0x784 base 0x784 insns 481/481; diffs 446: [0, 2, 3, 4, 5, 7, 10, 11, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24]; retained
## libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse TMCJPEGDEC_IFD1_tag_parse
TMCJPEGDEC_IFD1_tag_parse attempt 4: IFD1 ignored-tag group reaches common exit through switch break. objdiff 91.694214%; src 0x3bc base 0x3c8 insns 239/242; --- replace mine 9:11 base 9:11; discarded
TMCJPEGDEC_IFD1_tag_parse attempt 5: IFD1 retains original recognized tags and uses common switch exit. objdiff 93.099174%; src 0x3bc base 0x3c8 insns 239/242; --- replace mine 9:11 base 9:11; retained
TMCJPEGDEC_IFD1_tag_parse attempt 6: all IFD1 case bodies converge through single function exit. objdiff 93.099174%; src 0x3bc base 0x3c8 insns 239/242; --- replace mine 9:11 base 9:11; discarded
## libs/RVL_SDK/src/nup/nup __nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 7: variable-sized request subtotal before fixed XML overhead. objdiff 99.17242%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 8: request subtotal groups accumulated lengths and fixed overhead on right. objdiff 99.17242%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 9: fixed request overhead is first operand before country length. objdiff 99.93104%; src 0x244 base 0x244 insns 145/145; diffs 1: [58]; discarded
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc attempt 10: request size uses country result plus existing request length, then fixed overhead. objdiff 99.06896%; src 0x244 base 0x244 insns 145/145; diffs 22: [6, 11, 17, 21, 33, 39, 45, 51, 54, 58, 59, 63, 64, 67, 89, 90, 99, 100, 126, 128]; discarded
## src/keyboard/tiZiString partialConfirmForKR__Q39textinput8tistring6WithZiFv
partialConfirmForKR__Q39textinput8tistring6WithZiFv attempt 4: ordinary inline leading-letter lookup variation 1. objdiff 100.0%; src 0x24c base 0x24c insns 147/147; diffs 0: []; retained
partialConfirmForKR__Q39textinput8tistring6WithZiFv attempt 5: ordinary inline leading-letter lookup variation 2. BUILD FAILED: ninja: build stopped: subcommand failed.
partialConfirmForKR__Q39textinput8tistring6WithZiFv attempt 6: ordinary inline leading-letter lookup variation 3. BUILD FAILED: ninja: build stopped: subcommand failed.
## src/keyboard/tiZiString setCurrentWord__Q39textinput8tistring6WithZiFPCw
setCurrentWord__Q39textinput8tistring6WithZiFPCw attempt 4: word copy reads by retained result count rather than redundant separate index. objdiff 94.96429%; src 0xdc base 0xe0 insns 55/56; --- replace mine 13:14 base 13:14; retained
setCurrentWord__Q39textinput8tistring6WithZiFPCw attempt 5: word copy writes by retained total-length index and increments after store. objdiff 86.66071%; src 0xe0 base 0xe0 insns 56/56; diffs 21: [13, 15, 18, 24, 30, 31, 32, 33, 34, 35, 37, 38, 39, 40, 41, 42, 43, 44, 47, 50]; discarded
## Final coverage and acceptance
32 initially open functions; 114 compiled source attempts; minimum three per function. Failed builds excluded.
Korean partial confirmation: 100.0% objdiff, 147/147 instructions, ctxdiff differences zero.
Removed unused sourceOffset after selecting result-count indexing; remaining setCurrentWord code generation unchanged.
All five pools identical; full build and DOL SHA1 pass; regressions, forbidden additions and readability warnings zero.
Detailed final metrics, remaining functions, diagnostic limitations and gate output: structural-matching.final.md.
Final per-function disassembly differences: structural-matching.ctxdiff.md.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,161 @@
# Structural matching final evidence
All 32 initially open functions have at least three distinct compiled source experiments; 114 compiled attempts are recorded. Failed builds do not count. One additional function is exact. Thirty-one remain open. Shared headers and configure.py were not changed.
## Before and after
| Unit | Exact objdiff functions | Matched code bytes | Matched data bytes | Fuzzy percent |
| --- | --- | --- | --- | --- |
| libs/RVL_SDK/src/nup/nup | 17 -> 17 / 23 | 5164 -> 5164 / 10764 | 1720 -> 1720 / 1720 | 92.89669 -> 93.24786 |
| libs/RVL_SDK/src/kbd/kbd_lib | 13 -> 13 / 21 | 1744 -> 1744 / 5764 | 3992 -> 3992 / 5296 | 93.70091 -> 96.35184 |
| src/scene/memoryCard/iplMemoryCardManager | 16 -> 16 / 26 | 2032 -> 2032 / 5396 | not present | 95.71090 -> 96.10749 |
| src/keyboard/tiZiString | 24 -> 25 / 29 | 2324 -> 2912 / 5504 | 7680 -> 7680 / 7680 | 95.52398 -> 96.10247 |
| libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse | 3 -> 3 / 6 | 1348 -> 1348 / 5088 | not present | 92.70361 -> 96.28931 |
## Remaining functions in object address order
__nupParseServerInfo__FP14NUPContextInfoPcPcUx: 98.108406%; instructions 452/452; operand/register allocation differs; 148 ctxdiff differences; 3 compiled attempts.
__nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc: 99.93104%; instructions 145/145; operand/register allocation differs; 1 ctxdiff differences; 10 compiled attempts.
__nupBase64Encode__FPUcPUcUl: 94.20635%; instructions 63/63; instruction scheduling/selection and register allocation differ; 21 ctxdiff differences; 3 compiled attempts.
__nupGetBootVersion__FP14ESTitleVersion: unavailable%; instructions 163/163; source/target signature mismatch prevents exact-name comparison; cross-name 17 instruction differences; 3 compiled attempts.
__nupGetTitleSize__FP12NUPTitleInfo: 99.100716%; instructions 139/139; operand/register allocation differs; 22 ctxdiff differences; 3 compiled attempts.
__nupOp: 98.8242%; instructions 440/438; instruction count and block scheduling differ; 3 compiled attempts.
kbdEventHandler: 99.83871%; instructions 186/186; operand/register allocation differs; 5 ctxdiff differences; 3 compiled attempts.
kbdProcKey: 97.5%; instructions 174/172; instruction count and block scheduling differ; 3 compiled attempts.
kbdProcMod: 93.18359%; instructions 261/256; instruction count and block scheduling differ; 3 compiled attempts.
kbd_led_handler: 70.0%; instructions 24/25; instruction count and block scheduling differ; 3 compiled attempts.
KBDSetLedsAsync: 90.69136%; instructions 84/81; instruction count and block scheduling differ; 3 compiled attempts.
KBDSetLeds: 81.48101%; instructions 78/79; instruction count and block scheduling differ; 3 compiled attempts.
KBDSetModState: 99.40476%; instructions 42/42; operand/register allocation differs; 4 ctxdiff differences; 3 compiled attempts.
KBDTranslateHidCode: 99.63415%; instructions 164/164; operand/register allocation differs; 9 ctxdiff differences; 3 compiled attempts.
isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl: 93.13559%; instructions 118/118; instruction scheduling/selection and register allocation differ; 41 ctxdiff differences; 4 compiled attempts.
isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl: 93.13559%; instructions 118/118; instruction scheduling/selection and register allocation differ; 41 ctxdiff differences; 4 compiled attempts.
isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs: 92.30769%; instructions 26/26; instruction scheduling/selection and register allocation differ; 8 ctxdiff differences; 3 compiled attempts.
update_icon_anm__Q33ipl5scene17MemoryCardManagerFv: 98.27381%; instructions 83/84; instruction count and block scheduling differ; 3 compiled attempts.
update_file_array__Q33ipl5scene17MemoryCardManagerFUc: 99.72222%; instructions 90/90; operand/register allocation differs; 4 ctxdiff differences; 3 compiled attempts.
create_icon__Q33ipl5scene17MemoryCardManagerFUcs: 86.84314%; instructions 50/51; instruction count and block scheduling differ; 3 compiled attempts.
_create_icon__Q33ipl5scene17MemoryCardManagerFUcsl: 87.55%; instructions 100/100; instruction scheduling/selection and register allocation differ; 37 ctxdiff differences; 3 compiled attempts.
getComment__Q33ipl5scene17MemoryCardManagerFUcsi: 98.94309%; instructions 123/123; operand/register allocation differs; 20 ctxdiff differences; 3 compiled attempts.
create_banner__Q33ipl5scene17MemoryCardManagerFUcs: 90.42453%; instructions 106/106; instruction scheduling/selection and register allocation differ; 70 ctxdiff differences; 3 compiled attempts.
getBlocks__Q33ipl5scene17MemoryCardManagerFUcs: 92.0%; instructions 25/25; instruction scheduling/selection and register allocation differ; 9 ctxdiff differences; 3 compiled attempts.
clearCandidates__Q39textinput8tistring6WithZiFv: 91.049385%; instructions 84/81; instruction count and block scheduling differ; 3 compiled attempts.
update__Q39textinput8tistring6WithZiFv: 91.70852%; instructions 447/446; instruction count and block scheduling differ; 3 compiled attempts.
setElementBuffer__Q39textinput8tistring6WithZiFv: 89.87692%; instructions 65/65; instruction scheduling/selection and register allocation differ; 22 ctxdiff differences; 3 compiled attempts.
setCurrentWord__Q39textinput8tistring6WithZiFPCw: 94.96429%; instructions 55/56; instruction count and block scheduling differ; 5 compiled attempts.
TMCJPEGDEC_exif_parse: 98.679245%; instructions 212/212; operand/register allocation differs; 46 ctxdiff differences; 3 compiled attempts.
TMCJPEGDEC_IFD0_tag_parse: 94.241165%; instructions 481/481; instruction scheduling/selection and register allocation differ; 446 ctxdiff differences; 6 compiled attempts.
TMCJPEGDEC_IFD1_tag_parse: 93.099174%; instructions 239/242; instruction count and block scheduling differ; 6 compiled attempts.
## Verification limits
KBDResetChannel is 100% in objdiff, but the gate counts 12/21 keyboard instruction-exact functions rather than 13/21. ctxdiff treats the condition-register operand as a branch destination: indices 5 and 26 have identical raw instruction words 4086000c and 4186000c, respectively. Original/source function offsets differ by 32 bytes. The gate and ctxdiff were preserved.
The target boot-version symbol omits the context argument present in the source signature. Assembly uses both arguments. The function was not renamed, and no exact match is claimed.
kbd .data bytes are physically identical, but jump-table relocation matching remains below 100%; the reported 3992/5296 matched data bytes are unchanged. Memory-card and EXIF objects have no data sections. The full DOL hash passes; this does not establish that any unlinked unit is fully matched.
Memory-card destinationState is assigned through isDistSlot before every read. isDistSlot assigns its non-null out parameter unconditionally before returning. No uninitialized value is consumed.
## Files changed
libs/RVL_SDK/src/nup/nup.cpp
libs/RVL_SDK/src/kbd/kbd_lib.c
src/scene/memoryCard/iplMemoryCardManager.cpp
src/keyboard/tiZiString.cpp
libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse.c
tools/decomp-assist/structural-matching.attempts.md
tools/decomp-assist/structural-matching.ctxdiff.md
tools/decomp-assist/structural-matching.final.md
## Source commits
```text
faa734ec match korean leading letter lookup
4c02833c align exif tag decoding blocks
98ba65f2 align zi buffer and word copy lifetimes
4d29665d align memory card validation and counters
5288b266 align keyboard modifier and led blocks
1378c3d6 align nup title and version lifetimes
```
## Final full gate
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/nup/nup] pool: IDENTICAL
[libs/RVL_SDK/src/nup/nup] objdiff: code 5164/10764 data 1720/1720 functions 17/23 fuzzy 93.2479 linked code 0
[libs/RVL_SDK/src/nup/nup] instruction-exact functions: 17/23
[libs/RVL_SDK/src/nup/nup] section .data size 1592 match 100.0
[libs/RVL_SDK/src/nup/nup] section .rodata size 88 match 100.0
[libs/RVL_SDK/src/nup/nup] section .sbss size 8 match 100.0
[libs/RVL_SDK/src/nup/nup] section .sdata size 32 match 100.0
[libs/RVL_SDK/src/nup/nup] section .text size 10764 match 93.24786
[libs/RVL_SDK/src/nup/nup] below 100: __nupParseServerInfo__FP14NUPContextInfoPcPcUx 98.108406
[libs/RVL_SDK/src/nup/nup] below 100: __nupGetServerInfo__FPcPcUxPcPcUlPcUsUsUxUsPPc 99.93104
[libs/RVL_SDK/src/nup/nup] below 100: __nupBase64Encode__FPUcPUcUl 94.20635
[libs/RVL_SDK/src/nup/nup] below 100: __nupGetBootVersion__FP14ESTitleVersion None
[libs/RVL_SDK/src/nup/nup] below 100: __nupGetTitleSize__FP12NUPTitleInfo 99.100716
[libs/RVL_SDK/src/nup/nup] below 100: __nupOp 98.8242
[libs/RVL_SDK/src/nup/nup] baseline: code 5164/10764 data 1720 functions 17 fuzzy 92.8967
[libs/RVL_SDK/src/kbd/kbd_lib] pool: IDENTICAL
[libs/RVL_SDK/src/kbd/kbd_lib] objdiff: code 1744/5764 data 3992/5296 functions 13/21 fuzzy 96.3518 linked code 0
[libs/RVL_SDK/src/kbd/kbd_lib] instruction-exact functions: 12/21
[libs/RVL_SDK/src/kbd/kbd_lib] section .bss size 3968 match 100.0
[libs/RVL_SDK/src/kbd/kbd_lib] section .data size 1304 match 84.024574
[libs/RVL_SDK/src/kbd/kbd_lib] section .sbss size 16 match 100.0
[libs/RVL_SDK/src/kbd/kbd_lib] section .sdata size 8 match 100.0
[libs/RVL_SDK/src/kbd/kbd_lib] section .text size 5764 match 96.35184
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: kbdEventHandler 99.83871
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: kbdProcKey 97.5
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: kbdProcMod 93.18359
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: kbd_led_handler 70.0
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: KBDSetLedsAsync 90.69136
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: KBDSetLeds 81.48101
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: KBDSetModState 99.40476
[libs/RVL_SDK/src/kbd/kbd_lib] below 100: KBDTranslateHidCode 99.63415
[libs/RVL_SDK/src/kbd/kbd_lib] baseline: code 1744/5764 data 3992 functions 13 fuzzy 93.7009
[src/scene/memoryCard/iplMemoryCardManager] pool: IDENTICAL
[src/scene/memoryCard/iplMemoryCardManager] objdiff: code 2032/5396 data None/None functions 16/26 fuzzy 96.1075 linked code 0
[src/scene/memoryCard/iplMemoryCardManager] instruction-exact functions: 16/26
[src/scene/memoryCard/iplMemoryCardManager] section .text size 5396 match 96.10749
[src/scene/memoryCard/iplMemoryCardManager] below 100: isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl 93.13559
[src/scene/memoryCard/iplMemoryCardManager] below 100: isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl 93.13559
[src/scene/memoryCard/iplMemoryCardManager] below 100: isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs 92.30769
[src/scene/memoryCard/iplMemoryCardManager] below 100: update_icon_anm__Q33ipl5scene17MemoryCardManagerFv 98.27381
[src/scene/memoryCard/iplMemoryCardManager] below 100: update_file_array__Q33ipl5scene17MemoryCardManagerFUc 99.72222
[src/scene/memoryCard/iplMemoryCardManager] below 100: create_icon__Q33ipl5scene17MemoryCardManagerFUcs 86.84314
[src/scene/memoryCard/iplMemoryCardManager] below 100: _create_icon__Q33ipl5scene17MemoryCardManagerFUcsl 87.55
[src/scene/memoryCard/iplMemoryCardManager] below 100: getComment__Q33ipl5scene17MemoryCardManagerFUcsi 98.94309
[src/scene/memoryCard/iplMemoryCardManager] below 100: create_banner__Q33ipl5scene17MemoryCardManagerFUcs 90.42453
[src/scene/memoryCard/iplMemoryCardManager] below 100: getBlocks__Q33ipl5scene17MemoryCardManagerFUcs 92.0
[src/scene/memoryCard/iplMemoryCardManager] baseline: code 2032/5396 data None functions 16 fuzzy 95.7109
[src/keyboard/tiZiString] pool: IDENTICAL
[src/keyboard/tiZiString] objdiff: code 2912/5504 data 7680/7680 functions 25/29 fuzzy 96.1025 linked code 0
[src/keyboard/tiZiString] instruction-exact functions: 25/29
[src/keyboard/tiZiString] section .bss size 7296 match 100.0
[src/keyboard/tiZiString] section .data size 328 match 100.0
[src/keyboard/tiZiString] section .rodata size 56 match 100.0
[src/keyboard/tiZiString] section .text size 5504 match 96.10247
[src/keyboard/tiZiString] below 100: clearCandidates__Q39textinput8tistring6WithZiFv 91.049385
[src/keyboard/tiZiString] below 100: update__Q39textinput8tistring6WithZiFv 91.70852
[src/keyboard/tiZiString] below 100: setElementBuffer__Q39textinput8tistring6WithZiFv 89.87692
[src/keyboard/tiZiString] below 100: setCurrentWord__Q39textinput8tistring6WithZiFPCw 94.96429
[src/keyboard/tiZiString] baseline: code 2324/5504 data 7680 functions 24 fuzzy 95.5240
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] pool: IDENTICAL
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] objdiff: code 1348/5088 data None/None functions 3/6 fuzzy 96.2893 linked code 0
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] instruction-exact functions: 3/6
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] section .text size 5088 match 96.28931
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] below 100: TMCJPEGDEC_exif_parse 98.679245
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] below 100: TMCJPEGDEC_IFD0_tag_parse 94.241165
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] below 100: TMCJPEGDEC_IFD1_tag_parse 93.099174
[libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse] baseline: code 1348/5088 data None functions 3 fuzzy 92.7036
regressions vs baseline: 0
global matched_code_percent: 86.00588 -> 86.02551
global fuzzy_match_percent: 98.74086 -> 98.75509
global complete_code_percent: 59.99415 -> 59.99415
global matched_data_percent: 90.86673 -> 90.86673
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```