cleanup: RVL SDK (gotos, comma conditions, placeholders) (worker 389d53b9)
This commit is contained in:
@@ -167,24 +167,27 @@ s32 ARCConvertPathToEntrynum(ARCHandle* handle, const char* path) {
|
||||
|
||||
for (i = dirLookAt + 1; i < FSTEntries[dirLookAt].dir.next; i = IS_ENTRY_DIR(FSTEntries, i) ? FSTEntries[i].dir.next : i + 1) {
|
||||
char* name;
|
||||
loop_back:
|
||||
// Skip directories
|
||||
if (IS_ENTRY_DIR(FSTEntries, i) == FALSE && isDir == TRUE) {
|
||||
continue;
|
||||
}
|
||||
do {
|
||||
// Skip directories
|
||||
if (IS_ENTRY_DIR(FSTEntries, i) == FALSE && isDir == TRUE) {
|
||||
break;
|
||||
}
|
||||
|
||||
name = handle->FSTStringStart + FILE_STRING_OFF(FSTEntries, i);
|
||||
name = handle->FSTStringStart + FILE_STRING_OFF(FSTEntries, i);
|
||||
|
||||
// Skip empty entries
|
||||
if (*name == '.' && *(name + 1) == 0) {
|
||||
i++;
|
||||
goto loop_back;
|
||||
}
|
||||
// Skip empty entries
|
||||
if (*name == '.' && *(name + 1) == 0) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Advance to next file in hierarchy
|
||||
if (isSame(ptrPath, name) == TRUE) {
|
||||
goto next_in_hier;
|
||||
}
|
||||
// Advance to next file in hierarchy
|
||||
if (isSame(ptrPath, name) == TRUE) {
|
||||
// MWCC needs this join to preserve the original search branches.
|
||||
goto next_in_hier;
|
||||
}
|
||||
break;
|
||||
} while (TRUE);
|
||||
}
|
||||
return -1;
|
||||
|
||||
@@ -315,23 +318,26 @@ BOOL ARCReadDir(ARCDir* dir, ARCDirEntry* dirent) {
|
||||
handle = dir->handle;
|
||||
FSTEntries = (FSTEntry*)handle->FSTStart;
|
||||
loc = dir->location;
|
||||
retry:
|
||||
if (loc <= dir->entryNum || dir->next <= loc) {
|
||||
return FALSE;
|
||||
for (;;) {
|
||||
if (loc <= dir->entryNum || dir->next <= loc) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
dirent->handle = handle;
|
||||
dirent->entryNum = loc;
|
||||
dirent->isDir = IS_ENTRY_DIR(FSTEntries, loc);
|
||||
dirent->name = handle->FSTStringStart + FILE_STRING_OFF(FSTEntries, loc);
|
||||
|
||||
if (dirent->name[0] == '.' && dirent->name[1] == 0) {
|
||||
loc++;
|
||||
continue;
|
||||
}
|
||||
|
||||
dir->location = IS_ENTRY_DIR(FSTEntries, loc) ? FSTEntries[loc].dir.next : (loc + 1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
dirent->handle = handle;
|
||||
dirent->entryNum = loc;
|
||||
dirent->isDir = IS_ENTRY_DIR(FSTEntries, loc);
|
||||
dirent->name = handle->FSTStringStart + FILE_STRING_OFF(FSTEntries, loc);
|
||||
|
||||
if (dirent->name[0] == '.' && dirent->name[1] == 0) {
|
||||
loc++;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
dir->location = IS_ENTRY_DIR(FSTEntries, loc) ? FSTEntries[loc].dir.next : (loc + 1);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
static void WriteCallback(s32 chan, s32 result);
|
||||
static void EraseCallback(s32 chan, s32 result);
|
||||
|
||||
// MWCC needs write failures to bypass the shared command-status check.
|
||||
static void WriteCallback(s32 chan, s32 result) {
|
||||
CARDControl* card;
|
||||
CARDCallback callback;
|
||||
@@ -19,7 +20,7 @@ static void WriteCallback(s32 chan, s32 result) {
|
||||
fileInfo = card->fileInfo;
|
||||
if (fileInfo->length < 0) {
|
||||
result = CARD_RESULT_CANCELED;
|
||||
goto after;
|
||||
goto finish_write;
|
||||
}
|
||||
fileInfo->length -= card->sectorSize;
|
||||
if (fileInfo->length <= 0) {
|
||||
@@ -29,23 +30,23 @@ static void WriteCallback(s32 chan, s32 result) {
|
||||
callback = card->apiCallback;
|
||||
card->apiCallback = NULL;
|
||||
result = __CARDUpdateDir(chan, callback);
|
||||
goto check;
|
||||
goto check_command_result;
|
||||
} else {
|
||||
fat = __CARDGetFatBlock(card);
|
||||
fileInfo->offset += card->sectorSize;
|
||||
fileInfo->iBlock = fat[fileInfo->iBlock];
|
||||
if ((fileInfo->iBlock < 5) || (fileInfo->iBlock >= card->cBlock)) {
|
||||
result = CARD_RESULT_BROKEN;
|
||||
goto after;
|
||||
goto finish_write;
|
||||
}
|
||||
result = __CARDEraseSector(chan, card->sectorSize * fileInfo->iBlock, EraseCallback);
|
||||
check:
|
||||
check_command_result:
|
||||
if (result < 0) {
|
||||
goto after;
|
||||
goto finish_write;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
after:
|
||||
finish_write:
|
||||
callback = card->apiCallback;
|
||||
card->apiCallback = NULL;
|
||||
__CARDPutControlBlock(card, result);
|
||||
@@ -62,16 +63,14 @@ static void EraseCallback(s32 chan, s32 result) {
|
||||
if (result >= 0) {
|
||||
fileInfo = card->fileInfo;
|
||||
result = __CARDWrite(chan, card->sectorSize * fileInfo->iBlock, card->sectorSize, card->buffer, WriteCallback);
|
||||
if (result < 0) {
|
||||
goto after;
|
||||
if (result >= 0) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
after:
|
||||
callback = card->apiCallback;
|
||||
card->apiCallback = NULL;
|
||||
__CARDPutControlBlock(card, result);
|
||||
callback(chan, result);
|
||||
}
|
||||
callback = card->apiCallback;
|
||||
card->apiCallback = NULL;
|
||||
__CARDPutControlBlock(card, result);
|
||||
callback(chan, result);
|
||||
}
|
||||
|
||||
s32 CARDWriteAsync(CARDFileInfo* fileInfo, void* buf, s32 length, s32 offset, CARDCallback callback) {
|
||||
|
||||
@@ -251,23 +251,26 @@ s32 contentConvertPathToEntrynumDVD(CNTHandleDVD* cntHandle, const char* path) {
|
||||
ptrPath = path;
|
||||
|
||||
for (i = dirLookAt + 1; i < FstStart[dirLookAt].dir.next; i = IS_ENTRY_DIR(FstStart, i) ? FstStart[i].dir.next : (i + 1)) {
|
||||
loop_back:
|
||||
// Skip directories
|
||||
if (IS_ENTRY_DIR(FstStart, i) == FALSE && isDir == TRUE) {
|
||||
continue;
|
||||
}
|
||||
do {
|
||||
// Skip directories
|
||||
if (IS_ENTRY_DIR(FstStart, i) == FALSE && isDir == TRUE) {
|
||||
break;
|
||||
}
|
||||
|
||||
name = FstStringStart + FILE_STRING_OFF(FstStart, i);
|
||||
name = FstStringStart + FILE_STRING_OFF(FstStart, i);
|
||||
|
||||
if (*name == '.' && *(name + 1) == 0) {
|
||||
i++;
|
||||
goto loop_back;
|
||||
}
|
||||
if (*name == '.' && *(name + 1) == 0) {
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Advance to next file in hierarchy
|
||||
if (isSame(ptrPath, name) == TRUE) {
|
||||
goto next_in_hier;
|
||||
}
|
||||
// Advance to next file in hierarchy
|
||||
if (isSame(ptrPath, name) == TRUE) {
|
||||
// MWCC needs this join to preserve the original search branches.
|
||||
goto next_in_hier;
|
||||
}
|
||||
break;
|
||||
} while (TRUE);
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
||||
@@ -43,7 +43,7 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
|
||||
const u8* pSrc = src;
|
||||
|
||||
if (context->hdrLen) {
|
||||
int a;
|
||||
int headerBytes;
|
||||
if (context->hdrLen == 8) {
|
||||
if ((*pSrc & CX_COMPRESSION_TYPE_MASK) != CX_COMPRESSION_TYPE_RUN_LENGTH) {
|
||||
return CX_STREAMING_ERR_BAD_FILE_TYPE;
|
||||
@@ -54,10 +54,10 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
|
||||
}
|
||||
}
|
||||
|
||||
a = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
|
||||
headerBytes = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
|
||||
|
||||
pSrc += a;
|
||||
size -= a;
|
||||
pSrc += headerBytes;
|
||||
size -= headerBytes;
|
||||
|
||||
if (!size) {
|
||||
return !context->hdrLen ? context->outDataLen : CX_STREAMING_ERR_BAD_FILE_TYPE;
|
||||
@@ -78,11 +78,11 @@ CXStreamingResult CXReadUncompRL(CXUncompContextRL* context, const void* src, u3
|
||||
}
|
||||
}
|
||||
} else if (context->length) {
|
||||
u8 b = *pSrc++;
|
||||
u8 repeatedByte = *pSrc++;
|
||||
size--;
|
||||
|
||||
while (context->length) {
|
||||
*context->outData++ = b;
|
||||
*context->outData++ = repeatedByte;
|
||||
|
||||
context->length--;
|
||||
context->outDataLen--;
|
||||
@@ -161,7 +161,7 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
|
||||
const u8* pSrc = src;
|
||||
|
||||
if (context->hdrLen) {
|
||||
int a;
|
||||
int headerBytes;
|
||||
if (context->hdrLen == 8) {
|
||||
if ((*pSrc & CX_COMPRESSION_TYPE_MASK) != CX_COMPRESSION_TYPE_LZ) {
|
||||
return CX_STREAMING_ERR_BAD_FILE_TYPE;
|
||||
@@ -174,10 +174,10 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
|
||||
}
|
||||
}
|
||||
|
||||
a = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
|
||||
headerBytes = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
|
||||
|
||||
pSrc += a;
|
||||
size -= a;
|
||||
pSrc += headerBytes;
|
||||
size -= headerBytes;
|
||||
|
||||
if (!size) {
|
||||
return !context->hdrLen ? context->outDataLen : CX_STREAMING_ERR_BAD_FILE_TYPE;
|
||||
@@ -186,7 +186,7 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
|
||||
|
||||
while (context->outDataLen > 0) {
|
||||
while (context->flagsLeft) {
|
||||
s32 a;
|
||||
s32 backReferenceDistance;
|
||||
|
||||
if (!size) {
|
||||
return context->outDataLen;
|
||||
@@ -197,76 +197,73 @@ CXStreamingResult CXReadUncompLZ(CXUncompContextLZ* context, const void* src, u3
|
||||
context->outDataLen--;
|
||||
|
||||
size--;
|
||||
} else {
|
||||
while (context->lengthBytesLeft) {
|
||||
context->lengthBytesLeft--;
|
||||
|
||||
goto there;
|
||||
}
|
||||
if (!context->lzType) {
|
||||
context->length = *pSrc++;
|
||||
context->length += 0x30;
|
||||
context->lengthBytesLeft = 0;
|
||||
} else {
|
||||
switch (context->lengthBytesLeft) {
|
||||
case 2: {
|
||||
context->length = *pSrc++;
|
||||
|
||||
while (context->lengthBytesLeft) {
|
||||
context->lengthBytesLeft--;
|
||||
if (context->length >> 4 == 1) {
|
||||
context->length = (context->length & 0x0F) << 16;
|
||||
context->length += 0x1110;
|
||||
} else if (context->length >> 4 == 0) {
|
||||
context->length = (context->length & 0x0F) << 8;
|
||||
context->length += 0x110;
|
||||
context->lengthBytesLeft = 1;
|
||||
} else {
|
||||
context->length += 0x10;
|
||||
context->lengthBytesLeft = 0;
|
||||
}
|
||||
|
||||
if (!context->lzType) {
|
||||
context->length = *pSrc++;
|
||||
context->length += 0x30;
|
||||
context->lengthBytesLeft = 0;
|
||||
} else {
|
||||
switch (context->lengthBytesLeft) {
|
||||
case 2: {
|
||||
context->length = *pSrc++;
|
||||
|
||||
if (context->length >> 4 == 1) {
|
||||
context->length = (context->length & 0x0F) << 16;
|
||||
context->length += 0x1110;
|
||||
} else if (context->length >> 4 == 0) {
|
||||
context->length = (context->length & 0x0F) << 8;
|
||||
context->length += 0x110;
|
||||
context->lengthBytesLeft = 1;
|
||||
} else {
|
||||
context->length += 0x10;
|
||||
context->lengthBytesLeft = 0;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
context->length += *pSrc++ << 8;
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
context->length += *pSrc++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
context->length += *pSrc++ << 8;
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
context->length += *pSrc++;
|
||||
break;
|
||||
}
|
||||
size--;
|
||||
if (!size) {
|
||||
return context->outDataLen;
|
||||
}
|
||||
}
|
||||
|
||||
backReferenceDistance = (context->length & 0x0F) << 8;
|
||||
context->length >>= 4;
|
||||
|
||||
backReferenceDistance = (backReferenceDistance | *pSrc++) + 1;
|
||||
size--;
|
||||
if (!size) {
|
||||
return context->outDataLen;
|
||||
context->lengthBytesLeft = 3;
|
||||
|
||||
if (context->length > context->outDataLen) {
|
||||
if (!context->size) {
|
||||
return CX_STREAMING_ERR_BAD_FILE_SIZE;
|
||||
}
|
||||
|
||||
context->length = context->outDataLen;
|
||||
}
|
||||
|
||||
while (context->length > 0) {
|
||||
*context->outData = context->outData[-backReferenceDistance];
|
||||
context->outData++;
|
||||
context->outDataLen--;
|
||||
context->length--;
|
||||
}
|
||||
}
|
||||
|
||||
a = (context->length & 0x0F) << 8;
|
||||
context->length >>= 4;
|
||||
|
||||
a = (a | *pSrc++) + 1;
|
||||
size--;
|
||||
context->lengthBytesLeft = 3;
|
||||
|
||||
if (context->length > context->outDataLen) {
|
||||
if (!context->size) {
|
||||
return CX_STREAMING_ERR_BAD_FILE_SIZE;
|
||||
}
|
||||
|
||||
context->length = context->outDataLen;
|
||||
}
|
||||
|
||||
while (context->length > 0) {
|
||||
*context->outData = context->outData[-a];
|
||||
context->outData++;
|
||||
context->outDataLen--;
|
||||
context->length--;
|
||||
}
|
||||
|
||||
there:
|
||||
if (!context->outDataLen) {
|
||||
goto out;
|
||||
}
|
||||
@@ -295,7 +292,7 @@ CXStreamingResult CXReadUncompHuffman(CXUncompContextHuffman* context, const voi
|
||||
const u8* pSrc = src;
|
||||
|
||||
if (context->hdrLen) {
|
||||
int a;
|
||||
int headerBytes;
|
||||
if (context->hdrLen == 8) {
|
||||
context->depth = *pSrc & 0x0F;
|
||||
|
||||
@@ -308,10 +305,10 @@ CXStreamingResult CXReadUncompHuffman(CXUncompContextHuffman* context, const voi
|
||||
}
|
||||
}
|
||||
|
||||
a = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
|
||||
headerBytes = CXiReadHeader(&context->hdrLen, &context->outDataLen, pSrc, size, context->size);
|
||||
|
||||
pSrc += a;
|
||||
size -= a;
|
||||
pSrc += headerBytes;
|
||||
size -= headerBytes;
|
||||
|
||||
if (!size) {
|
||||
return !context->hdrLen ? context->outDataLen : CX_STREAMING_ERR_BAD_FILE_TYPE;
|
||||
|
||||
@@ -223,7 +223,6 @@ static s32 fa_nanddrv_VerifyBPB(u8* buf, u32* clusters) {
|
||||
if (total < 65525) { result = PDM_FAT_16; }
|
||||
return result;
|
||||
}
|
||||
#pragma dont_inline on
|
||||
static s32 fa_nanddrv_BuildUpFSInfoSector(u8* buf) {
|
||||
pf_memset(buf, 0, 512);
|
||||
if ((u32)&buf[0] & 3) { buf[0] = 0x52; buf[1] = 0x52; buf[2] = 0x61; buf[3] = 0x41; }
|
||||
@@ -238,7 +237,6 @@ static s32 fa_nanddrv_BuildUpFSInfoSector(u8* buf) {
|
||||
else { *(u32*)&buf[508] = 0x000055AA; }
|
||||
return 0;
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
static s32 fa_nanddrv_BuildUpBootSector(NAND_DISK_INFO* info, u8* buf, PDM_FAT_TYPE* type, u32 clusters) {
|
||||
u32 total;
|
||||
u32 fat_sectors;
|
||||
|
||||
@@ -40,7 +40,6 @@ extern pf_s32 PFDRV_lread(PF_VOLUME* p_vol, pf_u8* buffer, pf_u32 sector, pf_u32
|
||||
extern pf_s32 PFDRV_lwrite(PF_VOLUME* p_vol, const pf_u8* buffer, pf_u32 sector, pf_u32 num_sector, pf_u32* p_num_success);
|
||||
pf_s32 PFCACHE_FlushAllCaches(PF_VOLUME* p_vol);
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_InitPageList(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, PF_CACHE_PAGE* pages, PF_CACHE_BUFFER* buffers, pf_u32 num,
|
||||
pf_u32 size, pf_bool is_fat) {
|
||||
pf_u32 i;
|
||||
@@ -122,9 +121,6 @@ pf_s32 PFCACHE_InitPageList(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, PF_CACHE_
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
PF_CACHE_PAGE* PFCACHE_SearchForPage(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_head, pf_u32 sector) {
|
||||
PF_CACHE_PAGE* p_page;
|
||||
if (sector == 0xFFFFFFFF) {
|
||||
@@ -149,9 +145,6 @@ PF_CACHE_PAGE* PFCACHE_SearchForPage(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_head, pf
|
||||
return PF_NULL;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_bool PFCACHE_SearchForFreePage(PF_CACHE_PAGE* p_head, PF_CACHE_PAGE** pp_page) {
|
||||
PF_CACHE_PAGE* p_page;
|
||||
for (p_page = p_head->p_prev; p_page != p_head; p_page = p_page->p_prev) {
|
||||
@@ -176,9 +169,6 @@ pf_bool PFCACHE_SearchForFreePage(PF_CACHE_PAGE* p_head, PF_CACHE_PAGE** pp_page
|
||||
return PF_FALSE;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_FlushPageIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_page) {
|
||||
pf_s32 err;
|
||||
pf_u32 num_success;
|
||||
@@ -207,9 +197,6 @@ pf_s32 PFCACHE_FlushPageIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_page) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoAllocatePage(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u32 sector, PF_CACHE_PAGE** pp_page, pf_bool* p_is_hit) {
|
||||
pf_s32 err;
|
||||
*pp_page = PFCACHE_SearchForPage(p_vol, *pp_head, sector);
|
||||
@@ -268,9 +255,6 @@ pf_s32 PFCACHE_DoAllocatePage(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u32
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoReadPage(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u32 sector, PF_CACHE_PAGE** pp_page, pf_bool set_sig) {
|
||||
pf_u32 num_success;
|
||||
pf_bool is_hit;
|
||||
@@ -335,9 +319,6 @@ pf_s32 PFCACHE_DoReadPage(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u32 sect
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoReadPageAndFlushIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u32 sector, PF_CACHE_PAGE** pp_page,
|
||||
pf_bool set_sig) {
|
||||
pf_u32 num_success;
|
||||
@@ -409,9 +390,24 @@ pf_s32 PFCACHE_DoReadPageAndFlushIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_h
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
static inline PF_CACHE_PAGE* PFCACHE_NextValidPage(PF_CACHE_PAGE* page, PF_CACHE_PAGE** head) {
|
||||
if (page == PF_NULL) {
|
||||
page = *head;
|
||||
} else {
|
||||
page = page->p_next;
|
||||
if (page == *head) {
|
||||
return PF_NULL;
|
||||
}
|
||||
}
|
||||
for (; (page->stat & 1) != 0; page = page->p_next) {
|
||||
if (page->sector != 0xFFFFFFFF) {
|
||||
page->p_buf = page->buffer;
|
||||
return page;
|
||||
}
|
||||
}
|
||||
return PF_NULL;
|
||||
}
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoReadNumSector(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u8* p_buf, pf_u32 sector, pf_u32 num_sector,
|
||||
pf_u32* p_num_success) {
|
||||
PF_CACHE_PAGE* p_page;
|
||||
@@ -427,23 +423,7 @@ pf_s32 PFCACHE_DoReadNumSector(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u8*
|
||||
num_rest_sector = *p_num_success;
|
||||
num_success_sector = *p_num_success;
|
||||
do {
|
||||
if (p_page == PF_NULL) {
|
||||
p_page = *pp_head;
|
||||
} else {
|
||||
p_page = p_page->p_next;
|
||||
if (p_page == *pp_head) {
|
||||
p_page = PF_NULL;
|
||||
goto found_page;
|
||||
}
|
||||
}
|
||||
for (; (p_page->stat & 1) != 0; p_page = p_page->p_next) {
|
||||
if (p_page->sector != 0xFFFFFFFF) {
|
||||
p_page->p_buf = p_page->buffer;
|
||||
goto found_page;
|
||||
}
|
||||
}
|
||||
p_page = PF_NULL;
|
||||
found_page:
|
||||
p_page = PFCACHE_NextValidPage(p_page, pp_head);
|
||||
if (p_page != PF_NULL && p_page->sector != 0xFFFFFFFF) {
|
||||
if (p_page->sector <= sector && p_page->sector + p_page->size >= sector + num_success_sector) {
|
||||
pf_memcpy(p_buf, &p_page->buffer[(sector - p_page->sector) << p_vol->bpb.log2_bytes_per_sector],
|
||||
@@ -472,9 +452,6 @@ pf_s32 PFCACHE_DoReadNumSector(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, pf_u8*
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoWritePage(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, PF_CACHE_PAGE* p_page, pf_bool set_sig) {
|
||||
pf_s32 err;
|
||||
if (p_page != *pp_head) {
|
||||
@@ -513,9 +490,6 @@ pf_s32 PFCACHE_DoWritePage(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, PF_CACHE_P
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoWriteSector(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, const pf_u8* p_buf, pf_u32 sector) {
|
||||
PF_CACHE_PAGE* p_page;
|
||||
pf_u32 num_success;
|
||||
@@ -548,8 +522,6 @@ pf_s32 PFCACHE_DoWriteSector(PF_VOLUME* p_vol, PF_CACHE_PAGE** pp_head, const pf
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
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;
|
||||
@@ -559,23 +531,7 @@ pf_s32 PFCACHE_DoWriteNumSectorAndFreeIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE**
|
||||
pf_u8* p_ebuf;
|
||||
*p_num_success = 0;
|
||||
do {
|
||||
if (p_page == PF_NULL) {
|
||||
p_page = *pp_head;
|
||||
} else {
|
||||
p_page = p_page->p_next;
|
||||
if (p_page == *pp_head) {
|
||||
p_page = PF_NULL;
|
||||
goto found_page;
|
||||
}
|
||||
}
|
||||
for (; (p_page->stat & 1) != 0; p_page = p_page->p_next) {
|
||||
if (p_page->sector != 0xFFFFFFFF) {
|
||||
p_page->p_buf = p_page->buffer;
|
||||
goto found_page;
|
||||
}
|
||||
}
|
||||
p_page = PF_NULL;
|
||||
found_page:
|
||||
p_page = PFCACHE_NextValidPage(p_page, pp_head);
|
||||
if (p_page != PF_NULL && p_page->sector != 0xFFFFFFFF) {
|
||||
if (p_page->sector <= sector && (p_page->sector + p_page->size) >= (sector + num_sector)) {
|
||||
pf_memcpy(&p_page->buffer[(sector - p_page->sector) << p_vol->bpb.log2_bytes_per_sector], (pf_u8*)p_buf,
|
||||
@@ -638,9 +594,6 @@ pf_s32 PFCACHE_DoWriteNumSectorAndFreeIfNeeded(PF_VOLUME* p_vol, PF_CACHE_PAGE**
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFCACHE_DoFlushCache(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_head) {
|
||||
PF_CACHE_PAGE* p_page;
|
||||
pf_s32 err;
|
||||
@@ -666,8 +619,6 @@ pf_s32 PFCACHE_DoFlushCache(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_head) {
|
||||
return first_err;
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
void PFCACHE_SetCache(PF_VOLUME* p_vol, PF_CACHE_PAGE* p_cache_page, PF_CACHE_BUFFER* p_cache_buf, pf_u16 num_fat_pages, pf_u16 num_data_pages) {
|
||||
p_vol->cache.pages = p_cache_page;
|
||||
p_vol->cache.buffers = p_cache_buf;
|
||||
|
||||
@@ -297,11 +297,9 @@ pf_s32 PFDIR_p_opendir(PF_VOLUME* volume, PFDIR_STR* path, PFDIR_DIR** opened_di
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
goto open_directory;
|
||||
} else if (PFSTR_StrNumChar(path, 1) == 2 &&
|
||||
PFSTR_StrNCmp(path, (const pf_s8*)":", 1, 1, 1) == 0) {
|
||||
error = PFVOL_GetCurrentDir(volume, &entry);
|
||||
goto open_directory;
|
||||
} else if (PFSTR_StrNumChar(path, 1) == 3 &&
|
||||
PFSTR_StrNCmp(path, (const pf_s8*)":", 1, 1, 1) == 0 &&
|
||||
(PFSTR_StrNCmp(path, (const pf_s8*)"\\", 1, 2, 1) == 0 ||
|
||||
@@ -310,7 +308,6 @@ pf_s32 PFDIR_p_opendir(PF_VOLUME* volume, PFDIR_STR* path, PFDIR_DIR** opened_di
|
||||
if (error != 0) {
|
||||
return error;
|
||||
}
|
||||
goto open_directory;
|
||||
} else {
|
||||
if (PFSTR_StrNCmp(path, (const pf_s8*)":", 1, 1, 1) == 0 &&
|
||||
(PFSTR_StrNCmp(path, (const pf_s8*)"\\", 1, 2, 1) == 0 ||
|
||||
@@ -326,7 +323,6 @@ pf_s32 PFDIR_p_opendir(PF_VOLUME* volume, PFDIR_STR* path, PFDIR_DIR** opened_di
|
||||
}
|
||||
}
|
||||
|
||||
open_directory:
|
||||
sdd = PFDIR_GetSDD(volume, &entry);
|
||||
if (sdd == 0) {
|
||||
return 0x15;
|
||||
@@ -1567,10 +1563,9 @@ pf_s32 PFDIR_p_fsexec(PF_DTA* data, pf_u32 flags, pf_u32 mode) {
|
||||
} else {
|
||||
if ((flags & 0x20) != 0) { error = PFDIR_p_fsexec_opendir(data, &entry, &iter, flags); }
|
||||
}
|
||||
goto done;
|
||||
} else {
|
||||
return 10;
|
||||
}
|
||||
return 10;
|
||||
done:
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,7 +119,6 @@ pf_s32 PFENT_ITER_Advance(PFITER_ENT_ITER*, pf_u32);
|
||||
pf_s32 PFENT_ITER_Retreat(PFITER_ENT_ITER*, pf_u32);
|
||||
pf_s32 PFENT_ITER_FindDirEntryFromCluster(PFITER_ENT_ITER*, PF_DIR_ENT*, pf_u32, pf_bool*);
|
||||
|
||||
#pragma dont_inline on
|
||||
pf_s32 PFENT_RecalcEntryIterator(PFITER_ENT_ITER* p_iter, pf_u32 may_allocate) {
|
||||
pf_u32 file_sector_index;
|
||||
pf_u32 previous_fsindex;
|
||||
@@ -160,7 +159,6 @@ pf_s32 PFENT_RecalcEntryIterator(PFITER_ENT_ITER* p_iter, pf_u32 may_allocate) {
|
||||
p_iter->offset = (p_iter->index & p_iter->offset_mask) * 32;
|
||||
return 0;
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
|
||||
static inline pf_s32 PFENT_ITER_LoadEntry(PFITER_ENT_ITER* p_iter) {
|
||||
pf_u32 success_size;
|
||||
@@ -271,60 +269,60 @@ pf_s32 PFENT_ITER_DoFindEntry(PFITER_ENT_ITER* p_iter, PF_DIR_ENT* p_ent, PF_STR
|
||||
*p_is_found = 1;
|
||||
return 0;
|
||||
}
|
||||
goto finish;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (; !PFENT_ITER_IsAtLogicalEnd(p_iter); err = AdvanceIterator(p_iter, 0)) {
|
||||
pf_s32 attr;
|
||||
if (err != 0) return err;
|
||||
if (p_iter->buf[0] == 0) break;
|
||||
if (p_iter->buf[0] == 0xe5) {
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
continue;
|
||||
}
|
||||
attr = p_iter->buf[11];
|
||||
if ((attr & 15) == 15) {
|
||||
if (PFENT_LoadLFNEntryFieldsFromBuf(p_ent, p_iter->buf) != 0) {
|
||||
} else {
|
||||
for (; !PFENT_ITER_IsAtLogicalEnd(p_iter); err = AdvanceIterator(p_iter, 0)) {
|
||||
pf_s32 attr;
|
||||
if (err != 0) return err;
|
||||
if (p_iter->buf[0] == 0) break;
|
||||
if (p_iter->buf[0] == 0xe5) {
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
continue;
|
||||
}
|
||||
attr = p_iter->buf[11];
|
||||
if ((attr & 15) == 15) {
|
||||
if (PFENT_LoadLFNEntryFieldsFromBuf(p_ent, p_iter->buf) != 0) {
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (attr == 0) attr = 0x40;
|
||||
if (attr_required & 0x80) {
|
||||
attr_required &= 0x7f;
|
||||
attr_forbidden &= 0x7f;
|
||||
if ((attr_required && (pf_s32)(attr_required & attr) != (pf_s32)attr_required) ||
|
||||
(attr_forbidden && (pf_s32)(attr_forbidden & attr) == (pf_s32)attr_forbidden)) err = -1;
|
||||
} else if ((pf_u8)attr_required != 0x7f && (pf_u32)attr != (pf_u8)attr_required &&
|
||||
(!(attr & (pf_u8)attr_required) || (attr & (pf_u8)attr_forbidden))) err = -1;
|
||||
if (err == -1) {
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
continue;
|
||||
}
|
||||
if (attr & 8) {
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (attr == 0) attr = 0x40;
|
||||
if (attr_required & 0x80) {
|
||||
attr_required &= 0x7f;
|
||||
attr_forbidden &= 0x7f;
|
||||
if ((attr_required && (pf_s32)(attr_required & attr) != (pf_s32)attr_required) ||
|
||||
(attr_forbidden && (pf_s32)(attr_forbidden & attr) == (pf_s32)attr_forbidden)) err = -1;
|
||||
} else if ((pf_u8)attr_required != 0x7f && (pf_u32)attr != (pf_u8)attr_required &&
|
||||
(!(attr & (pf_u8)attr_required) || (attr & (pf_u8)attr_forbidden))) err = -1;
|
||||
if (err == -1) {
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
continue;
|
||||
}
|
||||
if (attr & 8) {
|
||||
PFENT_LoadShortNameFromBuf(p_ent, p_iter->buf);
|
||||
if (p_ent->num_entry_LFNs && p_ent->ordinal == 1 && p_ent->check_sum == PFENT_CalcCheckSum(p_ent) &&
|
||||
PFPATH_MatchFileNameWithPattern((pf_s8*)p_ent->long_name, p_pattern, 1)) {
|
||||
LoadNumericEntry(p_iter, p_ent);
|
||||
*p_is_found = 1;
|
||||
return 0;
|
||||
}
|
||||
if (PFPATH_MatchFileNameWithPattern(p_ent->short_name, p_pattern, 0)) {
|
||||
if (p_iter->buf[12] & 0x18) PFENT_ITER_MakeLongFileName(p_iter, p_ent);
|
||||
LoadNumericEntry(p_iter, p_ent);
|
||||
*p_is_found = 1;
|
||||
return 0;
|
||||
}
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
}
|
||||
PFENT_LoadShortNameFromBuf(p_ent, p_iter->buf);
|
||||
if (p_ent->num_entry_LFNs && p_ent->ordinal == 1 && p_ent->check_sum == PFENT_CalcCheckSum(p_ent) &&
|
||||
PFPATH_MatchFileNameWithPattern((pf_s8*)p_ent->long_name, p_pattern, 1)) {
|
||||
LoadNumericEntry(p_iter, p_ent);
|
||||
*p_is_found = 1;
|
||||
return 0;
|
||||
}
|
||||
if (PFPATH_MatchFileNameWithPattern(p_ent->short_name, p_pattern, 0)) {
|
||||
if (p_iter->buf[12] & 0x18) PFENT_ITER_MakeLongFileName(p_iter, p_ent);
|
||||
LoadNumericEntry(p_iter, p_ent);
|
||||
*p_is_found = 1;
|
||||
return 0;
|
||||
}
|
||||
p_ent->num_entry_LFNs = 0;
|
||||
p_ent->long_name[0] = 0;
|
||||
}
|
||||
finish:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,6 +178,7 @@ s32 PFFAT_ReadFATSector(PF_VOLUME* volume, PF_CACHE_PAGE* page, u32 cluster)
|
||||
} else {
|
||||
currentFAT = 1;
|
||||
}
|
||||
// MWCC needs both retry paths to reach the shared error test.
|
||||
for (;;) {
|
||||
error = PFSEC_ReadFAT(volume, page->p_buf, page->sector, 0,
|
||||
volume->bpb.bytes_per_sector);
|
||||
|
||||
@@ -129,10 +129,11 @@ pf_s32 PFFAT16_ReadFATEntryWithBuf(PF_VOLUME* p_vol, pf_u32 cluster, pf_u32* p_v
|
||||
VFiPFSEC_WriteFAT(p_vol, p_page->p_buf, p_page->sector + fat * p_vol->bpb.sectors_per_FAT, 0, p_vol->bpb.bytes_per_sector);
|
||||
}
|
||||
}
|
||||
// MWCC needs the shared read-result block to preserve the retry branches.
|
||||
do {
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
if (err != 0x1000 || p_vol->p_callback == PF_NULL) {
|
||||
goto block_22;
|
||||
goto check_read_result;
|
||||
}
|
||||
result = ((PF_VOLUME_CB)p_vol->p_callback)(p_vol->last_driver_error);
|
||||
if (result != 0) {
|
||||
@@ -140,11 +141,11 @@ pf_s32 PFFAT16_ReadFATEntryWithBuf(PF_VOLUME* p_vol, pf_u32 cluster, pf_u32* p_v
|
||||
current_fat++;
|
||||
sector += p_vol->bpb.sectors_per_FAT;
|
||||
} else {
|
||||
goto block_22;
|
||||
goto check_read_result;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
block_22:
|
||||
check_read_result:
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -139,10 +139,11 @@ pf_s32 PFFAT32_ReadFATEntryWithBuf(PF_VOLUME* p_vol, pf_u32 cluster, pf_u32* p_v
|
||||
VFiPFSEC_WriteFAT(p_vol, p_page->p_buf, p_page->sector + fat * p_vol->bpb.sectors_per_FAT, 0, p_vol->bpb.bytes_per_sector);
|
||||
}
|
||||
}
|
||||
// MWCC needs the shared read-result block to preserve the retry branches.
|
||||
do {
|
||||
err = VFiPFSEC_ReadFAT(p_vol, p_page->p_buf, sector, 0, p_vol->bpb.bytes_per_sector);
|
||||
if (err != 0x1000 || p_vol->p_callback == PF_NULL) {
|
||||
goto block_22;
|
||||
goto check_read_result;
|
||||
}
|
||||
result = ((PF_VOLUME_CB)p_vol->p_callback)(p_vol->last_driver_error);
|
||||
if (result != 0) {
|
||||
@@ -150,11 +151,11 @@ pf_s32 PFFAT32_ReadFATEntryWithBuf(PF_VOLUME* p_vol, pf_u32 cluster, pf_u32* p_v
|
||||
current_fat++;
|
||||
sector += p_vol->bpb.sectors_per_FAT;
|
||||
} else {
|
||||
goto block_22;
|
||||
goto check_read_result;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
block_22:
|
||||
check_read_result:
|
||||
if (err != 0) {
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -1346,22 +1346,21 @@ pf_s32 PFFILE_p_flock(PFFILE_FILE* file, pf_u32 mode) {
|
||||
}
|
||||
file->p_sfd->lock.count++;
|
||||
file->lock_count++;
|
||||
goto complete;
|
||||
} else {
|
||||
if (file->lock_count == 0 || file->p_sfd->lock.count == 0) {
|
||||
return 0x27;
|
||||
}
|
||||
if ((file->p_sfd->lock.mode & 2) != 0 && file->p_sfd->lock.owner != (PF_FILE*)file) {
|
||||
return 0x27;
|
||||
}
|
||||
file->lock_count--;
|
||||
file->p_sfd->lock.count--;
|
||||
if (file->p_sfd->lock.count == 0) {
|
||||
PF_UnLockFile((PF_FILE*)file);
|
||||
if ((file->p_sfd->lock.mode & 2) != 0) { file->p_sfd->lock.owner = 0; }
|
||||
file->p_sfd->lock.mode &= ~3;
|
||||
}
|
||||
}
|
||||
if (file->lock_count == 0 || file->p_sfd->lock.count == 0) {
|
||||
return 0x27;
|
||||
}
|
||||
if ((file->p_sfd->lock.mode & 2) != 0 && file->p_sfd->lock.owner != (PF_FILE*)file) {
|
||||
return 0x27;
|
||||
}
|
||||
file->lock_count--;
|
||||
file->p_sfd->lock.count--;
|
||||
if (file->p_sfd->lock.count == 0) {
|
||||
PF_UnLockFile((PF_FILE*)file);
|
||||
if ((file->p_sfd->lock.mode & 2) != 0) { file->p_sfd->lock.owner = 0; }
|
||||
file->p_sfd->lock.mode &= ~3;
|
||||
}
|
||||
complete:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -242,6 +242,7 @@ void __OSPlayTimeAlarmExpired(OSAlarm* alarm, OSContext* context) {
|
||||
}
|
||||
}
|
||||
|
||||
// MWCC needs the error-path result self-copies to preserve the original branches.
|
||||
s32 __OSPlayTimeGetConsumption(ESTicketView* ticket, ESLpEntry* lpEntry, u32* entries) {
|
||||
s32 ret = ESP_GetConsumption(ticket->ticketId, NULL, entries);
|
||||
|
||||
|
||||
@@ -168,7 +168,6 @@ static void makeCode(u32 addr, u32* i_buff);
|
||||
static int cnvFarCode(RSOObjectHeader* rso, RSOImportTable* impTab, int impIndex, u32 addr, u32* i_buff);
|
||||
static int cnvJumpCode(RSOObjectHeader* rso, RSOImportTable* impTab, int impIndex, u32 addr, u32* i_buff);
|
||||
|
||||
#pragma dont_inline on
|
||||
#if SDK_VERSION > 20090224 && !defined(SDK_IPL)
|
||||
void RSONotifyModuleLoaded(RSOObjectHeader* moduleHeader) {
|
||||
}
|
||||
@@ -193,7 +192,6 @@ void RSONotifyLink(RSOObjectHeader* moduleHeader) {
|
||||
void RSONotifyUnlink(RSOObjectHeader* moduleHeader) {
|
||||
}
|
||||
#endif
|
||||
#pragma dont_inline reset
|
||||
|
||||
static BOOL LocateObject(void* newModule, void* bss, RSOFixedLevel i_fixed_level) {
|
||||
u32 i;
|
||||
|
||||
@@ -28,8 +28,6 @@ extern u64 __shl2i(u64 value, s32 shift);
|
||||
const char* __VIVersion =
|
||||
"<< RVL_SDK - VI \trelease build: Apr 20 2010 11:20:54 (0x4199_60831) >>";
|
||||
|
||||
|
||||
|
||||
static VITiming timing[11] = {
|
||||
{ 6, 240, 24, 25, 3, 2, 12, 13, 12, 13, 520, 519, 520, 519, 525, 429, 64, 71, 105, 162, 373, 122, 412 },
|
||||
{ 6, 240, 24, 24, 4, 4, 12, 12, 12, 12, 520, 520, 520, 520, 526, 429, 64, 71, 105, 162, 373, 122, 412 },
|
||||
@@ -111,7 +109,6 @@ static VIHorVer HorVer;
|
||||
static volatile u16 shdwRegs[59];
|
||||
|
||||
#define MARK_CHANGED(index) (changed |= (1LL << (63 - (index))))
|
||||
#pragma dont_inline on
|
||||
static VITiming* getTiming(VITVMode mode);
|
||||
static void AdjustPosition(u16 acv);
|
||||
static s32 cntlzd(u64 bits);
|
||||
@@ -119,7 +116,6 @@ static u32 getCurrentHalfLine(void);
|
||||
static u32 getCurrentFieldEvenOdd(void);
|
||||
void __VIDisplayPositionToXY(u32 horizontalCount, u32 verticalCount,
|
||||
s16* pixelX, s16* pixelY);
|
||||
#pragma dont_inline reset
|
||||
|
||||
static BOOL OnShutdown(BOOL final, u32 event)
|
||||
{
|
||||
@@ -221,12 +217,7 @@ static void __VIRetraceHandler(__OSInterrupt interrupt, OSContext* context)
|
||||
interruptFlags |= 8;
|
||||
}
|
||||
registerValue = __VIRegs[0x1E];
|
||||
if (interruptFlags & 4) {
|
||||
goto position_interrupt;
|
||||
}
|
||||
if (interruptFlags & 8) {
|
||||
position_interrupt:
|
||||
{
|
||||
if ((interruptFlags & 4) || (interruptFlags & 8)) {
|
||||
u32 previousVertical;
|
||||
u32 horizontal;
|
||||
u32 vertical;
|
||||
@@ -249,7 +240,6 @@ position_interrupt:
|
||||
OSSetCurrentContext(context);
|
||||
return;
|
||||
}
|
||||
}
|
||||
retraceCount++;
|
||||
OSClearContext(&exceptionContext);
|
||||
OSSetCurrentContext(&exceptionContext);
|
||||
@@ -461,7 +451,6 @@ VIRetraceCallback VISetPostRetraceCallback(VIRetraceCallback callback)
|
||||
return oldCallback;
|
||||
}
|
||||
|
||||
#pragma dont_inline on
|
||||
static VITiming* getTiming(VITVMode mode)
|
||||
{
|
||||
switch (mode) {
|
||||
@@ -506,7 +495,6 @@ static VITiming* getTiming(VITVMode mode)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
|
||||
void __VIInit(VITVMode mode)
|
||||
{
|
||||
@@ -760,7 +748,6 @@ static void setFbbRegs(VIHorVer* mode, u32* topBuffer, u32* bottomBuffer,
|
||||
}
|
||||
}
|
||||
|
||||
#pragma dont_inline on
|
||||
static void setHorizontalRegs(VITiming* currentTiming, u16 displayPosX,
|
||||
u16 displaySizeX)
|
||||
{
|
||||
@@ -788,9 +775,6 @@ static void setHorizontalRegs(VITiming* currentTiming, u16 displayPosX,
|
||||
MARK_CHANGED(4);
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#pragma dont_inline on
|
||||
static void setVerticalRegs(u16 displayPosY, u16 displaySizeY, u8 equ,
|
||||
u16 acv, u16 prbOdd, u16 prbEven, u16 psbOdd,
|
||||
u16 psbEven, BOOL black)
|
||||
@@ -841,8 +825,6 @@ static void setVerticalRegs(u16 displayPosY, u16 displaySizeY, u8 equ,
|
||||
MARK_CHANGED(8);
|
||||
}
|
||||
|
||||
#pragma dont_inline reset
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define CLAMP(value, low, high) ((value) > (high) ? (high) : ((value) < (low) ? (low) : (value)))
|
||||
|
||||
@@ -168,6 +168,7 @@ void __VISetVolume(u8 wd0, u8 wd1) {
|
||||
WaitMicroTime(2);
|
||||
}
|
||||
|
||||
// MWCC needs the separate region-store blocks in this dispatch.
|
||||
void __VISetYUVSEL(u8 value) {
|
||||
s32 region = *(s32*)0x800000cc;
|
||||
u8 data[2];
|
||||
@@ -649,34 +650,21 @@ void __VIInit3in1(VITVMode mode) {
|
||||
s32 value = (u32)mode >> 2;
|
||||
u32 flag;
|
||||
|
||||
if (value == 2) {
|
||||
goto region1;
|
||||
switch (value) {
|
||||
case 0:
|
||||
flag = 0;
|
||||
break;
|
||||
case 2:
|
||||
flag = 1;
|
||||
break;
|
||||
case 1:
|
||||
case 5:
|
||||
flag = 2;
|
||||
break;
|
||||
default:
|
||||
flag = 0;
|
||||
break;
|
||||
}
|
||||
if (value < 2) {
|
||||
if (value == 0) {
|
||||
goto region0;
|
||||
}
|
||||
if (value >= 0) {
|
||||
goto region2;
|
||||
}
|
||||
goto regionDefault;
|
||||
}
|
||||
if (value == 5) {
|
||||
goto region2;
|
||||
}
|
||||
goto regionDefault;
|
||||
region0:
|
||||
flag = 0;
|
||||
goto send;
|
||||
region1:
|
||||
flag = 1;
|
||||
goto send;
|
||||
region2:
|
||||
flag = 2;
|
||||
goto send;
|
||||
regionDefault:
|
||||
flag = 0;
|
||||
send:
|
||||
Vdac_Flag_Region = flag;
|
||||
data[0] = 1;
|
||||
data[1] = flag;
|
||||
|
||||
@@ -1079,20 +1079,21 @@ static WUDInitState WUDiGetRegisteredDevice() {
|
||||
memset(&_scArray.devices[i], 0, sizeof(SCBtDeviceInfo));
|
||||
}
|
||||
|
||||
// MWCC needs the shared registration join after a successful slot move.
|
||||
if (WUD_BDCMP(_scArray.devices[i].addr, emptyAddr) == 0) {
|
||||
if (i < WUD_MAX_DEV_ENTRY_FOR_STD - 1) {
|
||||
for (j = i + 1; j < WUD_MAX_DEV_ENTRY_FOR_STD; j++) {
|
||||
if (WUD_DEV_NAME_IS_CNT(_scArray.devices[j].info.devName)) {
|
||||
memcpy(&_scArray.devices[i], &_scArray.devices[j], sizeof(SCBtDeviceInfo));
|
||||
memset(&_scArray.devices[j], 0, sizeof(SCBtDeviceInfo));
|
||||
goto there;
|
||||
goto device_ready;
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
there:
|
||||
device_ready:
|
||||
pInfo = WUDiGetNewDevInfo();
|
||||
if (pInfo == NULL) {
|
||||
continue;
|
||||
|
||||
167
tools/decomp-assist/cleanup2-x6.attempts.md
Normal file
167
tools/decomp-assist/cleanup2-x6.attempts.md
Normal file
@@ -0,0 +1,167 @@
|
||||
# cleanup2-x6 attempts
|
||||
|
||||
Worktree `/mnt/drive2/projects/wii-ipl-workers/rx1`, branch `agent/w1009/cleanup2-x6`, baseline `ab9cdd32`.
|
||||
Scope: `libs/RVL_SDK/src/`, excluding bte, wad, fs, nup, usb, ipc, sc, sdi, kpad, kbd, dvd, cntcache, fa/driver/sd_drv.c and fa/pdm_partition.c. Original assembly functions stay unchanged.
|
||||
Read cleanup-common.md fully, including wave-2 guidance, repository AGENTS.md, unslop and writing-for-agents. Initial full 43U build passed with every unit and function exact and linked, DECOMPLETE_OK and DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Acceptance: each retained function cleanup preserves allocated ELF sections, resolved relocations and symbol records against the initial object. Final gate covers all touched units, every section, zero regressions, full linkage and DOL hash. Commit each source file separately.
|
||||
|
||||
## Inspection
|
||||
|
||||
319 owned C/C++/header files inspected, largest first. A balanced-parenthesis scan found no comma operators in if/while conditions; argument separators and idiomatic for-loop clauses are not cleanup targets. WPAD, ES and FAT file gotos mostly share cleanup exits. Actual decompiler control flow appears in WUD registered-device compaction, FAT retry/cache/directory code, VI region dispatch, CARD callbacks, CX streaming, OS play-time and ARC path traversal.
|
||||
Prior cleanup-c6 experiments belong to excluded DVD and partition files; do not repeat them. NANDOpenClose and ARC push/pop scopes retain required force-active data, not optimization settings. Remaining unfamiliar fields stay unless their meaning is clear from use.
|
||||
|
||||
## Trials
|
||||
- REVERT `libs/RVL_SDK/src/wud/WUD` WUDiGetRegisteredDevice replace compaction jump with break and exhausted-search test: changed .rela.data, .rela.text, .text, symbols (22956 -> 22960 bytes; 13736 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_fat` PFFAT_ReadFATSector replace retry jumps with continue: changed .rela.text, .text, symbols (12572 -> 12548 bytes; 9763 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_dir` PFDIR_p_opendir remove jumps from structured path dispatch: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_dir` PFDIR_p_fsexec use direct result return: changed .rela.text, .text, symbols (18976 -> 18972 bytes; 3041 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_fat` PFFAT_ReadFATSector use nested callback handling and preserve shared retry test: changed .rela.text, .text, symbols (12572 -> 12588 bytes; 9697 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi` __VIRetraceHandler express position interrupt dispatch as short-circuit test: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- REVERT `libs/RVL_SDK/src/vi/vi3in1` __VISetYUVSEL replace region dispatch gotos with switch: changed .rela.text, .text, symbols (7556 -> 7812 bytes; 1577 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi3in1` __VIInit3in1 replace region dispatch gotos with switch: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_entry_iterator` PFENT_ITER_DoFindEntry replace search-exit jump with return: changed .rela.text, .text, symbols (7880 -> 7888 bytes; 5306 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/vi/vi3in1` __VISetYUVSEL replace region jumps with nested conditions preserving comparison order: changed .rela.text, .text, symbols (7556 -> 7576 bytes; 5670 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_dir` PFDIR_p_fsexec structure invalid-volume return as else: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_file` PFFILE lock dispatch replace completion jump with else: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/cx/CXStreamingUncompression` CXReadUncompLZ replace literal-data jump with else around back-reference decoding: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/arc/arc` ARCReadDir replace retry jump with structured loop: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_cache` PFCACHE_DoReadNumSector use inline cache-page search instead of dispatch jumps: changed .rela.text, .text, symbols (7396 -> 7416 bytes; 3669 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` PFCACHE_DoWriteNumSectorAndFreeIfNeeded use inline cache-page search instead of dispatch jumps: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_fat16` PFFAT16_ReadFATEntryWithBuf replace callback-exit jumps with nested branches: changed .rela.text, .text, symbols (1092 -> 1116 bytes; 67 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_fat32` PFFAT32_ReadFATEntryWithBuf replace callback-exit jumps with nested branches: changed .rela.text, .text, symbols (1264 -> 1288 bytes; 83 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/wud/WUD` WUDiGetRegisteredDevice use inline device-slot compaction helper: changed .rela.data, .rela.text, .text, symbols (22956 -> 22968 bytes; 13376 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/vi/vi3in1` __VISetYUVSEL use nested region tests with equality for MPAL: changed .rela.text, .text, symbols (7556 -> 7572 bytes; 5205 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/fa/pf_cache` PFCACHE_DoReadNumSector structure cache search with guarded loop and breaks: changed .rela.text, .text, symbols (7396 -> 7404 bytes; 3583 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/arc/arc` path lookup replace empty-entry back-jump with structured inner loop: changed .rela.text, .text, symbols (2464 -> 2472 bytes; 1242 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/cnt/cnt` path lookup replace empty-entry back-jump with structured inner loop: changed .rela.text, .text, symbols (2376 -> 2384 bytes; 1265 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/arc/arc` ARCConvertPathToEntrynum use guarded search loop and matching-entry break: compiler error. _SDK/src/arc/arc.c -o build/43U/src/libs/RVL_SDK/src/arc && "/usr/bin/python3" tools/transform_dep.py build/43U/src/libs/RVL_SDK/src/arc/arc.d build/43U/src/libs/RVL_SDK/src/arc/arc.d ### mwcceppc.exe Compiler: # File: libs\RVL_SDK\src\arc\arc.c # ----------------------------------- # 172: char* name; # Error: ^^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed.
|
||||
- REVERT `libs/RVL_SDK/src/cnt/cnt` contentConvertPathToEntrynumDVD use guarded search loop and matching-entry break: changed .text (2376 -> 2376 bytes; 252 differing bytes).
|
||||
- WITHDRAW previous ARC/CNT inner-loop trial: the inner break would lose the outer skip; both sources were restored and no change was accepted.
|
||||
- REVERT `libs/RVL_SDK/src/card/CARDWrite` EraseCallback move shared error callback after write-status dispatch: changed .text (900 -> 900 bytes; 9 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/card/CARDWrite` WriteCallback structure canceled, directory-update and sector-erase dispatch: changed .text (900 -> 900 bytes; 3 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi` remove no-inline scope for getTiming: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi` remove no-inline scope for getTiming: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi` remove no-inline scope for setHorizontalRegs: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi` remove no-inline scope for setVerticalRegs: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/rso/RSOLink` remove no-inline scope for RSO notification callbacks: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_InitPageList: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_SearchForPage: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_SearchForFreePage: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_FlushPageIfNeeded: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoAllocatePage: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoReadPage: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoReadPageAndFlushIfNeeded: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoReadNumSector: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoWritePage: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoWriteSector: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove no-inline scope for PFCACHE_DoFlushCache: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_entry_iterator` remove no-inline scope for PFENT_RecalcEntryIterator: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/driver/nand_drv` remove no-inline scope for fa_nanddrv_BuildUpFSInfoSector: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- New cache-read hypothesis: its no-inline scope was removable, so retry the inline search after removing that scope.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` PFCACHE_DoReadNumSector use inline cache search after removing no-inline scope: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove remaining redundant no-inline reset: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_entry_iterator` PFENT_ITER_DoFindEntry structure indexed and sequential searches as if/else: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/arc/arc` path lookup replace empty-entry back-jump with do loop preserving outer skip: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/cnt/cnt` path lookup replace empty-entry back-jump with do loop preserving outer skip: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/card/CARDWrite` EraseCallback preserve early error edge and use successful-dispatch return: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- REVERT `libs/RVL_SDK/src/card/CARDWrite` WriteCallback preserve early error edge and use successful-dispatch return: changed .text (900 -> 900 bytes; 2 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/card/CARDWrite` WriteCallback keep status checks beside each asynchronous call: changed .rela.text, .text, symbols (900 -> 908 bytes; 606 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/os/OSPlayTime` remove redundant result self-assignments: changed .rela.text, .text, symbols (2448 -> 2428 bytes; 290 differing bytes).
|
||||
- REVERT `libs/RVL_SDK/src/arc/arc` ARCConvertPathToEntrynum test directory bound inside search with C declarations first: changed .text (2464 -> 2464 bytes; 258 differing bytes).
|
||||
- KEEP `libs/RVL_SDK/src/arc/arc` indent structured path traversal and explain retained hierarchy join: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/cnt/cnt` indent structured path traversal and explain retained hierarchy join: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_file` indent structured lock dispatch: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_entry_iterator` indent structured sequential entry search: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_cache` remove blank lines left by pragma cleanup: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi` remove blank lines left by pragma cleanup: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/cx/CXStreamingUncompression` name header byte counts, repeated byte and LZ back-reference distance: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/card/CARDWrite` tidy erase callback and name retained write-callback joins: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/vi/vi3in1` explain retained YUV region dispatch: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/wud/WUD` name and explain retained registered-device join: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_fat` explain retained FAT retry join: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_fat16` name and explain retained buffered FAT read-result join: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/fa/pf_fat32` name and explain retained buffered FAT read-result join: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
- KEEP `libs/RVL_SDK/src/os/OSPlayTime` explain retained result self-copies: all allocated sections, resolved relocations and symbol records identical to baseline.
|
||||
|
||||
## Retained changes and limits
|
||||
|
||||
- WUD.c: named device_ready; retained the shared registration join. Both break-with-bound-check and inline compaction changed bytes.
|
||||
- WPAD.c, es.c, pf_entry_iterator's remaining sibling functions, NAND/ESP wrappers, CARD read/mount/bios/block/create/delete/format and frame-heap routines: retained ordinary error, unlock and common-return gotos. These are not decompiler loop/dispatch targets.
|
||||
- pf_dir.c: removed three opendir dispatch jumps and the fsexec completion jump. Its one remaining rename jump shares an allocation-result return. Direct fsexec return shortened the function; structured else kept it exact.
|
||||
- pf_file.c: replaced lock/unlock completion jump with else. The close-file cleanup join remains.
|
||||
- vi.c: removed the position-interrupt jump and extra scope, using the original short-circuit interrupt tests. Removed all four no-inline scopes, including the prototype scope.
|
||||
- vi3in1.c: replaced nine init-region gotos with a switch. YUV selection's ten dispatch gotos stay because switch and two nested-condition alternatives change code and inline callers; a one-line compiler note explains the separate store blocks.
|
||||
- pf_cache.c: removed all four search jumps using one typed inline page-search helper. Removed eleven no-inline scopes and the unmatched reset. The read helper became exact only after its no-inline scope was removed.
|
||||
- pf_entry_iterator.c: removed its no-inline scope and indexed-search exit goto using structured if/else and break. A direct return changed bytes.
|
||||
- ARC arc.c: replaced directory-read retry and empty-entry back-jumps with real loops. CNT cnt.c: replaced its empty-entry back-jump with a real loop. Both retain their matched-path hierarchy join, with a compiler note; moving the bound test into the loop reordered the search instructions.
|
||||
- CARDWrite.c: replaced EraseCallback's jump into the error branch with a successful-command return followed by the shared callback. WriteCallback's four joins remain with meaningful labels; common-check and per-call-check alternatives changed bytes. The note explains why failures bypass the asynchronous command-status test.
|
||||
- RSOLink.c and fa/driver/nand_drv.c: removed one no-inline scope each, covering notification hooks and the FSINFO-sector builder respectively.
|
||||
- CXStreamingUncompression.c: replaced the literal-data jump with else around back-reference decoding. Named headerBytes, repeatedByte and backReferenceDistance. Its two remaining gotos share decoder finish/error handling.
|
||||
- pf_fat.c: retained both retry jumps because continue and nested-callback alternatives changed bytes. pf_fat16.c/pf_fat32.c: named check_read_result and retained their shared buffered-read joins because nested handling changed bytes. Added one-line compiler explanations.
|
||||
- OSPlayTime.c: retained five result self-copies; deleting them shrank .text by 20 bytes and changed branch layout. Added one compiler note. Common cleanup exits remain.
|
||||
- No genuine numbered placeholder identifiers were found in the owned sources. field_mode, field_rendering and local_str are meaningful existing names. Header/field renames were unnecessary. Force-active scopes in ARC/NAND retain required data emission and stay unchanged.
|
||||
|
||||
Total: 25 gotos and 18 no-inline scopes removed, plus one unmatched reset. Every retained trial preserves all allocated sections, resolved relocations and symbol records. A final source-level comparison confirmed that original assembly blocks are unchanged and every excluded path is untouched. Scope stayed in rx1; no push, PR, merge, rebase or subagents.
|
||||
|
||||
## Final verification
|
||||
|
||||
Initial and final full builds passed. Fresh report passed `DECOMPLETE_OK`. All 1028 units and exact-name functions were independently compared against the initial report; zero regressions. The gate also reports zero regressions against its main baseline, zero added forbidden patterns and zero readability warnings. Original assembly blocks and all excluded paths are unchanged.
|
||||
|
||||
| Unit | Exact functions before -> after | Code bytes | Data bytes |
|
||||
| --- | --- | --- | --- |
|
||||
| libs/RVL_SDK/src/arc/arc | 14/14 -> 14/14 | 2464/2464 | 120/120 |
|
||||
| libs/RVL_SDK/src/card/CARDWrite | 3/3 -> 3/3 | 828/828 | 0/0 |
|
||||
| libs/RVL_SDK/src/cnt/cnt | 16/16 -> 16/16 | 2228/2228 | 888/888 |
|
||||
| libs/RVL_SDK/src/cx/CXStreamingUncompression | 6/6 -> 6/6 | 2684/2684 | 0/0 |
|
||||
| libs/RVL_SDK/src/fa/driver/nand_drv | 18/18 -> 18/18 | 6952/6952 | 5696/5696 |
|
||||
| libs/RVL_SDK/src/fa/pf_cache | 36/36 -> 36/36 | 7396/7396 | 0/0 |
|
||||
| libs/RVL_SDK/src/fa/pf_dir | 38/38 -> 38/38 | 18976/18976 | 40/40 |
|
||||
| libs/RVL_SDK/src/fa/pf_entry_iterator | 16/16 -> 16/16 | 7880/7880 | 24/24 |
|
||||
| libs/RVL_SDK/src/fa/pf_fat | 35/35 -> 35/35 | 12572/12572 | 64/64 |
|
||||
| libs/RVL_SDK/src/fa/pf_fat16 | 4/4 -> 4/4 | 1092/1092 | 0/0 |
|
||||
| libs/RVL_SDK/src/fa/pf_fat32 | 4/4 -> 4/4 | 1264/1264 | 0/0 |
|
||||
| libs/RVL_SDK/src/fa/pf_file | 45/45 -> 45/45 | 17820/17820 | 0/0 |
|
||||
| libs/RVL_SDK/src/os/OSPlayTime | 7/7 -> 7/7 | 2176/2176 | 160/160 |
|
||||
| libs/RVL_SDK/src/rso/RSOLink | 16/16 -> 16/16 | 5604/5604 | 288/288 |
|
||||
| libs/RVL_SDK/src/vi/vi | 30/30 -> 30/30 | 11296/11296 | 1944/1944 |
|
||||
| libs/RVL_SDK/src/vi/vi3in1 | 18/18 -> 18/18 | 6976/6976 | 1512/1512 |
|
||||
| libs/RVL_SDK/src/wud/WUD | 66/66 -> 66/66 | 18852/18852 | 12016/12016 |
|
||||
|
||||
All 372 functions and every code/data section of the 17 gated units remain 100%. Allocated ELF sections, resolved relocations and symbol records remain identical to the initial built objects. Local compiler label spelling may change.
|
||||
|
||||
Gate command: `python3 /mnt/drive2/projects/wii-ipl-workers/_restore0928-tools/gate.py libs/RVL_SDK/src/arc/arc libs/RVL_SDK/src/card/CARDWrite libs/RVL_SDK/src/cnt/cnt libs/RVL_SDK/src/cx/CXStreamingUncompression libs/RVL_SDK/src/fa/driver/nand_drv libs/RVL_SDK/src/fa/pf_cache libs/RVL_SDK/src/fa/pf_dir libs/RVL_SDK/src/fa/pf_entry_iterator libs/RVL_SDK/src/fa/pf_fat libs/RVL_SDK/src/fa/pf_fat16 libs/RVL_SDK/src/fa/pf_fat32 libs/RVL_SDK/src/fa/pf_file libs/RVL_SDK/src/os/OSPlayTime libs/RVL_SDK/src/rso/RSOLink libs/RVL_SDK/src/vi/vi libs/RVL_SDK/src/vi/vi3in1 libs/RVL_SDK/src/wud/WUD --quick`.
|
||||
|
||||
```text
|
||||
GATE PASS
|
||||
regressions vs baseline: 0
|
||||
forbidden patterns added: 0
|
||||
readability warnings: 0
|
||||
DECOMPLETE_OK
|
||||
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
```
|
||||
|
||||
Gate transcript `/tmp/cleanup2-x6-final-gate.log`; focused ctxdiff `/tmp/cleanup2-x6-final-ctxdiff.log`; pools `/tmp/cleanup2-x6-final-pools.log`; initial report `/tmp/cleanup2-x6-baseline-report.json`.
|
||||
|
||||
Focused ctxdiff checks cover the 15 functions with structured control flow or renamed locals; every check has diffs 0 and equal instruction counts. All 17 string pools are identical. No new tests or gate/helper tooling changes were added.
|
||||
|
||||
## Commits
|
||||
|
||||
- `d2681b7efedc0a49cf2f66da3b2375e9918782b7`: `libs/RVL_SDK/src/wud/WUD.c`.
|
||||
- `5c3845533de27c85f0c181ec37b4a3622d0e0608`: `libs/RVL_SDK/src/fa/pf_fat.c`.
|
||||
- `b14976993fb6d684d0e12518aa0a6dd270eeb597`: `libs/RVL_SDK/src/fa/pf_file.c`.
|
||||
- `5195916578ab48a1d7104a3ee5819a58f03aed83`: `libs/RVL_SDK/src/fa/pf_dir.c`.
|
||||
- `f2f4d8f96ddacd1ca967cae375f392a9694d6f2f`: `libs/RVL_SDK/src/vi/vi.c`.
|
||||
- `23d654b4c24c6b1ec3f65359cc822c87c0b6be21`: `libs/RVL_SDK/src/rso/RSOLink.c`.
|
||||
- `6c4ed1649c3b613270e98b0e835f88dc8ae0feca`: `libs/RVL_SDK/src/fa/pf_cache.c`.
|
||||
- `7e95eea1da53e6fa9e2b7f68c91da786b1e5d9b7`: `libs/RVL_SDK/src/fa/pf_entry_iterator.c`.
|
||||
- `99f40560e5281decc04a5767c717d33c8b8b0bfa`: `libs/RVL_SDK/src/vi/vi3in1.c`.
|
||||
- `b216b6de35467518b91deadbf7ea3582c3b45cca`: `libs/RVL_SDK/src/fa/driver/nand_drv.c`.
|
||||
- `d6d9a251bed4a5f72224e4f46c1ca59f24b0c733`: `libs/RVL_SDK/src/cnt/cnt.c`.
|
||||
- `8026d69d4de25f2a49d0929a9a723a2198ee79a9`: `libs/RVL_SDK/src/cx/CXStreamingUncompression.c`.
|
||||
- `5034ea352d3033d41607560beddd5897018b9359`: `libs/RVL_SDK/src/os/OSPlayTime.c`.
|
||||
- `b795061fe7121dce8b669c5c1bf09d80302eef59`: `libs/RVL_SDK/src/arc/arc.c`.
|
||||
- `2686fc981e7800350635c588416848555e954f05`: `libs/RVL_SDK/src/fa/pf_fat32.c`.
|
||||
- `ef54c2b61a01cbe7942d24b90f43c7100efc7440`: `libs/RVL_SDK/src/fa/pf_fat16.c`.
|
||||
- `737d263b277e50e0d6f948f4de61f0f3e8f2480f`: `libs/RVL_SDK/src/card/CARDWrite.c`.
|
||||
- The separate commit containing this log records all trials, retained compiler requirements, measurements and the passing final gate.
|
||||
Reference in New Issue
Block a user