cleanup: SD scenes and ChannelTitle (comma operators, duplicates, a pragma) #1342

Merged
coah80 merged 1 commits from agent/w0929/cleanup-c3-land into main 2026-10-09 17:29:47 +00:00
5 changed files with 121 additions and 37 deletions

View File

@@ -24,7 +24,6 @@
#undef IPL_CHANNEL_TITLE_NOVTABLE
// :)
#define PREV_LOADED_INDEX (1 - mLoadedIndex)
namespace ipl {
@@ -646,6 +645,7 @@ namespace ipl {
if (System::getFader()->getStatus() == EGG::Fader::PREPARE_IN && System::isReceiveScheduleStopped()) {
if (System::getNwc24Manager() && !System::getNwc24Manager()->isReceivingIdle()) {
// MWCC needs the shared exit label to preserve these branches.
goto scn_continue;
}
@@ -708,7 +708,7 @@ namespace ipl {
memcpy(titleName[1], System::getChannelManager()->getTitleName(mChanPage, mChanIndex, 1), sizeof(titleName[1]));
char code[] = {((char*)&mCurGameCode)[0], ((char*)&mCurGameCode)[1]};
__OSCreatePlayRecord(titleName[0], &((char*)&titleId)[sizeof(ESTitleId32)] /* :( */, code);
__OSCreatePlayRecord(titleName[0], &((char*)&titleId)[sizeof(ESTitleId32)], code);
OSReport("Create play recode\n"); // @BUG: recode instead of record
BS2SetStateFlags();
@@ -801,7 +801,7 @@ namespace ipl {
memcpy(titleName[1], System::getChannelManager()->getTitleName(mChanPage, mChanIndex, 1), sizeof(titleName[1]));
char code[] = {((char*)&mCurGameCode)[0], ((char*)&mCurGameCode)[1]};
__OSCreatePlayRecord(titleName[0], &((char*)&titleId)[sizeof(ESTitleId32)] /* :( */, code);
__OSCreatePlayRecord(titleName[0], &((char*)&titleId)[sizeof(ESTitleId32)], code);
OSReport("Create play recode\n"); // @BUG: recode instead of record
System::getBS2Manager()->startRVLGame();
@@ -1213,6 +1213,7 @@ namespace ipl {
}
}
// MWCC needs IRO level 0 to preserve the BS2 argument-base registers.
#pragma push
#pragma ppc_iro_level 0
void ChannelTitle::calcNormalParentalDialog() {
@@ -1313,7 +1314,7 @@ namespace ipl {
}
}
// uhh
// MWCC needs IRO level 0 to preserve ticket-check branches and register saves.
#pragma push
#pragma ppc_iro_level 0
void ChannelTitle::calcNormalWaitTmd() {
@@ -1455,6 +1456,7 @@ namespace ipl {
}
}
// MWCC needs IRO level 1 to preserve progress-bar register allocation.
#pragma push
#pragma ppc_iro_level 1
void ChannelTitle::calcNormalUpdating() {
@@ -1926,6 +1928,7 @@ namespace ipl {
bool noDisk = BS2State == bs2::IPL_STATE_NO_DISK;
nw4r::lyt::Group* group = mpDiskBnrLayout->FindGroupByName(scDiskGroups[DISK_ANIM_GRP_COMMENT]);
// MWCC needs group references to preserve pane-loop register allocation.
nw4r::lyt::Group*& groupAlias = group;
for (nw4r::lyt::PaneLinkList::Iterator it = groupAlias->GetPaneList().GetBeginIter(); it != groupAlias->GetPaneList().GetEndIter();
it++) {
@@ -2152,8 +2155,7 @@ namespace ipl {
}
BOOL ChannelTitle::checkNetSetting(int page, int index) {
// i hate this
// MWCC needs the shared return label to preserve this branch sequence.
BOOL flag = System::getChannelManager()->getSceneID(page, index) == SCENE_DISK_CHANNEL;
if (flag) {
goto yes;
@@ -2552,9 +2554,8 @@ namespace ipl {
if (mLimitType == LIMIT_TYPE_TIME) {
*hour = mTimeLimitRemain / (60 * 60);
// FAKEMATCH: should be modular division. not whatever this is
// MWCC needs subtraction through the stored hour value to preserve this sequence.
*minute = (mTimeLimitRemain - ((60 * 60) * *hour)) / 60;
//*minute = (u32)(mTimeLimitRemain % (60 * 60)) / 60U;
return TRUE;
} else {
return FALSE;
@@ -2675,8 +2676,6 @@ namespace ipl {
chanTtl->mbTmdReady = true;
}
#pragma push
#pragma ppc_iro_level 1
void ChannelTitle::getTicketLimitTask(void* work) {
ChannelTitle* chanTtl = static_cast<ChannelTitle*>(work);
@@ -2694,7 +2693,6 @@ namespace ipl {
}
chanTtl->mbTicketLimitReady = true;
}
#pragma pop
void ChannelTitle::deleteTmpTitleContentTask(void* work) {
ChannelTitle* chanTtl = static_cast<ChannelTitle*>(work);

View File

@@ -55,6 +55,7 @@ namespace ipl {
return count;
}
// MWCC needs IRO level 1 to preserve the layout-string base register.
#pragma push
#pragma ppc_iro_level 1
void SDMemory::create(EGG::Heap* heap, nand::LayoutFile* layoutFile, SDChannelSelect* channelSelect) {
@@ -1140,7 +1141,9 @@ namespace ipl {
if (blockCountMarker != NULL && message != NULL) {
format[0] = L'\0';
// MWCC retains this zero-length memset call in the original dialog setup.
memset(format + 1, 1, 0);
// MWCC needs unsigned address subtraction to preserve the logical shift.
wcsncat(format, message,
(reinterpret_cast<u32>(blockCountMarker) - reinterpret_cast<u32>(message)) >> 1);
wcscat(format, L"%d");
@@ -1269,9 +1272,7 @@ namespace ipl {
u32 lineLength;
const nw4r::math::VEC3& translation = mpDialogLayout->FindPaneByName("N_Memo")->GetTranslate();
nw4r::math::VEC3 memoPosition;
memoPosition.x = translation.x;
memoPosition.y = translation.y;
memoPosition.z = translation.z;
memoPosition = translation;
bodyY = memoPosition.y;
mpDialogLayout->FindPaneByName("header_header");
bodyPane = mpDialogLayout->FindPaneByName("header_body");

View File

@@ -206,12 +206,12 @@ namespace ipl {
getSceneHeap(), "corrupt_icon.ash", 0, 0, 0);
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
iplSDChannelObj_activateIfIdle(channel);
}
}
// MWCC needs IRO level 0 to preserve the BS2 wait-loop instructions.
#pragma push
#pragma ppc_iro_level 0
void SDChannelSelect::create() {
@@ -453,6 +453,7 @@ namespace ipl {
break;
}
// MWCC needs this branch shape to preserve worker-state dispatch.
if (mState < 8) {
if (mState == 1) {
} else if (mState >= 1) {
@@ -1646,6 +1647,7 @@ namespace ipl {
}
}
// MWCC needs IRO level 0 to load the flush heap before its receiver.
#pragma push
#pragma ppc_iro_level 0
void SDChannelSelect::flushSaveDataAndMountSD() {
@@ -1935,8 +1937,7 @@ namespace ipl {
SDChannelObj* channel = NULL;
System::getSaveData()->setLastSDPrevPage(mCurrentPage);
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
nw4r::ut::List_Remove(&mChannelObjects, channel);
destroyChannelObject(channel);
channel = NULL;
@@ -2054,8 +2055,7 @@ namespace ipl {
void SDChannelSelect::updateChannelObjects() {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
updateChannelObject(channel);
}
}
@@ -2071,16 +2071,14 @@ namespace ipl {
void SDChannelSelect::calcChannelObjects() {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
iplSDChannelObj_calc(channel);
}
}
void SDChannelSelect::drawChannelTransitionObjects() {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
int page = channel->mPage;
int index = channel->mIndex;
if (!hasChannelObject(page, index) || !isChannelReady(channel)) {
@@ -2145,6 +2143,7 @@ namespace ipl {
}
}
// MWCC needs this pragma to preserve calls from the drawing loops.
#pragma dont_inline on
BOOL SDChannelSelect::isChannelReady(const SDChannelObj* channel) {
return channel->mState == 3;
@@ -2153,16 +2152,14 @@ namespace ipl {
void SDChannelSelect::drawChannelObjects() {
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
if (hasChannelObject(channel->getPage(), channel->getIndex())) {
iplSDChannelObj_drawPage(channel);
}
}
channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
if (hasChannelObject(channel->getPage(), channel->getIndex())) {
iplSDChannelObj_drawDialog(channel);
}
@@ -3289,8 +3286,7 @@ namespace ipl {
button->disableBtn();
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
int channelPage = channel->getPage();
int channelIndex = channel->getIndex();
bool selected = channelPage == page && channelIndex == index;
@@ -3328,8 +3324,7 @@ namespace ipl {
mbDialogActive = false;
SDChannelObj* channel = NULL;
while (channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel)),
channel != NULL) {
while ((channel = static_cast<SDChannelObj*>(nw4r::ut::List_GetNext(&mChannelObjects, channel))) != NULL) {
iplSDChannelObj_resetPageAnim(channel, 1);
}

View File

@@ -54,10 +54,8 @@ extern "C" BOOL iplSDChannelTitle_isNetworkAllowed(SDChannelTitle*, ESTmdView*,
extern "C" BOOL iplSDChannelTitle_isParentalEnabled();
extern "C" void iplSDChannelTitle_beginLaunch(SDChannelTitle* scene, SDChannelObj* channel);
extern "C" void iplSDChannelTitle_prepareSceneExit(SDChannelTitle* scene, int nextScene);
extern "C" void iplSDChannelTitle_rebootSystem(SDChannelTitle*);
extern "C" bool iplSDChannelTitle_isLaunchDelayDone(SDChannelTitle* scene);
extern "C" void iplSDChannelTitle_setStartButtonPressed(SDChannelTitle* scene);
extern "C" void iplSDChannelTitle_drawDimOverlay(SDChannelTitle*, const nw4r::ut::Rect& bounds, GXColor color);
extern "C" void iplSDChannelTitle_setPaneMessage(SDChannelTitle*, nw4r::lyt::Pane* pane, u32 message, bool allocate);
extern "C" nand::LayoutFile* iplSDChannelTitle_loadBannerMetaFiles(SDChannelTitle*, ESTitleId title, nand::File** sound);
extern "C" void iplSDChannelTitle_fetchTmdViewTask(void* argument);
@@ -139,9 +137,6 @@ public:
extern "C" void iplSDChannelObj_applyLanguageGroups(layout::Object* layout);
extern "C" const wchar_t* iplSDChannelObj_getLocalizedName(SDChannelObj* channel, int nameIndex);
extern "C" bool iplSDChannelTitle_startZoomFade(SDChannelTitle* scene);
extern "C" void iplSDChannelTitle_rebuildBannerLayout(SDChannelTitle* scene);
extern "C" void iplSDChannelTitle_setPaneMessage(SDChannelTitle* scene, nw4r::lyt::Pane* pane, u32 message, bool allocate);
SDChannelTitle::SDChannelTitle(EGG::Heap* heap, SDChannelSelect* channelSelect)
: FaderSceneBase(heap), mState(0), mNextScene(0), mParentalResult(0),
@@ -765,6 +760,7 @@ extern "C" void iplSDChannelTitle_updateCopyPrepare(SDChannelTitle* scene) {
nandRange.mCount = scene->mTitleRange.mCount;
sdRange = scene->mTitleRange;
} else {
// MWCC needs the chained copy to preserve title-range copy order.
nandRange = sdRange = scene->mTitleRange;
}
SDMemory* memory = &scene->mMemory;
@@ -1342,6 +1338,7 @@ extern "C" void iplSDChannelTitle_prepareSceneExit(SDChannelTitle* scene, int ne
}
}
// MWCC needs IRO level 0 to preserve the save-manager address register.
#pragma push
#pragma ppc_iro_level 0
extern "C" void iplSDChannelTitle_flushSaveBeforeExit(SDChannelTitle* scene, int nextScene) {

View File

@@ -0,0 +1,93 @@
# cleanup-c3
Baseline `f1db6b656e386063a8bc263fb75a299f36ae4803`, branch `agent/w1009/cleanup-c3`.
Initial full 43U build passed. The live report is 100% matched and linked for code and data.
`DECOMPLETE_OK`; DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`.
Each trial rebuilds the owned object and compares its sections with the initial object.
Code, data, relocations and symbol records must remain identical. Compiler-generated local literal names and local-static numeric suffixes may change without changing the linked bytes.
Trials changing compiled bytes are restored. Final acceptance requires the four-unit gate and completion checker.
`drawTransferTitles` already uses `nw4r::ut::Color` directly, with no GXColor reinterpret casts or color copy chain.
## Trials
- REVERT `iplSDChannelSelect` remove scoped IRO pragma from void SDChannelSelect::create(): changed sections: .rela.text, .strtab, .symtab, .text.
- REVERT `iplSDChannelSelect` remove scoped IRO pragma from void SDChannelSelect::flushSaveDataAndMountSD(): changed sections: .text.
- REVERT `iplSDMemory` remove scoped IRO pragma from void SDMemory::create(: changed sections: .strtab, .text; .text 21992 -> 21992 bytes, 191 differing bytes.
- REVERT `iplSDChannelTitle` remove scoped IRO pragma from void iplSDChannelTitle_flushSaveBeforeExit: changed sections: .text; .text 19480 -> 19480 bytes, 8 differing bytes.
- REVERT `iplChannelTitle` remove scoped IRO pragma from void ChannelTitle::calcNormalParentalDialog(): changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 5 differing bytes.
- REVERT `iplChannelTitle` remove scoped IRO pragma from void ChannelTitle::calcNormalWaitTmd(): changed sections: .rela.text, .strtab, .symtab, .text; .text 30156 -> 30136 bytes, 13771 differing bytes.
- REVERT `iplChannelTitle` remove scoped IRO pragma from void ChannelTitle::calcNormalUpdating(): changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 12 differing bytes.
- KEEP `iplChannelTitle` remove scoped IRO pragma from void ChannelTitle::getTicketLimitTask: all ELF sections identical.
- REVERT `iplSDMemory` drawTransferTitles remove unused memo-position component copies: changed sections: .rela.text, .strtab, .symtab, .text; .text 21992 -> 21972 bytes, 5289 differing bytes.
- REVERT `iplSDMemory` drawTransferTitles replace component copy chain with VEC3 copy: changed sections: .rela.text, .strtab, .symtab, .text; .text 21992 -> 21996 bytes, 5275 differing bytes.
- REVERT `iplSDMemory` drawTransferTitles replace component copies with VEC3 assignment: changed sections: .strtab.
- KEEP `iplSDMemory` drawTransferTitles VEC3 assignment, allowing harmless local-literal renumbering: code, data, relocations and symbol records identical; local literal names renumbered.
- REVERT `iplSDMemory` onDialogState21 remove zero-length memset: changed sections: .comment, .rela.data, .rela.text, .strtab, .symtab, .text; .text 21992 -> 21976 bytes, 5873 differing bytes.
- REVERT `iplSDMemory` onDialogState21 use typed pointer difference for marker length: changed sections: .rela.text, .strtab, .symtab, .text; .text 21992 -> 21996 bytes, 6116 differing bytes.
- REVERT `iplSDChannelSelect` remove comma operators in drag traversal conditions: changed sections: .strtab.
- REVERT `iplChannelTitle` remove redundant group reference aliases: changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 12 differing bytes.
- REVERT `iplChannelTitle` checkNetSetting replace goto and bool copy with early returns: changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 13 differing bytes.
- REVERT `iplSDChannelTitle` updateMemoryCalc split chained title-range assignment: changed sections: .rela.text, .symtab, .text; .text 19480 -> 19484 bytes, 8220 differing bytes.
- REVERT `iplSDChannelSelect` drag traversal remove comma operators, allowing compiler-local names: changed sections: .strtab.
- REVERT `iplSDChannelSelect` flushSaveDataAndMountSD remove pragma with named save-data receiver: changed sections: .strtab, .text; .text 35264 -> 35264 bytes, 4 differing bytes.
- REVERT `iplSDChannelSelect` flushSaveDataAndMountSD remove pragma with named flush heap: changed sections: .strtab, .text; .text 35264 -> 35264 bytes, 4 differing bytes.
- REVERT `iplSDChannelTitle` flushSaveBeforeExit remove pragma with named page reference: compile failed.
- REVERT `iplSDChannelTitle` flushSaveBeforeExit remove pragma with named page value: changed sections: .strtab, .text; .text 19480 -> 19480 bytes, 8 differing bytes.
- REVERT `iplChannelTitle` calcNormalUpdating remove pragma with named update size: changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 13 differing bytes.
- REVERT `iplChannelTitle` calcNormalUpdating remove pragma with named update offset: changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 12 differing bytes.
- KEEP `iplSDChannelSelect` drag and prepare traversal remove comma operators; normalize local static suffixes: code, data, relocations and symbol records identical; local literal names renumbered.
- REVERT `iplSDChannelTitle` flushSaveBeforeExit remove pragma with correctly typed page reference: changed sections: .strtab, .text; .text 19480 -> 19480 bytes, 8 differing bytes.
- REVERT `iplSDChannelTitle` remove six duplicate helper forward declarations: compile failed.
- REVERT `iplSDChannelTitle` updateMemoryCalc split range copies in destination order: changed sections: .rela.text, .symtab, .text; .text 19480 -> 19484 bytes, 8202 differing bytes.
- REVERT `iplChannelTitle` checkNetSetting remove goto with existing boolean temporaries: changed sections: .rela.text, .strtab, .symtab, .text; .text 30156 -> 30164 bytes, 6831 differing bytes.
- REVERT `iplChannelTitle` calcFadeout replace exit goto with early return: changed sections: .rela.text, .strtab, .symtab, .text; .text 30156 -> 30164 bytes, 19807 differing bytes.
- REVERT `iplChannelTitle` isTimeLimitedChannel express remaining minutes with modulo: changed sections: .rela.text, .symtab, .text; .text 30156 -> 30160 bytes, 3840 differing bytes.
- KEEP `iplSDChannelTitle` remove duplicate helper declarations with declaration-only matching: code, data, relocations and symbol records identical; local literal names renumbered.
- REVERT `iplSDMemory` create remove pragma and declare title-cache locals at use: changed sections: .strtab, .text; .text 21992 -> 21992 bytes, 191 differing bytes.
- REVERT `iplSDChannelSelect` create remove pragma with upfront heap/timing declarations: changed sections: .rela.text, .strtab, .symtab, .text; .text 35264 -> 35260 bytes, 27101 differing bytes.
- REVERT `iplSDChannelSelect` prepare use for-loop list traversal without assignment condition: changed sections: .rela.text, .strtab, .symtab, .text; .text 35264 -> 35276 bytes, 27194 differing bytes.
- REVERT `iplSDChannelSelect` updateChannelObjects use for-loop list traversal without assignment condition: changed sections: .rela.text, .strtab, .symtab, .text; .text 35264 -> 35276 bytes, 13953 differing bytes.
- REVERT `iplSDChannelSelect` calcChannelObjects use for-loop list traversal without assignment condition: changed sections: .rela.text, .strtab, .symtab, .text; .text 35264 -> 35276 bytes, 13788 differing bytes.
- REVERT `iplSDChannelSelect` finishDrag use for-loop list traversal without assignment condition: changed sections: .rela.text, .strtab, .symtab, .text; .text 35264 -> 35276 bytes, 2198 differing bytes.
- REVERT `iplChannelTitle` calcNormalParentalDialog remove pragma with upfront dialog declaration: changed sections: .strtab, .text; .text 30156 -> 30156 bytes, 5 differing bytes.
- REVERT `iplChannelTitle` calcNormalWaitTmd remove pragma with direct ticket-flag initialization: changed sections: .rela.text, .strtab, .symtab, .text; .text 30156 -> 30136 bytes, 13771 differing bytes.
- REVERT `iplSDChannelTitle` updateMemoryCalc copy title range separately into both destinations: changed sections: .strtab, .text; .text 19480 -> 19480 bytes, 7 differing bytes.
- REVERT `iplSDChannelSelect` remove scoped dont_inline pragma: changed sections: .comment, .rela.text, .strtab, .symtab, .text; .text 35264 -> 35256 bytes, 13654 differing bytes.
- REVERT `iplSDChannelSelect` processWorkerCommands replace goto dispatch with structured state guard: changed sections: .rela.data, .rela.text, .strtab, .symtab, .text; .text 35264 -> 35256 bytes, 25748 differing bytes.
- KEEP `iplChannelTitle` remove discarded jokes and commented-out modulo alternative: all ELF sections identical.
- REVERT `iplSDChannelSelect` isChannelReady replace scoped pragma with existing NO_INLINE attribute: changed sections: .comment, .rela.text, .strtab, .symtab, .text; .text 35264 -> 35256 bytes, 13654 differing bytes.
- REVERT `iplSDChannelSelect` flushSaveDataAndMountSD remove pragma with named heap and save receiver: changed sections: .strtab, .text; .text 35264 -> 35264 bytes, 4 differing bytes.
- REVERT `iplSDChannelTitle` flushSaveBeforeExit remove pragma with named heap and save receiver: changed sections: .strtab, .text; .text 19480 -> 19480 bytes, 8 differing bytes.
## Retained cleanup
- `iplSDChannelSelect.cpp`: removed comma operators from all nine channel traversals. Kept the ordinary assignment conditions because for-loop versions added three instructions. Kept both IRO-0 scopes, the drawing-loop no-inline pragma and worker-state dispatch, with concise compiler explanations.
- `iplSDMemory.cpp`: replaced three component copies with `memoPosition = translation`. Colors were already direct `nw4r::ut::Color` values. Kept IRO-1, the zero-length memset call and unsigned marker-address subtraction, with concise compiler explanations.
- `iplSDChannelTitle.cpp`: removed five duplicate forward declarations. Kept IRO-0 and the chained title-range copy, with concise compiler explanations.
- `iplChannelTitle.cpp`: removed the IRO-1 scope from `getTicketLimitTask`, discarded jokes and the commented-out modulo alternative. Kept the other three IRO scopes, group references, shared goto exits and stored-quotient subtraction, with concise compiler explanations.
The first duplicate-declaration regex crossed into a definition and failed compilation; the source was restored and the corrected declaration-only trial passed. The first page-reference trial used `s32&` for an `int&` accessor; the corrected type compiled and still changed bytes.
Final focused object rebuild passed. All four objects have identical code, data, relocations and symbol records versus the initial objects. Only local literal labels and local-static numeric suffixes were renumbered in the first three units; `iplChannelTitle.o` is entirely identical.
Instruction evidence for retained pragmas: SDChannelSelect create loses one BS2-loop instruction without IRO-0; its flush swaps receiver/heap loads. SDMemory create changes its string-base register without IRO-1. SDChannelTitle flush changes the save-manager address register without IRO-0. ChannelTitle parental changes BS2 argument-base registers, TMD waiting loses five instructions, and update progress changes registers without their scopes.
## Final acceptance
`gate.py src/scene/sdChannelSelect/iplSDChannelSelect src/scene/sdChannelMemory/iplSDMemory src/scene/sdChannelTitle/iplSDChannelTitle src/scene/channelTitle/iplChannelTitle --quick` passed.
| Unit | Exact functions before -> after | Matched code | Matched data | Pools |
| --- | --- | --- | --- | --- |
| SDChannelSelect | 129/129 -> 129/129 | 33828/33828 | 2960/2960 | identical |
| SDMemory | 66/66 -> 66/66 | 20872/20872 | 3344/3344 | identical |
| SDChannelTitle | 69/69 -> 69/69 | 18624/18624 | 1976/1976 | identical |
| ChannelTitle | 95/95 -> 95/95 | 28788/28788 | 3144/3144 | identical |
Every owned objdiff section remains 100%. The gate independently found every owned function instruction-exact, 0 regressions, 0 forbidden patterns and 0 readability warnings. A separate comparison against the initial live report also found 0 regressions across all units and exact functions.
Full build passed; refreshed `build/43U/report.json` passed `DECOMPLETE_OK`.
DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`.
Final gate transcript: `/tmp/cleanup-c3-final-gate.log`.
Source commits: SDChannelSelect `dde666c3`; SDMemory `9c7cd77f`; SDChannelTitle `f5bfa17b`; ChannelTitle `8b101cc3`.
GATE PASS