From 6e1da1c35c413df866cf089da481b3174c275548 Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 1 Oct 2026 18:42:28 -0500 Subject: [PATCH 1/2] match(pf_fat): PFFAT_GetSectorSpecified Rewrite the error cleanup as switch(error) so MWCC emits the target beq/b/li epilogue instead of a collapsed bne/li. Unit pf_fat: 30/35 -> 31/35 funcs; 9900 -> 9968 / 12572 code bytes. DOL sha1: 26116613f624061ba99c8d1a299aaa6efa85670d --- libs/RVL_SDK/src/fa/pf_fat.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/RVL_SDK/src/fa/pf_fat.c b/libs/RVL_SDK/src/fa/pf_fat.c index 046531d5..479c89df 100644 --- a/libs/RVL_SDK/src/fa/pf_fat.c +++ b/libs/RVL_SDK/src/fa/pf_fat.c @@ -1282,11 +1282,13 @@ s32 PFFAT_GetSectorSpecified(PFFAT_FFD* file, u32 fileSectorIndex, error = PFFAT_GetSector(file, fileSectorIndex, clusterIndex != 0, 0, sector); - if (error != 0) { - goto done; + switch (error) { + case 0: + error = 0; + break; + default: + break; } - error = 0; -done: return error; } -- 2.49.1 From 3bd814f042ede784febb94ed9832075ccd2c149a Mon Sep 17 00:00:00 2001 From: coah <100182500+coah80@users.noreply.github.com> Date: Thu, 1 Oct 2026 18:42:39 -0500 Subject: [PATCH 2/2] cleanup(SDMemory): rename iplSDMemory_813EE358 to containsTitleId (#655) Helper scans a title-id list for a match; unused SDMemory* param kept. Verified ok + sha1 26116613f624061ba99c8d1a299aaa6efa85670d. --- config/43U/symbols.txt | 2 +- src/scene/sdChannelMemory/iplSDMemory.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/43U/symbols.txt b/config/43U/symbols.txt index 70b27d78..d70e6b28 100644 --- a/config/43U/symbols.txt +++ b/config/43U/symbols.txt @@ -4866,7 +4866,7 @@ onDialogState9__Q33ipl5scene8SDMemoryFv = .text:0x813EDF04; // type:function siz onDialogState10__Q33ipl5scene8SDMemoryFv = .text:0x813EDFA8; // type:function size:0x130 onDialogState11__Q33ipl5scene8SDMemoryFv = .text:0x813EE0D8; // type:function size:0xE0 onDialogState12__Q33ipl5scene8SDMemoryFv = .text:0x813EE1B8; // type:function size:0x1A0 -iplSDMemory_813EE358 = .text:0x813EE358; // type:function size:0x44 +iplSDMemory_containsTitleId = .text:0x813EE358; // type:function size:0x44 onDialogState13__Q33ipl5scene8SDMemoryFv = .text:0x813EE39C; // type:function size:0xEC onDialogState14__Q33ipl5scene8SDMemoryFv = .text:0x813EE488; // type:function size:0x1C4 onDialogState15__Q33ipl5scene8SDMemoryFv = .text:0x813EE64C; // type:function size:0x12C diff --git a/src/scene/sdChannelMemory/iplSDMemory.cpp b/src/scene/sdChannelMemory/iplSDMemory.cpp index b054b116..731c8611 100644 --- a/src/scene/sdChannelMemory/iplSDMemory.cpp +++ b/src/scene/sdChannelMemory/iplSDMemory.cpp @@ -934,7 +934,7 @@ namespace ipl { } } - extern "C" bool iplSDMemory_813EE358(const SDMemory* memory, + extern "C" bool iplSDMemory_containsTitleId(const SDMemory* memory, ESTitleId titleId, const ESTitleId* titleIds, u32 titleCount) { for (u32 i = 0; i < titleCount; i++) { @@ -951,7 +951,7 @@ namespace ipl { s32 result = mpSDChannelSelect->getWorker()->get_async_result(); if (result == 0) { ESTitleId titleId = mTitleIds[mCurrentTitle]; - if (iplSDMemory_813EE358(this, titleId, + if (iplSDMemory_containsTitleId(this, titleId, mNandTitleIds, mNandTitleCount)) { mDialogState = 17; } else { @@ -984,8 +984,8 @@ namespace ipl { swprintf(mCurrentTitleName, 0x107f, L"%ls\n%ls", titleName, message); System::getDialog()->setTitleForSDMemory(mCurrentTitleName); - if (iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) || - iplSDMemory_813EE358(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) { + if (iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mSDTitleIds, mTitleNameCount) || + iplSDMemory_containsTitleId(this, mTitleIds[mCurrentTitle], mNandTitleIds, mNandTitleCount)) { ESTitleId titleId = mTitleIds[mCurrentTitle]; if (iplSDChannelSelect_813DB478(mpSDChannelSelect, titleId)) { mDialogState = 14; @@ -1064,7 +1064,7 @@ namespace ipl { mCurrentTitle++; if (mTitleCount > mCurrentTitle) { ESTitleId nextTitleId = mTitleIds[mCurrentTitle]; - if (iplSDMemory_813EE358(this, nextTitleId, + if (iplSDMemory_containsTitleId(this, nextTitleId, mNandTitleIds, mNandTitleCount)) { mDialogState = 17; } else { -- 2.49.1