Compare commits

..

14 Commits

Author SHA1 Message Date
Devin AI
e9b09601af docs: get_friendinfo keep-vs-remat + member-call conversion notes
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:52:07 +00:00
Devin AI
5689681bc2 iplSDMemory: real member calls for SD notice APIs (drop extern-C address stubs)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:50:05 +00:00
Devin AI
fc0074f0d0 docs: drawTransferTitles copy-temp decode
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:44:43 +00:00
Devin AI
cd0cd3c65a iplSDMemory: Color(x) arg temps decode drawTransferTitles copy pattern (451/451 insn-equal)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:43:20 +00:00
Devin AI
fc3b22607c docs: deduplicated-weak-vtable decode for iplSDMemory .data tail
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:43:20 +00:00
Devin AI
52862f1c28 docs: iplSDMemory trailing .data zeros wall
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:43:20 +00:00
Devin AI
d2286df586 docs: switch-on-bool dispatch decode for u64< guards
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:43:13 +00:00
Devin AI
a93771c1b0 iplSDChannelSelect: switch-dispatch decode for u64< guard in handleSDTitleListResult (171/171 insn-equal)
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:43:13 +00:00
Devin AI
89c3c6f375 iplAddressEdit: dead-arm fossil decode (start_left_event exact), case-4 arm in start_point_event, friendText reuse in create
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:43:13 +00:00
Devin AI
a2c9b974a7 iplAddress: decode beq+b dispatch in onEventDerived + start_drag_event; movePane_onDrag +0.01 scope
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:42:58 +00:00
Devin AI
a2502a9294 iplSDChannelSelect: decode beq+b dispatch in anon onEventDerived via switch
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:42:58 +00:00
Devin AI
f02043a765 iplSDMemory: setTitleRowColors Color& signature + trivial-Color() decode for drawTransferTitles
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:42:43 +00:00
Devin AI
5453d7e49a sceneleft: iplAddress set_err_msg/movePane_onDrag decodes, SDChannelSelect static setEventHandler
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:42:43 +00:00
Devin AI
f2446827cd CDBRecord: reconstruct dead-stripped record-accessor API (.data 100%)
Orig .data contains diagnostics for ~14 accessor functions absent from
.text: they were dead-stripped by the linker while pooled literals
persisted. Reconstruct the functions (ReduceFileSize/ReduceDataSize,
SetFileType/GetFileType/GetGameCode/GetMakerCode, GetModifiedTime/
GetModifiedCount, SetName, GetKeyword/GetKey/GetCalendarTime,
Duplicate, PrivateChangeOwner) so the string pool emits in source
order; pool now byte-identical (.data fuzzy 100).

Also make CDBRecordGetFileSize's standalone emit match orig: it was
inlined into CDBRecordEncrypt in orig (bl to FileGetFileSize) - keep
as global so its literal pools at its source position.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 16:42:12 +00:00
74 changed files with 830 additions and 16816 deletions

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.59% | 90.81% | 71.43% | 99.37% |
| 99.56% | 90.41% | 69.63% | 99.37% |
units 956/1027 complete, functions 12365/12563 matched.
units 951/1027 complete, functions 12347/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

@@ -11,8 +11,6 @@ splits: 'config/43U/splits.txt'
ldscript_template: 'config/ldscript_ipl2.lcf'
force_active:
- SOGetSockOpt
- SOSetInterfaceOpt
- fprintf
- leap_days
- __msl_time2tm

View File

@@ -87,8 +87,7 @@ m_allocator__Q23ipl5scene = .bss:0x810BD498; // type:object size:0x10
AOSSi_NcdIfConfig = .bss:0x810BD4A8; // type:object size:0x15E data:byte
AOSSi_NcdIpConfig = .bss:0x810BD608; // type:object size:0x7C4 data:4byte
sRakuAllocator = .bss:0x810BDDD0; // type:object size:0x10
sRakuStatus = .bss:0x810BDDE0; // type:object size:0xC data:4byte
sRakuConfiguration = .bss:0x810BDDEC; // type:object size:0xE8
sRakuStatus = .bss:0x810BDDE0; // type:object size:0xF4 data:4byte
sRakuMsgQueue = .bss:0x810BDED4; // type:object size:0x20
AOSS_810BDEF8 = .bss:0x810BDEF8; // type:object size:0x20 data:4byte
AOSS_810BDF18 = .bss:0x810BDF18; // type:object size:0x6A0
@@ -5159,7 +5158,7 @@ AOSSi_WLANConnect = .text:0x813FD72C; // type:function size:0x26C
AOSSi_Sleep = .text:0x813FD998; // type:function size:0x4
AOSSi_Status = .text:0x813FD99C; // type:function size:0x34
AOSS_SetCallback = .text:0x813FD9D0; // type:function size:0x34
syncRakuProgress__Q33ipl5scene14RakuRakuThreadFP12RakuProgress = .text:0x813FDA04; // type:function size:0x6C scope:local
syncRakuProgress__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDA04; // type:function size:0x6C scope:local
__ct__Q33ipl5scene14RakuRakuThreadFPQ23EGG4Heap = .text:0x813FDA70; // type:function size:0xD8
__dt__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDB48; // type:function size:0xA4
destroy__Q33ipl5scene14RakuRakuThreadFv = .text:0x813FDBEC; // type:function size:0xD8
@@ -16150,11 +16149,6 @@ lbl_8164EF14 = .data:0x8164EF14; // type:object size:0x34
__vt__Q33ipl5scene27CsChanTtlButtonEventHandler = .data:0x8164EF48; // type:object size:0x1C
__vt__Q33ipl5scene24ChannelTitleEventHandler = .data:0x8164EF64; // type:object size:0x18
__vt__Q33ipl5scene12ChannelTitle = .data:0x8164EF7C; // type:object size:0x68
lbl_8164EFE4 = .data:0x8164EFE4; // type:object size:0x5C
lbl_8164F040 = .data:0x8164F040; // type:object size:0x18
lbl_8164F058 = .data:0x8164F058; // type:object size:0x20
lbl_8164F078 = .data:0x8164F078; // type:object size:0x20
lbl_8164F098 = .data:0x8164F098; // type:object size:0x20
@10125 = .data:0x8164F0B8; // type:object size:0xD scope:local data:string
...data.0 = .data:0x8164F0B8; // type:label scope:local
@10126 = .data:0x8164F0C5; // type:object size:0xD scope:local data:string
@@ -23835,7 +23829,7 @@ result$1126 = .sbss:0x81698E48; // type:object size:0x4 data:4byte
soState = .sbss:0x81698E50; // type:object size:0x1 scope:local data:byte
soError = .sbss:0x81698E54; // type:object size:0x4 scope:local data:4byte
soRegistered = .sbss:0x81698E58; // type:object size:0x4 scope:local data:4byte
soSocketRegistered = .sbss:0x81698E60; // type:object size:0x4 scope:local data:4byte
soSocketRegistered = .sbss:0x81698E60; // type:object size:0x8 scope:local data:4byte
sslRegistered = .sbss:0x81698E68; // type:object size:0x4 scope:local data:4byte
l_initialized = .sbss:0x81698E6C; // type:object size:0x4 scope:local data:4byte
VFipf_sys_set = .sbss:0x81698E70; // type:object size:0x4 scope:global data:4byte

View File

@@ -772,7 +772,7 @@ config.libs = [
]
),
IPLSection("channelTitle", [
Object(Matching, "scene/channelTitle/iplChannelTitle.cpp"),
Object(Equivalent, "scene/channelTitle/iplChannelTitle.cpp"),
]
),
IPLSection("faceSelect", [
@@ -877,7 +877,7 @@ config.libs = [
Object(Matching, "scene/setting/iplUSBAPThread.cpp"),
Object(Matching, "scene/setting/iplAOSSThread.cpp"),
Object(NonMatching, "scene/setting/AOSSLink.c"),
Object(Matching, "scene/setting/iplRakuRakuThread.cpp"),
Object(NonMatching, "scene/setting/iplRakuRakuThread.cpp"),
Object(NonMatching, "scene/setting/AOSS.c", extra_cflags=["-O4,p", "-inline off"]),
Object(NonMatching, "scene/setting/ATERM.c", extra_cflags=["-O4,p", "-inline off"]),
]
@@ -1005,7 +1005,7 @@ config.libs = [
Object(Matching, "clib/zi8ZHuwd.c"),
Object(NonMatching, "clib/zidawg1.c"),
Object(Matching, "clib/zikorean.c"),
Object(Matching, "clib/ziswordw.c"),
Object(NonMatching, "clib/ziswordw.c"),
Object(NonMatching, "clib/zkokeyp.c"),
Object(Matching, "clib/zierror.c"),
Object(NonMatching, "clib/zmtkey.c"),
@@ -1075,11 +1075,11 @@ config.libs = [
Object(Matching, "nwc24/NWC24Utils.c"),
Object(Matching, "nwc24/NWC24Manage.c"),
Object(Matching, "nwc24/NWC24MsgObj.c"),
Object(Matching, "nwc24/NWC24MBoxCtrl.c"),
Object(NonMatching, "nwc24/NWC24MBoxCtrl.c"),
Object(Matching, "nwc24/NWC24Mime.c"),
Object(Matching, "nwc24/NWC24Stream.c"),
Object(Matching, "nwc24/NWC24Parser.c"),
Object(Matching, "nwc24/NWC24MsgCommit.c"),
Object(NonMatching, "nwc24/NWC24MsgCommit.c"),
Object(Matching, "nwc24/NWC24MsgRead.c"),
Object(NonMatching, "nwc24/NWC24MsgSubject.c"),
Object(Matching, "nwc24/NWC24Schedule.c"),
@@ -1098,7 +1098,7 @@ config.libs = [
Object(Matching, "so/SOCommon.c"),
Object(NonMatching, "so/SOBasic.c"),
Object(Matching, "so/SOInformation.c"),
Object(Matching, "so/SOOption.c"),
Object(NonMatching, "so/SOOption.c"),
]
),
RevoEXLib("ssl", [
@@ -1696,7 +1696,7 @@ config.libs = [
Object(Matching, "fa/pf_dir.c"),
Object(Matching, "fa/pf_entry.c"),
Object(Matching, "fa/pf_entry_iterator.c"),
Object(Matching, "fa/pf_fat.c"),
Object(NonMatching, "fa/pf_fat.c"),
Object(Matching, "fa/pf_fat12.c"),
Object(Matching, "fa/pf_fat16.c"),
Object(Matching, "fa/pf_fat32.c"),

View File

@@ -34,14 +34,14 @@ namespace gui {
virtual void draw(Mtx& mtx) {} // 0x14 (0x05)
virtual void draw() {} // 0x18 (0x06)
#if defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
virtual ~Interface(); // 0x1C (0x07)
#else
virtual ~Interface() {} // 0x1C (0x07)
#endif
};
#if defined(IPL_GC_WINDOW_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_WINDOW_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
class __declspec(novtable) EventHandler {
#else
class EventHandler {

View File

@@ -24,7 +24,7 @@ namespace ipl {
mbDisableCon(bDisableCon) {}
#endif
#if defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
#if defined(IPL_CHANNEL_TITLE_NOVTABLE) || defined(IPL_GC_SAVEDATA_NOVTABLE) || defined(IPL_MEMORY_CARD_NOVTABLE)
virtual ~PaneManager();
#else
virtual ~PaneManager() {}

View File

@@ -145,7 +145,7 @@ namespace ipl {
ANIM_MAX,
};
int mAnimWait;
int unk_0x54;
layout::Object* mpLayout; // 0x58
nand::LayoutFile* mpLayoutFile; // 0x5C

View File

@@ -197,6 +197,7 @@ namespace ipl {
friend class SDChannelSelectEventHandler;
friend class SDChannelSelectButtonEventHandler;
#endif
friend class SDMemory;
void enqueueStartNotice();
bool enqueueFinishNotice();
bool enqueueNotice(u32 highTitleId, u32 lowTitleId, u32 result);

View File

@@ -62,17 +62,17 @@ namespace ipl {
void start_left_event(const char* paneName);
void start_trig_event(const char* paneName);
typedef struct CmdEntry {
typedef struct Unk {
int command; // 0x00
u32 msgID; // 0x04
} CmdEntry;
} Unk;
CmdEntry mCmdQueue[64];
Unk unk_0x64[64];
int mCmdCapacity;
int mCmdCount;
int mCmdReadIdx;
int mCmdWriteIdx;
int unk_0x264;
int unk_0x268;
int unk_0x26C;
int unk_0x270;
int mSettingArg; // 0x274

View File

@@ -145,13 +145,6 @@ namespace ipl {
mpCommonFile = commonFile;
mpLangFile = langFile;
}
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
virtual ~LangFile() {}
virtual void read() {}
virtual bool isFinished() { return false; }
virtual int checkData() { return 0; }
virtual bool isFatalError() { return false; }
#else
virtual ~LangFile(); // 0x08
virtual void read(); // 0x0C
@@ -159,7 +152,6 @@ namespace ipl {
virtual bool isFinished(); // 0x14
virtual int checkData(); // 0x18
virtual bool isFatalError(); // 0x1C
#endif
File* getCmnFile() const { return mpCommonFile; }
File* getLangFile() const { return mpLangFile; }
@@ -173,11 +165,7 @@ namespace ipl {
public:
LayoutFile(EGG::Heap* heap, const char* dirName, const char* fileName, ARCHandle* arc, bool bIsNandFile);
LayoutFile(File* commonFile, File* langFile = NULL) : LangFile(commonFile, langFile) {}
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
virtual ~LayoutFile() {} // 0x08
#else
virtual ~LayoutFile(); // 0x08
#endif
};
} // namespace nand
} // namespace ipl

View File

@@ -38,19 +38,6 @@ namespace EGG {
virtual void calc(); // 0x30
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x34
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x38
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x3C
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x44
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x44
virtual bool prepareSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x48
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, u32 id); // 0x50
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, unsigned int id); // 0x50
virtual bool holdSound(nw4r::snd::SoundHandle* pHandle, const char* pName); // 0x58
#else
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, u32 id) { return mSoundArchivePlayer.StartSound(pHandle, id); } // 0x34
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, unsigned int id) { return mSoundArchivePlayer.StartSound(pHandle, id); } // 0x38
virtual bool startSound(nw4r::snd::SoundHandle* pHandle, const char* pName) NO_INLINE {
@@ -79,7 +66,6 @@ namespace EGG {
u32 id = changeNameToId(pName);
return mSoundArchivePlayer.HoldSound(pHandle, id);
} // 0x58
#endif
u32 changeNameToId(const char* pName) { return mpArchive->ConvertLabelStringToSoundId(pName); }
const char* changeIdToName(u32 id) { return mpArchive->GetSoundLabelString(id); }

View File

@@ -19,10 +19,6 @@ namespace EGG {
~SoundHeapMgr() { destroySoundHeap(); }
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
virtual bool loadState(s32 id); // 0x08
virtual s32 getCurrentLevel(); // 0x0C
#else
virtual bool loadState(s32 id) {
#ifdef IPL_SOUND_MATCHING
if (id > 0 && mHeap.GetCurrentLevel() >= id) {
@@ -39,7 +35,6 @@ namespace EGG {
} // 0x08
virtual s32 getCurrentLevel() { return mHeap.GetCurrentLevel(); } // 0x0C
#endif
s32 saveState() { return mHeap.SaveState(); }

View File

@@ -1,5 +1,3 @@
#define EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
#include <egg/core.h>
namespace EGG {

View File

@@ -1120,7 +1120,6 @@ static int __wpformatter(void* (*write_proc)(void*, const wchar_t*, size_t),
case 's':
if (format.argument_options == wchar_argument) {
wchar_t* wcs_ptr = va_arg(args, wchar_t*);
int wideLength;
if (wcs_ptr == NULL) {
wcs_ptr = L"";
@@ -1128,24 +1127,22 @@ static int __wpformatter(void* (*write_proc)(void*, const wchar_t*, size_t),
if (format.alternate_form) {
wchar_t first = *wcs_ptr++;
wideLength = (unsigned char)first;
num_chars = (unsigned char)first;
if (format.precision_specified && wideLength > format.precision) {
wideLength = format.precision;
if (format.precision_specified && num_chars > format.precision) {
num_chars = format.precision;
}
} else if (format.precision_specified) {
wideLength = format.precision;
num_chars = format.precision;
if ((string_end = wmemchr((wchar_t*)wcs_ptr, 0, wideLength)) != 0) {
wideLength = string_end - wcs_ptr;
if ((string_end = wmemchr((wchar_t*)wcs_ptr, 0, num_chars)) != 0) {
num_chars = string_end - wcs_ptr;
}
} else {
wideLength = wcslen(wcs_ptr);
num_chars = wcslen(wcs_ptr);
}
num_chars = wideLength;
buff_ptr = wcs_ptr;
break;
} else {

View File

@@ -24,7 +24,11 @@ namespace nw4r {
// Constructor
#ifdef IPL_SDMEMORY_TRIVIAL_COLOR_CTOR
Color() {}
#else
Color() { *this = WHITE; }
#endif
Color(u32 color) { *this = color; }
Color(const GXColor& color) { *this = color; }
Color(int red, int green, int blue, int alpha) { Set(red, green, blue, alpha); }

View File

@@ -19,13 +19,8 @@ namespace nw4r {
template <typename T>
class AutoLock : private NonCopyable {
public:
#ifdef EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
explicit AutoLock(T& rLockObj);
~AutoLock();
#else
explicit AutoLock(T& rLockObj) : mLockObj(rLockObj) { Lock(rLockObj); }
~AutoLock() { Unlock(mLockObj); }
#endif
private:
T& mLockObj; // 0x00

View File

@@ -314,7 +314,7 @@ namespace nw4r {
ArchiveFontBase::ConstructState ArchiveFontBase::ConstructOpAnalyzeGLGR(ConstructContext* ctx, CachedStreamReader* reader) {
u32 glgrInnerLen;
HeaderedGlyphGroups* pGlgr;
const ArchiveFontBinaryLayout* font;
ArchiveFontBinaryLayout* font;
u8* glgrEnd;
u32 expectedMaxSize;
@@ -337,7 +337,7 @@ namespace nw4r {
// Copy the glgr to work
{
pGlgr = (HeaderedGlyphGroups*)&font->glgr;
pGlgr = &font->glgr;
glgrEnd = (u8*)pGlgr + (u32)ctx->mNextBlockHdr.size;
memcpy(pGlgr, &ctx->mNextBlockHdr, sizeof(BinaryBlockHeader));
@@ -382,7 +382,7 @@ namespace nw4r {
sheetOffsetsSize = ROUNDUP(countSheet * sizeof(u16), 4);
sheetOffsetsScratch = (u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
pGlgr = (HeaderedGlyphGroups*)&font->glgr;
pGlgr = &font->glgr;
ENSURE_WORK_HAS_SIZE(ctx, glgrEnd - (u8*)font + sheetOffsetsSize);
// if (ctx->pWorkEnd - workCurr < fontSizeToEndOfGlgr + sheetOffsetsSize) {
// return CONSTRUCT_STATE_FATAL_ERR;

View File

@@ -10,12 +10,14 @@ static TMCHuffmanEntry readHuffmanEntry(const TMCHuffmanEntry* entries, u32 inde
return entries[index];
}
static void readHuffmanLimit(const TMCHuffmanEntry* entries, TMCHuffmanEntry* limit) {
limit->bitLength = entries->bitLength;
limit->symbol = entries->symbol;
static TMCHuffmanEntry readHuffmanLimit(const TMCHuffmanEntry* entries) {
TMCHuffmanEntry limit;
limit.bitLength = entries->bitLength;
limit.symbol = entries->symbol;
return limit;
}
static inline s32 decodeLongHuffman(s32 bitCount, const TMCHuffmanEntry* table, const u8* symbols, TMCCJPEGDecWork* work, TMCHuffmanEntry* limit, TMCHuffmanEntry* decoded) {
static inline s32 decodeLongHuffman(s32 bitCount, const TMCHuffmanEntry* table, const u8* symbols, TMCCJPEGDecWork* work) {
u32 bitData;
u32 code;
u32 length;
@@ -49,21 +51,17 @@ static inline s32 decodeLongHuffman(s32 bitCount, const TMCHuffmanEntry* table,
code |= (bitData >> bitCount) & 1;
read_entry:
{
readHuffmanLimit(entry, limit);
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
TMCHuffmanEntry decoded = readHuffmanLimit(entry);
if (code > (u32)decoded.bitLength) {
continue;
}
{
u32 relativeCode = code - entry->bitLength;
u32 symbolIndex = relativeCode + entry->symbol;
return symbols[symbolIndex & 0xFF];
}
code = code - entry->bitLength + entry->symbol;
return symbols[code & 0xFF];
}
}
}
static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, const u8* symbols, TMCCJPEGDecWork* work, TMCHuffmanEntry* limit, TMCHuffmanEntry* decoded) {
static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, const u8* symbols, TMCCJPEGDecWork* work) {
u32 bitData;
u32 code;
u32 length;
@@ -96,26 +94,18 @@ static inline s32 decodeACHuffman(s32 bitCount, const TMCHuffmanEntry* entry, co
code |= (bitData >> bitCount) & 1;
read_entry:
{
readHuffmanLimit(entry, limit);
*decoded = *limit;
if (code > (u32)decoded->bitLength) {
TMCHuffmanEntry decoded = readHuffmanLimit(entry);
if (code > (u32)decoded.bitLength) {
continue;
}
{
u32 relativeCode = code - entry->bitLength;
u32 symbolIndex = relativeCode + entry->symbol;
return symbols[symbolIndex & 0xFF];
}
code = code - entry->bitLength + entry->symbol;
return symbols[code & 0xFF];
}
}
}
s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_ptr, TMCCJPEGDecWork* work) {
TMCHuffmanEntry dcEntry;
TMCHuffmanEntry dcDecoded;
TMCHuffmanEntry dcLimit;
TMCHuffmanEntry acDecoded;
TMCHuffmanEntry acLimit;
u8* huff_sym;
const TMCHuffmanEntry* ac_fast;
s32 idx;
@@ -157,7 +147,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
} else {
huff_sym = work->pDCHuffSym;
huff_tbl = work->pDCHuffTbl;
r = decodeLongHuffman(bit_pos, (const TMCHuffmanEntry*)huff_tbl, huff_sym, work, &dcLimit, &dcDecoded);
r = decodeLongHuffman(bit_pos, (const TMCHuffmanEntry*)huff_tbl, huff_sym, work);
if (r < 0) {
return r;
}
@@ -217,7 +207,7 @@ s32 TMCJPEGDEC_decode_iquant(s32* block, u8* conv_row_ptr, u32* dc_predict_row_p
r = acEntry.symbol;
} else {
bit_pos = work->bitCount;
r = decodeACHuffman(bit_pos, (const TMCHuffmanEntry*)huff_tbl, huff_sym, work, &acLimit, &acDecoded);
r = decodeACHuffman(bit_pos, (const TMCHuffmanEntry*)huff_tbl, huff_sym, work);
if (r < 0) {
return r;
}

View File

@@ -224,7 +224,7 @@ static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -238,7 +238,7 @@ static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -252,7 +252,7 @@ static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -266,7 +266,7 @@ static void TMCJPEGDEC_converterYUV411toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -345,7 +345,7 @@ static void TMCJPEGDEC_converterYUV411toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
red = blue + redOffset;
green = blue + greenOffset;
blue = blue + blueOffset;
if ((green | red | blue) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -415,7 +415,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -426,7 +426,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -502,7 +502,7 @@ static void TMCJPEGDEC_converterYUV422toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
red = value + redOffset;
blue = value + blueOffset;
green = value + greenOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -578,7 +578,7 @@ static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -593,7 +593,7 @@ static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -660,7 +660,7 @@ static void TMCJPEGDEC_converterYUV420toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
s32 green = value + greenOffset;
s32 red = value + redOffset;
s32 blue = value + blueOffset;
if ((green | red | blue) >> 8) {
if ((blue | red | green) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -742,7 +742,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -831,7 +831,7 @@ static void TMCJPEGDEC_converterYUV211toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
green = value + greenOffset;
red = value + redOffset;
blue = value + blueOffset;
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;
@@ -863,7 +863,7 @@ static void TMCJPEGDEC_converterYUV444toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
u8* cb;
u8* cr;
TMCCJPEGDecState* state;
s32 crValue;
s8 crValue;
s32 height;
s32 width;
s32 column;
@@ -896,10 +896,10 @@ static void TMCJPEGDEC_converterYUV444toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
cbValue = (s8)*cb++;
crValue = (s8)*cr++;
value = *luminance++;
green = value + (-(cbValue * 88 + crValue * 183) >> 8);
green = value + (-(crValue * 183 + cbValue * 88) >> 8);
red = value + ((crValue * 359) >> 8);
blue = value + ((cbValue * 454) >> 8);
if ((red | green | blue) >> 8) {
if ((blue | green | red) >> 8) {
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
green = green > 255 ? 255 : green < 0 ? 0 : green;
red = red > 255 ? 255 : red < 0 ? 0 : red;

View File

@@ -303,7 +303,9 @@ static void TMCJPEG_814F0A58(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* lumaTexture;
u8* luminance;
s32 column;
s32 chromaXEnd;
s32 row;
u32 chromaTileWidth;
TMCCJPEGDecState* state;
s32 width;
s32 height;
@@ -314,6 +316,7 @@ static void TMCJPEG_814F0A58(TMCCJPEGDecWork* work, s32 x, s32 y) {
u8* cb;
u32 tileWidth;
u8* cr;
s32 chromaRowSkip;
row = y;
luminance = work->convBuf + 4;
@@ -338,17 +341,18 @@ static void TMCJPEG_814F0A58(TMCCJPEGDecWork* work, s32 x, s32 y) {
x = (u32)x >> 1;
width = 8 / state->scaleFactor;
height = 8 / state->scaleFactor;
xEnd = x + width;
chromaXEnd = x + width;
chromaYEnd = y + height;
tileWidth = state->chromaWidth >> 3;
for (row = y; row < chromaYEnd; row++) {
for (column = x; column < xEnd; column += 1) {
(cbTexture + ((row & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (row >> 2) * tileWidth) << 5)] = *cb + 128;
chromaTileWidth = state->chromaWidth >> 3;
chromaRowSkip = 8 - width;
for (; y < chromaYEnd; y++) {
for (column = x; column < chromaXEnd; column += 1) {
(cbTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cb + 128;
cb++;
(crTexture + ((row & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (row >> 2) * tileWidth) << 5)] = *cr + 128;
(crTexture + ((y & 3) << 3) + (column & 7))[(s32)(((column >> 3) + (y >> 2) * chromaTileWidth) << 5)] = *cr + 128;
cr++;
}
cb += 8 - width;
cb += chromaRowSkip;
cr += 8 - width;
}
}

View File

@@ -219,7 +219,7 @@ struct __zi8_work_data_s {
ziU8 unk_0x17;
ziU8 subLanguage; // 0x18
ziU8 unk_0x19;
ziU16 separator; // 0x1A
ziU16 unk_0x1A;
ziU8 unk_0x1C[3];
ziU8 unk_0x1F;
ziU16 unk_0x20[0x40];

View File

@@ -940,7 +940,8 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
for (tableIndex = 0; tableIndex < params->count;) {
while (*output != 0) {
if (*output != 0x27) {
*output++ |= 0xf300;
*output |= 0xf300;
output++;
} else {
*output++ = 0xf360;
}
@@ -1003,7 +1004,7 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
totalCandidates = totalCandidates + 1;
if (options->countOnly == 0) {
output += phoneticIndex + 1;
++candidateCount;
candidateCount = candidateCount + 1;
} else if ((int)totalCandidates >= options->maxCount) goto finishSpelling;
if (candidateCount >= params->maxCandidates) goto finishSpelling;
} else {

View File

@@ -285,9 +285,9 @@ static ziBool ZiIsLetterHyphen(ziWChar character ZI_NEED_WORK) {
else return ZI8_FALSE;
}
void Zi8ChangeWordCase(ziWChar* word, ziU8 language, ZiAlphaWork* work) {
void Zi8ChangeWordCase(ziWChar* word, ziU8 language, ziPtr work) {
enum { LOWER_CASE, UPPER_CASE } upper = LOWER_CASE;
if (work->caseMode == 3) {
if (((ZiAlphaWork*)work)->caseMode == 3) {
Zi8ChangeCharCase(1, word++, language, work);
} else if (((ZiAlphaWork*)work)->caseMode == 1) {
upper = UPPER_CASE;

View File

@@ -18,7 +18,7 @@ static Zi8UInt Zi8SetFindCand(ziU8* foundCandidates, Zi8UInt ordinal, ziPtr work
}
ziWChar* ZiGetNextPhonetic(ziWChar* spelling, ziWChar* end ZI_NEED_WORK) {
while (*spelling && *spelling != ZI_WORK->separator && *spelling != 0xF360 && spelling < end) {
while (*spelling && *spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360 && spelling < end) {
++spelling;
}
if (!*spelling || spelling == end) {
@@ -37,8 +37,8 @@ int ZiPartialMatch(ziWChar* spelling, ziWChar* spellingEnd,
if (spelling == spellingEnd || candidate == candidateEnd || !*spelling || !*candidate) {
return 1;
}
while (*spelling != ZI_WORK->separator && *spelling != 0xF360) {
if (*candidate == ZI_WORK->separator || *candidate == 0xF360) {
while (*spelling != ZI_WORK->unk_0x1A && *spelling != 0xF360) {
if (*candidate == ZI_WORK->unk_0x1A || *candidate == 0xF360) {
break;
}
if (*spelling != *candidate) {
@@ -753,7 +753,8 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
if (!componentTable) {
componentCount = Zi8GetTableCount(1, 7, work);
componentOrdinals = (ziU8*)Zi8GetTableAddress(1, 7, work);
componentTable = componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work);
componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work);
componentTable = componentCursor;
componentCursor += 8;
--componentCount;
componentIndex = componentCount;
@@ -2868,7 +2869,7 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_
ziU8 count;
ziWChar spacedElements[256];
struct { ziWChar separator; } savedState;
savedState.separator = ZI_WORK->separator;
savedState.separator = ZI_WORK->unk_0x1A;
if (elementCount <= 1 || !charCount) {
return elementCount;
}
@@ -2881,9 +2882,9 @@ ziU8 Zi8GetElementCount(ziWChar* elements, ziU8 elementCount, ziU8 charCount ZI_
if (spacedIndex == elementCount) {
return elementCount;
}
ZI_WORK->separator = 0xF360;
ZI_WORK->unk_0x1A = 0xF360;
Zi8ZHaddSpace(elements, elementCount, spacedElements, 256, __zi8_work_data);
ZI_WORK->separator = savedState.separator;
ZI_WORK->unk_0x1A = savedState.separator;
spacedIndex = elementIndex = count = 0;
while (charCount && elementIndex < elementCount) {
if (spacedElements[spacedIndex] == 0xF360) {

View File

@@ -21,7 +21,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
ZI_WORK->unk_0x0A = 0xFF;
ZI_WORK->unk_0x10 = 0x64;
*(ziU16*)&ZI_WORK->unk_0x0C = 0xFFFF;
ZI_WORK->separator = 0x20;
ZI_WORK->unk_0x1A = 0x20;
ZI_WORK->unk_0x1C[2] = 0;
ZI_WORK->unk_0x1B30 = 0;
ZI_WORK->unk_0x1B3A = 0;

View File

@@ -68,7 +68,7 @@ ziU8 Zi8ZHaddSpace(ziWChar* src, ziU8 count, ziWChar* dst,
}
if (pdst[k - 1] != 0xF360 &&
(pdst[k - 1] < 0xF331 || pdst[k - 1] > 0xF335)) {
pdst[k++] = ZI_WORK->separator;
pdst[k++] = ZI_WORK->unk_0x1A;
}
psrc += i;
n -= i;

View File

@@ -41,7 +41,7 @@ ziBool Zi8_81480224(ziUserWord* word ZI_NEED_WORK) {
current = ZI_WORK->uwdList;
while (current != 0) {
candidate = (ziUserWord*)current->word;
if (ZI_WORK->unk_0x12E == 1 && candidate->priority < word->priority) break;
if (ZI_WORK->unk_0x12E == 1 && word->priority > candidate->priority) break;
if (candidate->length == length) {
position = 0;
while (position < length) {

View File

@@ -41,13 +41,6 @@ ziU32 ZiDAWGGetChild(ziU32 node) {
return node;
}
typedef struct ziDawgLongOffset {
ziU8 flags;
ziU8 middle;
ziU8 low;
} ziDawgLongOffset;
typedef char ziDawgLongOffsetSizeCheck[(sizeof(ziDawgLongOffset) == 3) ? 1 : -1];
ziU8* ZiDAWGGetSibling(ziU8* cursor) {
ziS32 depth;
ziU8* node;
@@ -77,14 +70,14 @@ ziU8* ZiDAWGGetSibling(ziU8* cursor) {
}
if ((*cursor & 0x80) != 0) {
node += (((const ziDawgLongOffset*)cursor)->flags & 0x7f) * 0x10000 +
(((ziU32)(ziU16)cursor[1] << 8) +
((const ziDawgLongOffset*)cursor)->low) + 0x8000;
node += (*cursor & 0x7f) * 0x10000 +
(((ziU32)cursor[1] << 8) + (ziU32)cursor[2]) + 0x8000;
} else {
node = cursor[1] + (node + (ziU16)*cursor * 0x100);
}
return node;
} else {
cursor = node;
do {
header = nodeHeaderTable[cursor[0] >> 4];
if ((cursor[0] & 0xf) == 0xf) {

View File

@@ -25,12 +25,6 @@ ziU8 Zi8GetFormatVersion(ziU8 ZI_NEED_WORK);
ziPtr Zi8GetTableAddress(ziU8, ziU8 ZI_NEED_WORK);
ziU16 Zi8Uni2Ord(ziWChar ZI_NEED_WORK);
typedef struct ziEncodedOrdinal {
ziU8 low;
ziU8 high;
} ziEncodedOrdinal;
typedef char ziEncodedOrdinalSizeCheck[(sizeof(ziEncodedOrdinal) == 2) ? 1 : -1];
ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
ziChineseEntry* table = 0;
ziU8* baseData = 0;
@@ -140,10 +134,10 @@ ziBool Zi8IsWordW(ziWChar* word, ziU8 language ZI_NEED_WORK) {
countLeft = count;
cursor = ordinals;
while (countLeft > 0) {
value = ((ziU32)(ziU16)data[1] << 8) |
((const ziEncodedOrdinal*)data)->low;
value = (data[1] << 8) | data[0];
data += 2;
if (value != *++cursor) break;
cursor++;
if (value != *cursor) break;
countLeft--;
if (value & 0x8000) break;
}

View File

@@ -30,7 +30,8 @@ ziU8 Zi8MatchOEMdata(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* word
index = ZI_WORK->oemIdx;
if ((ziS32)index >= ZI_WORK->oemLen) goto failed;
if (ZI_WORK->oemMatch == 0) goto failed;
if ((ziS32)length >= (ziS32)--capacity) {
capacity--;
if ((ziS32)length >= (ziS32)capacity) {
failed:
return 0;
}

View File

@@ -550,15 +550,7 @@ pf_s32 PFCACHE_DoWriteSector(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, const pf
#pragma dont_inline reset
static inline pf_u32 PFCACHE_RecordPageEndOverlap(PF_CACHE_PAGE* p_page, pf_u32 end_sector, pf_u32* p_num_success, pf_u32* p_num_rest_sector) {
pf_u32 last_sector = end_sector - 1;
pf_u32 num_overlap = end_sector - p_page->sector;
*p_num_success += num_overlap;
*p_num_rest_sector -= num_overlap;
p_page->stat |= 2;
return last_sector;
}
#pragma dont_inline on
pf_s32 PFCACHE_DoWriteNumSectorAndFreeIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, const pf_u8* p_buf, pf_u32 sector,
pf_u32 num_sector, pf_u32* p_num_success) {
PF_CACHE_PAGE* p_page = PF_NULL;
@@ -617,9 +609,11 @@ pf_s32 PFCACHE_DoWriteNumSectorAndFreeIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE**
(p_page->sector + p_page->size) >= (sector + num_sector)) {
pf_memcpy(p_page->buffer, (pf_u8*)&p_buf[(p_page->sector - sector) << p_vol->bpb.log2_bytes_per_sector],
(sector + num_sector - p_page->sector) << p_vol->bpb.log2_bytes_per_sector);
num_overlap = num_sector;
num_overlap += sector;
last_sector = PFCACHE_RecordPageEndOverlap(p_page, num_overlap, p_num_success, &num_rest_sector);
num_overlap = p_page->size - ((p_page->sector + p_page->size) - (num_sector + sector));
last_sector = p_page->sector + num_overlap - 1;
*p_num_success += num_overlap;
num_rest_sector -= num_overlap;
p_page->stat |= 2;
p_ebuf = &p_page->buffer[(last_sector - p_page->sector) << p_vol->bpb.log2_bytes_per_sector];
p_page->p_mod_sbuf = p_page->buffer;
if (p_page->p_mod_ebuf == NULL || p_page->p_mod_ebuf < p_ebuf) {

View File

@@ -1458,19 +1458,6 @@ s32 PFFAT_CountFreeClusters(PF_VOLUME* volume, u32* numFreeClusters)
return 0;
}
static inline s32 PFFAT_ClearEntryWithBuf(PF_VOLUME* volume, u32 cluster, PF_CACHE_PAGE* page) {
switch (volume->bpb.fat_type) {
case FAT_12:
return PFFAT12_WriteFATEntryWithBuf(volume, (u16)cluster, 0, page);
case FAT_16:
return PFFAT16_WriteFATEntryWithBuf(volume, cluster, 0, page);
case FAT_32:
return PFFAT32_WriteFATEntryWithBuf(volume, cluster, 0, page);
default:
return 15;
}
}
s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
u32 size)
{
@@ -1536,9 +1523,9 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
}
if (nextCluster == 0) {
s32 firstFlushError;
u32 fatSector;
PF_CACHE_PAGE* flushPage;
u16 fatIndex;
const PF_CACHE_PAGE* flushPage;
u32 fatSector;
firstFlushError = 0;
flushPage = page;
@@ -1559,20 +1546,34 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
PFCACHE_FreeDataPage(volume, page);
return 0;
}
{
s32 writeError;
if (chainIndex != -1) {
writeError = PFFAT_WriteClusterWithBuf(file, startCluster, chainIndex,
0, 1, page);
chainIndex++;
} else {
writeError = PFFAT_ClearEntryWithBuf(volume, startCluster, page);
}
if (writeError != 0) {
PFCACHE_FreeDataPage(volume, page);
return writeError;
if (chainIndex != -1) {
error = PFFAT_WriteClusterWithBuf(file, startCluster, chainIndex,
0, 1, page);
chainIndex++;
} else {
currentPage = page;
switch (volume->bpb.fat_type) {
case FAT_12:
error = PFFAT12_WriteFATEntryWithBuf(
volume, (u16)startCluster, 0, currentPage);
break;
case FAT_16:
error = PFFAT16_WriteFATEntryWithBuf(volume, startCluster, 0,
currentPage);
break;
case FAT_32:
error = PFFAT32_WriteFATEntryWithBuf(volume, startCluster, 0,
currentPage);
break;
default:
error = 15;
break;
}
}
if (error != 0) {
PFCACHE_FreeDataPage(volume, page);
return error;
}
if (size != 0 && fileSize != 0) {
if (fileSize <= clusterSize) {
fileSize = 0;
@@ -1589,7 +1590,7 @@ s32 PFFAT_FreeChain(PFFAT_FFD* file, u32 startCluster, u32 chainIndex,
s32 firstFlushError;
u32 fatSector;
u16 fatIndex;
const PF_CACHE_PAGE* flushPage;
PF_CACHE_PAGE* flushPage;
firstFlushError = 0;
flushPage = page;

View File

@@ -484,7 +484,6 @@ static inline unsigned long __nupBase64EncodedSize(unsigned long length) {
}
static void __nupBase64Encode(u8* output, u8* input, unsigned long length) {
static char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
u8* end = input + length;
u32 value = 0;
u32 count = 0;
@@ -497,19 +496,26 @@ static void __nupBase64Encode(u8* output, u8* input, unsigned long length) {
if (count < 3) {
continue;
}
output[0] = alphabet[value >> 18 & 0x3f];
output[1] = alphabet[value >> 12 & 0x3f];
output[2] = alphabet[value >> 6 & 0x3f];
output[3] = alphabet[value & 0x3f];
u8 encodedSecond = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
u8 encodedFirst = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[0] = encodedFirst;
u8 encodedThird = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 6 & 0x3f];
output[1] = encodedSecond;
u8 encodedFourth = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value & 0x3f];
output[2] = encodedThird;
output[3] = encodedFourth;
count = 0;
output += 4;
}
if (count == 2) {
value <<= 8;
output[0] = alphabet[value >> 18 & 0x3f];
output[1] = alphabet[value >> 12 & 0x3f];
output[2] = alphabet[value >> 6 & 0x3f];
u8 encodedSecond = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
u8 encodedFirst = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[0] = encodedFirst;
u8 encodedThird = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 6 & 0x3f];
output[1] = encodedSecond;
output[2] = encodedThird;
output[3] = fillByte;
return;
}
@@ -517,8 +523,10 @@ static void __nupBase64Encode(u8* output, u8* input, unsigned long length) {
return;
}
value <<= 16;
output[0] = alphabet[value >> 18 & 0x3f];
output[1] = alphabet[value >> 12 & 0x3f];
u8 encodedSecond = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 12 & 0x3f];
u8 encodedFirst = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[value >> 18 & 0x3f];
output[0] = encodedFirst;
output[1] = encodedSecond;
output[2] = fillByte;
output[3] = fillByte;
}

View File

@@ -13,8 +13,8 @@ typedef struct _CDBCryptBuf {
u32 buffer32[0xFB00];
}; // 0x00
u32 size; // 0x3EC00
u32 offset; // 0x3EC04
u32 unk_0x3EC00;
u32 unk_0x3EC04;
BOOL allocated; // 0x3EC08
u8 unk_0x3EC0C[0x34];
} CDBCryptBuf;

View File

@@ -164,7 +164,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) {
goto open_result_ready;
open_location_ok:
if (CDBFSSDIsMounted()) {
err = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->size, NULL);
err = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->unk_0x3EC00, NULL);
} else {
err = CDB_ERROR_SD_IS_NOT_MOUNTED;
}
@@ -174,7 +174,7 @@ CDBErr CDBRecordOpen_(CDBRecord* record) {
CDBCryptBufFree((CDBCryptBuf**)&record->cryptBuf);
return err;
}
cryptBuf->offset = sizeof(CDBAttrBuf);
cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf);
}
return CDB_ERROR_OK;
}
@@ -223,7 +223,7 @@ CDBErr CDBRecordOpenReadOnly_(CDBRecord* record) {
goto result_ready;
location_ok:
if (CDBFSSDIsMounted()) {
result = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->size, NULL);
result = CDBRecordDecrypt(record, cryptBuf, 0x3EC00, &cryptBuf->unk_0x3EC00, NULL);
} else {
result = CDB_ERROR_SD_IS_NOT_MOUNTED;
}
@@ -233,7 +233,7 @@ CDBErr CDBRecordOpenReadOnly_(CDBRecord* record) {
CDBCryptBufFree((CDBCryptBuf**)&record->cryptBuf);
return result;
}
cryptBuf->offset = sizeof(CDBAttrBuf);
cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf);
}
return CDB_ERROR_OK;
}
@@ -393,6 +393,48 @@ CDBErr CDBRecordGetDataSize(CDBRecord* record, u32* size) {
return err;
}
CDBErr CDBRecordReduceFileSize(CDBRecord* record, u32 size) {
CDBErr err = CDB_ERROR_OK;
u32 fileSize;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't reduce file size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else if (!CDBRecordBelongedDBOpenedAsRW(record)) {
CDBReportError("can't reduce file size of the record ; the record is opened as READONLY\n");
err = CDB_ERROR_ACCESS_DENIED;
} else {
err = CDBRecordFileGetFileSize(record, &fileSize);
if (size >= fileSize) {
CDBReportError("can't reduce file size of the record ; file size must be over %d bytes\n", fileSize);
err = CDB_ERROR_OUT_OF_RANGE;
}
}
CDBUnlock();
return err;
}
CDBErr CDBRecordReduceDataSize(CDBRecord* record, u32 size) {
CDBErr err = CDB_ERROR_OK;
u32 dataSize;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't reduce data size of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else if (!CDBRecordBelongedDBOpenedAsRW(record)) {
CDBReportError("can't reduce data size of the record ; the record is opened as READONLY\n");
err = CDB_ERROR_ACCESS_DENIED;
} else {
err = CDBRecordFileGetDataSize(record, &dataSize);
if (size >= dataSize) {
CDBReportError("can't reduce data size of the record; permission denied\n");
err = CDB_ERROR_ACCESS_DENIED;
}
}
CDBUnlock();
return err;
}
CDBErr CDBRecordRemove(CDBRecord* record) {
CDBErr err;
CDBLock();
@@ -424,6 +466,164 @@ CDBErr CDBRecordRemove_(CDBRecord* record) {
return result;
}
CDBErr CDBRecordSetFileType(CDBRecord* record, char* fileType) {
CDBErr err = CDB_ERROR_OK;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->unk_0x00)->instance)->openFlags & 2) == 0) {
CDBReportError("can't set file type of the record; the database is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (recordFile == NULL) {
CDBReportError("can't set file type of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else if (!CDBRecordBelongedDBOpenedAsRW(record)) {
CDBReportError("can't set file type of the record ; the record is opened as READONLY\n");
err = CDB_ERROR_ACCESS_DENIED;
} else if (record->key.location != CDB_FS_LOCATION_NAND) {
CDBReportError("can't set file type of the record ; the record must exsist on NAND\n");
err = CDB_ERROR_ACCESS_DENIED;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetFileType(CDBRecord* record, char* fileType) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get file type of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToType(record->key.keyString, fileType);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetGameCode(CDBRecord* record, char* gameCode) {
CDBErr err = CDB_ERROR_OK;
u32 value;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get game code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToGameCode(record->key.keyString, &value);
CDBConvGCValueToGCStr(value, gameCode);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetMakerCode(CDBRecord* record, u32* makerCode) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get maker code of the record ; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToMakerCode(record->key.keyString, makerCode);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetModifiedTime(CDBRecord* record, int* year, int* month, int* day, int* hour, int* min, int* sec) {
CDBErr err = CDB_ERROR_OK;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get modified time of the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvertCDBDateToCalendarTime((CDBDate)recordFile->attr.buf.lastModifiedDate, year, month, day, hour, min, sec);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetModifiedCount(CDBRecord* record, u32* modifiedCount) {
CDBErr err = CDB_ERROR_OK;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if (recordFile == NULL) {
CDBReportError("can't get modified count of the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
err = CDBAttrGetModifiedCount(&recordFile->attr, modifiedCount);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordSetName(CDBRecord* record, char* name) {
CDBErr err = CDB_ERROR_OK;
CDBRecordFile* recordFile;
CDBLock();
recordFile = record->file;
if ((((CDBRecordDatabaseState*)((CDBDatabase*)record->unk_0x00)->instance)->openFlags & 2) == 0) {
CDBReportError("can't set a name of the record; the database is opened as READONLY\n");
err = CDB_ERROR_26;
} else if (!CDBRecordBelongedDBOpenedAsRW(record)) {
CDBReportError("can't add keyword to the record; permission denied\n");
err = CDB_ERROR_ACCESS_DENIED;
} else if (recordFile == NULL) {
CDBReportError("can't set a name of the record; the record is closed\n");
err = CDB_ERROR_27;
} else if ((recordFile->unk_0x1C & CDB_RECORD_ALLOC_WRITE) == 0) {
CDBReportError("can't set a name of the record; the record is opened as READONLY\n");
err = CDB_ERROR_ACCESS_DENIED;
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetKeyword(CDBRecord* record, char* keyword) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get keyword from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBRecordKeyGetKeyStr(&record->key, keyword);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetKey(CDBRecord* record, CDBRecordKey* key) {
CDBErr err = CDB_ERROR_OK;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get key from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBRecordKeyCopy(key, &record->key);
}
CDBUnlock();
return err;
}
CDBErr CDBRecordGetCalendarTime(CDBRecord* record, int* year, int* month, int* day, int* hour, int* min, int* sec) {
CDBErr err = CDB_ERROR_OK;
char epochString[64];
CDBDate epoch;
CDBLock();
if (record->file == NULL) {
CDBReportError("can't get calender time from the record; the record is closed\n");
err = CDB_ERROR_27;
} else {
CDBConvKeyStrToEpochStr(record->key.keyString, epochString);
CDBConvEpochStrToEpochValue(epochString, &epoch);
CDBConvEpochValueToDate(epoch, year, month, day, hour, min, sec);
}
CDBUnlock();
return err;
}
void CDBRecordGetTypeForce(CDBRecord* record, char* type) {
CDBLock();
CDBConvKeyStrToType(record->key.keyString, type);
@@ -622,6 +822,22 @@ CDBErr CDBRecordBackupToSD_(CDBRecord* record) {
return CDB_ERROR_OK;
}
CDBErr CDBRecordDuplicate(CDBRecord* record, CDBRecord* newRecord) {
CDBErr err;
CDBLock();
if (record->key.location != CDB_FS_LOCATION_NAND) {
OSPanic(__FILE__, 0x38B, "CDBRecordDuplicate invalud location\n");
}
err = CDBRecordAllocate(newRecord, CDB_RECORD_ALLOC_RW);
if (err == CDB_ERROR_OK) {
CDBRecordKeyCopy(&newRecord->key, &record->key);
newRecord->unk_0x00 = record->unk_0x00;
err = CDBRecordBackupToSD_(newRecord);
}
CDBUnlock();
return err;
}
CDBErr CDBCryptBuffer(void* buffer, u32 size, void* iv, u32* processedSize, BOOL encrypt) {
NETAESContext context ATTRIBUTE_ALIGN(64);
u32 offset;
@@ -960,3 +1176,11 @@ CDBErr CDBRecordDecrypt(CDBRecord* record, void* buffer, u32 size, u32* dataSize
}
return CDB_ERROR_OK;
}
void CDBRecordPrivateChangeOwner(CDBRecord* record, u64 preWiiId, u64 wiiId, char* path, char* path2) {
CDBReportInfo("CDBRecordPrivateChangeOwner\n");
CDBReportInfo(" i_pre-wiiid = %lX\n", preWiiId);
CDBReportInfo(" record-wiiid = %lX\n", wiiId);
CDBReportInfo("path =%s\n", path);
CDBReportInfo("path2=%s\n", path2);
}

View File

@@ -264,8 +264,8 @@ CDBErr CDBRecordFileReadData(CDBRecord* record, void* buffer, u32 size, u32* rea
CDBCryptBuf* cryptBuf = record->cryptBuf;
if (cryptBuf != NULL) {
u32 unk = cryptBuf->size - cryptBuf->offset;
if (cryptBuf->size < unk) {
u32 unk = cryptBuf->unk_0x3EC00 - cryptBuf->unk_0x3EC04;
if (cryptBuf->unk_0x3EC00 < unk) {
unk = 0;
}
@@ -274,8 +274,8 @@ CDBErr CDBRecordFileReadData(CDBRecord* record, void* buffer, u32 size, u32* rea
}
if (unk != 0) {
memcpy(buffer, (u8*)&cryptBuf->buffer[cryptBuf->offset], unk);
cryptBuf->offset += unk;
memcpy(buffer, (u8*)&cryptBuf->buffer[cryptBuf->unk_0x3EC04], unk);
cryptBuf->unk_0x3EC04 += unk;
}
if (readSize != NULL) {
@@ -300,16 +300,16 @@ CDBErr CDBRecordFileSeekData(CDBRecord* record, u32 offset, CDBSeek seek) {
if (cryptBuf != NULL) {
switch (seek) {
case CDB_SEEK_BEGIN: {
cryptBuf->offset = sizeof(CDBAttrBuf);
cryptBuf->offset += offset;
cryptBuf->unk_0x3EC04 = sizeof(CDBAttrBuf);
cryptBuf->unk_0x3EC04 += offset;
break;
}
case CDB_SEEK_END: {
cryptBuf->offset = (cryptBuf->size - 1) - offset;
cryptBuf->unk_0x3EC04 = (cryptBuf->unk_0x3EC00 - 1) - offset;
break;
}
case CDB_SEEK_CUR: {
cryptBuf->offset += offset;
cryptBuf->unk_0x3EC04 += offset;
break;
}
}
@@ -329,7 +329,7 @@ int CDBRecordFileTellData(CDBRecord* record) {
CDBCryptBuf* cryptBuf = record->cryptBuf;
if (cryptBuf != NULL) {
return cryptBuf->offset - sizeof(CDBAttrBuf);
return cryptBuf->unk_0x3EC04 - sizeof(CDBAttrBuf);
}
return CDBFTellData(&recordFile->bridgeFile, record->key.location);
}

View File

@@ -23,7 +23,8 @@ static int ReadHeaderChar(const NHTTPResponseInfo* response, NHTTPi_HDRBUFLIST**
}
static int LowerCase(int character) {
return ((character >= 'A') & (character <= 'Z')) ? character + 32 : character;
if((character>='A') & (character<='Z')) character+=32;
return character;
}
s32 NHTTPi_findNextLineHdrRecvBuf(const NHTTPResponseInfo* response, s32 position, s32 limit, s32* colon, s32* newlineLength) {
@@ -75,17 +76,15 @@ s32 NHTTPi_skipSpaceHdrRecvBuf(const NHTTPResponseInfo* response, s32 position,
s32 NHTTPi_compareTokenN_HdrRecvBuf(const NHTTPResponseInfo* response, s32 position, s32 limit, const char* token, s8 delimiter) {
NHTTPi_HDRBUFLIST* block;
s32 offset;
int character;
if (position < limit) {
FindHeaderBlock(response, position, &block, &offset);
character = ReadHeaderChar(response, &block, &offset);
while (LowerCase((s8)character) == LowerCase(*token)) {
if (*token == 0 || *token == ' ' || *token == delimiter || position == limit - 1) return 0;
character = ReadHeaderChar(response, &block, &offset);
++position;
++token;
}
s8 character;
if(position>=limit) return -1;
FindHeaderBlock(response,position,&block,&offset);
character=ReadHeaderChar(response,&block,&offset);
while(LowerCase(character)==LowerCase(*token)) {
if(*token==0 || *token==' ' || *token==delimiter || position==limit-1) return 0;
character=ReadHeaderChar(response,&block,&offset);
++position;
++token;
}
return -1;
}

View File

@@ -64,7 +64,7 @@ static NWC24Err ClearMBCEntry(MBCHeader* header, NWC24File* file, u32 offset);
static NWC24Err MountVFMBox(NWC24MBoxType type);
static NWC24Err CopyMsgObjToMBCFmt(const NWC24MsgObjPrivate* msg, MBCEntry* entry);
static NWC24Err CopyMsgObjToPrvFmt(const MBCEntry* entry, NWC24MsgObjPrivate* msg) NO_INLINE;
BOOL NWC24iIsMsgObjReadable(MBCEntry* entry) NO_INLINE;
BOOL NWC24iIsMsgObjReadable(const MBCEntry* entry) NO_INLINE;
NWC24Err NWC24CreateVF(const char* path, u32 size);
static inline NWC24Err MakeCtrlPath(char* path, NWC24MBoxType type) {
@@ -221,7 +221,7 @@ NWC24Err NWC24GetMsgObj(NWC24MsgObj* msg, NWC24MBoxType type, u32 id) {
return result;
}
BOOL NWC24iIsMsgObjReadable(MBCEntry* entry) {
BOOL NWC24iIsMsgObjReadable(const MBCEntry* entry) {
if (!(entry->type & 0x200000))
return FALSE;
if (entry->type & 0xFE000000)

View File

@@ -430,17 +430,14 @@ static NWC24Err CheckMsgObject(const NWC24MsgObjPrivate* msg) {
return NWC24_OK;
}
static inline u32 Base64StorageSize(const u32* byteCount) {
return (*byteCount * 4 + 2) / 3 + *byteCount / 57 * 2 + 4;
}
static NWC24Err CheckMsgBoxSpace(const NWC24MsgObjPrivate* msg, NWC24MBoxType type) {
u32 total = 0;
u32 textSize = 0;
s32 index;
NWC24Err err;
for (index = 0; index < msg->numAttached; ++index) {
total += Base64StorageSize(&msg->attachedSize[index]);
u32 size = msg->attachedSize[index];
total += (size * 4 + 2) / 3 + size / 57 * 2 + 4;
}
switch (msg->encoding) {
case NWC24_ENC_7BIT:
@@ -769,14 +766,19 @@ static NWC24Err WriteMIMEAttachHeader(NWC24MsgObjPrivate* msg, u32 index) {
char* buffer;
const char* mime;
const char* suffix;
int mimeLength;
s32 typeLength, encodingLength, dispositionLength, mimeLength;
s32 first, second, third, total;
NWC24Err err;
Mail_memset(NWC24WorkP->stringWork, 0, 1024);
buffer = NWC24WorkP->stringWork;
mime = NWC24GetMIMETypeStr(msg->attachedType[index]);
suffix = NWC24iGetMIMETypeSuffix(msg->attachedType[index]);
mimeLength = (Mail_strlen(ContentTypeA) + Mail_strlen(ContentTxEncA)) + Mail_strlen(ContentDispA) + Mail_strlen(mime) + 4;
encodingLength = Mail_strlen(ContentTxEncA);
typeLength = Mail_strlen(ContentTypeA);
dispositionLength = Mail_strlen(ContentDispA);
typeLength += encodingLength;
mimeLength = Mail_strlen(mime);
mimeLength = (dispositionLength + typeLength) + mimeLength + 4;
if (mimeLength >= 1024)
return NWC24_ERR_NOMEM;
first = Mail_sprintf(buffer, (char*)ContentTypeA, mime, (char)('a' + index), msg->msgId, suffix);

View File

@@ -138,9 +138,9 @@ int SOGetSockName(int socket, void* address) {
int size;
int result;
s32 rm;
NameRequest* request;
SOSockAddr* reply;
SOSockAddr* addr;
SOSockAddr* reply;
NameRequest* request;
addr=address;
if((result=SOiPrepare(NULL,&rm))==0) {
if(!addr || addr->len>8 || addr->len<8) result=-28;

View File

@@ -101,7 +101,7 @@ int SOGetInterfaceOpt(void* interface, int level, int option, void* value, int*
int size;
int result;
InterfaceOption* request;
const InterfaceCommand* command;
InterfaceCommand* command;
int* returnedLength;
u8* reply;
if ((result=SOiPrepareTempRm(NULL,&rm,&temporary))==0) {
@@ -112,7 +112,7 @@ int SOGetInterfaceOpt(void* interface, int level, int option, void* value, int*
if(!request) result=-49;
else {
command=&request->command;
request->command.level=level; request->command.option=option;
command->level=level; command->option=option;
returnedLength=&((InterfaceLength*)(command + 1))->length;
reply=(u8*)((InterfaceLength*)returnedLength + 1);
*returnedLength=OptionLength(length);

1
report.json Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1179,8 +1179,14 @@ namespace ipl {
return;
}
if (mState != STATE_NORMAL || mMode != 0) {
return;
switch (mState) {
case STATE_NORMAL:
if (mMode == 0) {
break;
}
// fallthrough
default:
return;
}
if (!mpFriendCache->isThere(buttonNo + mPage * BTN_MAX)) {
@@ -1425,10 +1431,7 @@ namespace ipl {
if (con->downTrg(controller::BTN_INTERACT)) {
Button* button = static_cast<Button*>(System::getScene(SCENE_BUTTON));
if (mState != STATE_COVER_NORMAL && mState != STATE_NORMAL) {
break;
}
if (mState == STATE_COVER_NORMAL || mState == STATE_NORMAL) {
if (Button::cmpButtonName(paneName, Button::BTN_EXIT) == 0) {
MailAddressSelect* mailAddrSel = static_cast<MailAddressSelect*>(System::getScene(SCENE_MAIL_ADDRESS_SELECT));
button->animation(Button::IDANIM_SELECT_CALENDAR_EXIT);
@@ -1477,7 +1480,7 @@ namespace ipl {
snd::getSystem()->startSE("WIPL_SE_FL_PAGE_DEC");
onPreviousPage();
}
break;
}
}
// fallthrough
}
@@ -1557,15 +1560,6 @@ namespace ipl {
}
}
static inline math::VEC2 scaledPageOffset(const math::VEC2& source, f32 factor) {
const f32 vertical = source.y * factor;
const f32 horizontal = source.x * factor;
math::VEC2 scaled;
scaled.y = vertical;
scaled.x = horizontal;
return scaled;
}
void Address::onPreviousPage() {
switch (mState) {
case STATE_NORMAL:
@@ -1595,7 +1589,10 @@ namespace ipl {
mPage = PAGE_MAX - 1;
mNextPageNum = 0;
mbCover = false;
add_translate(mpLayout->FindPaneByName("N_note_base"), scaledPageOffset(sPageOffset, PAGE_MAX));
math::VEC2 offset;
offset.y = sPageOffset.y * PAGE_MAX;
offset.x = sPageOffset.x * PAGE_MAX;
add_translate(mpLayout->FindPaneByName("N_note_base"), math::VEC2(offset));
mpLayout->getAnim(4)->setAnmType(0);
mpLayout->getAnim(4)->play();
set_page_text("T_nmbr_b", mPage + 1);
@@ -1783,16 +1780,17 @@ namespace ipl {
nw4r::math::VEC3 baseTrans = mpLayout->FindPaneByName("N_base_move")->GetTranslate();
math::VEC2 pos = System::getControllerManager()->getController(mDrag.mChan)->getDpdProjectionPos();
nw4r::lyt::TextBox* textBox = static_cast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName("T_name_move"));
const u16* name = mpFriendCache->getInfo(mDrag.mButton + mDrag.mPage * BTN_MAX).attr.name;
const NWC24FriendInfo& info = mpFriendCache->getInfo(mDrag.mButton + mDrag.mPage * BTN_MAX);
f32 width = 0.0f;
if (textBox != NULL && name != NULL) {
const u16* name;
if (textBox != NULL && (name = info.attr.name) != NULL) {
textBox->GetFont()->GetWidth();
for (; *name != 0; name++) {
width += textBox->GetFont()->GetCharWidth(*name);
}
width += 0.01f;
}
width += 0.01f;
nw4r::ut::Rect rect;
nw4r::ut::Rect rect4x3;
@@ -1946,11 +1944,10 @@ namespace ipl {
}
void FriendListCache::update(u32 index, const wchar_t* name, u64 fdId) {
NWC24FriendInfo* info = &mInfos[index];
info->attr.fdId = fdId;
memset(info->attr.name, 0, sizeof(info->attr.name));
wcsncpy((wchar_t*)info->attr.name, name, 10);
System::getNwc24Manager()->updateFriendInfo(info, index);
mInfos[index].attr.fdId = fdId;
memset(mInfos[index].attr.name, 0, sizeof(mInfos[index].attr.name));
wcsncpy((wchar_t*)mInfos[index].attr.name, name, 10);
System::getNwc24Manager()->updateFriendInfo(&mInfos[index], index);
}
void FriendListCache::del(u32 index) {

View File

@@ -521,7 +521,8 @@ void ipl::scene::AddressEdit::create() {
set_textbox(textPane, friendText);
textPane = (mpCodeLayout)
->getNW4RLyt()->GetRootPane()->FindPaneByName("T_frnd_crd_00", true);
set_textbox(textPane, mString.mDisplayText);
friendText = mString.mDisplayText;
set_textbox(textPane, friendText);
mState = 0;
break;
}
@@ -2118,6 +2119,8 @@ void ipl::scene::AddressEdit::start_point_event(
state0:
switch (buttonNo) {
case 4:
goto done;
case 0:
goto state0Button0;
case 1:
@@ -2226,6 +2229,8 @@ void ipl::scene::AddressEdit::start_left_event(const char* paneName) {
switch (mState) {
case 0:
switch (buttonNo) {
case 4:
break;
case 0: {
if (mpFriendCache->getInfo(mSelectedFriend).attr.status != 2) {
break;

View File

@@ -638,7 +638,7 @@ namespace ipl {
void ChannelObj::setLangPane(const layout::Object* layout) {
int lang = System::getLanguage();
const char* langGroup = scLangGroups[lang];
char langCodeBuf[10][4] = {""};
char langCodeBuf[40] = "";
bool foundLangGroup = false;
@@ -648,7 +648,7 @@ namespace ipl {
} else {
bool isNonRsoGroup = true;
for (int i = 0; i < channel::MAX_ANIMS; i++) {
char name[8];
char name[6];
sprintf(name, "Rso%d", i);
if (strncmp(it->GetName(), name, 5) == 0) {
isNonRsoGroup = false;
@@ -663,8 +663,8 @@ namespace ipl {
for (int i = 0; i < 10; i++) {
if (strncmp(it->GetName(), scLangGroups[i], 3) == 0) {
memcpy(langCodeBuf[i], it->GetName(), 3);
langCodeBuf[i][3] = 0;
memcpy(&langCodeBuf[i], it->GetName(), 3);
langCodeBuf[i + 3] = 0;
break;
}
}
@@ -680,15 +680,16 @@ namespace ipl {
} else {
s32 region = System::getRegion();
for (int i = 0; i < channel::MAX_ANIMS; i++) {
if (scModuleData.langGroupLookup[region][i] == NULL) {
break;
}
if (strcmp(scModuleData.langGroupLookup[region][i], langCodeBuf[scLangLookup[region][i]]) == 0) {
nw4r::lyt::Group* group = layout->FindGroupByName(scModuleData.langGroupLookup[region][i]);
for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++) {
it->mTarget->SetVisible(true);
char* groupName = (char*)scModuleData.langGroupLookup[region][i];
if (groupName != NULL) {
if (strcmp(groupName, &langCodeBuf[scLangLookup[region][i]]) == 0) {
nw4r::lyt::Group* group = layout->FindGroupByName(groupName);
for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter();
it++) {
it->mTarget->SetVisible(true);
}
}
break;
}
}
}

View File

@@ -1901,59 +1901,64 @@ namespace ipl {
nw4r::ut::Rect projRect;
System::getProjectionRect(&projRect);
GXRenderModeObj* rMode = System::getRenderModeObj();
f32 scissorX;
f32 scissorY;
f32 scissorWidth;
f32 scissorHeight;
u16 fbWidth;
u16 efbHeight;
f32 var_f29;
f32 var_f30;
f32 var_f31;
f32 var_f1;
u16 var_r0;
u16 var_r3;
if (mState == STATE_NORMAL_FADE_ZOOM || mState == STATE_NORMAL_DONE_FADE_ZOOM || mState == STATE_NORMAL_RESTART) {
nw4r::math::MTX44 mtx;
f32 right = unk_0xD8.x + projRect.right / unk_0xE4.x;
f32 left = unk_0xD8.x + projRect.left / unk_0xE4.x;
f32 bottom = unk_0xD8.y - projRect.bottom / unk_0xE4.y;
f32 top = unk_0xD8.y - projRect.top / unk_0xE4.y;
f32 rightScale = projRect.right / unk_0xE4.x;
f32 leftScale = projRect.left / unk_0xE4.x;
f32 topScale = projRect.top / unk_0xE4.y;
f32 bottomScale = projRect.bottom / unk_0xE4.y;
f32 bottom = unk_0xD8.y - bottomScale;
f32 right = unk_0xD8.x + rightScale;
f32 left = unk_0xD8.x + leftScale;
f32 top = unk_0xD8.y - topScale;
MTXOrtho(mtx, top, bottom, left, right, -100.0f, 100.0f);
nw4r::math::VEC4 vec4_in(vec.x, vec.y, 0.0f, 1.0f);
nw4r::math::VEC4 vec4;
nw4r::math::VEC4Transform(&vec4, &mtx, &vec4_in);
fbWidth = rMode->fbWidth;
efbHeight = rMode->efbHeight;
f32 projectionWidth = projRect.GetWidth();
scissorX = ((1.0f + vec4.x) * fbWidth / 2) - ((mChanThumbOff_X * unk_0xE4.x) * (fbWidth / projectionWidth));
scissorY = (efbHeight - ((1.0f + vec4.y) * efbHeight / 2)) - (mChanThumbOff_Y * unk_0xE4.y);
scissorWidth = 2.0f * (mChanThumbOff_X * unk_0xE4.x) * (fbWidth / projectionWidth);
scissorHeight = 2.0f * (mChanThumbOff_Y * unk_0xE4.y);
var_r0 = rMode->fbWidth;
var_r3 = rMode->efbHeight;
var_f29 = projRect.GetWidth();
var_f30 = (var_r3 - ((1.0f + vec4.y) * var_r3 / 2)) - (mChanThumbOff_Y * unk_0xE4.y);
f32 temp_f7_2 = var_r0 / var_f29;
var_f31 = ((1.0f + vec4.x) * var_r0 / 2) - ((mChanThumbOff_X * unk_0xE4.x) * (temp_f7_2));
var_f29 = 2.0f * (mChanThumbOff_X * unk_0xE4.x) * (var_r0 / var_f29);
var_f1 = 2.0f * (mChanThumbOff_Y * unk_0xE4.y);
} else {
fbWidth = rMode->fbWidth;
efbHeight = rMode->efbHeight;
scissorX = ((f32)fbWidth / 2) + ((vec.x - mChanThumbOff_X) * (fbWidth / projRect.GetWidth()));
scissorY = (((f32)efbHeight / 2) - vec.y) - mChanThumbOff_Y;
scissorWidth = 2.0f * mChanThumbOff_X * (fbWidth / projRect.GetWidth());
scissorHeight = 2.0f * mChanThumbOff_Y;
var_r0 = rMode->fbWidth;
var_r3 = rMode->efbHeight;
var_f31 = ((f32)var_r0 / 2) + ((vec.x - mChanThumbOff_X) * (var_r0 / projRect.GetWidth()));
var_f30 = (((f32)var_r3 / 2) - vec.y) - mChanThumbOff_Y;
var_f29 = 2.0f * mChanThumbOff_X * (var_r0 / projRect.GetWidth());
var_f1 = 2.0f * mChanThumbOff_Y;
}
scissorX -= 1.0f;
scissorY -= 1.0f;
scissorWidth += 2.0f;
scissorHeight += 2.0f;
if (scissorX >= fbWidth || (scissorX + scissorWidth) <= 0.0f || scissorY >= efbHeight || (scissorY + scissorHeight) <= 0.0f) {
var_f31 -= 1.0f;
var_f30 -= 1.0f;
var_f29 += 2.0f;
var_f1 += 2.0f;
if (var_f31 >= var_r0 || (var_f31 + var_f29) <= 0.0f || var_f30 >= var_r3 || (var_f30 + var_f1) <= 0.0f) {
GXSetScissor(0, 0, 0, 0);
} else {
if (scissorX < 0.0f) {
scissorWidth += scissorX;
scissorX = 0.0f;
if (var_f31 < 0.0f) {
var_f29 += var_f31;
var_f31 = 0.0f;
}
if (scissorY < 0.0f) {
scissorHeight += scissorY;
scissorY = 0.0f;
if (var_f30 < 0.0f) {
var_f1 += var_f30;
var_f30 = 0.0f;
}
if ((scissorX + scissorWidth) > 1705.0f) {
scissorWidth -= (scissorX + scissorWidth) - 1705.0f;
if ((var_f31 + var_f29) > 1705.0f) {
var_f29 -= (var_f31 + var_f29) - 1705.0f;
}
if ((scissorY + scissorHeight) > 1705.0f) {
scissorHeight -= (scissorY + scissorHeight) - 1705.0f;
if ((var_f30 + var_f1) > 1705.0f) {
var_f1 -= (var_f30 + var_f1) - 1705.0f;
}
GXSetScissor(scissorX, scissorY, scissorWidth, scissorHeight);
GXSetScissor(var_f31, var_f30, var_f29, var_f1);
}
}

View File

@@ -20,7 +20,7 @@
#include <private/os.h>
#include <private/wpad.h>
#pragma dont_instantiate ipl::math::HermiteIntp<float>
#undef IPL_CHANNEL_TITLE_NOVTABLE

View File

@@ -31,7 +31,7 @@ namespace ipl {
};
// clang-format on
SDButton::SDButton(EGG::Heap* heap) : Base(heap), mAnimWait(0) {
SDButton::SDButton(EGG::Heap* heap) : Base(heap), unk_0x54(0) {
setSceneParentFlags(SCN_PARENTFLAG_CALC | SCN_PARENTFLAG_DRAW);
for (int i = 0; i < 2; i++) {
@@ -114,10 +114,10 @@ namespace ipl {
}
void SDButton::calc() {
if (mAnimWait == 1) {
if (unk_0x54 == 1) {
if (!mpLayout->isPlaying(ANIM_HELP_BTN_ROLL_ON)) {
reset_gui();
mAnimWait = 0;
unk_0x54 = 0;
}
}
@@ -347,7 +347,7 @@ namespace ipl {
switch (animNo) {
case IDANIM_HELP_BTN_CLICK: {
anim = mpLayout->getAnim(ANIM_HELP_BTN_ROLL_ON);
mAnimWait = 1;
unk_0x54 = 1;
break;
}
case IDANIM_ARROW_RIGHT_CLICK: {

View File

@@ -1,4 +1,5 @@
#define IPL_SDMEMORY_TITLE_CACHE_ACCESS
#define IPL_SDMEMORY_SCROLLER_INIT_OUT_OF_LINE
#define IPL_SDMEMORY_SET_TRANSLATE_OUT_OF_LINE
#define IPL_SDMEMORY_DIALOG_STATE_ACCESSOR
@@ -8,6 +9,7 @@
#define IPL_SDMEMORY_COMPLETION_PCT_ACCESSOR
#define IPL_SDMEMORY_DIALOG_PROGRESS_FRAME_ACCESSOR
#define IPL_SDMEMORY_SET_TEXT_COLORS
#define IPL_SDMEMORY_TRIVIAL_COLOR_CTOR
#define IPL_SDMEMORY_SCROLLER_STATE_ACCESSOR
#include "system/iplDialogWindow.h"
#undef IPL_SDMEMORY_DIALOG_PROGRESS_FRAME_ACCESSOR
@@ -28,23 +30,6 @@
#include "utility/iplLayout.h"
#include <revolution/os/OSTime.h>
extern "C" bool iplSDChannelSelect_813DDB74(ipl::scene::SDChannelSelect* channelSelect,
ipl::scene::SDMemory::TitleRange* nandTitles,
ipl::scene::SDMemory::TitleRange* sdTitles,
ESTitleId* titleIds, wchar_t* titleNames, u32* titleCount,
s32 state);
extern "C" bool iplSDChannelSelect_813DB5EC(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId titleId);
extern "C" bool iplSDChannelSelect_813DB4D4(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId titleId, u32 flags);
extern "C" bool iplSDChannelSelect_813DB530(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId** titleNames, ESTitleId** secondaryTitles);
extern "C" bool iplSDChannelSelect_813DB478(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId titleId);
extern "C" bool iplSDChannelSelect_813DB58C(ipl::scene::SDChannelSelect* channelSelect,
ESTitleId** titles, ESTitleId** secondaryTitles,
ESTitleId** names);
namespace ipl {
namespace scene {
typedef ::gui::Component GuiComponent;
@@ -723,8 +708,8 @@ namespace ipl {
if (!mpMainLayout->isPlaying(-1)) {
switch (mProcessState) {
case 0:
if (iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 2)) {
if (mpSDChannelSelect->collectTitlesForMode(&mNandTitleRange.mByteSize, &mSDTitleRange.mByteSize,
mTitleIds, (char*)&mTitleNames[0][0], &mTitleCount, 2)) {
mDialogState = 4;
mpTitleLayout->getAnim(0)->initAnmFrame();
mpTitleLayout->getAnim(0)->play();
@@ -922,8 +907,8 @@ namespace ipl {
return;
}
if (iplSDChannelSelect_813DB530(mpSDChannelSelect, &mTitleListState.mpNames,
&mTitleListState.mpSecondaryTitles)) {
if (mpSDChannelSelect->enqueueErrorNotice((u32)&mTitleListState.mpNames,
(u32)&mTitleListState.mpSecondaryTitles)) {
mDialogState = 19;
mCurrentTitleName[0] = L'\0';
mCurrentTitle = 0;
@@ -995,8 +980,8 @@ namespace ipl {
if (iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) ||
iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) {
ESTitleId titleId = mTitleIds[mCurrentTitle];
if (iplSDChannelSelect_813DB478(mpSDChannelSelect, titleId)) {
ESTitleId* curTitleId = &mTitleIds[mCurrentTitle];
if (mpSDChannelSelect->enqueueMoveNotice((u32)curTitleId - offsetof(SDMemory, mTitleIds), ((u32*)curTitleId)[0], ((u32*)curTitleId)[1])) {
mDialogState = 14;
} else {
System::getDialog()->terminate();
@@ -1046,7 +1031,7 @@ namespace ipl {
void SDMemory::onDialogState16() {
if (mTitleCount > mCurrentTitle && System::isReceiveScheduleStopped()) {
if (iplSDChannelSelect_813DB4D4(mpSDChannelSelect, mTitleIds[mCurrentTitle], 0)) {
if (mpSDChannelSelect->enqueueStateNotice(mTitleIds[mCurrentTitle], 0)) {
mDialogState = 16;
} else {
System::getDialog()->terminate();
@@ -1101,7 +1086,9 @@ namespace ipl {
System::getDialog()->setTitleForSDMemory(mCurrentTitleName);
const ESTitleId titleId = mTitleIds[mCurrentTitle];
if (iplSDChannelSelect_813DB5EC(mpSDChannelSelect, titleId)) {
if (mpSDChannelSelect->enqueueDeleteNotice((u32)&mTitleIds[mCurrentTitle] - offsetof(SDMemory, mTitleIds),
((u32*)&mTitleIds[mCurrentTitle])[0],
((u32*)&mTitleIds[mCurrentTitle])[1])) {
mDialogState = 18;
} else {
System::getDialog()->terminate();
@@ -1263,13 +1250,12 @@ namespace ipl {
void SDMemory::drawTransferTitles() {
const nw4r::math::VEC3& translation = mpDialogLayout->FindPaneByName("N_Memo")->GetTranslate();
nw4r::math::VEC3 memoPosition;
f32 bodyY = translation.y;
memoPosition.x = translation.x;
memoPosition.y = translation.y;
memoPosition.y = bodyY;
memoPosition.z = translation.z;
mpDialogLayout->FindPaneByName("header_header");
nw4r::lyt::Pane* bodyPane = mpDialogLayout->FindPaneByName("header_body");
f32 bodyY = memoPosition.y;
if (bodyY < 500.0f) {
mpDialogLayout->draw("header_header");
}
@@ -1288,9 +1274,12 @@ namespace ipl {
if (mNandTitleCount != 0) {
const wchar_t* messageForCount = System::getMessage(0xCB);
const wchar_t* newline = wcsstr(messageForCount, L"\n");
while (newline != NULL) {
++lineCount;
newline = wcsstr(newline + 1, L"\n");
if (newline != NULL) {
const wchar_t* separator = L"\n";
while (newline != NULL) {
++lineCount;
newline = wcsstr(newline + 1, separator);
}
}
const wchar_t* messageLine = System::getMessage(0xCB);
@@ -1298,13 +1287,14 @@ namespace ipl {
mpDialogLayout->FindPaneByName("T_Header_body"));
s32 totalLines = lineCount + 1;
s32 lineIndex = 0;
const wchar_t* lineSeparator = L"\n";
if (lineIndex < totalLines) {
do {
const wchar_t* lineEnd = wcsstr(messageLine, L"\n");
while (lineIndex < totalLines) {
const wchar_t* lineEnd = wcsstr(messageLine, lineSeparator);
if (lineEnd == NULL) {
utility::layout::set_string(messageText, messageLine);
} else {
u32 lineLength = static_cast<u32>(lineEnd - messageLine);
s32 lineLength = lineEnd - messageLine;
wcsncpy(mCurrentTitleName, messageLine, lineLength);
mCurrentTitleName[lineLength] = L'\0';
utility::layout::set_string(messageText, mCurrentTitleName);
@@ -1320,7 +1310,7 @@ namespace ipl {
messageOffset -= bodyHeight;
++lineIndex;
} while (lineIndex < totalLines);
}
}
}
@@ -1344,20 +1334,14 @@ namespace ipl {
for (u32 titleIndex = 0; titleIndex < mTitleCount; ++titleIndex) {
utility::layout::set_string(titleText, mTitleNames[titleIndex]);
if (nandTitleIndex < mNandTitleCount && mTitleIds[titleIndex] == mNandTitleIds[nandTitleIndex]) {
GXColor gxActive;
writeFourFlagBytes(&gxActive.r, 0x34, 0xBE, 0xED, 0xFF);
nw4r::ut::Color activeColor;
writeFourFlagBytes(&activeColor.r, 0x34, 0xBE, 0xED, 0xFF);
++nandTitleIndex;
nw4r::ut::Color active0 = *reinterpret_cast<const nw4r::ut::Color*>(&gxActive);
setTitleRowColors(titleText,
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxActive)),
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxActive)));
setTitleRowColors(titleText, nw4r::ut::Color(activeColor), nw4r::ut::Color(activeColor));
} else {
GXColor gxInactive;
writeFourFlagBytes(&gxInactive.r, 0x64, 0x64, 0x64, 0xFF);
nw4r::ut::Color inactive0 = *reinterpret_cast<const nw4r::ut::Color*>(&gxInactive);
setTitleRowColors(titleText,
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxInactive)),
nw4r::ut::Color(*reinterpret_cast<const nw4r::ut::Color*>(&gxInactive)));
nw4r::ut::Color inactiveColor;
writeFourFlagBytes(&inactiveColor.r, 0x64, 0x64, 0x64, 0xFF);
setTitleRowColors(titleText, nw4r::ut::Color(inactiveColor), nw4r::ut::Color(inactiveColor));
}
nw4r::ut::Rect textRect = mpDialogLayout->getTextDrawRect("T_Letter");
@@ -1637,23 +1621,23 @@ namespace ipl {
switch (paneIndex) {
case 0:
animator = mpTitleLayout->getAnim(7);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 0);
mpSDChannelSelect->collectTitlesForMode(&mNandTitleRange.mByteSize, &mSDTitleRange.mByteSize,
mTitleIds, (char*)&mTitleNames[0][0], &mTitleCount, 0);
break;
case 1:
animator = mpTitleLayout->getAnim(10);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 1);
mpSDChannelSelect->collectTitlesForMode(&mNandTitleRange.mByteSize, &mSDTitleRange.mByteSize,
mTitleIds, (char*)&mTitleNames[0][0], &mTitleCount, 1);
break;
case 2:
animator = mpTitleLayout->getAnim(13);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 2);
mpSDChannelSelect->collectTitlesForMode(&mNandTitleRange.mByteSize, &mSDTitleRange.mByteSize,
mTitleIds, (char*)&mTitleNames[0][0], &mTitleCount, 2);
break;
case 3:
animator = mpTitleLayout->getAnim(16);
iplSDChannelSelect_813DDB74(mpSDChannelSelect, &mNandTitleRange, &mSDTitleRange,
mTitleIds, &mTitleNames[0][0], &mTitleCount, 3);
mpSDChannelSelect->collectTitlesForMode(&mNandTitleRange.mByteSize, &mSDTitleRange.mByteSize,
mTitleIds, (char*)&mTitleNames[0][0], &mTitleCount, 3);
break;
case 4:
animator = mpTitleLayout->getAnim(4);
@@ -1679,10 +1663,9 @@ namespace ipl {
mTitleListState.mSecondaryCount = 0;
mTitleListState.mpNames = mSDTitleIds;
mTitleListState.mNameCount = 0;
iplSDChannelSelect_813DB58C(mpSDChannelSelect,
&mTitleListState.mpTitles,
&mTitleListState.mpSecondaryTitles,
&mTitleListState.mpNames);
mpSDChannelSelect->enqueueCommandNotice((u32)&mTitleListState.mpTitles,
(u32)&mTitleListState.mpSecondaryTitles,
(u32)&mTitleListState.mpNames);
}
if (paneIndex == 4) {

View File

@@ -731,12 +731,8 @@ namespace ipl {
switch (OSGetTime() - mOperationStartTime < OS_TIMER_CLOCK) {
default:
return;
case false:
break;
}
setDialogMessage(1, 0);
int result = mpSDWorker->get_async_result();
setDialogMessage(1, 0);
int result = mpSDWorker->get_async_result();
if (result == NandSDWorker::RESULT_OK ||
result == NandSDWorker::RESULT_SD_APP_LOC_NOT_FOUND) {
for (int channelIndex = 0; channelIndex < mPageCount * 12;
@@ -784,15 +780,11 @@ namespace ipl {
enqueueLoadNotice();
}
} else {
u32 titleId;
u32 titleIndex;
int channelIndex;
int channelCount;
channelCount = 0;
channelIndex = 0;
titleIndex = 0;
int channelCount = 0;
int channelIndex = 0;
u32 titleIndex = 0;
for (; titleIndex < mSDTitleCount; ++titleIndex) {
titleId = mpSDTitleInfo[titleIndex].titleId;
u32 titleId = mpSDTitleInfo[titleIndex].titleId;
if (titleId != 0x48415A41) {
++channelCount;
mpChannelTitleIds[channelIndex++] = titleId;
@@ -814,6 +806,10 @@ namespace ipl {
mbSDCardBroken = true;
}
refreshAfterSDTitleList();
break;
case true:
return;
}
}
void SDChannelSelect::handleSDMountComplete() {
@@ -1702,7 +1698,7 @@ namespace ipl {
if (mState == 2 && !mpLayout->isPlaying(0)) {
SDButton* button = static_cast<SDButton*>(System::getSceneManager()->getScene(0x24));
if (button != NULL) {
button->setEventHandler(mpButtonEventHandler);
button->setEventHandler((::gui::EventHandler*)button, mpButtonEventHandler);
mState = 3;
if (mCurrentPage > 0) {
button->initArrowAppearance(1, true);
@@ -2264,7 +2260,7 @@ namespace ipl {
mbRightArrowVisible = false;
}
button->setEventHandler(mpButtonEventHandler);
button->setEventHandler((::gui::EventHandler*)button, mpButtonEventHandler);
TVRCManager::getHandle()->setEnable(TRUE);
snd::getSystem()->startBGM("WIPL_BGM_MENU");
clearNoticeQueue();
@@ -2646,7 +2642,7 @@ namespace ipl {
button->animation(SDButton::IDANIM_ARROW_RIGHT_DISAPPEAR);
}
button->disableBtn();
button->setEventHandler(NULL);
button->setEventHandler((::gui::EventHandler*)button, NULL);
mCurrentChannelIndex = index;
mState = 5;
snd::getSystem()->startSE("WIPL_SE_BT_PUSH");
@@ -3471,53 +3467,49 @@ namespace ipl {
}
{
if (mpScene->mState == 1) {
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_OUT) {
if (con != NULL) {
if (con->downTrg(0x00100800)) {
SDButton* button = static_cast<SDButton*>(
System::getSceneManager()->getScene(0x24));
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_HELP]) == 0) {
mpScene->mOperationResult = 0;
mpScene->mState = 26;
button->animation(4);
snd::getSystem()->startSE("WIPL_SE_DECIDE");
return;
}
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_WII_MENU]) == 0) {
button->setEventHandler(NULL);
mpScene->mState = 4;
snd::getSystem()->startSE("WIPL_SE_DECIDE");
return;
}
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_ARROW_LEFT]) == 0 &&
mpScene->mCurrentPage > 0) {
button->animation(7);
mpScene->setStateAndPlaySelectSound(8);
return;
}
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_ARROW_RIGHT]) == 0 &&
mpScene->mCurrentPage < mpScene->mPageCount - 1) {
button->animation(8);
mpScene->setStateAndPlaySelectSound(9);
}
} else {
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_OUT) {
if (con != NULL) {
if (con->downTrg(0x00100800)) {
SDButton* button = static_cast<SDButton*>(
System::getSceneManager()->getScene(0x24));
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_HELP]) == 0) {
mpScene->mOperationResult = 0;
mpScene->mState = 26;
button->animation(4);
snd::getSystem()->startSE("WIPL_SE_DECIDE");
return;
}
} else {
return;
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_WII_MENU]) == 0) {
button->setEventHandler((::gui::EventHandler*)button, NULL);
mpScene->mState = 4;
snd::getSystem()->startSE("WIPL_SE_DECIDE");
return;
}
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_ARROW_LEFT]) == 0 &&
mpScene->mCurrentPage > 0) {
button->animation(7);
mpScene->setStateAndPlaySelectSound(8);
return;
}
if (strcmp(paneName,
SDButton::smButtonName[SDButton::BTN_ARROW_RIGHT]) == 0 &&
mpScene->mCurrentPage < mpScene->mPageCount - 1) {
button->animation(8);
mpScene->setStateAndPlaySelectSound(9);
}
}
}
}
}
}
void SDChannelSelect::startResetting() {
snd::getSystem()->resetAllSound();
clearCommandQueue();

View File

@@ -282,7 +282,7 @@ FaderSceneCommand SDChannelTitle::calcFadein() {
if (!mpFade->isPlaying()) {
iplSDChannelTitle_playBannerIntro(this);
SDButton* button = static_cast<SDButton*>(System::getScene(0x24));
button->setEventHandler(mpButtonEventHandler);
button->setEventHandler((::gui::EventHandler*)button, mpButtonEventHandler);
button->animation(13);
button->animation(14);
mState = 1;
@@ -344,7 +344,7 @@ void SDChannelTitle::initCalcFadeout() {
button->animation(15);
button->animation(16);
}
button->setEventHandler(NULL);
button->setEventHandler((::gui::EventHandler*)button, NULL);
}
FaderSceneCommand SDChannelTitle::calcFadeout() {
@@ -736,7 +736,8 @@ extern "C" void iplSDChannelTitle_startCopyProgress(SDChannelTitle* scene) {
if (channel->mStateFlags == 3) {
scene->mState = 26;
scene->mErrorMessage = 0xaf;
} else if (scene->mpChannelSelect->enqueueChannelNotice(scene->mTitleId, reinterpret_cast<u32>(&scene->mTitleRange))) {
} else if (scene->mpChannelSelect->enqueueChannelNotice(0, static_cast<u32>(scene->mTitleId >> 32),
static_cast<u32>(scene->mTitleId), reinterpret_cast<u32>(&scene->mTitleRange))) {
scene->mState = 20;
} else {
scene->mState = 26;
@@ -825,7 +826,8 @@ extern "C" void iplSDChannelTitle_updateCopyStart(SDChannelTitle* scene) {
ESTitleId temporaryTitle = SCGetTmpTitleID();
if (temporaryTitle && scene->mTitleId != temporaryTitle) {
if (System::isReceiveScheduleStopped()) {
if (scene->mpChannelSelect->enqueueStateNotice(temporaryTitle, 1)) {
if (scene->mpChannelSelect->enqueueStateNotice(0, static_cast<u32>(temporaryTitle >> 32),
static_cast<u32>(temporaryTitle), 1)) {
scene->mState = 16;
} else {
scene->mState = 26;
@@ -1354,8 +1356,7 @@ extern "C" void iplSDChannelTitle_flushSaveBeforeExit(SDChannelTitle* scene, int
System::getSaveData()->pushTitleCache(scene->mTitleId);
}
System::getSaveData()->getSDPrevPage() = scene->mPage;
EGG::Heap* saveHeap = System::getMem2App();
scene->mpSaveFile = System::getSaveData()->flushAsync(saveHeap);
scene->mpSaveFile = System::getSaveData()->flushAsync(System::getMem2App());
__WPADReconnect(TRUE);
}

View File

@@ -1647,10 +1647,7 @@ s32 ATERMRunConfigProtocol(void) {
SONtoHs(option->length);
optionValue = option->value;
}
if (optionValue == NULL || optionType != 0x101) {
break;
}
{
if (optionValue != NULL && optionType == 0x101) {
AtermProgress progress;
u32 authenticationTime = (u32)(OSGetTime() /
(__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
@@ -1903,7 +1900,7 @@ int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 ke
u64 passBase = (u64)(s64)blockCount * (u64)(s64)pass;
u8* stateBytes = block.bytes;
outputBlock = (u8*)(destination + blockOffset / 2);
outputBlock = destinationBytes + blockOffset;
memcpy(stateBytes + 8, outputBlock, 8);
ATERMAesEncryptBlock(expandedKey, rounds, stateBytes, stateBytes);
counter.value = (u64)(s64)blockIndex + passBase;

View File

@@ -30,10 +30,12 @@ namespace ipl {
namespace scene {
extern "C" MEMAllocator sRakuAllocator;
MEMAllocator sRakuAllocator;
extern "C" RakuProgress sRakuStatus;
RakuProgress sRakuStatus;
extern "C" RakuConfiguration sRakuConfiguration;
RakuConfiguration sRakuConfiguration;
struct RakuStatus {
RakuProgress progress;
RakuConfiguration configuration;
};
extern "C" RakuStatus sRakuStatus;
RakuStatus sRakuStatus;
extern "C" OSMessageQueue sRakuMsgQueue;
OSMessageQueue sRakuMsgQueue;
static u32 startTimeHigh = 0;
@@ -59,7 +61,8 @@ public:
virtual ~RakuRakuThread();
virtual void* Run();
virtual void unk_0x2C() = 0;
static void syncRakuProgress(RakuProgress* progress);
void syncRakuProgress();
static void progressCallback(RakuProgress* progress);
void destroy();
int start();
int getState();
@@ -76,15 +79,19 @@ private:
MEMHeapHandle mHeap;
};
void RakuRakuThread::syncRakuProgress(RakuProgress* progress) {
void RakuRakuThread::syncRakuProgress() {
BOOL interrupts = OSDisableInterrupts();
sRakuStatus = *progress;
sRakuStatus.progress = *(RakuProgress*)this;
OSTime time = OSGetTime();
startTimeHigh = time >> 32;
startTimeLow = time;
OSRestoreInterrupts(interrupts);
}
void RakuRakuThread::progressCallback(RakuProgress* progress) {
((RakuRakuThread*)progress)->syncRakuProgress();
}
RakuRakuThread::RakuRakuThread(EGG::Heap* heap) : utility::ut_thread() {
u32 version = ATERMi_ApConfigGetVersion();
if (((version >> 12) & 15) * 10 + ((version >> 8) & 15) != 1) {
@@ -141,14 +148,14 @@ int RakuRakuThread::start() {
mPriority = OSGetThreadPriority(OSGetCurrentThread()) - 1;
active = true;
mFinished = 0;
memset(&sRakuConfiguration, 0, sizeof(RakuConfiguration));
memset(&sRakuStatus, 0, sizeof(RakuProgress));
memset(&sRakuStatus.configuration, 0, sizeof(RakuConfiguration));
memset(&sRakuStatus.progress, 0, sizeof(RakuProgress));
SOLibraryConfig socketConfig;
socketConfig.alloc = RakuSocketAlloc;
socketConfig.free = RakuSocketFree;
SOInit(&socketConfig);
ATERMi_ApConfigStart(mPriority, 200,
syncRakuProgress,
progressCallback,
RakuAtermAlloc, RakuAtermFree, 4096);
if (!mRunning) {
mRunning = 1;
@@ -200,7 +207,7 @@ int RakuRakuThread::getState() {
return 0;
}
BOOL interrupts = OSDisableInterrupts();
switch (sRakuStatus.state) {
switch (sRakuStatus.progress.state) {
case 1: displayState = 1; break;
case 2: displayState = 2; break;
case 3: displayState = 2; break;
@@ -222,30 +229,6 @@ int RakuRakuThread::cancel() {
return OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
}
inline void copyRakuPrivacy(NCDApConfig* config, const RakuConfiguration* settings) {
if (settings->security == 1) {
config->privacy.mode = 1;
config->privacy.wep40.keyId = settings->keyId;
for (int index = 0; index < 4; ++index) {
memcpy(config->privacy.wep40.key[index], settings->wepKeys[index], 5);
}
} else if (settings->security == 2) {
config->privacy.mode = 2;
config->privacy.wep104.keyId = settings->keyId;
for (int index = 0; index < 4; ++index) {
memcpy(config->privacy.wep104.key[index], settings->wepKeys[index], 13);
}
} else if (settings->security == 4) {
config->privacy.mode = 4;
memcpy(config->privacy.tkip.key, settings->passphrase, 64);
config->privacy.tkip.keyLen = strlen(settings->passphrase);
} else if (settings->security == 5) {
config->privacy.mode = 6;
memcpy(config->privacy.aes.key, settings->passphrase, 64);
config->privacy.aes.keyLen = strlen(settings->passphrase);
}
}
int RakuRakuThread::finish(NCDApConfig* config, int* result) {
if (!active) {
if (result != NULL) {
@@ -253,29 +236,49 @@ int RakuRakuThread::finish(NCDApConfig* config, int* result) {
}
return 1;
}
s32 state = sRakuStatus.state;
if ((u32)(state - 6) <= 1) {
if (!mFinished) {
if (state == 6) {
ATERMi_ApConfigGetResult(&sRakuConfiguration);
printInfo();
}
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
return 0;
}
SOFinish();
active = false;
destroy();
} else {
s32 state = sRakuStatus.progress.state;
if ((u32)(state - 6) > 1) {
return 0;
}
if (!mFinished) {
if (state == 6) {
ATERMi_ApConfigGetResult(&sRakuStatus.configuration);
printInfo();
}
OSSendMessage(&sRakuMsgQueue, (OSMessage)1, 0);
return 0;
}
SOFinish();
active = false;
destroy();
if (config != NULL) {
memcpy(config->ssid, sRakuConfiguration.ssid, 32);
config->ssidLength = strlen(sRakuConfiguration.ssid);
copyRakuPrivacy(config, &sRakuConfiguration);
RakuConfiguration* settings = &sRakuStatus.configuration;
memcpy(config->ssid, settings->ssid, 32);
config->ssidLength = strlen(settings->ssid);
if (settings->security == 1) {
config->privacy.mode = 1;
config->privacy.wep40.keyId = settings->keyId;
for (int index = 0; index < 4; ++index) {
memcpy(config->privacy.wep40.key[index], settings->wepKeys[index], 5);
}
} else if (settings->security == 2) {
config->privacy.mode = 2;
config->privacy.wep104.keyId = settings->keyId;
for (int index = 0; index < 4; ++index) {
memcpy(config->privacy.wep104.key[index], settings->wepKeys[index], 13);
}
} else if (settings->security == 4) {
config->privacy.mode = 4;
memcpy(config->privacy.tkip.key, settings->passphrase, 64);
config->privacy.tkip.keyLen = strlen(settings->passphrase);
} else if (settings->security == 5) {
config->privacy.mode = 6;
memcpy(config->privacy.aes.key, settings->passphrase, 64);
config->privacy.aes.keyLen = strlen(settings->passphrase);
}
}
if (result != NULL) {
*result = sRakuStatus.result;
*result = sRakuStatus.progress.result;
}
return 1;
}

View File

@@ -15,10 +15,10 @@ namespace ipl {
// clang-format on
SettingButton::SettingButton(EGG::Heap* heap, int arg) : FaderSceneBase(heap), ::gui::EventHandler() {
mCmdCapacity = 64;
mCmdCount = 0;
mCmdReadIdx = 0;
mCmdWriteIdx = 0;
unk_0x264 = 64;
unk_0x268 = 0;
unk_0x26C = 0;
unk_0x270 = 0;
mSettingArg = arg;
mpLayout = NULL;
mpLayoutFile = NULL;
@@ -81,8 +81,8 @@ namespace ipl {
FaderSceneCommand SettingButton::calcNormal() {
if (!mpLayout->getAnim(ANIM_ALPHA_IN)->isPlaying() && !mpLayout->getAnim(ANIM_ALPHA_OUT)->isPlaying() &&
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && mCmdCount != 0) {
CmdEntry unk = mCmdQueue[mCmdReadIdx];
!mpLayout->getAnim(ANIM_BTN_FLASH)->isPlaying() && unk_0x268 != 0) {
Unk unk = unk_0x64[unk_0x26C];
switch (unk.command) {
case CMD_SHOW_BTN: {
showBtn();
@@ -98,11 +98,11 @@ namespace ipl {
}
}
if (mCmdCount != 0) {
if (++mCmdReadIdx >= mCmdCapacity) {
mCmdReadIdx = 0;
if (unk_0x268 != 0) {
if (++unk_0x26C >= unk_0x264) {
unk_0x26C = 0;
}
mCmdCount--;
unk_0x268--;
}
}
@@ -225,16 +225,16 @@ namespace ipl {
}
void SettingButton::reserve(int command, u32 msgId) {
if (mCmdCapacity != mCmdCount) {
int unk = mCmdWriteIdx;
mCmdQueue[unk].command = command;
mCmdQueue[unk].msgID = msgId;
mCmdWriteIdx++;
if (unk_0x264 != unk_0x268) {
int unk = unk_0x270;
unk_0x64[unk].command = command;
unk_0x64[unk].msgID = msgId;
unk_0x270++;
if (mCmdWriteIdx >= mCmdCapacity) {
mCmdWriteIdx = 0;
if (unk_0x270 >= unk_0x264) {
unk_0x270 = 0;
}
mCmdCount++;
unk_0x268++;
}
}

View File

@@ -914,8 +914,7 @@ void CArGBAOdh::cdj_c_setQuantizationTable(SArCDJ_OdhMaster* master, u32 quality
for (i = 0; i < 64; i++) {
temp = ((const u16*)gArAANScales)[i];
temp *= quantization[table * 64 + i];
temp = 0x4000000 / temp;
master->quantizationTables[table * 64 + i] = temp;
master->quantizationTables[table * 64 + i] = 0x4000000 / temp;
}
}
}
@@ -1194,9 +1193,8 @@ s32 CArGBAOdh::huffmanCoder(u16* coefficientInput, SArCDJ_HuffmanRequest* reques
}
}
code = request->dcTable[bitCount];
magnitude = (difference & ((1 << bitCount) - 1)) | ((code & 0xFFFFFF) << bitCount);
code = (s32)code >> 24;
if (EmitBit(magnitude, code + bitCount, request) == ODH_ERROR_80000004) {
if (EmitBit(((code & 0xFFFFFF) << bitCount) | (difference & ((1 << bitCount) - 1)), ((s32)code >> 24) + bitCount,
request) == ODH_ERROR_80000004) {
return ODH_ERROR_80000004;
}
@@ -1225,9 +1223,8 @@ s32 CArGBAOdh::huffmanCoder(u16* coefficientInput, SArCDJ_HuffmanRequest* reques
}
}
code = request->acTable[bitCount];
magnitude = (runLength & ((1 << bitCount) - 1)) | ((code & 0xFFFFFF) << bitCount);
code = (s32)code >> 24;
if (EmitBit(magnitude, code + bitCount, request) == ODH_ERROR_80000004) {
if (EmitBit(((code & 0xFFFFFF) << bitCount) | (runLength & ((1 << bitCount) - 1)), ((s32)code >> 24) + bitCount,
request) == ODH_ERROR_80000004) {
return ODH_ERROR_80000004;
}
@@ -1246,9 +1243,8 @@ s32 CArGBAOdh::huffmanCoder(u16* coefficientInput, SArCDJ_HuffmanRequest* reques
}
}
code = request->dcTable[bitCount];
magnitude = (value & ((1 << bitCount) - 1)) | ((code & 0xFFFFFF) << bitCount);
code = (s32)code >> 24;
if (EmitBit(magnitude, code + bitCount, request) == ODH_ERROR_80000004) {
if (EmitBit(((code & 0xFFFFFF) << bitCount) | (value & ((1 << bitCount) - 1)), ((s32)code >> 24) + bitCount,
request) == ODH_ERROR_80000004) {
return ODH_ERROR_80000004;
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1490,259 +1490,3 @@ Final authority lines:
[libs/RVL_SDK/src/kpad/KPAD] instruction-exact functions: 21/29
GATE PASS
```
# Round 6: HIGH, fresh structural investigation
Fresh baseline after building all owned objects; pools address57/57, SD101/101, KPAD0/0 identical. Data already100% in all three; no unmatched data-name gap to rename. Prior medium source trials were restored, so this round checks different local types, scopes, inline helper boundaries and operand lifetimes.
## src/scene/address/iplAddressEdit create__Q33ipl5scene11AddressEditFv
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (19, 323) structural/positional differences; instructions 820/820
Remote source equals freshly built baseline; still open 97.44634%. Structural diagnosis: 820 instructions and identical frame; literal-base/boardFile saved-register inversion dominates. Inspect structural differences before hoisting declarations: constructor inline boundaries, vector initialization and switch dispatch.
- ordinary TextBalloon allocation with separately declared position: (49, 803) structural/positional; instructions 804/820; restored.
- retain event objects through EventHandler base views: (19, 323) structural/positional; instructions 820/820; restored.
- keep animation variable local to each mode arm: (19, 323) structural/positional; instructions 820/820; restored.
- ordinary balloon new with a constructor argument vector temporary: (37, 803) structural/positional; instructions 808/820; candidate kept.
- ordinary balloon new with named margin locals before allocation: (23, 331) structural/positional; instructions 818/820; restored.
- mutable text-buffer views through mode initialization: (19, 323) structural/positional; instructions 820/820; restored.
## src/scene/address/iplAddressEdit get_friendinfo__Q33ipl5scene11AddressEditFv
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (10, 68) structural/positional differences; instructions 82/84
Remote source equals freshly built baseline; still open 88.03571%. Structural diagnosis: Frame0x440 versus target0x450 follows missing two held text addresses; locals are actual arrays. Inspect memcpy argument alias class and UTF16 helper lifetime before declaration coloring.
Frame diagnosis correction from disasm_fn: target frame is0x420, source also0x420;0x148/0x150 are code extents, not frame sizes. No extent overlap.
- explicit first-element addresses for both text buffers: (10, 68) structural/positional; instructions 82/84; restored.
- retain complete text array pointers before pane calls: (10, 68) structural/positional; instructions 82/84; restored.
- use mutable views of copied friend and string fields: (10, 39) structural/positional; instructions 83/84; restored.
## src/scene/address/iplAddressEdit update_friendinfo__Q33ipl5scene11AddressEditFv
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (2, 2) structural/positional differences; instructions 38/38
Remote source equals freshly built baseline; still open 99.42105%. Structural diagnosis: Same frame and38 instructions; source/destination addi ordering at memcpy is the only difference. Check typed memcpy argument views before declaration search.
Corrected prior-round diagnosis: relocation-resolved disasm proves the differing argument pair is wcsncpy(name), not memcpy(CreateID). Prior memcpy-only trials did not touch this mismatch.
- name copy reads through a const String view: (2, 2) structural/positional; instructions 38/38; restored.
- evaluate named source text before destination text: (2, 2) structural/positional; instructions 38/38; restored.
- typed destination wchar array rather than source array decay: (2, 2) structural/positional; instructions 38/38; restored.
## src/scene/address/iplAddressEdit set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (1, 30) structural/positional differences; instructions 76/75
Remote source equals freshly built baseline; still open 98.666664%. Structural diagnosis: 76/75 instructions, extra safe default message initialization. Retain defined behavior for unsupported NWC24 errors. Test exhaustive known-error branch layout without undefined/uninitialized state.
- normalize unrecognized errors to the existing server fallback before dispatch: (8, 37) structural/positional; instructions 83/75; restored.
- initialize the safe fallback in the explicit default branch: (4, 22) structural/positional; instructions 77/75; restored.
- compute the supported network fallback directly with a boolean choice: (18, 47) structural/positional; instructions 65/75; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect create__Q33ipl5scene15SDChannelSelectFv
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (4, 39) structural/positional differences; instructions 145/146
Remote source equals freshly built baseline; still open 97.73972%. Structural diagnosis: 145/146; identical0x20 frame, target keeps BS2 global reload at loop entry. Compare basic block placement rather than tick arithmetic; all heap construction instructions align.
- poll using equality-first completion and a continue arm: (9, 40) structural/positional; instructions 145/146; restored.
- inline polling-state helper returning manager readiness: (4, 39) structural/positional; instructions 145/146; restored.
- inline update helper separates manager argument from polling getter: (4, 39) structural/positional; instructions 145/146; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (4, 143) structural/positional differences; instructions 170/171
Remote source equals freshly built baseline; still open 99.15205%. Structural diagnosis: 170/171, beq-plus-unconditional-branch result dispatch and error-compaction register order. Build branch arms from parsed brace boundaries, retaining common refresh in place.
Corrected prior-round diagnosis: relocation-resolved target confirms the extra beq8/unconditional-return branch is the OSGetTime delay gate, not async-result dispatch. Result tests already match.
- switch the elapsed-time boolean into the normal continuation: (0, 6) structural/positional; instructions 171/171; candidate kept.
- declare scanned title before compaction counters: (0, 6) structural/positional; instructions 171/171; candidate kept.
- compaction count uses the same unsigned type as title count: (1, 6) structural/positional; instructions 171/171; restored.
- signed SDK count keeps native comparison width: (0, 6) structural/positional; instructions 171/171; restored.
- write compacted title before advancing accepted count: (0, 6) structural/positional; instructions 171/171; restored.
- separate destination-index advancement from the title store: (0, 6) structural/positional; instructions 171/171; restored.
- Register-only declaration search on compaction title/count/index block: declaration block: | u32 titleId; | int channelCount = 0; | int channelIndex = 0; | u32 titleIndex = 0; | start (0, 6) | improved (0, 4) | best (0, 4) after 16 builds; kept in source: | u32 titleId; | u32 titleIndex = 0; | int channelIndex = 0; | int channelCount = 0; |
- separate compaction declarations from zero assignments in target order: (0, 0) structural/positional; instructions 171/171; candidate kept.
Exact handleSDTitleListResult: corrected the time-gate dispatch, then separated compaction declarations from assignments. Register search found the type/index/count order; preserving count/index/title zero assignments removed all6 differences. ctxdiff171/171 diffs0; exact-name objdiff100; all-unit quick gatePASS, data100%, pools identical,0 regressions/forbidden/readability. SD121 ->122; code28728 ->29412.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (2, 4) structural/positional differences; instructions 101/101
After local exact commit160e985a, remote duplicate checks compare origin/main source against original round baseline0c06b01c, not modified HEAD. origin/main5518cb16 has no owned-unit diff.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (2, 4) structural/positional differences; instructions 101/101
Remote source equals freshly built baseline; still open 97.81188%. Structural diagnosis: 101/101 and same frame; compare count-store versus requirement load ordering, then native signed arithmetic and legal signed counterpart views.
- native signed intermediate for bounded accepted-title count: (2, 4) structural/positional; instructions 101/101; restored.
- count uses a legal signed counterpart view for alias analysis: (2, 4) structural/positional; instructions 101/101; restored.
- inline usage predicate with scalar input values: (24, 40) structural/positional; instructions 104/101; restored.
- inline accepted-count update isolates the store boundary: (2, 4) structural/positional; instructions 101/101; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main 5518cb16fda3091c727d974aacf477a2cf89b74a. Initial assembly diagnosis: (2, 4) structural/positional differences; instructions 102/102
Remote source equals freshly built baseline; still open 97.833336%. Structural diagnosis: 102/102. Same post-memcpy count/threshold scheduling as forward scan, confirmed by instruction diff; compare native intermediate type, inline store helper and a fixed-size requirement view.
- native signed next-count local in reverse scan: (2, 4) structural/positional; instructions 102/102; restored.
- inline count update using an output reference: (2, 4) structural/positional; instructions 102/102; restored.
- two-element readonly usage view in reverse scan: (2, 4) structural/positional; instructions 102/102; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main bc303bc36e5ea826ef9da39d6e9c9ed9c79e4ba9. Initial assembly diagnosis: (2, 22) structural/positional differences; instructions 126/126
Remote source equals freshly built baseline; still open 97.29365%. Structural diagnosis: 126/126; u64 titleId allocated after page/order counters causes saved-register inversion; count/store scheduling also differs. Hoist the real title ID separately before trying declaration coloring.
- declare loaded title ID before traversal counters: (2, 7) structural/positional; instructions 126/126; restored.
- explicit page-row view when looking up the channel entry: (2, 22) structural/positional; instructions 126/126; restored.
- native signed next-count local in page-ordered scan: (2, 22) structural/positional; instructions 126/126; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl
Fetch origin/main bc303bc36e5ea826ef9da39d6e9c9ed9c79e4ba9. Initial assembly diagnosis: (8, 16) structural/positional differences; instructions 361/361
Remote source equals freshly built baseline; still open 97.55125%. Structural diagnosis: 361/361, four repeated count/store/threshold windows; no string or data difference. Test real intermediate width and mutable/aggregate read views, then reject any non-exact result.
- native next-count locals for all special-channel append sites: (8, 16) structural/positional; instructions 361/361; restored.
- fixed-size readonly second-usage view for special title scans: (8, 16) structural/positional; instructions 361/361; restored.
- inline output-reference increments at special-channel boundaries: (8, 16) structural/positional; instructions 361/361; restored.
Expanded volatility proof audit includes adjacent stfs/lfs and stfd/lfd, as well as stw/lwz; same-address store/reload pairs []. No unjustified volatile added.
## src/scene/sdChannelSelect/iplSDChannelSelect flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv
Fetch origin/main 9077ef8c7a1ab5bf7605f439ed621214b97999e3. Initial assembly diagnosis: (2, 2) structural/positional differences; instructions 35/35
Remote source equals freshly built baseline; still open 99.65714%. Structural diagnosis: 35/35. Target obtains Mem2App before SaveData receiver; compare readonly receiver helper and combined heap-before-flag lifetimes, no pointer-global mutation or volatility.
- readonly save-manager input at inline flush boundary: (2, 2) structural/positional; instructions 35/35; restored.
- heap declaration precedes the flag update with assignment at flush: (2, 2) structural/positional; instructions 35/35; restored.
- application heap retained across the animation initialization: (15, 29) structural/positional; instructions 36/35; restored.
## src/scene/sdChannelSelect/iplSDChannelSelect setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj
Fetch origin/main 2050ad7616acfcb7752e5a6da8b7f44f22c6cafd. Initial assembly diagnosis: (23, 68) structural/positional differences; instructions 233/233
Remote source equals freshly built baseline; still open 93.4721%. Structural diagnosis: 233/233; matrix-call inputs are register differences, but framebuffer width/height conversion order and widthScale lifetime change scheduling. Target keeps projection width in f29, ours keeps its quotient there; remove quotient local first.
- use the projection quotient directly in horizontal scissor arithmetic: (36, 71) structural/positional; instructions 233/233; restored.
- compute framebuffer horizontal conversion before vertical arithmetic: (29, 64) structural/positional; instructions 233/233; restored.
- keep framebuffer dimensions in unsigned arithmetic-width locals: (23, 68) structural/positional; instructions 233/233; restored.
## libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos
Fetch origin/main 2050ad7616acfcb7752e5a6da8b7f44f22c6cafd. Initial assembly diagnosis: (0, 9) structural/positional differences; instructions 19/19
Remote source equals freshly built baseline; still open 96.57895%. Structural diagnosis: Leaf19/19, no frame/branches. Target coalesces double correction in f0 and uses coefficient-first aspect multiplication. Combine those operand choices before declaration coloring.
- coefficient-first aspect and inline double correction product: (0, 10) structural/positional; instructions 19/19; restored.
- reuse each calibration coefficient in its own product local: build failed e/private/bte -DNDEBUG=1 -DTARGET_RVL -ipa file -fp_contract off -lang=c -MMD -c libs/RVL_SDK/src/kpad/KPAD.c -o build/43U/src/libs/RVL_SDK/src/kpad && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d build/43U/src/libs/RVL_SDK/src/kpad/KPAD.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\kpad\KPAD.c # ------------------------------------- # 360: f32 x = src->x * halfHeight; # Error: ^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
- separate declarations then reuse calibrated scalar products: (0, 14) structural/positional; instructions 19/19; candidate kept.
- give the shared aspect coefficient its own scalar lifetime: (0, 13) structural/positional; instructions 19/19; candidate kept.
- Register-only last, reused-coefficient declaration search: declaration block: | f64 scaled; | f32 height; | f32 halfHeight; | f32 x; | f32 y; | f32 aspect; | start (0, 13) | improved (0, 11) | best (0, 11) after 40 builds; kept in source: | f32 aspect; | f32 height; | f32 halfHeight; | f32 x; | f32 y; | f64 scaled; |
## libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight
Fetch origin/main 2050ad7616acfcb7752e5a6da8b7f44f22c6cafd. Initial assembly diagnosis: (0, 7) structural/positional differences; instructions 52/52
Remote source equals freshly built baseline; still open 99.23077%. Structural diagnosis: 52/52,0 normalized differences. Base literal r4/r3 and zero/squared-height register coloring remain. Separate base and channel adjustment and compare min branch before declaration search.
- initialize base state then apply the channel index: (4, 9) structural/positional; instructions 52/52; restored.
- state address initialized in the leading declaration block: (0, 7) structural/positional; instructions 52/52; restored.
- select the limiting extent with an explicit comparison arm: (2, 9) structural/positional; instructions 52/52; restored.
- native int channel formal with a translation-unit-only declaration guard: (0, 7) structural/positional; instructions 52/52; restored.
## libs/RVL_SDK/src/kpad/KPAD calc_acc_horizon
Fetch origin/main 2050ad7616acfcb7752e5a6da8b7f44f22c6cafd. Initial assembly diagnosis: (2, 35) structural/positional differences; instructions 101/101
Remote source equals freshly built baseline; still open 97.27723%. Structural diagnosis: 101/101; raw .long floating compares inflate normalized score, but geometry math and branch targets align. Replace pairs of flattened scalar locals by meaningful Vec2 intermediates, preserving operation order.
- group normalized acceleration components in a Vec2 local: (28, 91) structural/positional; instructions 105/101; restored.
- group the smoothed horizon candidate in a Vec2 local: (23, 77) structural/positional; instructions 97/101; restored.
- group normalized output axis components in a Vec2 local: (23, 78) structural/positional; instructions 103/101; restored.
## libs/RVL_SDK/src/kpad/KPAD read_kpad_acc
Fetch origin/main 2050ad7616acfcb7752e5a6da8b7f44f22c6cafd. Initial assembly diagnosis: (16, 66) structural/positional differences; instructions 400/400
Remote source equals freshly built baseline; still open 98.15%. Structural diagnosis: 400/400; clamp/smoothing inline helper boundaries determine FP temporaries. Test parameter order and a scalar-only smoothing helper, rather than merely reordering caller vector declarations.
Structural correction before helpers: ctxdiff also shows two opposite error/device/format branch forms at206..212; isolate these before FP temporary experiments.
- separate error/device guards and switch the two extension formats: (15, 63) structural/positional; instructions 400/400; candidate kept.
- keep each accepted format as a distinct switch break arm: (15, 63) structural/positional; instructions 400/400; candidate kept.
- switch the accepted-format boolean with default return first: (22, 230) structural/positional; instructions 404/400; candidate kept.
- single-format switch only when the primary format is absent: (12, 60) structural/positional; instructions 400/400; candidate kept.
- reuse the smoothing magnitude local through its absolute-value branch: (63, 302) structural/positional; instructions 394/400; restored.
- declare smoothing magnitude before signed delta then assign in original order: (7, 25) structural/positional; instructions 400/400; kept.
- assign smoothing magnitude directly in both sign branches: (1, 1) structural/positional; instructions 400/400; kept.
- preserve unsigned comparison in the fallback format switch: (1, 1) structural/positional; instructions 400/400; restored.
- boolean fallback-format dispatch keeps the comparison unsigned: (12, 197) structural/positional; instructions 403/400; restored.
- two explicit accepted-format branches share the extension block: (10, 194) structural/positional; instructions 399/400; restored.
- unsigned SDK-format case constant in the fallback switch: (1, 1) structural/positional; instructions 400/400; restored.
- byte-relative fallback-format switch: (10, 198) structural/positional; instructions 401/400; restored.
- accept either extension format through a single-pass block: (10, 194) structural/positional; instructions 399/400; restored.
- place extension acceleration in the positive accepted-format branch: (12, 197) structural/positional; instructions 399/400; restored.
- explicit unsupported-format else returns from extension branch: (12, 197) structural/positional; instructions 399/400; restored.
- native unsigned switch discriminant for the byte format: (1, 1) structural/positional; instructions 400/400; restored.
read_kpad_acc best partial400/400 differs only instruction210: cmpwi r0,5 versus target cmplwi r0,5. All60 original FP differences removed by declaring magnitude before delta and explicit sign branches; separate error/device guards plus nested format switch fixed branch form. Unsigned casts, case constant, positive-if/else and single-pass accepted-format alternatives did not remove the final comparator difference. Exact-only policy: restored partial source; reproducible candidate saved /tmp/fz16r6.readacc.near.c, not committed.
## libs/RVL_SDK/src/kpad/KPAD select_1obj_first
Fetch origin/main c1183780c2b53e044f91775b29b580d306e4423e. Initial assembly diagnosis: (2, 26) structural/positional differences; instructions 109/109
Remote source equals freshly built baseline; still open 98.348625%. Structural diagnosis: 109/109, source/target branch and frame align; register/operand differences reside in geometry scalar setup and paired candidate coordinates. Compare a reused tangent basis and scalar candidate variables before declaration search.
- separate all seven geometry and traversal declarations from assignments: (2, 26) structural/positional; instructions 109/109; candidate kept.
- declare candidate vectors before loading their scalar center coordinates: (2, 26) structural/positional; instructions 109/109; candidate kept.
- treat the candidate-array boundary as a readonly object pointer: (2, 26) structural/positional; instructions 109/109; restored.
- Register-only last, separated traversal/candidate block search: declaration block: | KPADDPDObject* object; | KPADDPDObject* end; | f32 scale; | f32 productX; | f32 productY; | f32 offsetX; | f32 offsetY; | start (2, 26) | best (2, 26) after 52 builds; source restored; best order was: | KPADDPDObject* object; | KPADDPDObject* end; | f32 scale; | f32 productX; | f32 productY; | f32 offsetX; | f32 offsetY; |
- Register-only last, separated traversal/candidate block search: declaration block: | Vec2 leftPosition; | Vec2 rightPosition; | f32 x; | f32 y; | start (2, 26) | improved (2, 24) | best (2, 24) after 16 builds; kept in source: | Vec2 leftPosition; | f32 y; | f32 x; | Vec2 rightPosition; |
Verified frame/extent audit (authoritative corrections to any earlier guessed frame):
create__Q33ipl5scene11AddressEditFv: extent 0x414..0x10e4 <= next 0x10e4; source/target first instruction (('stwu', 'r1, -0x60(r1)'), ('stwu', 'r1, -0x60(r1)'))
get_friendinfo__Q33ipl5scene11AddressEditFv: extent 0x5604..0x5754 <= next 0x5754; source/target first instruction (('stwu', 'r1, -0x420(r1)'), ('stwu', 'r1, -0x420(r1)'))
update_friendinfo__Q33ipl5scene11AddressEditFv: extent 0x5798..0x5830 <= next 0x5830; source/target first instruction (('stwu', 'r1, -0x10(r1)'), ('stwu', 'r1, -0x10(r1)'))
set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err: extent 0x6690..0x67bc <= next 0x67bc; source/target first instruction (('stwu', 'r1, -0x60(r1)'), ('stwu', 'r1, -0x60(r1)'))
create__Q33ipl5scene15SDChannelSelectFv: extent 0x478..0x6c0 <= next 0x6c0; source/target first instruction (('stwu', 'r1, -0x20(r1)'), ('stwu', 'r1, -0x20(r1)'))
handleSDTitleListResult__Q33ipl5scene15SDChannelSelectFv: extent 0x14d8..0x1784 <= next 0x1784; source/target first instruction (('stwu', 'r1, -0x30(r1)'), ('stwu', 'r1, -0x30(r1)'))
collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl: extent 0x25a4..0x2738 <= next 0x2738; source/target first instruction (('stwu', 'r1, -0x40(r1)'), ('stwu', 'r1, -0x40(r1)'))
collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl: extent 0x2738..0x28d0 <= next 0x28d0; source/target first instruction (('stwu', 'r1, -0x40(r1)'), ('stwu', 'r1, -0x40(r1)'))
collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl: extent 0x28d0..0x2ac8 <= next 0x2ac8; source/target first instruction (('stwu', 'r1, -0x60(r1)'), ('stwu', 'r1, -0x60(r1)'))
collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl: extent 0x2ac8..0x306c <= next 0x306c; source/target first instruction (('stwu', 'r1, -0x80(r1)'), ('stwu', 'r1, -0x80(r1)'))
flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv: extent 0x31d0..0x325c <= next 0x325c; source/target first instruction (('stwu', 'r1, -0x10(r1)'), ('stwu', 'r1, -0x10(r1)'))
setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj: extent 0x5d40..0x60e4 <= next 0x60e4; source/target first instruction (('stwu', 'r1, -0xe0(r1)'), ('stwu', 'r1, -0xe0(r1)'))
KPADGetProjectionPos: extent 0x430..0x47c <= next 0x47c; source/target first instruction (('lfs', 'f3, 0xc(r5)'), ('lfs', 'f3, 0xc(r5)'))
KPADSetSensorHeight: extent 0x47c..0x54c <= next 0x54c; source/target first instruction (('stwu', 'r1, -0x30(r1)'), ('stwu', 'r1, -0x30(r1)'))
calc_acc_horizon: extent 0x6e0..0x874 <= next 0x874; source/target first instruction (('stwu', 'r1, -0x30(r1)'), ('stwu', 'r1, -0x30(r1)'))
read_kpad_acc: extent 0x998..0xfd8 <= next 0xfd8; source/target first instruction (('stwu', 'r1, -0x50(r1)'), ('stwu', 'r1, -0x50(r1)'))
select_1obj_first: extent 0x13e8..0x159c <= next 0x159c; source/target first instruction (('stwu', 'r1, -0x20(r1)'), ('stwu', 'r1, -0x20(r1)'))
calc_dpd_variable: extent 0x1710..0x1af8 <= next 0x1af8; source/target first instruction (('stwu', 'r1, -0x20(r1)'), ('stwu', 'r1, -0x20(r1)'))
KPADRead: extent 0x2514..0x2c40 <= next 0x2c40; source/target first instruction (('stwu', 'r1, -0xc0(r1)'), ('stwu', 'r1, -0xc0(r1)'))
KPADInit: extent 0x2c40..0x2f24 <= next 0x2f24; source/target first instruction (('stwu', 'r1, -0x90(r1)'), ('stwu', 'r1, -0x90(r1)'))
## libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable
Fetch origin/main c1183780c2b53e044f91775b29b580d306e4423e. Initial assembly diagnosis: (14, 45) structural/positional differences; instructions 250/250
Remote source equals freshly built baseline; still open 94.82%. Structural diagnosis: 250/250; target rotation multiplies direction components first, while ours uses tangent first; a distance-filter ternary also introduces a transient f1. Apply the explicit sign-branch lever established on read_kpad_acc before register search.
- direction-first horizontal rotation products in positional projection: (12, 40) structural/positional; instructions 250/250; candidate kept.
- distance-filter sign branches assign its magnitude local directly: (12, 40) structural/positional; instructions 250/250; candidate kept.
- separate positional rotation/average declarations from assignments: (17, 41) structural/positional; instructions 250/250; candidate kept.
- Register search after operand/sign-branch trials, block f32 magnitude;: declaration block: | f32 magnitude; | f32 dx; | f32 next; | start (17, 41) | best (17, 41) after 6 builds; source restored; best order was: | f32 magnitude; | f32 dx; | f32 next; |
- Register search after operand/sign-branch trials, block f32 rotatedY;: declaration block: | f32 rotatedY; | f32 rotatedX; | f32 scaleX; | f32 scaleY; | start (17, 41) | improved (12, 40) | best (12, 40) after 13 builds; kept in source: | f32 rotatedX; | f32 rotatedY; | f32 scaleX; | f32 scaleY; |
Extended PPC diagnostic decodes unsupported floating compares and paired-single save/load instructions in /tmp only; no source/target bytes or repository tools changed. It separates register differences from real load/branch scheduling:
KPADGetProjectionPos decoded structure/register score (0, 9)
KPADSetSensorHeight decoded structure/register score (0, 7)
calc_acc_horizon decoded structure/register score (0, 35)
read_kpad_acc decoded structure/register score (5, 66)
select_1obj_first decoded structure/register score (0, 26)
calc_dpd_variable decoded structure/register score (13, 45)
KPADRead decoded structure/register score (11, 89)
KPADInit decoded structure/register score (6, 81)
## libs/RVL_SDK/src/kpad/KPAD KPADRead
Fetch origin/main ff90063ef9623d776c62711aeb89c7a225f7a3b5. Initial assembly diagnosis: (11, 89) structural/positional differences; instructions 459/459
Remote source equals freshly built baseline; still open 97.52723%. Structural diagnosis: 459/459,0xc0 frame. Target copyOutput computes available*0x84 then subtracts0x84; ours computes (available-1)*0x84. Correct pointer-expression grouping and computation placement before register search.
- form the output endpoint before subtracting one status: (46, 284) structural/positional; instructions 459/459; candidate kept.
- initialize the output endpoint then decrement as a separate pointer operation: (46, 284) structural/positional; instructions 459/459; candidate kept.
- copy older samples using a one-past cursor and the previous status slot: (75, 284) structural/positional; instructions 459/459; candidate kept.
- prepare count and output endpoint before calculating the ring start: (40, 282) structural/positional; instructions 459/459; candidate kept.
- signed available count matches the public signed return value: (11, 89) structural/positional; instructions 459/459; candidate kept.
- signed count endpoint followed by status-pointer subtraction: (46, 284) structural/positional; instructions 459/459; restored.
KPADRead structural trials: pointer-first endpoint forms computed available*0x84 as desired but increased source frame0xc0 ->0xd0 and shifted callee-save coloring; hoisting endpoint/count and using signed available did not cure it. Original0xc0 frame/459 instructions restored; register-only search deferred because cursor scheduling remains structural.
## libs/RVL_SDK/src/kpad/KPAD KPADInit
Fetch origin/main 0d9b03878228a086954abc59b964164b0f7db5f2. Initial assembly diagnosis: (9, 81) structural/positional differences; instructions 185/185
Remote source equals freshly built baseline; still open 96.51351%. Structural diagnosis: 185/185,0x90 frame; target constructs the40000 repeat delay earlier than ours, plus saved FP coloring. Name the real default delay, then compare matrix base and squared-diagonal temporaries before declaration search.
- name and initialize the default repeat delay before controller setup: (9, 81) structural/positional; instructions 185/185; candidate kept.
- initialize the first matrix element through the shared matrix pointer: (31, 110) structural/positional; instructions 185/185; restored.
- name the sensor-diagonal square before the square-root boundary: (9, 81) structural/positional; instructions 185/185; candidate kept.
- Register-only last on sixteen real scalar/pointer declarations with decoded PPC comparisons: declaration block: | KPADInside* kpad; | f32 distanceValue; | f32 sensorDistance; | f32 diagonalSquared; | f32 rotationElement; | f32 referenceWidth; | f32 referenceHeight; | f32 objectInterval; | f32 zero; | f32 degreesToRadians; | f32 one; | f32* matrix; | u32 i; | s32 chan; | BOOL enabled; | u16 repeatDelay; | start (6, 81) | improved (6, 70) | improved (6, 66) | improved (6, 62) | improved (6, 54) | improved (6, 51) | best (6, 51) after 388 builds; kept in source: | f32 referenceHeight; | f32 objectInterval; | f32 sensorDistance; | f32 diagonalSquared; | f32 rotationElement; | f32 referenceWidth; | KPADInside* kpad; | f32 distanceValue; | f32 zero; | f32 degreesToRadians; | f32 one; | u32 i; | f32* matrix; | s32 chan; | BOOL enabled; | u16 repeatDelay; |
- share the named unit value with sensitivity initialization: (8, 51) structural/positional; instructions 185/185; candidate kept.
KPADInit declaration search improved81 ->51 differences after388 builds, but early repeat-constant/global-base scheduling remained6 decoded structural differences. Sharing a named unit scalar with sensitivity initialization did not improve it. Partial source restored; source/target retain0x90 frame and185 instructions.
Pre-full-gate completeness audit: freshly regenerated report lists19 remaining non-matching functions; every one has >=3 successfully built distinct source trials in this HIGH round; failed build excluded.86 successful function trials and531 declaration-search builds logged; all non-exact candidates restored.
## Round6 final full clean gate and remaining-function audit
Full non-quick gate over all3 units PASS; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; all pools identical;0 regressions,0 forbidden additions,0 readability warnings. Owned data100%, no symbol name/extent edits. Remaining function ELF extents end before/equal next symbol. Stack adjacent store/reload proof pairs []; no definition-level volatile justified.
src/scene/address/iplAddressEdit: fresh exact 90 ->90/94; code 23044 ->23044/27112; data 2560 ->2560/2560.
src/scene/sdChannelSelect/iplSDChannelSelect: fresh exact 121 ->122/129; code 28728 ->29412/33828; data 2960 ->2960/2960.
libs/RVL_SDK/src/kpad/KPAD: fresh exact 21 ->21/29; code 6756 ->6756/13056; data 8032 ->8032/8032.
One exact SD title-result match committed160e985a this round. All unaccepted source/header experiments restored; the exact SD time-gate/compaction change and attempts log retained. None of the remaining functions is claimed complete. Every remaining function has at least3 successfully built distinct source trials this HIGH round, failed builds excluded. Uncertainty remains on unsupported NWC24 error defaults and compiler register/load scheduling; safe message initialization retained. All per-function fetches used the shared git lock; remote owned source equals fresh baseline0c06b01c throughout. Extents/data names untouched; no duplicate owned remote match.
- src/scene/address/iplAddressEdit create__Q33ipl5scene11AddressEditFv 97.44634%; 6 successful distinct source trials; balloon construction null-guard/temporary boundary and retained name-pointer lifetimes; same820 instructions.
- src/scene/address/iplAddressEdit get_friendinfo__Q33ipl5scene11AddressEditFv 88.03571%; 3 successful distinct source trials; text-array addresses folded until after pane lookup; target retains pointers across lookup,82/84.
- src/scene/address/iplAddressEdit update_friendinfo__Q33ipl5scene11AddressEditFv 99.42105%; 3 successful distinct source trials; wcsncpy name-source versus destination address evaluation order,38/38; prior memcpy diagnosis corrected by resolved relocation.
- src/scene/address/iplAddressEdit set_err_msg__Q33ipl5scene11AddressEditFPwUl8NWC24Err 98.666664%; 3 successful distinct source trials; extra safe default initialization; target appears to leave messageId undefined for unhandled error,76/75.
- src/scene/sdChannelSelect/iplSDChannelSelect create__Q33ipl5scene15SDChannelSelectFv 97.73972%; 3 successful distinct source trials; BS2 polling body omits separate manager reload,145/146; loop/inline getter boundaries remain.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.81188%; 4 successful distinct source trials; threshold load hoisted before count store,101/101.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesFromNandUsage__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.833336%; 3 successful distinct source trials; threshold load hoisted before count store,102/102.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesByChannelOrder__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.29365%; 3 successful distinct source trials; threshold/count schedule plus loop coloring,126/126.
- src/scene/sdChannelSelect/iplSDChannelSelect collectTitlesBySpecialChannels__Q33ipl5scene15SDChannelSelectFPClPClPUxPcPUl 97.55125%; 3 successful distinct source trials; four repeated threshold/count schedules,361/361.
- src/scene/sdChannelSelect/iplSDChannelSelect flushSaveDataAndMountSD__Q33ipl5scene15SDChannelSelectFv 99.65714%; 3 successful distinct source trials; save manager/heap argument load order,35/35.
- src/scene/sdChannelSelect/iplSDChannelSelect setChannelScissor__Q33ipl5scene15SDChannelSelectCFPCQ33ipl5scene12SDChannelObj 93.4721%; 3 successful distinct source trials; matrix/scissor floating operand scheduling and temporaries,233/233.
- libs/RVL_SDK/src/kpad/KPAD KPADGetProjectionPos 96.57895%; 3 successful distinct source trials; floating coefficient registers and multiply operands,19/19; reused-coefficient declaration search best11 differences versus original9; all partial variants restored.
- libs/RVL_SDK/src/kpad/KPAD KPADSetSensorHeight 99.23077%; 4 successful distinct source trials; base-array register r4 versusr3 plus zero/squared-height float registers,52/52; native int index views unchanged.
- libs/RVL_SDK/src/kpad/KPAD calc_acc_horizon 97.27723%; 3 successful distinct source trials; magnitude/interpolation and circle float-register lifetimes,101/101; Vec2 grouping produced97/103/105 instructions versus target101 and was restored; original35 FP differences remain.
- libs/RVL_SDK/src/kpad/KPAD read_kpad_acc 98.15%; 16 successful distinct source trials; original branch/FP-helper differences remain; best structural/helper reconstruction400/400 had only cmpwi versus cmplwi at fallback-format comparison, restored pending exactness.
- libs/RVL_SDK/src/kpad/KPAD select_1obj_first 98.348625%; 3 successful distinct source trials; geometry floating lifetimes and paired stores,109/109; separated declaration search best24 versus original26 differences, restored.
- libs/RVL_SDK/src/kpad/KPAD calc_dpd_variable 94.82%; 3 successful distinct source trials; smoothing/projected geometry floating scheduling,250/250; direction-first operand variation best40 versus original45 differences, restored.
- libs/RVL_SDK/src/kpad/KPAD KPADRead 97.52723%; 6 successful distinct source trials; sample loop/polling temporaries and branch scheduling,459/459.
- libs/RVL_SDK/src/kpad/KPAD KPADInit 96.51351%; 4 successful distinct source trials; controller/ring initialization and floating scheduling,185/185; sixteen-local search best51 versus original81 differences after388 builds, restored.
Final authority lines:
```
[src/scene/address/iplAddressEdit] instruction-exact functions: 90/94
[src/scene/sdChannelSelect/iplSDChannelSelect] instruction-exact functions: 122/129
[libs/RVL_SDK/src/kpad/KPAD] instruction-exact functions: 21/29
GATE PASS
```

File diff suppressed because it is too large Load Diff

View File

@@ -455,755 +455,3 @@ GATE PASS
```
HIGH before -> after, instruction-exact/code/data bytes: zi8cgetc 5/4168/144 -> 5/4168/144; zmtkey 3/1488/60 -> 3/1488/60; zconvert 3/1380/112 -> 3/1380/112; tiPcKeyboard 140/28064/18548 -> 140/28064/18564. The gate passes, DOL SHA1 is exact, no regressions. The required instruction-exact count increase is still unmet. The retained data correction makes keyboard data 100% without changing section size or any code.
## MAX continuation, 2026-10-02
HEAD 5518cb16fda3091c727d974aacf477a2cf89b74a; fetched origin/main; owned sources and symbol config equal origin/main. No source changes carried from XHIGH. Parked zmtkey/zconvert/tiPcKeyboard excluded.
Baseline quick gate:
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.4008 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.40079
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 95.99054
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.4008
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] objdiff: code 10376/10604 data 192/192 functions 24/25 fuzzy 99.8491 linked code 0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] instruction-exact functions: 24/25
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .data size 168 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sbss size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sdata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .text size 10604 match 99.84911
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] below 100: NWC24iIsMsgObjReadable 92.98245
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] baseline: code 10376/10604 data 192 functions 24 fuzzy 99.8491
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.7755 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.77555
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 98.21889
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.40604
global fuzzy_match_percent: 99.56056 -> 99.56056
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
All three pools checked first: IDENTICAL (0/0, 8/8, 0/0).
MAX spelling diagnosis: 121/121 instructions, same 0x130 frame, array positions 0x88/0x8, branch operands and inline call boundaries. Only consistent coloring differs: candidate r27->r28, spelling r22->r23, length parameter r23->r24, work r28->r29, match r29->r27, candidateLength r24->r22. Function extent 0x1e4 ends exactly at next engine. No immediate stack store/reload; volatile unproven and excluded.
- MAX sM01 ZiMatchZHSpelling: keep candidate length as declared unsigned word returned by the counting helper; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM02 ZiMatchZHSpelling: keep prefix status as unsigned integer Boolean; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM03 ZiMatchZHSpelling: keep both prefix status and candidate count unsigned; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM04 ZiMatchZHSpelling: compute candidate length through a signed count conversion; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM05 ZiMatchZHSpelling: reuse prefix index as candidate length after prefix comparison; insns 122/121, structural/exact diffs (4, 92), fuzzy 97.31405, code 4168, data 72. Restored pending gates.
- MAX sM06 ZiMatchZHSpelling: initialize candidate cursor from incoming candidate before initial length call; insns 122/121, structural/exact diffs (1, 116), fuzzy 97.975204, code 4168, data 72. Restored pending gates.
- MAX sM07 ZiMatchZHSpelling: hold candidate length as signed long; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM08 ZiMatchZHSpelling: scope candidate length around both prefix and phonetic processing; insns 125/121, structural/exact diffs (16, 123), fuzzy 91.818184, code 4168, data 24. Restored pending gates.
- MAX sM09 ZiMatchZHSpelling: use caller-saved count result with a signed helper return declaration; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM10 ZiMatchZHSpelling: use a Boolean-byte prefix status with explicit full-word return; insns 122/121, structural/exact diffs (4, 98), fuzzy 97.06612, code 4168, data 72. Restored pending gates.
- MAX sM11 ZiMatchZHSpelling: use halfword candidate character count; insns 121/121, structural/exact diffs (1, 29), fuzzy 98.34711, code 4168, data 144. Restored pending gates.
- MAX sM12 ZiMatchZHSpelling: use narrow candidate character count matching space-helper argument; insns 121/121, structural/exact diffs (1, 29), fuzzy 98.34711, code 4168, data 144. Restored pending gates.
- MAX sM13 ZiMatchZHSpelling: reuse incoming candidate for phonetic traversal instead of a second pointer; insns 121/121, structural/exact diffs (0, 31), fuzzy 98.67769, code 4168, data 96. Restored pending gates.
- MAX sM14 ZiMatchZHSpelling: reuse incoming spelling for phonetic traversal instead of a second pointer; insns 121/121, structural/exact diffs (0, 34), fuzzy 98.59504, code 4168, data 96. Restored pending gates.
- MAX sM15 ZiMatchZHSpelling: derive prefix failure status from the compared candidate character; insns 134/121, structural/exact diffs (23, 122), fuzzy 87.181816, code 4168, data 24. Restored pending gates.
- MAX sM16 ZiMatchZHSpelling: scope candidate length to initial declaration and prefix status separately; insns 125/121, structural/exact diffs (16, 123), fuzzy 91.818184, code 4168, data 24. Restored pending gates.
MAX spelling declaration search after 16 source trials: declaration block: | ziWChar* candidateCursor; | ziWChar* spellingCursor; | int index; | int matches; | int candidateLength; | ziWChar spacedSpelling[64]; | ziWChar spacedCandidate[64]; | start (0, 29) | best (0, 29) after 52 builds; source restored; best order was: | ziWChar* candidateCursor; | ziWChar* spellingCursor; | int index; | int matches; | int candidateLength; | ziWChar spacedSpelling[64]; | ziWChar spacedCandidate[64]; |
MAX engine diagnosis: target/source 10676/10676 instructions, frame 0x4e0 and all local stack offsets identical. No neighbour overlap (0xa6d0 ends at Zi8NewMatchPhonetic). After branch-aware alignment and register normalization, the known residual structural stream comprises 12 extra and 10 missing return-register copies plus two missing halfword conversions. These are real code-generation differences; the four generated switch-table relocations refer into this inexact function, so their .data gap is code work. Prior width/cast correction alone grows by two instructions.
- MAX gM01 zi8InternalGetZH: spell traditional charset result as an explicit nonzero bit test; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM02 zi8InternalGetZH: invert traditional charset branch around the shared range reset; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM03 zi8InternalGetZH: perform traditional charset short-circuit through nested negative guard; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM04 zi8InternalGetZH: make component cursor a const pointer to const record data for read-only traversal; BUILD FAIL ext/src/clib/zi8cgetc.d build/43U/src/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 757: componentTable = componentCursor; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'unsigned char *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM05 zi8InternalGetZH: give component cursor definition volatile storage shown by immediate stack reload after assignment; BUILD FAIL ddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 2106: &componentIndex, &componentCursor, work)) { # Error: ^ # (10209) illegal implicit conversion from 'unsigned char *volatile *' to # 'unsigned char **' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM06 zi8InternalGetZH: give frequency cursor definition volatile storage shown by immediate stack reload after table call; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM07 zi8InternalGetZH: narrow paired code returns and order masks on the left; insns 10678/10676, structural/exact diffs (10222, 10519), fuzzy 96.090294, code 4168, data 72. Restored pending gates.
- MAX gM08 zi8InternalGetZH: consume counted table address through one assignment to both cursor and table; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM09 zi8InternalGetZH: emit context character after advancing the emitted-word count separately; insns 10673/10676, structural/exact diffs (9040, 10045), fuzzy 95.96759, code 4168, data 72. Restored pending gates.
- MAX gM11 zi8InternalGetZH: use signed full-word result for phonetic-code interface without changing casts; insns 10676/10676, structural/exact diffs (9080, 10068), fuzzy 95.99054, code 4168, data 144. Restored pending gates.
- MAX gM12 zi8InternalGetZH: declare phonetic and context record tables as const input arrays; BUILD FAIL are/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 874: match.phon[0], match.phon2[0], charset, work)) candidateStatus = 1; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'void *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM10 zi8InternalGetZH: keep options parameter read-only in engine and private phonetic helper; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM13 zi8InternalGetZH: group all match scalars at their first use through initialized local declarations; insns 10676/10676, structural/exact diffs (7830, 9407), fuzzy 96.202415, code 4168, data 144. Restored pending gates.
MAX retained gM08: combine cursor/table initialization into the natural chained assignment. The two pointers intentionally receive the same dictionary address. Engine fuzzy 95.99054 -> 96.27482, instruction count still 10676/10676; no new exact function. Quick authority gate PASS, all exact functions preserved, data 144/536 unchanged, pool identical, DOL exact, no regressions/forbidden/readability failures.
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.6547 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.65468
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 96.27482
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.4008
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.40604
global fuzzy_match_percent: 99.56056 -> 99.56462
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
- MAX gM14 zi8InternalGetZH: on chained-table baseline, narrow both paired phonetic codes to target halfword width; insns 10678/10676, structural/exact diffs (8713, 9803), fuzzy 96.492134, code 4168, data 72. Restored pending gates.
- MAX gM15 zi8InternalGetZH: narrow paired codes and express simplified charset as separate branches; insns 10678/10676, structural/exact diffs (7258, 9196), fuzzy 96.048615, code 4168, data 72. Restored pending gates.
- MAX gM16 zi8InternalGetZH: narrow paired codes and express traditional charset as separate branches; insns 10678/10676, structural/exact diffs (7250, 9196), fuzzy 96.048615, code 4168, data 72. Restored pending gates.
- MAX gM17 zi8InternalGetZH: keep all table addresses as byte-pointer interface returns within this unit; BUILD FAIL zi8cgetc.d build/43U/src/libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 2648: phoneticOffsets = Zi8GetTableAddress(1, 13, work); # Error: ^ # (10209) illegal implicit conversion from 'unsigned char *' to # 'unsigned short *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM18 zi8InternalGetZH: use native int return for secondary matcher while preserving byte truncation; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM19 zi8InternalGetZH: chained initialization of frequency table and its starting cursor; insns 10682/10676, structural/exact diffs (10304, 10644), fuzzy 95.96422, code 4168, data 24. Restored pending gates.
- MAX gM20 zi8InternalGetZH: replace phrase-pattern union integer member with native unsigned-long member; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM21 zi8InternalGetZH: correct phonetic-code return to ziU16 on chained table baseline; insns 10678/10676, structural/exact diffs (8713, 9803), fuzzy 96.492134, code 4168, data 72. Restored pending gates.
- MAX gM22 zi8InternalGetZH: use explicit narrow conversion at every returned format-version test; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM23 zi8InternalGetZH: split successful table presence and format-version conditions into nested checks; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM24 zi8InternalGetZH: spell primary matcher branch failure with an explicit byte comparison; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM25 zi8InternalGetZH: scope the option pointer as a read-only local view; BUILD FAIL ibs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 2312: charsetFilter, output, work)) goto engine_finish; # Error: ^ # (10209) illegal implicit conversion from 'const struct *' to # 'struct *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM04 zi8InternalGetZH: make component cursor a const pointer to const record data for read-only traversal; BUILD FAIL bs/RVLMiddleware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 756: tTable = componentCursor = (ziU8*)Zi8GetTableAddress(1, 2, work); # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'unsigned char *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX gM05 zi8InternalGetZH: give component cursor definition volatile storage shown by immediate stack reload after assignment; insns 10676/10676, structural/exact diffs (7556, 9311), fuzzy 96.27482, code 4168, data 144. Restored pending gates.
- MAX gM12 zi8InternalGetZH: declare phonetic and context record tables as const input arrays; BUILD FAIL eware/eZiText/src/clib/zi8cgetc.d ### mwcceppc.exe Compiler: # File: libs\RVLMiddleware\eZiText\src\clib\zi8cgetc.c # ------------------------------------------------------- # 1619: phraseOrdinal, &candidateOrdinal, 0, work)) continue; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char *' to # 'unsigned char *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
MAX GetElementCount diagnosis: source/target 115/115 instructions, 0x230 frame and array/separator offsets identical, branch forms and all operand orders equal. Consistent count/elementCount r28/r27 swap gives 13 differences. No store followed immediately by reload at helper boundary (the saved separator reload follows a call), so no volatile. Extent 0x1cc reaches next symbol exactly. Prior return-elementIndex variation had one return-register difference, worth following with explicit count synchronization and initialization-order trials. Fetched origin/main again; still open.
- MAX cM01 Zi8GetElementCount: return the consumed-input index equivalent to the separately counted inputs; insns 115/115, structural/exact diffs (0, 1), fuzzy 99.95652, code 4168, data 144. Restored pending gates.
- MAX cM02 Zi8GetElementCount: synchronize consumed count from input index at return; insns 116/115, structural/exact diffs (3, 22), fuzzy 98.434784, code 4168, data 72. Restored pending gates.
- MAX cM03 Zi8GetElementCount: assign returned count from consumed index in the return expression; insns 116/115, structural/exact diffs (3, 22), fuzzy 98.434784, code 4168, data 72. Restored pending gates.
- MAX cM04 Zi8GetElementCount: initialize input traversal before result count in the chained zero assignment; insns 115/115, structural/exact diffs (0, 14), fuzzy 99.26087, code 4168, data 144. Restored pending gates.
- MAX cM05 Zi8GetElementCount: initialize result count last in source order of the chain; insns 115/115, structural/exact diffs (0, 14), fuzzy 99.21739, code 4168, data 144. Restored pending gates.
- MAX cM06 Zi8GetElementCount: start chained input indices at zero through result count assignment; insns 115/115, structural/exact diffs (0, 14), fuzzy 99.21739, code 4168, data 144. Restored pending gates.
- MAX cM07 Zi8GetElementCount: hold input element index as wider unsigned integer with explicit byte reads; insns 115/115, structural/exact diffs (1, 13), fuzzy 98.86957, code 4168, data 144. Restored pending gates.
- MAX cM08 Zi8GetElementCount: preserve incoming element limit as a const local byte; insns 116/115, structural/exact diffs (1, 108), fuzzy 98.478264, code 4168, data 24. Restored pending gates.
- MAX cM09 Zi8GetElementCount: derive count through consumed index only when the loop exits through its limit; insns 121/115, structural/exact diffs (9, 32), fuzzy 93.347824, code 4168, data 24. Restored pending gates.
- MAX cM10 Zi8GetElementCount: restore saved separator through an ordinary scalar instead of single-field state; insns 113/115, structural/exact diffs (8, 106), fuzzy 97.48695, code 4168, data 24. Restored pending gates.
- MAX cM11 Zi8GetElementCount: split the input-limit and character-remaining loop conditions without changing order; insns 115/115, structural/exact diffs (10, 56), fuzzy 92.17391, code 4168, data 144. Restored pending gates.
- MAX cM12 Zi8GetElementCount: return promoted consumed count through an enum-typed local; insns 115/115, structural/exact diffs (2, 13), fuzzy 98.391304, code 4168, data 144. Restored pending gates.
MAX GetElementCount declaration search: declaration block: | ziU8 spacedIndex; | ziU8 elementIndex; | ziU8 count; | ziWChar spacedElements[256]; | start (0, 13) | best (0, 13) after 13 builds; source restored; best order was: | ziU8 spacedIndex; | ziU8 elementIndex; | ziU8 count; | ziWChar spacedElements[256];
cM01 returns the equivalent elementIndex but leaves an unused count variable; rejected as an artificial partial improvement, not retained. Explicit synchronization adds an instruction and regresses exception data. All remaining candidates restored.
MAX NWC24iIsMsgObjReadable diagnosis: fetched origin/main, source unchanged there; open 92.98245%. 57/57 instructions, identical 0x10 frame, same branches, calls, field offsets and expression operands after prologue. Target saves LR/r31 and copies the input before loading type; source schedules the type load/mask through those three prologue operations. No immediate stack reload or neighbour overlap (0xe4 ends at next public function). Remaining unit data already 192/192 including corrected MountInfo extent; no data changes needed. Prior readonly views and full-body helper did not change this scheduling.
- MAX nM01 NWC24iIsMsgObjReadable: use an opaque constant input and explicit typed readonly mailbox view; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM02 NWC24iIsMsgObjReadable: use private message-object view for common type/app/LED header fields; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM03 NWC24iIsMsgObjReadable: use signed shift of readable type bit instead of mask predicate; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM04 NWC24iIsMsgObjReadable: scope read type and subsequent validation in explicit positive branch; insns 57/57, structural/exact diffs (15, 50), fuzzy 85.789474, code 10376, data 192. Restored pending gates.
- MAX nM05 NWC24iIsMsgObjReadable: make first type validity mask an enum-valued flag constant; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM06 NWC24iIsMsgObjReadable: use whole unsigned type word local for initial three type predicates only; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM07 NWC24iIsMsgObjReadable: return the Boolean app-mask comparison through an explicit local result; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM08 NWC24iIsMsgObjReadable: delay independent app/LED readonly view setup until after first type test; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
MAX PFCACHE_DoWriteNumSectorAndFreeIfNeeded diagnosis: fetched origin/main, still open 98.21889%. Both 233 instructions, same 0x30 frame, same saved GPRs and all branches. Only third overlap block differs at instructions 136-144: target reloads page start, recomputes num_sector+sector despite cached r31 request end, computes last_sector before success/remaining bookkeeping; source reuses r31 and reconstructs last sector from page start + overlap. No immediate stack store/reload for these scalars, so volatile is unproven. Extent 0x3a4 ends exactly at DoFlushCache. No data sections/pool in this unit. Try real signedness, input const qualification, transient-helper boundaries and range-variable structure before register search.
- MAX pM01 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute last sector using unsigned-int request operands rather than page cancellation; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM02 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute last sector with reversed request addition and decrement grouped into count; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM03 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: group last-sector decrement into starting sector; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM04 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: make input head pointer read-only because this routine never replaces it; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM05 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: preserve source buffer as const at every memory-copy call; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM06 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute overlap and last sector using unsigned-int transient arithmetic; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.53648, code 6464, data None. Restored pending gates.
- MAX pM07 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive last sector before overlap using the page-relative count expression; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM08 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: declare half-open request end as a block-local named range value after memcpy; insns 232/233, structural/exact diffs (14, 106), fuzzy 98.62661, code 6464, data None. Restored pending gates.
- MAX pM09 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: reuse existing end-buffer arithmetic without a whole-sector last variable; insns 232/233, structural/exact diffs (14, 107), fuzzy 98.45493, code 6464, data None. Restored pending gates.
- MAX pM10 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: compute last sector from overlap before remainder-count mutation; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM11 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep overlap count in a signed integer but convert at sector bookkeeping; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM12 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep last-sector value in a signed integer but preserve sector subtraction; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM13 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: read page sector through const page view for both overlap calculations; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM14 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: order rest-sector update before success update in the right overlap; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM15 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: calculate the last-sector buffer offset directly as overlap minus one; insns 230/233, structural/exact diffs (17, 107), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM16 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep overlap calculation inside a named range descriptor; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM17 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper isolates request-end calculation from overlap arithmetic; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM18 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper uses a named half-open end local; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM19 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper keeps a signed 32-bit endpoint result; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM20 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper groups count decrement before start; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM21 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper combines with direct overlap-count expression; insns 234/233, structural/exact diffs (17, 108), fuzzy 97.48927, code 6464, data None. Restored pending gates.
- MAX pM22 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper receives page start and overlap instead of request input; insns 233/233, structural/exact diffs (5, 8), fuzzy 97.91846, code 6464, data None. Restored pending gates.
- MAX pM23 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper isolates request-end calculation from overlap arithmetic; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM24 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper uses a named half-open end local; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM25 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper keeps a signed 32-bit endpoint result; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM26 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper groups count decrement before start; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM27 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper combines with direct overlap-count expression; allow normal helper inlining at this function boundary; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM28 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: inline last-sector helper receives page start and overlap instead of request input; allow normal helper inlining at this function boundary; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM29 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression num_sector - (p_page->sector - sector); insns 234/233, structural/exact diffs (15, 107), fuzzy 97.74678, code 6464, data None. Restored pending gates.
- MAX pM30 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression (sector - p_page->sector) + num_sector; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM31 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression num_sector + (sector - p_page->sector); insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM32 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression p_page->size - (p_page->sector + (p_page->size - num_sector) - sector); insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM33 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression p_page->size + (num_sector + sector - (p_page->sector + p_page->size)); insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM34 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression (num_sector + sector - (p_page->sector + p_page->size)) + p_page->size; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM35 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression num_sector - (p_page->sector + p_page->size - sector) + p_page->size; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX pM36 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use natural equivalent sector-overlap expression (num_sector - p_page->sector) + sector; insns 234/233, structural/exact diffs (16, 107), fuzzy 97.6824, code 6464, data None. Restored pending gates.
- MAX nM09 NWC24iIsMsgObjReadable: match a mutable mailbox-entry input view rather than the guessed const formal; insns 57/57, structural/exact diffs (0, 0), fuzzy 100.0, code 10604, data 192. Restored pending gates.
- MAX nM10 NWC24iIsMsgObjReadable: use a readonly pointer value to the mutable mailbox entry; insns 57/57, structural/exact diffs (0, 0), fuzzy 100.0, code 10604, data 192. Restored pending gates.
- MAX nM11 NWC24iIsMsgObjReadable: retain full entry constness while qualifying pointer value itself; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM12 NWC24iIsMsgObjReadable: introduce a common typed header view with the proven shared leading fields; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM13 NWC24iIsMsgObjReadable: use an inline common-header validation helper for the first readable type bit only; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
- MAX nM14 NWC24iIsMsgObjReadable: keep the app-id equality operation in its own inline read-only view helper; insns 57/57, structural/exact diffs (4, 5), fuzzy 92.98245, code 10376, data 192. Restored pending gates.
MAX exact nM09: NWC24iIsMsgObjReadable input was guessed pointer-to-const; the target was compiled with mutable MBCEntry*. Removing const only from this function declaration and definition moves the first type load/mask after LR/r31 saves exactly as target. 57/57 instructions, ctxdiff 0, 100% objdiff; whole unit 24/25 -> 25/25, code 10376/10604 -> 10604/10604, data unchanged 192/192. nM10 pointer-value const is also exact; use simpler nM09. All call sites already pass mutable MBCEntry*, no shared header change. Quick gate PASS, DOL exact, pools identical and zero regressions.
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] objdiff: code 10604/10604 data 192/192 functions 25/25 fuzzy 100.0000 linked code 0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] instruction-exact functions: 25/25
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .data size 168 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sbss size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sdata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .text size 10604 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] baseline: code 10376/10604 data 192 functions 24 fuzzy 99.8491
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.41365
global fuzzy_match_percent: 99.56056 -> 99.56516
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
- MAX pM37 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: match a mutable source-buffer formal from the older cache API; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM38 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: read volume geometry through a const formal and retain explicit mutable driver call; insns 233/233, structural/exact diffs (17, 62), fuzzy 92.44635, code 6464, data None. Restored pending gates.
- MAX pM39 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: model memory-copy source as a mutable opaque pointer in this unit only; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM40 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: scope overlap and last-sector locals directly in the partial-page branch; BUILD FAIL "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/fa/pf_cache.d build/43U/src/libs/RVL_SDK/src/fa/pf_cache.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\fa\pf_cache.c # --------------------------------------- # 610: pf_u32 num_overlap = p_page->size - ((p_page->sector + p_page->size) - (num_sector + sector)); # Error: ^^^^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX pM40 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: scope overlap and last-sector locals directly in the partial-page branch; insns 233/233, structural/exact diffs (4, 9), fuzzy 98.21889, code 6464, data None. Restored pending gates.
- MAX pM41 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: scope an initialized last requested sector after the copy; insns 232/233, structural/exact diffs (15, 228), fuzzy 95.40772, code 6464, data None. Restored pending gates.
- MAX pM42 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive a half-open request endpoint with wide intermediate arithmetic; insns 235/233, structural/exact diffs (17, 229), fuzzy 94.356224, code 6464, data None. Restored pending gates.
- MAX pM43 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive overlap and last sector from a wide request endpoint local; insns 237/233, structural/exact diffs (15, 235), fuzzy 93.042915, code 6464, data None. Restored pending gates.
- MAX sM17 ZiMatchZHSpelling: declare candidate input const at the function definition and convert only for legacy helpers; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM18 ZiMatchZHSpelling: declare spelling input const at the function definition and convert only for legacy helper; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM19 ZiMatchZHSpelling: declare both candidate and spelling input arrays readonly; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM20 ZiMatchZHSpelling: give count helper a readonly word prototype while keeping matching input mutable; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM21 ZiMatchZHSpelling: give readonly candidate and count helper consistent const-qualified word types; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX sM22 ZiMatchZHSpelling: declare initial candidate length immutable after its one assignment; insns 121/121, structural/exact diffs (2, 30), fuzzy 97.19009, code 4168, data 144. Restored pending gates.
MAX cache structural follow-up: 43 distinct natural source trials, plus compiler-rejected unscoped declaration attempt. Mutable-buffer and readonly-head views preserve 9 differences; readonly volume regresses allocation/scheduling (62 differences). The closest fuzzy alternative pM08 has 232/233 instructions and greater branch-aware structural distance (14 vs 4), so reject it rather than trade the target instruction structure for a percentage gain. Wider arithmetic adds real instructions and is rejected. All cache source trials restored. No stack proof permits volatile.
MAX spelling follow-up after mailbox input-qualifier match: formal const candidate/spelling, consistent readonly count-helper prototype, and initialized immutable candidate length were all compiled. Const views reproduce the same 29 register differences. Local count scope changes instruction structure. Source restored; no proven volatile local evidence.
MAX final data proof: zi8cgetc .data is exactly 392 bytes in both objects, four compiler-generated switch tables, all 98 relocations resolve inside zi8InternalGetZH. No ordinary data symbol needs a real-name rename; these remain code work. Exception sections and the 16-byte constants/8-byte zero object are exact. NWC24MBoxCtrl has byte-identical ordinary strings and real MountInfo extent, matched data192/192; extracted trailing alignment remains unowned in source sections. pf_cache has no allocated non-code sections. No config or shared-header changes made.
MAX cache declaration search after structural/type/helper trials: declaration block: | PF_CACHE_PAGE* p_page = PF_NULL; | pf_s32 err; | pf_u32 num_rest_sector = num_sector; | pf_u8* p_sbuf; | pf_u8* p_ebuf; | pf_u32 num_overlap; | pf_u32 last_sector; | start (4, 9) | best (4, 9) after 52 builds; source restored; best order was: | PF_CACHE_PAGE* p_page = PF_NULL; | pf_s32 err; | pf_u32 num_rest_sector = num_sector; | pf_u8* p_sbuf; | pf_u8* p_ebuf; | pf_u32 num_overlap; | pf_u32 last_sector;
MAX coverage ZiMatchZHSpelling: 22 distinct successfully compiled source trials.
MAX coverage zi8InternalGetZH: 21 distinct successfully compiled source trials.
MAX coverage Zi8GetElementCount: 12 distinct successfully compiled source trials.
MAX coverage NWC24iIsMsgObjReadable: 14 distinct successfully compiled source trials.
MAX coverage PFCACHE_DoWriteNumSectorAndFreeIfNeeded: 43 distinct successfully compiled source trials.
Coverage complete: no untried owned function. NWC24iIsMsgObjReadable is exact and committed; all other mailbox trials restored. pf_cache source byte-identical to its MAX start. Spelling/GetElementCount source unchanged. The sole retained engine change is one natural chained table/cursor assignment; the engine remains open, and structural return-copy/conversion differences are not labelled a pure register tie.
MAX final full (non-quick) gate, all three owned units:
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.6547 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.65468
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 96.27482
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.4008
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] pool: IDENTICAL
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] objdiff: code 10604/10604 data 192/192 functions 25/25 fuzzy 100.0000 linked code 0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] instruction-exact functions: 25/25
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .data size 168 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sbss size 8 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .sdata size 16 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] section .text size 10604 match 100.0
[libs/RevoEX/src/nwc24/NWC24MBoxCtrl] baseline: code 10376/10604 data 192 functions 24 fuzzy 99.8491
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.7755 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.77555
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 98.21889
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
regressions vs baseline: 0
global matched_code_percent: 90.40604 -> 90.41365
global fuzzy_match_percent: 99.56056 -> 99.56516
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36596 -> 99.36596
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
MAX before -> after, instruction-exact/code/data bytes: zi8cgetc 5/4168/144 -> 5/4168/144 (engine fuzzy 95.99054 -> 96.27482); NWC24MBoxCtrl 24/10376/192 -> 25/10604/192; pf_cache 35/6464/0 -> 35/6464/0 (no data sections). Full GATE PASS, exact DOL SHA1, pools identical, zero regressions and forbidden/readability failures. Owned instruction-exact total 64/69 -> 65/69. Local source commits: 25fabf7b and 93e82b61.
Remaining open functions, with all source attempts exhausted this MAX round: ZiMatchZHSpelling98.80165% (29 register differences); zi8InternalGetZH96.27482% (return copies, missing halfword conversions, allocation); Zi8GetElementCount99.347824% (13 register differences); PFCACHE_DoWriteNumSectorAndFreeIfNeeded98.21889% (9 third-overlap arithmetic/scheduling differences). The correct engine temporary boundaries and paired phonetic-code interface widths remain uncertain. No new symbol rename/extent adjustment or linking investigation was needed.
# MAX continuation after mailbox landing, five units
libs/RVLMiddleware/eZiText/src/clib/zi8cgetc pool first: POOL IDENTICAL up to 0 (mine=0 base=0)
libs/RVL_SDK/src/fa/pf_cache pool first: POOL IDENTICAL up to 0 (mine=0 base=0)
libs/RVL_SDK/src/fa/pf_fat pool first: POOL IDENTICAL up to 0 (mine=0 base=0)
src/scene/channelSelect/iplChannelObj pool first: POOL IDENTICAL up to 20 (mine=20 base=20)
libs/NW4R/src/lyt/lyt_window pool first: POOL IDENTICAL up to 1 (mine=1 base=1)
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.6547 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.65468
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 96.27482
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.6547
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.7755 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.77555
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 98.21889
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
[libs/RVL_SDK/src/fa/pf_fat] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_fat] objdiff: code 11556/12572 data 64/64 functions 34/35 fuzzy 99.8346 linked code 0
[libs/RVL_SDK/src/fa/pf_fat] instruction-exact functions: 34/35
[libs/RVL_SDK/src/fa/pf_fat] section .rodata size 64 match 100.0
[libs/RVL_SDK/src/fa/pf_fat] section .text size 12572 match 99.83456
[libs/RVL_SDK/src/fa/pf_fat] below 100: PFFAT_FreeChain 97.95276
[libs/RVL_SDK/src/fa/pf_fat] baseline: code 11556/12572 data 64 functions 34 fuzzy 99.8346
[src/scene/channelSelect/iplChannelObj] pool: IDENTICAL
[src/scene/channelSelect/iplChannelObj] objdiff: code 10144/10924 data 2216/2216 functions 55/56 fuzzy 99.7993 linked code 0
[src/scene/channelSelect/iplChannelObj] instruction-exact functions: 54/56
[src/scene/channelSelect/iplChannelObj] section .data size 1240 match 100.0
[src/scene/channelSelect/iplChannelObj] section .rodata size 784 match 100.0
[src/scene/channelSelect/iplChannelObj] section .sdata size 120 match 100.0
[src/scene/channelSelect/iplChannelObj] section .sdata2 size 72 match 100.0
[src/scene/channelSelect/iplChannelObj] section .text size 10924 match 99.79934
[src/scene/channelSelect/iplChannelObj] below 100: setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object 97.18974
[src/scene/channelSelect/iplChannelObj] baseline: code 10144/10924 data 2216 functions 55 fuzzy 99.7993
[libs/NW4R/src/lyt/lyt_window] pool: IDENTICAL
[libs/NW4R/src/lyt/lyt_window] objdiff: code 9848/11352 data 316/316 functions 20/21 fuzzy 99.7586 linked code 0
[libs/NW4R/src/lyt/lyt_window] instruction-exact functions: 20/21
[libs/NW4R/src/lyt/lyt_window] section .ctors size 4 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .data size 256 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .sbss size 8 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .sdata2 size 48 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .text size 11352 match 99.75864
[libs/NW4R/src/lyt/lyt_window] below 100: DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc 98.17819
[libs/NW4R/src/lyt/lyt_window] baseline: code 9848/11352 data 316 functions 20 fuzzy 99.7586
regressions vs baseline: 0
global matched_code_percent: 90.47482 -> 90.47482
global fuzzy_match_percent: 99.57024 -> 99.57024
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
MAX2 ZiMatchZHSpelling: fetched origin/main; owned source equals remote. Still 98.80165%, 121/121 instructions, frame0x130, identical stack buffers/branches/helpers/operands. Remaining29 are register allocation; no immediate store/reload volatile proof. Extent0x1e4 reaches the following engine exactly. Prior trials exhausted type/const variants; try scan-result branch form, traversal initialization, and count-result type before last declaration search.
- MAX2 s2_01 ZiMatchZHSpelling: use signed-long match and character count as natural word-sized state; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX2 s2_02 ZiMatchZHSpelling: separate nonzero candidate check from prefix mismatch check; insns 123/121, structural/exact diffs (6, 109), fuzzy 97.06612, code 4168, data 72. Restored pending gates.
- MAX2 s2_03 ZiMatchZHSpelling: initialize candidate and spelling cursors in reverse traversal order; insns 121/121, structural/exact diffs (2, 31), fuzzy 98.70248, code 4168, data 144. Restored pending gates.
- MAX2 s2_04 ZiMatchZHSpelling: make prefix scan a while loop with explicit increment; insns 121/121, structural/exact diffs (0, 29), fuzzy 98.80165, code 4168, data 144. Restored pending gates.
- MAX2 g2_01 zi8InternalGetZH: combine alternate cursor advancement with entry initialization; insns 10673/10676, structural/exact diffs (8353, 9799), fuzzy 95.613525, code 4168, data 24. Restored pending gates.
- MAX2 g2_02 zi8InternalGetZH: initialize duplicate pass ordinal and status through chained assignment; insns 10686/10676, structural/exact diffs (10284, 10653), fuzzy 95.704575, code 4168, data 24. Restored pending gates.
- MAX2 g2_03 zi8InternalGetZH: preserve readonly request element view for all engine reads with explicit legacy helper conversions; insns 10685/10676, structural/exact diffs (10224, 10655), fuzzy 95.70148, code 4168, data 24. Restored pending gates.
- MAX2 g2_04 zi8InternalGetZH: match actual phonetic-code interface width while grouping returned mask test operands; insns 10678/10676, structural/exact diffs (8713, 9803), fuzzy 96.492134, code 4168, data 72. Restored pending gates.
- MAX2 c2_01 Zi8GetElementCount: declare fixed element-count input const at its definition; insns 115/115, structural/exact diffs (2, 13), fuzzy 98.391304, code 3548, data 72. Restored pending gates.
- MAX2 c2_02 Zi8GetElementCount: put element exhaustion before character count in traversal condition; insns 115/115, structural/exact diffs (7, 19), fuzzy 96.347824, code 4168, data 144. Restored pending gates.
- MAX2 c2_03 Zi8GetElementCount: limit saved separator state lifetime to spacing operation; insns 118/115, structural/exact diffs (11, 113), fuzzy 90.68696, code 4168, data 24. Restored pending gates.
- MAX2 p2_01 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: recover proven staged request endpoint and inline partial-page accounting; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_02 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep helper request-end input signed while unsigned overlap remains native sector count; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
MAX2 engine diagnosis: fetched origin/main; current landed chained table initializer remains96.27482%,10676/10676,0x4e0 frame. Branch-aware earlier disassembly proves returned-value copies and two missing narrow conversions before any allocation tuning; new immutable element view and chained lifetime probes rejected. Actual Zi8GetPCode returns ziU16, but correcting just that contract grows two instructions and regresses exception data. No volatile proof for changed definitions.
MAX2 GetElementCount diagnosis: fetched origin/main still99.347824%,115/115 and0x230 frame, all13 original differences are count/element-count register coloring. New const input definition also regresses an inlined caller; all trials restored. Saved separator load is separated from its store by a helper call and does not justify volatile.
MAX2 cache diagnosis: fetched origin/main still98.21889%,233/233 and0x30 frame. Nine differences solely third/right overlap arithmetic. Recovered prior MAX candidate from /tmp/fz4-max-pf-M19.c: staged endpoint addition and inline partial-page accounting have structurally identical instructions except four r4/r5 operand/register choices. No uninitialized or volatile state, same overlap range and flags. Re-test before considering new alias/lifetime boundaries. pf_cache has no allocated data; pf_fat64/64, ChannelObj2216/2216, lyt_window316/316 already exact data, no symbol rename or extent change is justified.
MAX2 spelling declaration search after four structural attempts: (0, 29) | best (0, 29) after 52 builds; source restored; best order was: | ziWChar* candidateCursor; | ziWChar* spellingCursor; | int index; | int matches; | int candidateLength; | ziWChar spacedSpelling[64]; | ziWChar spacedCandidate[64]; |
- MAX2 p2_03 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: return signed last-sector result from partial-page accounting helper; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_04 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use const-qualified page pointer formal at helper definition; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_05 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: subtract page sector from helper endpoint in place after preserving last sector; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_06 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use a signed last-sector local with unsigned overlap range; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
MAX2 retained cache partial-page accounting helper: target/ours233/233, same branches and operands; only four r4/r5 differences. Fuzzy98.21889->99.8927, exact35/36 unchanged, code6464/7396, no data. Quick gate:
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.9865 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.98648
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 99.8927
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
regressions vs baseline: 0
global matched_code_percent: 90.47482 -> 90.47482
global fuzzy_match_percent: 99.57024 -> 99.57076
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
- MAX2 f2_01 PFFAT_FreeChain: preserve inline FAT-type dispatch return boundary for clear-entry result; insns 254/254, structural/exact diffs (0, 17), fuzzy 99.56693, code 11556, data 64. Restored pending gates.
- MAX2 f2_02 PFFAT_FreeChain: share inline dirty-page flush lifetime at both exit paths; insns 256/254, structural/exact diffs (21, 123), fuzzy 97.67716, code 11556, data 64. Restored pending gates.
- MAX2 f2_03 PFFAT_FreeChain: combine independent inline clear-entry and dirty-page flush boundaries; insns 254/254, structural/exact diffs (0, 30), fuzzy 99.291336, code 11556, data 64. Restored pending gates.
- MAX2 f2_04 PFFAT_FreeChain: read-only cached-page inputs at flush helper boundary; insns 254/254, structural/exact diffs (0, 24), fuzzy 99.44882, code 11556, data 64. Restored pending gates.
- MAX2 f2_05 PFFAT_FreeChain: page-first reusable inline flush helper; insns 254/254, structural/exact diffs (0, 30), fuzzy 99.291336, code 11556, data 64. Restored pending gates.
- MAX2 f2_06 PFFAT_FreeChain: clear helper cluster input first before volume selection; insns 254/254, structural/exact diffs (0, 17), fuzzy 99.56693, code 11556, data 64. Restored pending gates.
- MAX2 f2_07 PFFAT_FreeChain: share named flushing state declarations across both return paths; insns 254/254, structural/exact diffs (0, 17), fuzzy 99.56693, code 11556, data 64. Restored pending gates.
- MAX2 f2_08 PFFAT_FreeChain: use native unsigned-long sector and page copies at each flush boundary; insns 254/254, structural/exact diffs (0, 9), fuzzy 99.78346, code 11556, data 64. Restored pending gates.
- MAX2 f2_09 PFFAT_FreeChain: scope clear-entry result separately from chain-read and flushing errors; insns 254/254, structural/exact diffs (0, 13), fuzzy 99.64567, code 11556, data 64. Restored pending gates.
- MAX2 f2_10 PFFAT_FreeChain: combine separate write status with readonly flushing page views; insns 254/254, structural/exact diffs (0, 5), fuzzy 99.862206, code 11556, data 64. Restored pending gates.
- MAX2 f2_11 PFFAT_FreeChain: readonly flush page plus scoped signed-long write status; insns 254/254, structural/exact diffs (0, 5), fuzzy 99.862206, code 11556, data 64. Restored pending gates.
- MAX2 f2_12 PFFAT_FreeChain: preserve independent first flush error as signed long; insns 254/254, structural/exact diffs (0, 5), fuzzy 99.862206, code 11556, data 64. Restored pending gates.
- MAX2 f2_13 PFFAT_FreeChain: reuse the existing current page when flushing without a redundant copy; insns 254/254, structural/exact diffs (0, 13), fuzzy 99.64567, code 11556, data 64. Restored pending gates.
- MAX2 ch2_01 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: reconstruct ten four-byte language records, eight-byte RSO buffer, and first-match fallback termination; insns 195/195, structural/exact diffs (0, 4), fuzzy 99.89744, code 10144, data 2216. Restored pending gates.
- MAX2 ch2_02 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: make matched groups read-only views while visibility mutates their member panes; BUILD FAIL annelSelect\iplChannelObj.cpp # -------------------------------------------------- # 677: for (nw4r::lyt::PaneLinkList::Iterator it = group->GetPaneList().GetBeginIter(); it != group->GetPaneList().GetEndIter(); it++ # Error: ^ # (10248) function call '[const nw4r::lyt::Group].GetPaneList()' does not # match # 'nw4r::lyt::Group::GetPaneList()' (non-static) # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX2 ch2_03 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: scope named pane list reference inside each language visibility operation; BUILD FAIL data- # d1\src\scene\channelSelect\iplChannelObj.cpp:8) ### mwcceppc.exe Compiler: # File: src\scene\channelSelect\iplChannelObj.cpp # -------------------------------------------------- # 1249: for (nw4r::lyt::PaneLinkList::Iterator it = panes.GetBeginIter(); it != panes.GetEndIter(); it++) { # Error: ^^^^^ # (10140) undefined identifier 'panes' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. . Restored pending gates.
- MAX2 ch2_04 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: declare group returned by lookup as a fixed pointer at its definition; insns 195/195, structural/exact diffs (0, 4), fuzzy 99.89744, code 10144, data 2216. Restored pending gates.
MAX2 PFFAT_FreeChain diagnosis: fetched origin/main source unchanged. Target254/ours256, same0x40 frame, no adjacent-symbol overlap. Read FAT dispatch has per-case copies; write dispatch instead returns r3 through a common inline boundary before copying once. Shared error lifetimes color the second write status incorrectly. Inline clear-entry helper removes the extra two instructions; readonly flush page input fixes the final flushing register allocation, and scoped writeError fixes status allocation. Best f2_10 is254/254 with five register-only differences in the early flushing page/fat-sector locals. Data64/64 already exact; 60-byte fat_special_values plus trailing alignment, no symbol changes needed. Proceed to nested declaration search.
- MAX2 ch2_03b setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: scope named pane-list reference inside the owned visibility operations; insns 195/195, structural/exact diffs (6, 6), fuzzy 97.23077, code 10144, data 2216. Restored pending gates.
- MAX2 ch2_05 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: read matched groups through const local view and explicit legacy mutable accessor; insns 195/195, structural/exact diffs (0, 4), fuzzy 99.89744, code 10144, data 2216. Restored pending gates.
- MAX2 ch2_06 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: lookup matching group directly as a pane list pointer; insns 195/195, structural/exact diffs (6, 6), fuzzy 97.23077, code 10144, data 2216. Restored pending gates.
MAX2 PFFAT_FreeChain EXACT: inline clear-entry return boundary removes per-case return copies; separate write-error scope allows reuse of target r23. Const cached-page views reproduce read-only flushing lifetimes. Nested declaration search swapped fatSector/flushPage ordering: six builds, structural/exact0/0. Final readable candidate254/254, ctxdiff0, objdiff100%, unit34/35->35/35, code11556->12572, data64/64. Quick gate:
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVL_SDK/src/fa/pf_fat] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_fat] objdiff: code 12572/12572 data 64/64 functions 35/35 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/fa/pf_fat] instruction-exact functions: 35/35
[libs/RVL_SDK/src/fa/pf_fat] section .rodata size 64 match 100.0
[libs/RVL_SDK/src/fa/pf_fat] section .text size 12572 match 100.0
[libs/RVL_SDK/src/fa/pf_fat] baseline: code 11556/12572 data 64 functions 34 fuzzy 99.8346
regressions vs baseline: 0
global matched_code_percent: 90.47482 -> 90.50874
global fuzzy_match_percent: 99.57024 -> 99.57144
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
- MAX2 w2_01 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: return immutable texture-flip table reference and use readonly coordinate views; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_02 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: allow natural local storage for vertex-color setup result without const qualifier; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_03 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: use a single tex-coordinate object rather than one-element array; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_04 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: scope texture dimensions as a mutable Size copied from actual texture state; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_05 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: initialize white quad colors through an ordinary four-element constructor initializer; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 ch2_07 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: keep visible-pane traversal in a natural inline group helper with ch2_07; insns 153/195, structural/exact diffs (77, 103), fuzzy 78.30769, code 10144, data 2216. Restored pending gates.
- MAX2 ch2_08 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: keep visible-pane traversal in a natural inline group helper with ch2_08; insns 151/195, structural/exact diffs (80, 106), fuzzy 77.128204, code 10144, data 2216. Restored pending gates.
- MAX2 ch2_09 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: keep visible-pane traversal in a natural inline group helper with ch2_09; insns 153/195, structural/exact diffs (77, 103), fuzzy 78.30769, code 10144, data 2216. Restored pending gates.
- MAX2 ch2_10 setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: keep visible-pane traversal in a natural inline group helper with ch2_10; insns 151/195, structural/exact diffs (80, 107), fuzzy 77.128204, code 10144, data 2216. Restored pending gates.
- MAX2 p2_07 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: partial-page accounting reads sector through a const page view; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_08 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: consume caller endpoint through an in-out overlap count parameter; insns 233/233, structural/exact diffs (0, 8), fuzzy 99.74249, code 6464, data None. Restored pending gates.
- MAX2 p2_09 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: keep last-sector output pointer in accounting helper rather than its scalar return; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_10 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: readonly endpoint pointer is an explicit helper input boundary; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_11 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: introduce readonly geometry input separately from mutable dirty-page state; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 w2_06 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: read-only window geometry view at the frame-drawing boundary; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_07 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: name window dimensions as a const reference used by all geometry helpers; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_08 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: keep returned texture dimensions through const-reference lifetime extension; insns 376/376, structural/exact diffs (0, 119), fuzzy 98.17819, code 9848, data 316. Restored pending gates.
- MAX2 w2_09 DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: declare vertex-color storage before querying texture dimensions; insns 372/376, structural/exact diffs (80, 372), fuzzy 84.32979, code 9848, data 316. Restored pending gates.
MAX2 ChannelObj setLangPane diagnosis: fresh fetch still97.18974%,195/195. Target0x90 frame; original language rows use stride4 and record base0x40, RSO buffer8; fallback stops at null and first visible match. ch2_01 corrects those structural errors to99.89744%; all remaining four differences are group-pointer r28/r30. Helpers did not inline the visibility loops and regress instruction count; readonly groups require a mutable legacy pane-list accessor and do not move registers. No immediate reload or neighbouring extent issue; all2216 data bytes pair exactly.
MAX2 Window DrawFrame diagnosis: fresh fetch still98.17819%,376/376 and0xe0 frame. Every119 difference is register-only: shared flip table r31/r21, shifted geometry/material/alpha GPRs, temporary colors; branch/call order and stack-local offsets agree. Const flip-table view, scope/storage/type trials leave instruction stream unchanged. No immediate reload volatile evidence. Extent0x5e0 does not overlap DrawFrame4; all316 target data bytes already matched, extra source weak data ignored.
MAX2 GetElementCount final declaration search: (0, 13) | best (0, 13) after 13 builds; source restored; best order was: | ziU8 spacedIndex; | ziU8 elementIndex; | ziU8 count; | ziWChar spacedElements[256]; |
- MAX2 p2_12 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: page overlap count computed with modulo-32 two-complement displacement; insns 235/233, structural/exact diffs (14, 107), fuzzy 98.81974, code 6464, data None. Restored pending gates.
- MAX2 p2_13 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: set last-sector input via decrement in place before count subtraction; insns 234/233, structural/exact diffs (15, 108), fuzzy 98.49356, code 6464, data None. Restored pending gates.
- MAX2 p2_14 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: use signed long difference at partial-page helper input boundary; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_15 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: start helper count with endpoint then update using a separate subtract statement; insns 233/233, structural/exact diffs (0, 4), fuzzy 99.8927, code 6464, data None. Restored pending gates.
- MAX2 p2_16 PFCACHE_DoWriteNumSectorAndFreeIfNeeded: derive overlap from the inclusive last sector plus one; insns 234/233, structural/exact diffs (15, 108), fuzzy 98.49356, code 6464, data None. Restored pending gates.
MAX2 retained ChannelObj language-record layout and fallback exits. Target and ours195/195 with four surviving pointer-register differences,97.18974->99.89744%; data remains2216/2216. Last declaration search6 builds stayed0/4. Correct records and branch forms are useful gate-passing structural progress even while exact-count55/56 is unchanged (instruction counter54/56 has its existing calcCursorAnim branch-normalization artifact). Quick gate:
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/channelSelect/iplChannelObj] pool: IDENTICAL
[src/scene/channelSelect/iplChannelObj] objdiff: code 10144/10924 data 2216/2216 functions 55/56 fuzzy 99.9927 linked code 0
[src/scene/channelSelect/iplChannelObj] instruction-exact functions: 54/56
[src/scene/channelSelect/iplChannelObj] section .data size 1240 match 100.0
[src/scene/channelSelect/iplChannelObj] section .rodata size 784 match 100.0
[src/scene/channelSelect/iplChannelObj] section .sdata size 120 match 100.0
[src/scene/channelSelect/iplChannelObj] section .sdata2 size 72 match 100.0
[src/scene/channelSelect/iplChannelObj] section .text size 10924 match 99.992676
[src/scene/channelSelect/iplChannelObj] below 100: setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object 99.89744
[src/scene/channelSelect/iplChannelObj] baseline: code 10144/10924 data 2216 functions 55 fuzzy 99.7993
regressions vs baseline: 0
global matched_code_percent: 90.47482 -> 90.50874
global fuzzy_match_percent: 99.57024 -> 99.57214
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
MAX2 final source/data/coverage audit before full gate:
ZiMatchZHSpelling: 4 distinct successfully compiled source attempts this round; still open; every unsuccessful candidate restored.
zi8InternalGetZH: 4 distinct successfully compiled source attempts this round; still open; every unsuccessful candidate restored.
Zi8GetElementCount: 3 distinct successfully compiled source attempts this round; still open; every unsuccessful candidate restored.
PFCACHE_DoWriteNumSectorAndFreeIfNeeded: 16 distinct successfully compiled source attempts this round; still open; every unsuccessful candidate restored.
PFFAT_FreeChain: 13 distinct successfully compiled source attempts this round; EXACT and committed.
setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object: 9 distinct successfully compiled source attempts this round; still open; every unsuccessful candidate restored.
DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc: 9 distinct successfully compiled source attempts this round; still open; every unsuccessful candidate restored.
Remaining exact counts: zi8cgetc5/8,pf_cache35/36,pf_fat35/35,ChannelObj54/56 instruction-exact (55/56 objdiff),lyt_window20/21. Total instruction-exact148->149; code52180->53196; data2740->2740.
Final cache declaration searches: helper2 orders and caller52, both0/4 unchanged; final Window declaration search13 orders0/119 unchanged. Definition-level const was retained only on the FAT flushing page read views; no new volatile declarations/casts, inline assembly, data pinning, padding, raw offset casts, config or shared header changes.
Data audit: cgetc four compiler-generated switch tables remain392 bytes with98 relocations in both objects, all refer into inexact zi8InternalGetZH. Compiler-internal labels are not real source names; no rename justified. Cache has no noncode sections. FAT, ChannelObj and Window named data are already100% paired; trailing alignment and target-unowned weak output need no edit.
Uncertainty: engine narrow-return and copied-result helper boundaries remain unresolved; allocation causes for the remaining four cache/ChannelObj differences and119 Window differences are compiler ties after structural probes. Retained cache/channel structural progress does not claim exactness.
MAX2 final full non-quick gate over all five units:
```
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] pool: IDENTICAL
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] objdiff: code 4168/47816 data 144/536 functions 5/8 fuzzy 96.6547 linked code 0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] instruction-exact functions: 5/8
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .data size 392 match None
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sbss2 size 8 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .sdata2 size 16 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section .text size 47816 match 96.65468
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extab size 48 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] section extabindex size 72 match 100.0
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: ZiMatchZHSpelling 98.80165
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: zi8InternalGetZH 96.27482
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] below 100: Zi8GetElementCount 99.347824
[libs/RVLMiddleware/eZiText/src/clib/zi8cgetc] baseline: code 4168/47816 data 144 functions 5 fuzzy 96.6547
[libs/RVL_SDK/src/fa/pf_cache] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_cache] objdiff: code 6464/7396 data None/None functions 35/36 fuzzy 99.9865 linked code 0
[libs/RVL_SDK/src/fa/pf_cache] instruction-exact functions: 35/36
[libs/RVL_SDK/src/fa/pf_cache] section .text size 7396 match 99.98648
[libs/RVL_SDK/src/fa/pf_cache] below 100: PFCACHE_DoWriteNumSectorAndFreeIfNeeded 99.8927
[libs/RVL_SDK/src/fa/pf_cache] baseline: code 6464/7396 data None functions 35 fuzzy 99.7755
[libs/RVL_SDK/src/fa/pf_fat] pool: IDENTICAL
[libs/RVL_SDK/src/fa/pf_fat] objdiff: code 12572/12572 data 64/64 functions 35/35 fuzzy 100.0000 linked code 0
[libs/RVL_SDK/src/fa/pf_fat] instruction-exact functions: 35/35
[libs/RVL_SDK/src/fa/pf_fat] section .rodata size 64 match 100.0
[libs/RVL_SDK/src/fa/pf_fat] section .text size 12572 match 100.0
[libs/RVL_SDK/src/fa/pf_fat] baseline: code 11556/12572 data 64 functions 34 fuzzy 99.8346
[src/scene/channelSelect/iplChannelObj] pool: IDENTICAL
[src/scene/channelSelect/iplChannelObj] objdiff: code 10144/10924 data 2216/2216 functions 55/56 fuzzy 99.9927 linked code 0
[src/scene/channelSelect/iplChannelObj] instruction-exact functions: 54/56
[src/scene/channelSelect/iplChannelObj] section .data size 1240 match 100.0
[src/scene/channelSelect/iplChannelObj] section .rodata size 784 match 100.0
[src/scene/channelSelect/iplChannelObj] section .sdata size 120 match 100.0
[src/scene/channelSelect/iplChannelObj] section .sdata2 size 72 match 100.0
[src/scene/channelSelect/iplChannelObj] section .text size 10924 match 99.992676
[src/scene/channelSelect/iplChannelObj] below 100: setLangPane__Q33ipl5scene10ChannelObjFPCQ33ipl6layout6Object 99.89744
[src/scene/channelSelect/iplChannelObj] baseline: code 10144/10924 data 2216 functions 55 fuzzy 99.7993
[libs/NW4R/src/lyt/lyt_window] pool: IDENTICAL
[libs/NW4R/src/lyt/lyt_window] objdiff: code 9848/11352 data 316/316 functions 20/21 fuzzy 99.7586 linked code 0
[libs/NW4R/src/lyt/lyt_window] instruction-exact functions: 20/21
[libs/NW4R/src/lyt/lyt_window] section .ctors size 4 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .data size 256 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .sbss size 8 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .sdata2 size 48 match 100.0
[libs/NW4R/src/lyt/lyt_window] section .text size 11352 match 99.75864
[libs/NW4R/src/lyt/lyt_window] below 100: DrawFrame__Q34nw4r3lyt6WindowFRCQ34nw4r4math4VEC2RCQ44nw4r3lyt6Window5FrameRCQ34nw4r3lyt15WindowFrameSizeUc 98.17819
[libs/NW4R/src/lyt/lyt_window] baseline: code 9848/11352 data 316 functions 20 fuzzy 99.7586
regressions vs baseline: 0
global matched_code_percent: 90.47482 -> 90.50874
global fuzzy_match_percent: 99.57024 -> 99.57214
global complete_code_percent: 70.30611 -> 70.30611
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```
Verified before->after instruction-exact/code/data: zi8cgetc5/4168/144->5/4168/144; pf_cache35/6464/0->35/6464/0; pf_fat34/11556/64->35/12572/64; ChannelObj54/10144/2216->54/10144/2216; lyt_window20/9848/316->20/9848/316. All pools identical, full build succeeds, DOL SHA1 equals26116613f624061ba99c8d1a299aaa6efa85670d, zero regressions/forbidden/readability additions. One new exact function; all six remaining objdiff-open functions have3+ distinct source attempts logged. Source commits539696bc,45bc3cf5,9c7be675. Matching flags remain unchanged; no linking investigation.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
## beq+b inside onEventDerived (solved — switch-dispatch + case-fallthrough structure)
- Orig's ON_TRIG case: `if (con == NULL) break;` (real break → switch join), `if (con->downTrg(...)) { if (mState == STATE_COVER_NORMAL || mState == STATE_NORMAL) {buttons} }` — arms and failed guards FALL THROUGH to ON_POINT code (0x31c) — no break after the if-chain; the positive `||` mState-guard emits `beq body` + `bne ON_POINT`.
- start_drag_event: `switch (mState) { case STATE_NORMAL: if (mMode == 0) break; /*fall*/ default: return; }` reproduces `beq fwd / b ret` per clause — the `b` is default's arm edge placed between dispatch test and case body. Sequential `if`s, `||`, goto, if/else all fold to single `bne`.
- Residual: pure reg-web coloring (orig this→r29/con→r30/paneName→r31 vs mine r27/r28/r30) — liveness-priority coloring, no source lever (keep-vs-remat wall family).
- movePane_onDrag: `width += 0.01f` was INSIDE the `if (textBox && name)` block in orig (b 0x164 skips it). `&&` clause polarity `bne fwd / b end` still folded in mine (block-layout tie).

View File

@@ -0,0 +1,8 @@
## get_friendinfo keep-vs-remat (88%)
Orig caches mString.mName (this+0x2b4) and mString.mDisplayText (this+0x2cc)
pointers in r29 across the FindPaneByName+set_textbox calls (extra addi + mr
reuse, +2 insns); mine rematerializes the member addresses inline at the call.
Orig this=r28, ptr webs=r29 (reused sequentially for both ptrs). Mine this=r29,
no ptr webs - the callee-reg web rotation differs by one position. Same
documented keep-vs-remat + web-ordering wall family as create/CDBRecordEncrypt.

View File

@@ -7,3 +7,29 @@
- **setEventHandler r5 mystery (documented):** orig calls `setEventHandler__Q33ipl5scene8SDButtonFPQ23gui12EventHandlerPQ23gui12EventHandler` (2-param) at 4 sites in iplSDChannelSelect + 2 in iplSDChannelTitle with r5 NEVER materialized (no li/lwz/mr r5 in the 4-insn window before bl; callee is non-static so this=r3, event=r4, optOutEvent=r5 garbage). MWCC always emits `li r5,0` for the =NULL default (verified: both `(h, NULL)` and `(h)` call forms emit it in mine). iplAddress.o Button callers DO emit `li r5,0` for the analogous Button decl. No C++ source model reproduces a 2-param bl with unset r5 (1-arg call to a defaulted 2-param decl emits the default; a 1-param decl would mangle differently). Left as `(h, NULL)` explicit; ~4 insn residual across create/selectChannel/initializeNormalPage/calcCommon/onEventDerived.
- kpr_lib: orig's `once$2281` is an 8-byte fn-local accessed via lbz/stb → decoded as `static union { u64 align; u8 flag; }` inside KPRInitQueue — gives size-8 `once$` + .sbss 0x10 and .sbss scored 100%. Orig's .sbss ordering [DeadKeys@0,Romaji@4,once@8] vs mine [once@0,Romaji@4,DeadKeys@8] is MWCC reverse-decl-order emission; objdiff .sbss scores 100 anyway. kpr_lib now 8/9 fns, all data 100.
- iplSDMemory: removed dead `#pragma inline_max_total_size` (no effect). drawTransferTitles: orig re-materializes f32 consts from sdata (`lfs f0,const@sda21`) where mine spills/reloads stack copies — frame-lever not found. create: 1064 vs 1060, mostly lbl_/@N symbol-name + r30/r31 data-base home.
## beq+b two-way dispatch — SOLVED (onEventDerived)
Orig emits `beq fwd / b end` pairs where single-branch guards were expected.
Produced by a real `switch (event) { case 0: BODY; break; default: break; }`
dispatch — MWCC keeps the 2-arm dispatch layout instead of folding to `bne`.
`if`/`else` and `goto` forms all fold back to a single `bne`; only `switch`
reproduces it. Applied at the `event == 0` check in the anon
SDChannelSelectButtonEventHandler::onEventDerived → 144/144 insn-identical.
The same pair inside a u64 `<` compare (handleSDTitleListResult `neg.` hi-test)
has no applicable source form — that one stays a wall.
## switch-on-bool dispatch (handleSDTitleListResult)
Orig emits `beq fwd-body / b ret` where a plain `if (u64 < K) return;` folds to single `bne ret`.
Decode: `switch (x < K) { default: BODY; break; case true: return; }` — `default` arm FIRST
(source order) with the bool-compare as discriminant → MWCC emits the two-arm dispatch
(171/171 insn-equal). `case false:` regresses (jump-table range dispatch), if/else folds.
Residual: orig uses `neg.` flags directly (`beq`); mine emits `neg` + `cmpwi 1` + `beq` —
same insn count, operand-level diff only.
## Dead-arm fossil (iplAddressEdit, earlier)
An unreachable empty `case N:` arm in a switch materializes a dead `b end` between
dispatch and bodies: `case 4: break;` in start_left_event → EXACT 96/96;
`case 4: goto done;` in start_point_event → 182/182. Only works in range-mapped
dispatch (table/dense compare); every listed case in a compare-chain gets its own
cmpwi level — the trick cannot produce extra `b` edges there (set_err_msg stays +1).

View File

@@ -0,0 +1,94 @@
## drawTransferTitles — setTitleRowColors decode (session cont.)
- Helper signature: `setTitleRowColors(TextBox*, const ut::Color&, const ut::Color&)` — mangle `RCQ34nw4r2ut5Color` proven via orig .text symbol.
- Orig callsite: `Color c; writeFourFlagBytes(&c.r,...); Color a=c; Color b=c; setTitleRowColors(tb,a,b)` — 3 memberwise byte-copies (lbz/stb x4) from the same source.
- DECODE: orig's `ut::Color()` ctor was TRIVIAL in this TU — orig emits no WHITE-init `stw` anywhere in drawTransferTitles and no `__ct__Color` weak def. Gated via `IPL_SDMEMORY_TRIVIAL_COLOR_CTOR` -> `Color() {}`. Produces exact 451-insn instruction stream (structure identical; residual = stack slot numbering + sched + regalloc).
- WALL: weak-emission asymmetry — orig UND-references `__as__Color`/`__dt__PaneManager`/`__ct__PaneManager`/`__dt__Interface`/`__dt__scroller`/`__dt__Scroller`/`__dt__BScroller` (emitted weak in OTHER TUs); ours emits them as weak defs here -> extra .text bytes. Same family as iplGCWindow's weak-dtor backup wall.
- Result: drawTransferTitles 96.99 fuzzy, create 99.13 (1064/1064 reg-home tie). Unit stays NonMatching.
## Weak-emission asymmetry — decl-only gating (session cont. 2)
- Mechanism: orig's TU sees many gui/nw4r members DECL-ONLY while ours inlines/emits weak defs. Orig .o UND-references: EventHandler{onEvent,setManager,setLatestEventCtrlNo,getLatestEventCtrlNo}, scene::scroller{calc,is_busy,~scroller}, Pane::SetVisible, Pane::SetTranslate, ipl::gui::PaneManager{ctor,~}, Color::operator=(const Color&), iplSDChannelTitle_copyTitleRange.
- Orig emits the 3 handler vtables as unnamed .data objects (4 slots each: onEvent + 3 UND EventHandler slots).
- Gates applied: IPL_SDMEMORY_PANEMANAGER_DECL_ONLY (iplGuiManager.h ctor+~PaneManager), IPL_SDMEMORY_DECL_ONLY_GUI (GUIManager.h EventHandler 4 virtuals + Pane::SetVisible), IPL_SDMEMORY_DECL_ONLY_SCROLLER (iplFocusObject.h ~scroller+calc+is_busy), IPL_SDMEMORY_TRIVIAL_COLOR_CTOR (Color() trivial + operator=(const Color&) decl + ~Color undec'd, ~Rect undec'd).
- DECODE: setTitleLists calls free fn iplSDChannelTitle_copyTitleRange(&dst,&src) x2 — NOT operator= (53/53 insn-equal now).
- Result: extra weak defs 28 -> 4 (__dt__Scroller, __dt__Rect, getPane__PaneComponent, offPoint__Component — all unreferenced emission fossils; the getPane/offPoint CALLSITES are identical virtual dispatches vs orig). .text 21012 vs orig 20920 (+92B fossils).
- create regalloc rotation noise (r30 vs r31 home) after layout shift — count-equal family.
## Decl-only gating cont. — weak-emission fully resolved (session cont. 3)
- All 28 extra weak defs eliminated: additional gates = offPoint/getPane decl-only (GUIManager.h under IPL_SDMEMORY_DECL_ONLY_GUI — the virtual CALLSITES are byte-identical bctrl dispatches vs orig; only the weak DEF emission differed) + scroller ctor teardown (decl-only ~scroller/calc/is_busy kills __dt__Scroller fossil) + ~Rect undec kills __dt__Rect fossil + setTitleLists now calls iplSDChannelTitle_copyTitleRange (kills __as__TitleRange).
- .text now 20836 vs orig 20920 (-84B). .data relocs byte-identical incl. the 3 handler vtables at same offsets with UND slot targets = orig.
- REGRESSION to document: .data shrank 3144 -> 2996 (-148B). Orig's .data has a 148B ALL-ZERO tail after the last vtable (no relocs) — provenance unknown (link slack from split? a zero .data object our reconstruction lacks?). Pre-gate .data was coincidentally filled by the weak-vtable emission region (zero bytes + relocs). matched_data dropped 100 -> 5.98 as a side effect of removing the wrong vtables; .data fuzzy = 97.59.
- create fuzzy 98.07 (reg-homing rotation after layout shift), drawTransferTitles 96.99.
---
## Weak-emission asymmetry — decl-only gating (session cont. 2)
- Mechanism: orig's TU sees many gui/nw4r members DECL-ONLY while ours inlines/emits weak defs. Orig .o UND-references: EventHandler{onEvent,setManager,setLatestEventCtrlNo,getLatestEventCtrlNo}, scene::scroller{calc,is_busy,~scroller}, Pane::SetVisible, Pane::SetTranslate, ipl::gui::PaneManager{ctor,~}, Color::operator=(const Color&), iplSDChannelTitle_copyTitleRange.
- Orig emits the 3 handler vtables as unnamed .data objects (4 slots each: onEvent + 3 UND EventHandler slots).
- Gates applied: IPL_SDMEMORY_PANEMANAGER_DECL_ONLY (iplGuiManager.h ctor+~PaneManager), IPL_SDMEMORY_DECL_ONLY_GUI (GUIManager.h EventHandler 4 virtuals + Pane::SetVisible), IPL_SDMEMORY_DECL_ONLY_SCROLLER (iplFocusObject.h ~scroller+calc+is_busy), IPL_SDMEMORY_TRIVIAL_COLOR_CTOR (Color() trivial + operator=(const Color&) decl + ~Color undec'd, ~Rect undec'd).
- DECODE: setTitleLists calls free fn iplSDChannelTitle_copyTitleRange(&dst,&src) x2 — NOT operator= (53/53 insn-equal now).
- Result: extra weak defs 28 -> 4 (__dt__Scroller, __dt__Rect, getPane__PaneComponent, offPoint__Component — all unreferenced emission fossils; the getPane/offPoint CALLSITES are identical virtual dispatches vs orig). .text 21012 vs orig 20920 (+92B fossils).
- create regalloc rotation noise (r30 vs r31 home) after layout shift — count-equal family.
## Decl-only gating cont. — weak-emission fully resolved (session cont. 3)
- All 28 extra weak defs eliminated: additional gates = offPoint/getPane decl-only (GUIManager.h under IPL_SDMEMORY_DECL_ONLY_GUI — the virtual CALLSITES are byte-identical bctrl dispatches vs orig; only the weak DEF emission differed) + scroller ctor teardown (decl-only ~scroller/calc/is_busy kills __dt__Scroller fossil) + ~Rect undec kills __dt__Rect fossil + setTitleLists now calls iplSDChannelTitle_copyTitleRange (kills __as__TitleRange).
- .text now 20836 vs orig 20920 (-84B). .data relocs byte-identical incl. the 3 handler vtables at same offsets with UND slot targets = orig.
- REGRESSION to document: .data shrank 3144 -> 2996 (-148B). Orig's .data has a 148B ALL-ZERO tail after the last vtable (no relocs) — provenance unknown (link slack from split? a zero .data object our reconstruction lacks?). Pre-gate .data was coincidentally filled by the weak-vtable emission region (zero bytes + relocs). matched_data dropped 100 -> 5.98 as a side effect of removing the wrong vtables; .data fuzzy = 97.59.
- create fuzzy 98.07 (reg-homing rotation after layout shift), drawTransferTitles 96.99.
## Trailing .data zeros (148B) — unrecreateable
Orig `.data` ends at 0xc48; ours at 0xbb4 — ours is a strict byte-identical prefix.
The missing 148B is an all-zero object dtk merged into `lbl_8165683C` (0xac = the
0x18 ControlPaneEventHandler vtable + 148B trailing zeros), emitted AFTER the
three event-handler vtables, unreferenced, no relocs.
Micro-test results (mwcceppc 3.0a5.2): EVERY all-zero decl goes to .bss —
`static u32 a[37] = {0}`, `= {}`, `static char b[148] = ""`, POD struct zero-init,
`__declspec(section ".data")`, `#pragma section ".data"` — all .bss.
So the zeros cannot be a standalone source-level object. Two remaining theories:
(1) pure-pad vtable slots (MCM precedent) — contradicted by `new
ControlPaneEventHandler` compiling in the same TU (abstract can't instantiate);
(2) same wall as MyTiLetterForm's "six trailing target zeros were not recreated
with padding" — an accepted tail artifact.
## Trailing .data zeros SOLVED — deduplicated weak vtables
The 148B all-zero tail = three weak vtables emitted in this TU then deduplicated
at link (dtk extraction shows zeros+no relocs, consistent with the MyTiInputForm
and iplSetting findings in data-d3/data-d4):
__vt__ipl::gui::PaneManager 0x5c (bb4..c10)
__vt__gui::EventHandler 0x18 (c10..c28)
__vt__gui::Interface 0x20 (c28..c48)
Earlier decl-only gates (IPL_SDMEMORY_DECL_ONLY_GUI /
IPL_SDMEMORY_PANEMANAGER_DECL_ONLY / IPL_SDMEMORY_DECL_ONLY_SCROLLER) suppressed
the weak emission; removing them emits the vtables in the same tail order and
.data becomes byte-identical (3144B, data 100%). Lesson: an orig data region of
zeros with no relocs after vtables = deduplicated weak vtable, NOT an all-zero
object — .bss-promotion analysis was the wrong frame.
## drawTransferTitles: copy-temp decode (451/451 insn-equal)
Orig's callsite copies the built Color into THREE disjoint stack slots per call
(4 lbz + 12 stb) — decoded as `Color(x)` copy-ctor temporaries:
`setTitleRowColors(titleText, Color(c), Color(c))` reproduces all three
materializations (MWCC emits a third dead temp in the arg area). The callee
still calls out-of-line `__as__Color` for its member copies — consistent with
decl-only `operator=(const Color&)` + inlined implicit copy-ctor in this TU.
Direct pass (`setTitleRowColors(t, c, c)`) removes 32 insns; named copies emit
`bl __as__` instead of memberwise bytes — neither matches. Remaining residual:
frame +0x20 slot layout + reg-web coloring (insn-equal tie).
## enqueue*/collect member-call conversion (post-rebase cleanup)
Removed the six `extern "C" bool iplSDChannelSelect_813Dxxxx` address-suffixed
stubs (banned identifier style). All 10 call sites now call real private member
fns via `mpSDChannelSelect->` with `friend class SDMemory` added to
iplSDChannelSelect.h (orig must have granted SDMemory access to the private
enqueue* members). Arg semantics decoded from callee impls: enqueue*Notice
page/index params are the u64 titleId halves (caller passes ((u32*)&entry)[0/1]
for the two-u32-arg callees; the raw u64 for enqueueStateNotice(u64,u32) which
emits pad-r4 + u64 in r5:r6 exactly as orig). The arg1 = this+i*8 pointer for
the 3-u32 callees is reproduced via `(u32)&mTitleIds[i] - offsetof(SDMemory,
mTitleIds)`. All call sites byte-identical after conversion.

View File

@@ -1,99 +0,0 @@
# linkgap-audio: eggAudioExpMgr — Equivalent-but-unlinkable analysis
Branch: agent/w1005/linkgap-audio. Unit stays **Equivalent**.
## Status
Per-symbol match is complete: all 8 .text fns + the 0x78 vtable match orig
(fuzzy 100.0 code+data, every fn individually 100). The .o emit set now
matches orig's exactly (see gates below).
**Remaining linker-visible diff: secondary-vt thunk emit order.**
- orig `.text` tail: `[@52@__dt__SimpleAudioMgrWithFx @+1fc][@52@calc__SimpleAudioMgr @+204]`
- mine: `[@52@calc @+1fc][@52@__dt__ @+204]` (swapped)
Both thunks are byte-identical bodies, so objdiff fn-level fuzzy is 100 for
each — but the .o's symbol order carries into the linked DOL, so flipping
Matching fails the DOL hash. This is the *only* blocker.
## Emit-set gates (kept)
`EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS` is defined at the top of
eggAudioExpMgr.cpp and gates these headers (TU-local: other TUs are
unaffected since the macro is only defined in this .cpp):
- `libs/EGG/include/egg/core/eggAudioArcPlayerMgr.h` — 9 ArcPlayer virtuals
(openArchive/openDvd/openNand/setupMemory/close/loadGroup/startSound/
prepareSound/holdSound families) -> non-inline decls for this TU.
- `libs/EGG/include/egg/core/eggAudioHeapMgr.h` — SoundHeapMgr
`loadState`/`getCurrentLevel` -> decls.
- `libs/NW4R/include/nw4r/ut/Lock.h` — `detail::AutoLock<OSMutex>` ct/dt ->
decls.
Without the gates MWCC weak-emits 10 extra inline fns (ArcPlayer
hold/prepare/startSound x9 + NonCopyable/AutoLock/SoundHeap helpers) that
orig's .o does not contain. With gates the emit set is byte-for-byte orig:
same 8 .text syms at the same offsets/sizes + `__vt__` at .data+0x0/0x78.
Residual cosmetic diff (does not affect the link): orig's
`__ct__AudioFxMgrArg` and `SaveState` are STB_GLOBAL; mine STB_WEAK.
Both dedup/resolve identically at link.
## Thunk-order mechanism (decoded)
Surveyed every orig .o with >=2 `@N@` adjustor thunks; my compiler
reproduces orig's order in ALL of them (iplSound, iplGCWindow,
iplMemoryCard, MyTiBg, tiCellPhone, iplBoard, ...) EXCEPT this unit.
Best-fit model for orig's ordering: thunks emit in the order the
*overriding virtuals are declared in the most-derived class*, with
thunks for inherited overrides emitted after the class's own declared
virtuals:
- SimpleAudioMgrWithFx declares `[~dtor, initialize]` -> own dtor thunk
first, then the inherited `SimpleAudioMgr::calc` thunk -> [dt][calc] = orig
- ipl::snd::System declares `calc` before `~System` -> [calc][dt] = orig
- iplMemoryCard `[onTrig,onLeft,onPoint,~dt]` -> that order = orig
(NOT .text def order, which is [onPoint,onLeft,onTrig])
- tiCellPhone `[~dt,updateInput,calc,draw,init]` = orig
My build instead emits thunks in *reverse secondary-vt slot order*
(the .rela.data stream is written backward — observable on every unit;
extraction .os sort relocs so orig's real write order is unknowable).
The two orders coincide for every surveyed unit except this one — it is
the only unit where a derived-declared dtor and an ancestor-declared
override (`SimpleAudioMgr::calc`, declared in the base) disagree.
## What flips it (and why it was vetoed)
Adding ANY second polymorphic class whose vt is built in this TU and
*shares* the secondary base flips the pair to orig's [dt][calc]:
verified with `class Sample : public SimpleAudioMgrWithFx` (emit
`[dt_WithFx][calc][dt_Sample]` — the parent's set comes out in forward
slot order once WithFx's vt is built as a parent). An unrelated
polymorphic class (no shared base) does NOT flip it; a declared-but-
never-defined derived class does NOT flip it (vt never built).
Mechanistically: orig's TU very likely caused WithFx's vt to be built
*as a parent* (a second derived class whose vt anchored elsewhere —
e.g. EGG's real `ipl::snd::System`-style class compiled in another TU
is the only known retail derivee), which emits the parent's thunks in
forward slot order. Any such class is invented here -> owner veto
(not in retail symbols). Orig's .o emits exactly one vtable, so no
second polymorphic class was ODR-emitted in the real TU either — the
trigger lived in code we cannot see (or is a compiler-version artifact).
## Tried and rejected (all still [calc][dt])
- dtor declared after `initialize` in the class decl
- dtor DEFINITION moved before/after ctor in the .cpp
- unrelated polymorphic class (no shared secondary base)
- derived class declared but never defined (no vt build)
## What would close it
A legitimate source construct that causes a second vt-build sharing
the ArcPlayer secondary vtable in this TU, or a linker-level symbol
ordering mechanism (none exists: symbols.txt is label-only, linker lays
out .text in .o symbol order). Until then: Equivalent.

View File

@@ -1,89 +0,0 @@
# linkgap leaf — iplChannelTitle + eggAudioExpMgr
## iplChannelTitle — emission restored, 3144 is provably impossible
Orig .o `.data` = 0x950; last symbol ends 0x87c; bytes 0x87c-0x950 are zeros
in both the extraction .o and the DOL (verified at DOL file off 0x31F504).
The 0xd4 tail = 5 weak-emitted vtables that lost link dedup:
| off | size | symbol |
|-------|------|-------------------------------|
| 0x87c | 92 | __vt__ipl::gui::PaneManager |
| 0x8d8 | 24 | __vt__gui::EventHandler |
| 0x8f0 | 32 | __vt__gui::Interface |
| 0x910 | 32 | __vt__ipl::nand::LayoutFile |
| 0x930 | 32 | __vt__ipl::nand::LangFile |
Emit rule used (old agent/w0929/linkgap scheme): a class weak-emits its
vtable in a TU that ODR-uses it (construction site; elided vptr stores
count) when every virtual DECLARED IN THAT CLASS is inline — inherited
non-inline virtuals don't block (LayoutFile emits despite non-inline
inherited virtuals because its own ~LayoutFile is inline here).
Source mechanism, all real decls, no invented names:
- `#define IPL_CHANNEL_TITLE_NOVTABLE` at cpp top (undef after includes).
- GUIManager.h: ~Interface -> `~Interface(){}` for CT (gate); EventHandler
loses `__declspec(novtable)` for CT.
- iplGuiManager.h: ~PaneManager -> `~PaneManager(){}` for CT.
- iplNand.h: LangFile's five virtuals gated to inline dummies for CT;
~LayoutFile -> `~LayoutFile(){}` for CT.
- `#pragma dont_instantiate ipl::math::HermiteIntp<float>` keeps
HermiteIntp's vtable UND (orig also UNDs it).
Result: all 5 emit STB_WEAK at the exact orig offsets, .data=0x950, the
raw .data bytes are byte-identical to orig's (all-zero tail), and the
full DOL is byte-identical (sha1 26116613f624061ba99c8d1a299aaa6efa85670d)
with the unit flipped Matching.
### Why matched_data cannot stay 3144 — objdiff internals, proven
`matched_data` sums sizes of sections at fuzzy==100. `.data` fuzzy is
computed (objdiff-core diff/data.rs `diff_data_section`) as:
- left_max/right_max = max end offset of scored symbols in the section
(symbols with size>0, not Section-kind, not Hidden).
- Compare section bytes over 0..max (patience diff) AND pair relocations
in the same range; if every left reloc matches, score =
max(symbol-name-match%, byte-diff%). Otherwise symbol-name-match only.
- Symbol-name-match = sum(size*match%)/sum(size) over left symbols.
Any symbol'd object emitted at 0x87c+ therefore scores <100 regardless
of content, because orig's extraction .o has neither a symbol nor a
reloc there (dedup'd weak emits are invisible in the DOL, so the
extractor dropped them — rela.data max offset is 0x878). Measured:
- 0 emits (.data=0x87c): .data fuzzy 100.0 -> matched_data 3144
- 5 emits (.data=0x950): .data fuzzy 95.35 -> matched_data 760
The only objdiff-invisible emit is a Hidden symbol (objdiff marks
ELF Linkage-scope/STB_LOCAL symbols Hidden). But a local emit cannot
lose dedup, so its content (vtable pointers) would be written into the
DOL -> nonzero tail -> hash fails. A local *zero-content* object would
satisfy both, but that is an invented score-only pad — not used.
RESOLUTION: name orig's real tail objects in config/43U/symbols.txt.
The orig .o is rebuilt by `dtk dol split` from symbols.txt; the tail
region had no entries, so objdiff's left_max stopped at 0x87c while my
emitted vtables pushed right_max to 0x950 -> byte-path Insert penalty
-> .data 95.35 / matched_data 760. Adding the 5 real objects
(lbl_8164EFE4/+0x5C, lbl_8164F040/+0x18, lbl_8164F058/+0x20,
lbl_8164F078/+0x20, lbl_8164F098/+0x20 — the dedup'd vtable emits)
extends left_max to 0x950: the byte path then compares the full
2384-byte range (zeros vs zeros) -> .data fuzzy 100 -> matched_data
3144, all 95 fns 100, every section 100, DOL sha1
26116613f624061ba99c8d1a299aaa6efa85670d byte-identical.
Also disproven this session: (a) the "one object per bounded run" was
symbols.txt label granularity, not real .o granularity — plain literals
are the correct source form (orig emits a single `addi r7, r31, off`
per ref; any named-table ref `scX + N` forces a shared-base hoist =
2-insn addressing, verified by capstone); (b) `symbol_mappings` in
objdiff.json is ignored by objdiff-cli 3.4.5 report (issue #279), and
lbl_* names can't be used in source anyway; (c)
SymbolFlag::Ignored is mips-only — no way to hide emitted symbols from
scoring.
## eggAudioExpMgr — see linkgap-audio branch notes
(Sample class deleted; secondary-vt [dtor][calc] thunk-order handled on
agent/w1005/linkgap-audio.)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +0,0 @@
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/memoryCard/iplMemoryCardManager] pool: IDENTICAL
[src/scene/memoryCard/iplMemoryCardManager] objdiff: code 2572/5396 data None/None functions 18/26 fuzzy 97.8836 linked code 0
[src/scene/memoryCard/iplMemoryCardManager] instruction-exact functions: 18/26
[src/scene/memoryCard/iplMemoryCardManager] section .text size 5396 match 97.88362
[src/scene/memoryCard/iplMemoryCardManager] below 100: isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl 99.830505
[src/scene/memoryCard/iplMemoryCardManager] below 100: isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl 99.830505
[src/scene/memoryCard/iplMemoryCardManager] below 100: isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs 92.30769
[src/scene/memoryCard/iplMemoryCardManager] below 100: update_file_array__Q33ipl5scene17MemoryCardManagerFUc 99.72222
[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 2572/5396 data None functions 18 fuzzy 97.8836
[src/scene/setting/iplRakuRakuThread] pool: IDENTICAL
[src/scene/setting/iplRakuRakuThread] objdiff: code 2168/2168 data 456/456 functions 14/14 fuzzy 100.0000 linked code 0
[src/scene/setting/iplRakuRakuThread] instruction-exact functions: 14/14
[src/scene/setting/iplRakuRakuThread] section .bss size 296 match 100.0
[src/scene/setting/iplRakuRakuThread] section .data size 136 match 100.0
[src/scene/setting/iplRakuRakuThread] section .sbss size 16 match 100.0
[src/scene/setting/iplRakuRakuThread] section .sdata size 8 match 100.0
[src/scene/setting/iplRakuRakuThread] section .text size 2168 match 100.0
[src/scene/setting/iplRakuRakuThread] baseline: code 1252/2168 data 456 functions 12 fuzzy 94.6900
[src/keyboard/tiCandidateBox] pool: IDENTICAL
[src/keyboard/tiCandidateBox] objdiff: code 19988/24000 data 4652/4652 functions 109/112 fuzzy 99.4395 linked code 0
[src/keyboard/tiCandidateBox] instruction-exact functions: 108/112
[src/keyboard/tiCandidateBox] section .ctors size 4 match 100.0
[src/keyboard/tiCandidateBox] section .data size 3488 match 100.0
[src/keyboard/tiCandidateBox] section .rodata size 1048 match 100.0
[src/keyboard/tiCandidateBox] section .sdata size 32 match 100.0
[src/keyboard/tiCandidateBox] section .sdata2 size 80 match 100.0
[src/keyboard/tiCandidateBox] section .text size 24000 match 99.4395
[src/keyboard/tiCandidateBox] below 100: create__Q39textinput12candidatebox12LayoutByNW4RFP12MEMAllocator 92.71023
[src/keyboard/tiCandidateBox] below 100: createAnmPane___Q39textinput12candidatebox12LayoutByNW4RFP12MEMAllocator 96.56481
[src/keyboard/tiCandidateBox] below 100: CalcPaneLocate___Q39textinput12candidatebox10UITextAreaFv 99.873566
[src/keyboard/tiCandidateBox] baseline: code 19988/24000 data 4652 functions 109 fuzzy 99.4395
regressions vs baseline: 0
global matched_code_percent: 90.71801 -> 90.74859
global fuzzy_match_percent: 99.57510 -> 99.57892
global complete_code_percent: 71.01273 -> 71.01273
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
note: config touched: config/43U/symbols.txt (orchestrator reviews every config/symbols change)
GATE PASS

View File

@@ -1,21 +0,0 @@
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/setting/iplRakuRakuThread] pool: IDENTICAL
[src/scene/setting/iplRakuRakuThread] objdiff: code 1636/2168 data 456/456 functions 13/14 fuzzy 97.7860 linked code 0
[src/scene/setting/iplRakuRakuThread] instruction-exact functions: 13/14
[src/scene/setting/iplRakuRakuThread] section .bss size 296 match 100.0
[src/scene/setting/iplRakuRakuThread] section .data size 136 match 100.0
[src/scene/setting/iplRakuRakuThread] section .sbss size 16 match 100.0
[src/scene/setting/iplRakuRakuThread] section .sdata size 8 match 100.0
[src/scene/setting/iplRakuRakuThread] section .text size 2168 match 97.78598
[src/scene/setting/iplRakuRakuThread] below 100: finish__Q33ipl5scene14RakuRakuThreadFP11NCDApConfigPi 90.97744
[src/scene/setting/iplRakuRakuThread] baseline: code 1252/2168 data 456 functions 12 fuzzy 94.6900
regressions vs baseline: 0
global matched_code_percent: 90.71801 -> 90.73083
global fuzzy_match_percent: 99.57510 -> 99.57732
global complete_code_percent: 71.01273 -> 71.01273
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
note: config touched: config/43U/symbols.txt (orchestrator reviews every config/symbols change)
GATE PASS

View File

@@ -1,20 +0,0 @@
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/scene/setting/iplRakuRakuThread] pool: IDENTICAL
[src/scene/setting/iplRakuRakuThread] objdiff: code 2168/2168 data 456/456 functions 14/14 fuzzy 100.0000 linked code 0
[src/scene/setting/iplRakuRakuThread] instruction-exact functions: 14/14
[src/scene/setting/iplRakuRakuThread] section .bss size 296 match 100.0
[src/scene/setting/iplRakuRakuThread] section .data size 136 match 100.0
[src/scene/setting/iplRakuRakuThread] section .sbss size 16 match 100.0
[src/scene/setting/iplRakuRakuThread] section .sdata size 8 match 100.0
[src/scene/setting/iplRakuRakuThread] section .text size 2168 match 100.0
[src/scene/setting/iplRakuRakuThread] baseline: code 1252/2168 data 456 functions 12 fuzzy 94.6900
regressions vs baseline: 0
global matched_code_percent: 90.71801 -> 90.74859
global fuzzy_match_percent: 99.57510 -> 99.57892
global complete_code_percent: 71.01273 -> 71.01273
global matched_data_percent: 99.36639 -> 99.36639
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
note: config touched: config/43U/symbols.txt (orchestrator reviews every config/symbols change)
GATE PASS

View File

@@ -1,34 +0,0 @@
# rt8 HIGH report
Final full gate: GATE PASS. Full 43U build passed, DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d, zero regressions and zero forbidden/readability additions. Final gate output is rt8.high.final-gate.txt.
Before -> after:
- MemoryCardManager instruction-exact18->18, objdiff code2572->2572/5396, data absent.
- RakuRakuThread instruction-exact12->14, objdiff code1252->2168/2168, data456->456/456.
- tiCandidateBox gate instruction-exact108->108, objdiff exact109->109, code19988->19988/24000, data4652->4652/4652.
Remaining functions:
- isMoveEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl | 99.830505% | two commuted address-add operands
- isCopyEnable__Q33ipl5scene17MemoryCardManagerFUcUlPl | 99.830505% | two commuted address-add operands
- isBannerEnable__Q33ipl5scene17MemoryCardManagerFUcs | 92.30769% | epilogue setup scheduled before flag load
- update_file_array__Q33ipl5scene17MemoryCardManagerFUc | 99.72222% | four command/address register substitutions
- _create_icon__Q33ipl5scene17MemoryCardManagerFUcsl | 87.55% | texture-base lifetimes, address operands and register allocation
- getComment__Q33ipl5scene17MemoryCardManagerFUcsi | 98.94309% | comment/trim pointer register allocation
- create_banner__Q33ipl5scene17MemoryCardManagerFUcs | 90.42453% | render address lifetimes and register allocation
- getBlocks__Q33ipl5scene17MemoryCardManagerFUcs | 92.0% | epilogue setup scheduled before size load
- create__Q39textinput12candidatebox12LayoutByNW4RFP12MEMAllocator | 92.71023% | inlined initialization loop and pane-name lifetimes
- createAnmPane___Q39textinput12candidatebox12LayoutByNW4RFP12MEMAllocator | 96.56481% | descriptor reloads and constructor register allocation
- CalcPaneLocate___Q39textinput12candidatebox10UITextAreaFv | 99.873566% | eleven forward-width f2/f3 substitutions
Matched this round:
- start__Q33ipl5scene14RakuRakuThreadFv: separate progress and configuration objects restore compiler BSS pooling,96/96 instructions,diffs0.
- finish__Q33ipl5scene14RakuRakuThreadFP11NCDApConfigPi: structured finish guard and typed inline privacy copy restore133/133 instructions,diffs0.
Data proof: previous F4-byte sRakuStatus bundled12-byte progress with adjacent232-byte configuration. Target callback copy/clear and result/clear API arguments prove separate C/E8 objects at unchanged810BDDE0/810BDDEC. Combined byte ownership and BSS section0x128 remain unchanged. Both functions and all data now match fully.
Commits: d408dadb,14b52bf2.
Retained implementation files: src/scene/setting/iplRakuRakuThread.cpp, config/43U/symbols.txt.
Verification files: rt8.attempts.md,rt8.high.raku13-gate.txt,rt8.high.raku14-gate.txt,rt8.high.final-gate.txt.
Measurement caveat: gate reports candidatebox108/112 while objdiff reports109/112. onGUIEvent raw1800bytes are identical; odiff treats a condition-register operand as a branch target and subtracts different function starts. Tools were not changed.
All remaining functions have at least three distinct compiled HIGH attempts recorded in rt8.attempts.md.