Compare commits

..

1 Commits

Author SHA1 Message Date
devin
449fb9a66e Decode iplSDChannelTitle + ut_ArchiveFontBase (source-only, stays NonMatching)
- SDButton::setEventHandler was genuinely 1-arg in retail (dead second
  param): corrected decl/def/call sites + symbols.txt mangle. Fixes 5
  fns to instruction-identical and lifts iplSDChannelTitle data to
  .data/.rodata/.sdata/.sdata2 100% (was 12.1%).
- ut_ArchiveFontBase: reordered sheetOffsetsScratch decl/assign to
  match orig materialization.

Both units remain NonMatching — flip attempts verified to break the
linked DOL: iplSDChannelTitle's object emits 51 net-extra anonymous
literal objects (pool merge/order differs, fuzzy 99.94) plus two fns
+4B each (updateCopyStart, startCopyProgress); ut_ArchiveFontBase has
a ~0x380B content region differing (fuzzy 98.47). DOL sha1 stays
26116613f624061ba99c8d1a299aaa6efa85670d with them unlinked.

Co-authored-by: coah80 <usernamecole7@gmail.com>
Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-02 14:50:59 +00:00
16 changed files with 72 additions and 74 deletions

View File

@@ -4814,7 +4814,7 @@ reset_gui__Q33ipl5scene8SDButtonFv = .text:0x813E9BC0; // type:function size:0x1
startPointEvent__Q33ipl5scene8SDButtonFPCcPQ33ipl10controller9Interface = .text:0x813E9D08; // type:function size:0x258
startLeftEvent__Q33ipl5scene8SDButtonFPCc = .text:0x813E9F60; // type:function size:0x220
isActive__Q33ipl5scene8SDButtonCFv = .text:0x813EA180; // type:function size:0xC
setEventHandler__Q33ipl5scene8SDButtonFPQ23gui12EventHandlerPQ23gui12EventHandler = .text:0x813EA18C; // type:function size:0x14
setEventHandler__Q33ipl5scene8SDButtonFPQ23gui12EventHandler = .text:0x813EA18C; // type:function size:0x14
setText__Q33ipl5scene8SDButtonFPCcPCw = .text:0x813EA1A0; // type:function size:0xB4
animation__Q33ipl5scene8SDButtonFi = .text:0x813EA254; // type:function size:0x1C4
initArrowAppearance__Q33ipl5scene8SDButtonFib = .text:0x813EA418; // type:function size:0xD0

View File

@@ -772,7 +772,7 @@ config.libs = [
]
),
IPLSection("channelTitle", [
Object(Matching, "scene/channelTitle/iplChannelTitle.cpp"),
Object(Equivalent, "scene/channelTitle/iplChannelTitle.cpp"),
]
),
IPLSection("faceSelect", [
@@ -1908,7 +1908,7 @@ config.libs = [
[
Object(Matching, "core/eggAllocator.cpp"),
Object(Matching, "core/eggAudioArcPlayerMgr.cpp"),
Object(Matching, "core/eggAudioExpMgr.cpp"),
Object(Equivalent, "core/eggAudioExpMgr.cpp"),
Object(Matching, "core/eggAudioFxMgr.cpp"),
Object(Matching, "core/eggAudioMgr.cpp"),
Object(Matching, "core/eggAudioHeapMgr.cpp"),

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

@@ -103,11 +103,7 @@ namespace ipl {
*/
Object(EGG::Heap* heap, nand::LayoutFile* file, const char* directory, const char* fileName);
#ifdef IPL_CHANNEL_TITLE_NOVTABLE
virtual ~Object() {}
#else
virtual ~Object();
#endif
void initLocationAdjust();

View File

@@ -102,12 +102,7 @@ namespace ipl {
static const char* getButtonName(int button) { return smButtonName[button]; }
#endif
#ifdef IPL_SD_CHANNEL_SELECT_CPP
void setEventHandler(::gui::EventHandler * event,
::gui::EventHandler * optOutEvent = NULL);
#else
void setEventHandler(::gui::EventHandler * event, ::gui::EventHandler * optOutEvent);
#endif
void setEventHandler(::gui::EventHandler * event);
void setText(const char* paneName, u32 msgId);
void setText(const char* paneName, const wchar_t* text);

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,20 +1,6 @@
#define EGG_AUDIO_EXPMGR_NO_INLINE_VIRTUALS
#include <egg/core.h>
namespace EGG {
class Sample : public SimpleAudioMgrWithFx {
public:
Sample();
virtual ~Sample();
};
Sample::Sample() {
}
Sample::~Sample() {
}
SimpleAudioMgrWithFx::SimpleAudioMgrWithFx() {
}

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

@@ -368,20 +368,20 @@ namespace nw4r {
u32 sheetOffsetsScratchSize;
dataBlockCount = font->hdr.dataBlocks; // 0x0E
sheetGlyphCount = font->glgr.inner.sheetGlyphCount; // 0x1C
dataBlockCount = font->hdr.dataBlocks; // 0x0E
// countName = font->glgr.inner.nameCount;
countSheet = font->glgr.inner.sheetCount;
// count0A = font->glgr.inner.smthCount_0x0a;
// count0C = font->glgr.inner.smthCount_0x0c;
sheetOffsetsSize = ROUNDUP(countSheet * sizeof(u16), 4);
sheetOffsetsScratch = (u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
stepSheetFlags = detail::CalcSizeFlagSet(countSheet);
flagsSheetsOff = detail::CalcOffsetSheetFlags(font->glgr.inner.nameCount, countSheet, font->glgr.inner.smthCount_0x0a,
font->glgr.inner.smthCount_0x0c);
flagsSheets = (const u32*)font + (flagsSheetsOff >> 2);
sheetOffsetsSize = ROUNDUP(countSheet * sizeof(u16), 4);
sheetOffsetsScratch = (u16*)ROUNDDOWN((u32)((u8*)font + ctx->remWorkSpace()) - sheetOffsetsSize, 2);
pGlgr = &font->glgr;
ENSURE_WORK_HAS_SIZE(ctx, glgrEnd - (u8*)font + sheetOffsetsSize);
// if (ctx->pWorkEnd - workCurr < fontSizeToEndOfGlgr + sheetOffsetsSize) {

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

@@ -328,7 +328,7 @@ namespace ipl {
return isSceneCreated();
}
void SDButton::setEventHandler(::gui::EventHandler* event, ::gui::EventHandler* optOutEvent) {
void SDButton::setEventHandler(::gui::EventHandler* event) {
mpGui->setEventHandler(event);
}

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, NULL);
button->setEventHandler(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, NULL);
button->setEventHandler(NULL);
}
FaderSceneCommand SDChannelTitle::calcFadeout() {

View File

@@ -0,0 +1,57 @@
# mslmisc leaf attempts
Owned units: `src/scene/sdChannelTitle/iplSDChannelTitle.cpp`, `libs/NW4R/src/ut/ut_ArchiveFontBase.cpp`.
MSL checked via live report: only `MSL_Common/wprintf` incomplete — stays in misc1b's notes.
## DECODE: SDButton::setEventHandler retail dead-param (SOLVED)
orig's real decl was **1-arg** `setEventHandler(EventHandler*)`. Evidence:
- Every orig call site (title ×2, select ×4) emits a bare `bl` with only r3/r4 — never `li r5,0`.
- The 5-insn DEF (`lwz r3,0x60; lwz r12,0; lwz r12,0x38; mtctr; bctr`) forwards to `Manager::setEventHandler`, a 1-arg weak virtual — `optOut` was never consumed.
- `Button::setEventHandler` (a DIFFERENT class, genuine 2-arg impl at 0x8139C93C) DOES emit `li r5,0` in iplFocusObject — MWCC materializes default args, so SDButton's missing r5 means the decl never had it.
- The 2-arg mangle in symbols.txt was an author mislabel inherited from `Button`'s real 2-arg.
Fix (all kept): `iplSDButton.h` decl → `void setEventHandler(::gui::EventHandler* event);`; `iplSDButton.cpp` def → 1-arg; call sites in sdChannelTitle/sdChannelSelect → 1-arg; `config/43U/symbols.txt` line 4817 renamed `...8SDButtonFPQ23gui12EventHandlerPQ23gui12EventHandler` → `...8SDButtonFPQ23gui12EventHandler`. Flipped 5 fns to instruction-identical + all sdChannelTitle data sections to 100%.
Mechanism note: renaming a `.text` address in symbols.txt propagates through the splitter into orig's DEF name AND every caller's UND reloc name — the legit rename lever.
## UNSOLVED: enqueue*Notice leading dead-arg (r4)
`SDChannelSelect::enqueueChannelNotice(u32 controller, u32 page, u32 index, u32 value)` and
`enqueueStateNotice(u32 controller, u32 state, u32 type, u32)` (4×u32 each; defs build
`command.titleId = ((u64)page << 32) | index` — proven 4×u32, not u64).
orig call sites marshal r5/r6/r7 but **never write r4** (arg1 `controller` — dead param the
def bodies ignore; iplSDMemory callers DO materialize it). Same dead-arg family as
setEventHandler but on a LEADING arg — no decl form reproduces it:
- arg-count reduction shifts the marshal left (breaks r5/r6/r7 positions)
- defaulted params must be trailing
- `(u32,u64,u32)` still needs `li r4,0` for arg1
- `scene->mPage`/`mIndex`/`channel` as arg1 all emit real loads (`lwz`/`mr`) — orig has none
- r4 is call-clobbered at both sites (`bl findChannelObject`, `bl isReceiveScheduleStopped`)
so no "value already in r4" source expr exists
Residual = `+li r4,0` plus marshal-order (orig emits r6-before-r5 / addi-first) — scheduler family.
## TIE: flushSaveBeforeExit eval-order (98.59)
Insn+reloc-identical except a 6-word window: orig `lis r3` (smArg base→r3), `lwz r4,0x94` (stw-mgr),
`stw`, `lwz r4,0x28` (heap), `lwz r3,0x94` (flush receiver — reloaded LAST). Mine: base→r4,
receiver-load before heap-load. Orig evaluated the `flushAsync` ARG before the receiver reload.
Tried: `saveHeap` local (before/after stw, decl-init, separate assign — emits at-birth or at-use,
never between), `saveData`/`mgr` local (caches receiver → 5-insn form, wrong), nested
`flushAsync(System::getMem2App())` (same as original). All ~6-word identical or regression.
## TIE: ConstructOpAnalyzeGLGR 20-diff window (91.79)
239/239 insns — orig interleaves `lhz r31,0x1c` (sheetGlyphCount) + `lhz r23,0xe` (dataBlockCount)
mid-flag-chain (issued at birth, deep-callee homes); mine emits both at-use (`lhz r26/r25`,
~8 insns later). Same callee-web rotation family. Kept: flags-first reorder (24→20 diffs) +
the second `pGlgr = &font->glgr` assignment (removing it = 113 diffs). Decl-init variant no-op.
## Status
- iplSDChannelTitle: .text 99.9, all data sections 100% (baseline was data 12.1%). Three
sub-100 fns — all at the anomalies/ties above.
- ut_ArchiveFontBase: .text 98.5 — the 20-diff window.
- DOL sha1 `26116613f624061ba99c8d1a299aaa6efa85670d` verified. No shims; both units stay NonMatching.