Compare commits
1 Commits
main
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7cf252bd79 |
@@ -13,11 +13,6 @@
|
||||
|
||||
#undef IPL_SOUND_RECT_OUT_OF_LINE
|
||||
|
||||
extern "C" ipl::System::Arg smArg__Q23ipl6System;
|
||||
extern "C" void __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting();
|
||||
extern "C" void setMemoSetting__Q33ipl8savedata7ManagerFRCQ49textinput6extend8savedata11MemoSetting();
|
||||
extern "C" void flushAsync__Q33ipl8savedata7ManagerFPQ23EGG4Heap();
|
||||
|
||||
namespace ipl {
|
||||
namespace keyboard {
|
||||
// clang-format off
|
||||
@@ -634,95 +629,20 @@ namespace ipl {
|
||||
#endif // JAPANESE_BUILD
|
||||
}
|
||||
|
||||
asm void Manager::doSave() {
|
||||
nofralloc
|
||||
stwu r1, -0x30(r1)
|
||||
mflr r0
|
||||
stw r0, 0x34(r1)
|
||||
stw r31, 0x2c(r1)
|
||||
mr r31, r3
|
||||
stw r30, 0x28(r1)
|
||||
lwz r3, 4(r3)
|
||||
lwz r12, 0(r3)
|
||||
lwz r12, 0xd8(r12)
|
||||
mtctr r12
|
||||
bctrl
|
||||
srwi r10, r4, 0x18
|
||||
srwi r9, r3, 0x18
|
||||
stb r10, 0x1c(r1)
|
||||
rlwinm r10, r4, 0x10, 0x18, 0x1f
|
||||
li r5, 8
|
||||
stb r9, 0x18(r1)
|
||||
rlwinm r9, r3, 0x10, 0x18, 0x1f
|
||||
lbz r6, 0x1c(r1)
|
||||
stb r10, 0x1d(r1)
|
||||
rlwinm r10, r4, 0x18, 0x18, 0x1f
|
||||
lbz r8, 0x18(r1)
|
||||
stb r9, 0x19(r1)
|
||||
rlwinm r9, r3, 0x18, 0x18, 0x1f
|
||||
lbz r0, 0x1d(r1)
|
||||
lbz r7, 0x19(r1)
|
||||
stb r10, 0x1e(r1)
|
||||
stb r4, 0x1f(r1)
|
||||
stb r4, 0xf(r1)
|
||||
addi r4, r1, 8
|
||||
stb r9, 0x1a(r1)
|
||||
stb r3, 0x1b(r1)
|
||||
stb r3, 0xb(r1)
|
||||
addi r3, r1, 0x10
|
||||
stb r8, 8(r1)
|
||||
stb r7, 9(r1)
|
||||
stb r9, 0xa(r1)
|
||||
stb r6, 0xc(r1)
|
||||
stb r0, 0xd(r1)
|
||||
stb r10, 0xe(r1)
|
||||
lbz r6, 0x2e(r31)
|
||||
lbz r0, 0x2f(r31)
|
||||
stb r6, 0x10(r1)
|
||||
stb r0, 0x11(r1)
|
||||
lbz r6, 0x30(r31)
|
||||
lbz r0, 0x31(r31)
|
||||
stb r6, 0x12(r1)
|
||||
stb r0, 0x13(r1)
|
||||
lbz r6, 0x32(r31)
|
||||
lbz r0, 0x33(r31)
|
||||
stb r6, 0x14(r1)
|
||||
stb r0, 0x15(r1)
|
||||
lbz r6, 0x34(r31)
|
||||
lbz r0, 0x35(r31)
|
||||
stb r6, 0x16(r1)
|
||||
stb r0, 0x17(r1)
|
||||
bl memcmp
|
||||
cntlzw r0, r3
|
||||
li r3, 0
|
||||
rlwinm. r0, r0, 0x1b, 5, 0x1f
|
||||
bne doSave_L1
|
||||
lwz r0, 0x38(r31)
|
||||
cmpwi r0, 0
|
||||
bne doSave_L1
|
||||
li r3, 1
|
||||
doSave_L1:
|
||||
cmpwi r3, 0
|
||||
beq doSave_L2
|
||||
addi r3, r31, 0x2e
|
||||
addi r4, r1, 0x18
|
||||
bl __as__Q49textinput6extend8savedata11MemoSettingFRCQ49textinput6extend8savedata11MemoSetting
|
||||
lis r30, smArg__Q23ipl6System@ha
|
||||
addi r4, r31, 0x2e
|
||||
addi r30, r30, smArg__Q23ipl6System@l
|
||||
lwz r3, 0x94(r30)
|
||||
bl setMemoSetting__Q33ipl8savedata7ManagerFRCQ49textinput6extend8savedata11MemoSetting
|
||||
lwz r3, 0x94(r30)
|
||||
lwz r4, 0x28(r30)
|
||||
bl flushAsync__Q33ipl8savedata7ManagerFPQ23EGG4Heap
|
||||
stw r3, 0x38(r31)
|
||||
doSave_L2:
|
||||
lwz r0, 0x34(r1)
|
||||
lwz r31, 0x2c(r1)
|
||||
lwz r30, 0x28(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x30
|
||||
blr
|
||||
static inline bool sameMemoSetting(textinput::extend::savedata::MemoSetting first,
|
||||
textinput::extend::savedata::MemoSetting second) {
|
||||
return memcmp(&first, &second, sizeof(first)) == 0;
|
||||
}
|
||||
|
||||
void Manager::doSave() {
|
||||
textinput::extend::savedata::MemoSetting setting = mpManager->getSaveData();
|
||||
bool unchanged = sameMemoSetting(mSaveData, setting);
|
||||
bool shouldSave = !unchanged && mpSaveFile == NULL;
|
||||
if (shouldSave) {
|
||||
mSaveData = setting;
|
||||
System::getSaveData()->setMemoSetting(mSaveData);
|
||||
mpSaveFile = System::getSaveData()->flushAsync(System::getMem2App());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -755,115 +755,41 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
asm void Manager::makeTmpList(register ESTitleId* titleIdsOut, register u32 availableCount, register ESTitleId* titleIdsIn, register u32 titleCount) {
|
||||
nofralloc
|
||||
stwu r1, -0x50(r1)
|
||||
mflr r0
|
||||
stw r0, 0x54(r1)
|
||||
addi r11, r1, 0x50
|
||||
bl _savegpr_16
|
||||
mr r22, r3
|
||||
mr r23, r4
|
||||
mr r24, r5
|
||||
mr r25, r6
|
||||
mr r26, r7
|
||||
li r29, 6
|
||||
li r21, 0x30
|
||||
li r28, 0
|
||||
li r27, 0
|
||||
li r20, 0
|
||||
li r31, -1
|
||||
li r18, 0
|
||||
b makeTmpList_L8
|
||||
makeTmpList_L1:
|
||||
add r30, r25, r20
|
||||
lwzx r5, r25, r20
|
||||
lwz r6, 4(r30)
|
||||
or. r0, r6, r5
|
||||
beq makeTmpList_L7
|
||||
mr r3, r22
|
||||
bl checkValidApp__Q33ipl8savedata7ManagerFUx
|
||||
cmpwi r3, 0
|
||||
beq makeTmpList_L6
|
||||
li r3, -1
|
||||
li r16, 0
|
||||
li r19, 0
|
||||
b makeTmpList_L3
|
||||
makeTmpList_L2:
|
||||
add r17, r23, r19
|
||||
lwz r7, 0(r30)
|
||||
lwzx r5, r23, r19
|
||||
mr r3, r22
|
||||
lwz r6, 4(r17)
|
||||
lwz r8, 4(r30)
|
||||
bl isEqualChannel__Q33ipl8savedata7ManagerFUxUx
|
||||
cmpwi r3, -2
|
||||
beq makeTmpList_L5
|
||||
cmpwi r3, 0
|
||||
beq makeTmpList_L5
|
||||
cmpwi r3, 1
|
||||
bne makeTmpList_L4
|
||||
lwz r0, 0(r30)
|
||||
lwz r4, 4(r30)
|
||||
stw r4, 4(r17)
|
||||
stw r0, 0(r17)
|
||||
b makeTmpList_L5
|
||||
makeTmpList_L4:
|
||||
addi r16, r16, 1
|
||||
addi r19, r19, 8
|
||||
makeTmpList_L3:
|
||||
cmpw r16, r29
|
||||
blt makeTmpList_L2
|
||||
makeTmpList_L5:
|
||||
cmpwi r3, -1
|
||||
beq makeTmpList_L5B
|
||||
stw r18, 4(r30)
|
||||
stw r18, 0(r30)
|
||||
b makeTmpList_L7
|
||||
makeTmpList_L5B:
|
||||
lwz r0, 0(r30)
|
||||
mr r3, r22
|
||||
lwz r5, 4(r30)
|
||||
and r4, r0, r31
|
||||
and r5, r5, r31
|
||||
bl isDefaultChannel__Q33ipl8savedata7ManagerFUlUl
|
||||
cmpwi r3, -1
|
||||
bne makeTmpList_L5C
|
||||
lwz r0, 0(r30)
|
||||
add r3, r23, r21
|
||||
lwz r4, 4(r30)
|
||||
addi r29, r29, 1
|
||||
stw r4, 4(r3)
|
||||
stwx r0, r23, r21
|
||||
addi r21, r21, 8
|
||||
b makeTmpList_L5D
|
||||
makeTmpList_L5C:
|
||||
slwi r0, r3, 3
|
||||
lwz r4, 0(r30)
|
||||
lwz r5, 4(r30)
|
||||
add r3, r23, r0
|
||||
stw r5, 4(r3)
|
||||
stwx r4, r23, r0
|
||||
makeTmpList_L5D:
|
||||
addi r28, r28, 1
|
||||
makeTmpList_L6:
|
||||
stw r18, 4(r30)
|
||||
cmplw r28, r24
|
||||
stw r18, 0(r30)
|
||||
bge makeTmpList_L9
|
||||
makeTmpList_L7:
|
||||
addi r27, r27, 1
|
||||
addi r20, r20, 8
|
||||
makeTmpList_L8:
|
||||
cmplw r27, r26
|
||||
blt makeTmpList_L1
|
||||
makeTmpList_L9:
|
||||
addi r11, r1, 0x50
|
||||
bl _restgpr_16
|
||||
lwz r0, 0x54(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x50
|
||||
blr
|
||||
void Manager::makeTmpList(ESTitleId* titleIdsOut, u32 availableCount, ESTitleId* titleIdsIn, u32 titleCount) {
|
||||
int appendIndex = DEFAULT_CHANNEL_COUNT;
|
||||
u32 addedCount = 0;
|
||||
for (int inputIndex = 0; inputIndex < titleCount; inputIndex++) {
|
||||
if (titleIdsIn[inputIndex] != TITLE_NULL) {
|
||||
if (checkValidApp(titleIdsIn[inputIndex])) {
|
||||
int match = -1;
|
||||
for (int outputIndex = 0; outputIndex < appendIndex; outputIndex++) {
|
||||
match = isEqualChannel(titleIdsOut[outputIndex], titleIdsIn[inputIndex]);
|
||||
if (match == -2 || match == 0) {
|
||||
break;
|
||||
}
|
||||
if (match == 1) {
|
||||
titleIdsOut[outputIndex] = titleIdsIn[inputIndex];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (match != -1) {
|
||||
titleIdsIn[inputIndex] = TITLE_NULL;
|
||||
continue;
|
||||
}
|
||||
int defaultIndex = isDefaultChannel(ES_TITLE_TYPE(titleIdsIn[inputIndex]), ES_TITLE_CODE(titleIdsIn[inputIndex]));
|
||||
if (defaultIndex == -1) {
|
||||
titleIdsOut[appendIndex++] = titleIdsIn[inputIndex];
|
||||
} else {
|
||||
titleIdsOut[defaultIndex] = titleIdsIn[inputIndex];
|
||||
}
|
||||
addedCount++;
|
||||
}
|
||||
titleIdsIn[inputIndex] = TITLE_NULL;
|
||||
if (addedCount >= availableCount) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Manager::moveTitleTmpToPrior(ESTitleId* titleIdsOut, const ESTitleId* titleIdsIn) {
|
||||
@@ -1086,73 +1012,29 @@ namespace ipl {
|
||||
}
|
||||
|
||||
#ifdef __MWERKS__
|
||||
asm void Manager::pushTitleCache(register ESTitleId titleId) {
|
||||
nofralloc
|
||||
lis r7, 0x4841
|
||||
lis r4, 1
|
||||
addi r0, r7, 0x5445
|
||||
addi r8, r4, 1
|
||||
xor r4, r6, r0
|
||||
xor r0, r5, r8
|
||||
or. r0, r4, r0
|
||||
beqlr
|
||||
addi r4, r7, 0x4445
|
||||
xor r0, r5, r8
|
||||
xor r4, r6, r4
|
||||
or. r0, r4, r0
|
||||
bne pushTitleCache_L1
|
||||
blr
|
||||
pushTitleCache_L1:
|
||||
addis r0, r5, -1
|
||||
cmplwi r0, 1
|
||||
beq pushTitleCache_L2
|
||||
cmplwi r0, 3
|
||||
beq pushTitleCache_L2
|
||||
cmplwi r0, 4
|
||||
beq pushTitleCache_L2
|
||||
cmplwi r0, 6
|
||||
bnelr
|
||||
pushTitleCache_L2:
|
||||
li r0, 0x30
|
||||
li r9, 0
|
||||
li r4, 0
|
||||
mtctr r0
|
||||
pushTitleCache_L3:
|
||||
add r7, r3, r4
|
||||
lwz r0, 0x340(r7)
|
||||
lwz r7, 0x344(r7)
|
||||
xor r0, r5, r0
|
||||
xor r7, r6, r7
|
||||
or. r0, r7, r0
|
||||
beq pushTitleCache_L4
|
||||
addi r9, r9, 1
|
||||
addi r4, r4, 8
|
||||
bdnz pushTitleCache_L3
|
||||
pushTitleCache_L4:
|
||||
cmpwi r9, 0x30
|
||||
bne pushTitleCache_L5
|
||||
li r9, 0x2f
|
||||
pushTitleCache_L5:
|
||||
slwi r4, r9, 3
|
||||
mtctr r9
|
||||
cmpwi r9, 0
|
||||
ble pushTitleCache_L6
|
||||
pushTitleCache_L7:
|
||||
addi r0, r9, -1
|
||||
add r7, r3, r4
|
||||
slwi r0, r0, 3
|
||||
addi r9, r9, -1
|
||||
add r8, r3, r0
|
||||
addi r4, r4, -8
|
||||
lwz r0, 0x340(r8)
|
||||
lwz r8, 0x344(r8)
|
||||
stw r8, 0x344(r7)
|
||||
stw r0, 0x340(r7)
|
||||
bdnz pushTitleCache_L7
|
||||
pushTitleCache_L6:
|
||||
stw r6, 0x344(r3)
|
||||
stw r5, 0x340(r3)
|
||||
blr
|
||||
void Manager::pushTitleCache(ESTitleId titleId) {
|
||||
if (titleId == ES_TITLE_ID(TITLE_TYPE_CHANNEL, 'HATE') || titleId == ES_TITLE_ID(TITLE_TYPE_CHANNEL, 'HADE')) {
|
||||
return;
|
||||
}
|
||||
u32 titleType = ES_TITLE_TYPE_NOMASK(titleId);
|
||||
if (titleType != TITLE_TYPE_CHANNEL && titleType != TITLE_TYPE_UNK3 &&
|
||||
titleType != TITLE_TYPE_DISC_CHANNEL && titleType != TITLE_TYPE_UNK6) {
|
||||
return;
|
||||
}
|
||||
int index = 0;
|
||||
for (; index < MAX_CHANNEL_TOTAL; index++) {
|
||||
if ((&mData.titleCache[0][0])[index] == titleId) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == MAX_CHANNEL_TOTAL) {
|
||||
index = MAX_CHANNEL_TOTAL - 1;
|
||||
}
|
||||
for (; index > 0; index--) {
|
||||
u32 previousIndex = index - 1;
|
||||
(&mData.titleCache[0][0])[index] = (&mData.titleCache[0][0])[previousIndex];
|
||||
}
|
||||
mData.titleCache[0][0] = titleId;
|
||||
}
|
||||
|
||||
extern "C" BOOL isTitleCached(void* manager, ESTitleId titleId) {
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
#include "system/odh.h"
|
||||
#include <revolution/os/OSError.h>
|
||||
|
||||
extern "C" void _savegpr_24();
|
||||
extern "C" void _restgpr_24();
|
||||
extern "C" void cdj_c_initializeCompressOdh__9CArGBAOdhFP16SArCDJ_OdhMasterPUsUcPUcPUcUl();
|
||||
extern "C" void cdj_c_compressLoop__9CArGBAOdhFP16SArCDJ_OdhMaster();
|
||||
extern "C" void cdj_c_colorConv__9CArGBAOdhFP16SArCDJ_OdhMasterPUci();
|
||||
extern "C" s32 huffmanDecoder__9CArGBAOdhFPUlP21SArCDJ_HuffmanRequestPPUsiUl(u32, int, int, u32, int, u32);
|
||||
extern "C" void idct_fast__9CArGBAOdhFPCUcPUlPUlPUcUl(u32, u32, int, int, int, u32);
|
||||
|
||||
@@ -478,12 +473,9 @@ static const u16 gArDc_chrominance_huffTable[] = {
|
||||
0x8001, 0x0008, 0x8001, 0x0009, 0x8001, 0x000A, 0x8001, 0x000B,
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
struct HufftreeData {
|
||||
const u16* tables[4];
|
||||
char messages[0x1BB];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
HufftreeData hufftreePtr = {
|
||||
{
|
||||
@@ -492,16 +484,6 @@ HufftreeData hufftreePtr = {
|
||||
gArDc_chrominance_huffTable,
|
||||
gArDc_luminance_huffTable,
|
||||
},
|
||||
"decompressGbaOdh : source size error\n\0"
|
||||
"decompressGbaOdh : destination buffer over\n\0"
|
||||
"decompressGbaOdh : INITIALIZE ERROR %08x\n\0"
|
||||
"decompressGbaOdh : DECOMPRESSING ERROR %08x\n\0"
|
||||
"decompressGbaOdh : COLOR DECONVERSION ERROR %08x\n\0"
|
||||
"compressGbaOdh : INITIALIZE ERROR %08x\n\0"
|
||||
"compressGbaOdh : COLOR CONVERSION ERROR %08x\n\0"
|
||||
"compressGbaOdh : COMPRESS OVER AND RETRY %d q=%d, %08x\n\0"
|
||||
"compressGbaOdh : INITIALIZE ERROR2 %08x\n\0"
|
||||
"compressGbaOdh : COMPRESSING ERROR %08x\n",
|
||||
};
|
||||
|
||||
class CArGBAOdh {
|
||||
@@ -577,13 +559,12 @@ int ODHGetHeight(u8* data) {
|
||||
|
||||
s32 CArGBAOdh::decompressGbaOdh(u8* src, int srcSize, u8* dest, int destSize, u8* work, int unk, int format) {
|
||||
SArCDJ_OdhMaster master;
|
||||
const char* messages = (const char*)&hufftreePtr;
|
||||
int width;
|
||||
int height;
|
||||
int outputSize;
|
||||
|
||||
if (srcSize <= 0x10) {
|
||||
OSReport(messages + 0x10);
|
||||
OSReport("decompressGbaOdh : source size error\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -605,142 +586,67 @@ s32 CArGBAOdh::decompressGbaOdh(u8* src, int srcSize, u8* dest, int destSize, u8
|
||||
unk = width * height * 3;
|
||||
}
|
||||
if (outputSize > destSize) {
|
||||
OSReport(messages + 0x36);
|
||||
OSReport("decompressGbaOdh : destination buffer over\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 result = cdj_d_initializeDecompressOdh(&master, work, src);
|
||||
if (result != 0) {
|
||||
OSReport(messages + 0x62, result);
|
||||
OSReport("decompressGbaOdh : INITIALIZE ERROR %08x\n", result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
result = cdj_d_decompressLoop(&master, srcSize, unk);
|
||||
if (result != 0) {
|
||||
OSReport(messages + 0x8C, result);
|
||||
OSReport("decompressGbaOdh : DECOMPRESSING ERROR %08x\n", result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
result = cdj_d_colorDeconv(&master, dest, format);
|
||||
if (result != 0) {
|
||||
OSReport(messages + 0xB9, result);
|
||||
OSReport("decompressGbaOdh : COLOR DECONVERSION ERROR %08x\n", result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return height << 16 | width;
|
||||
}
|
||||
|
||||
asm s32 CArGBAOdh::compressGbaOdh(u8* src, u8* dest, int width, int height, int quality, u32 sizeLimit, u8* work, int format) {
|
||||
nofralloc
|
||||
stwu r1, -0x4b0(r1)
|
||||
mflr r0
|
||||
stw r0, 0x4b4(r1)
|
||||
addi r11, r1, 0x4b0
|
||||
bl _savegpr_24
|
||||
cmpwi r9, 0
|
||||
lis r31, hufftreePtr@ha
|
||||
lwz r29, 0x4b8(r1)
|
||||
mr r24, r3
|
||||
mr r30, r4
|
||||
mr r25, r5
|
||||
mr r26, r8
|
||||
mr r27, r9
|
||||
mr r28, r10
|
||||
addi r31, r31, hufftreePtr@l
|
||||
bne compressGbaOdh_L1
|
||||
mullw r0, r6, r7
|
||||
slwi r27, r0, 1
|
||||
compressGbaOdh_L1:
|
||||
sth r6, 8(r1)
|
||||
clrlwi r6, r8, 0x18
|
||||
mr r3, r24
|
||||
mr r8, r25
|
||||
sth r7, 0xa(r1)
|
||||
mr r7, r28
|
||||
mr r9, r27
|
||||
addi r4, r1, 0xc
|
||||
addi r5, r1, 8
|
||||
bl cdj_c_initializeCompressOdh__9CArGBAOdhFP16SArCDJ_OdhMasterPUsUcPUcPUcUl
|
||||
cmpwi r3, 0
|
||||
beq compressGbaOdh_L2
|
||||
mr r4, r3
|
||||
addi r3, r31, 0xeb
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L2:
|
||||
mr r3, r24
|
||||
mr r5, r30
|
||||
mr r6, r29
|
||||
addi r4, r1, 0xc
|
||||
bl cdj_c_colorConv__9CArGBAOdhFP16SArCDJ_OdhMasterPUci
|
||||
cmpwi r3, 0
|
||||
beq compressGbaOdh_L3
|
||||
mr r4, r3
|
||||
addi r3, r31, 0x113
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L3:
|
||||
mr r3, r24
|
||||
addi r4, r1, 0xc
|
||||
bl cdj_c_compressLoop__9CArGBAOdhFP16SArCDJ_OdhMaster
|
||||
mr r30, r3
|
||||
li r29, 1
|
||||
b compressGbaOdh_L6
|
||||
compressGbaOdh_L4:
|
||||
lbz r5, 0x10(r1)
|
||||
mr r4, r29
|
||||
mr r6, r30
|
||||
addi r3, r31, 0x141
|
||||
crclr 4*cr1+eq
|
||||
addi r29, r29, 1
|
||||
bl OSReport
|
||||
addic. r26, r26, -5
|
||||
ble compressGbaOdh_L7
|
||||
mr r3, r24
|
||||
mr r7, r28
|
||||
mr r8, r25
|
||||
mr r9, r27
|
||||
addi r4, r1, 0xc
|
||||
addi r5, r1, 8
|
||||
clrlwi r6, r26, 0x18
|
||||
bl cdj_c_initializeCompressOdh__9CArGBAOdhFP16SArCDJ_OdhMasterPUsUcPUcPUcUl
|
||||
cmpwi r3, 0
|
||||
beq compressGbaOdh_L5
|
||||
mr r4, r3
|
||||
addi r3, r31, 0x179
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L5:
|
||||
mr r3, r24
|
||||
addi r4, r1, 0xc
|
||||
bl cdj_c_compressLoop__9CArGBAOdhFP16SArCDJ_OdhMaster
|
||||
mr r30, r3
|
||||
b compressGbaOdh_L6
|
||||
compressGbaOdh_L7:
|
||||
mr r4, r30
|
||||
addi r3, r31, 0x1a2
|
||||
crclr 4*cr1+eq
|
||||
bl OSReport
|
||||
li r3, 0
|
||||
b compressGbaOdh_L8
|
||||
compressGbaOdh_L6:
|
||||
addis r0, r30, -0x8000
|
||||
cmplwi r0, 4
|
||||
beq compressGbaOdh_L4
|
||||
mr r3, r30
|
||||
compressGbaOdh_L8:
|
||||
addi r11, r1, 0x4b0
|
||||
bl _restgpr_24
|
||||
lwz r0, 0x4b4(r1)
|
||||
mtlr r0
|
||||
addi r1, r1, 0x4b0
|
||||
blr
|
||||
s32 CArGBAOdh::compressGbaOdh(u8* src, u8* dest, int width, int height, int quality, u32 sizeLimit, u8* work, int format) {
|
||||
SArCDJ_OdhMaster master;
|
||||
u16 dimensions[2];
|
||||
if (sizeLimit == 0) {
|
||||
sizeLimit = width * height * 2;
|
||||
}
|
||||
dimensions[0] = width;
|
||||
dimensions[1] = height;
|
||||
s32 result = cdj_c_initializeCompressOdh(&master, dimensions, quality, work, dest, sizeLimit);
|
||||
if (result != ODH_ERROR_SUCCESS) {
|
||||
OSReport("compressGbaOdh : INITIALIZE ERROR %08x\n", result);
|
||||
return 0;
|
||||
}
|
||||
result = cdj_c_colorConv(&master, src, format);
|
||||
if (result != ODH_ERROR_SUCCESS) {
|
||||
OSReport("compressGbaOdh : COLOR CONVERSION ERROR %08x\n", result);
|
||||
return 0;
|
||||
}
|
||||
result = cdj_c_compressLoop(&master);
|
||||
int retry = 1;
|
||||
while (result == ODH_ERROR_80000004) {
|
||||
OSReport("compressGbaOdh : COMPRESS OVER AND RETRY %d q=%d, %08x\n", retry++, master.quality, result);
|
||||
quality -= 5;
|
||||
if (quality > 0) {
|
||||
s32 initResult = cdj_c_initializeCompressOdh(&master, dimensions, quality, work, dest, sizeLimit);
|
||||
if (initResult != ODH_ERROR_SUCCESS) {
|
||||
OSReport("compressGbaOdh : INITIALIZE ERROR2 %08x\n", initResult);
|
||||
return 0;
|
||||
}
|
||||
result = cdj_c_compressLoop(&master);
|
||||
} else {
|
||||
OSReport("compressGbaOdh : COMPRESSING ERROR %08x\n", result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 CArGBAOdh::cdj_c_initializeCompressOdh(SArCDJ_OdhMaster* master, u16* dimensions, u8 requestedQuality, u8* workBuffer, u8* outputBuffer, u32 outputCapacity) {
|
||||
|
||||
307
tools/decomp-assist/da1.attempts.md
Normal file
307
tools/decomp-assist/da1.attempts.md
Normal file
@@ -0,0 +1,307 @@
|
||||
# da1 de-asm handoff
|
||||
|
||||
Four of eleven assigned asm bodies converted to C++. Seven retain their original asm after source attempts. This is partial de-asm progress. All accepted conversion functions remain 100.0% and instruction-exact.
|
||||
|
||||
| Function | Result | Best C++ evidence |
|
||||
|---|---|---|
|
||||
| keyboard::Manager::doSave | Converted, cd13786b | 100.0%, 85/85, diffs 0 |
|
||||
| savedata::Manager::hasChannel | Kept asm | 91.66197%, 71/71, 54 diffs |
|
||||
| savedata::Manager::makePriorTitleIDList | Kept asm | 80.22556%, 124/133 instructions |
|
||||
| savedata::Manager::makeTmpList | Converted, 86b306d1 | 100.0%, 95/95, diffs 0 |
|
||||
| savedata::Manager::doUpdateChanInfos | Kept asm | 91.9403%, 68/67 instructions |
|
||||
| savedata::Manager::pushTitleCache | Converted, b395ddf0 | 100.0%, 58/58, diffs 0 |
|
||||
| cdb_backup_delete_task_ | Kept asm | 99.781815%, 55/55, 2 epilogue diffs |
|
||||
| cdb_backup_move_task_ | Kept asm | 99.82609%, 69/69, 2 epilogue diffs |
|
||||
| System::warning_run | Kept asm | 98.66477%, 176/176, 47 register diffs |
|
||||
| Exception::exception_callback | Kept asm | 99.18367%, 98/98, 13 register diffs |
|
||||
| CArGBAOdh::compressGbaOdh | Converted, final commit | 100.0%, 101/101, diffs 0 |
|
||||
|
||||
Each trial below names its source, compiler output, pool result, ctxdiff and objdiff snapshot under build/da1. Inspect that folder before repeating an experiment. All seven kept functions have at least four successful compiled source attempts. No new asm, use-site volatile, register keyword, artificial padding, symbol edits or compiler flag changes were retained. Only keyboard, SaveDataManager, odh and this log changed.
|
||||
|
||||
## Attempts and verification
|
||||
|
||||
da1 de-asm round, base bfe77b7f, branch agent/w1005/da1.
|
||||
Scope: keyboard doSave; savedata hasChannel, makePriorTitleIDList, makeTmpList, doUpdateChanInfos, pushTitleCache; CdbBackup delete/move tasks; System warning_run; Exception callback; odh compressGbaOdh.
|
||||
Baseline: all assigned functions are 100% asm. Five units linked; odh remains NonMatching. DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. Fresh baseline report build/da1-baseline-report.json. Prior asm-conversions attempts reviewed.
|
||||
|
||||
keyboard-1 doSave__Q33ipl8keyboard7ManagerFv: Value-parameter comparison helper with direct returned setting initialization.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 93.988235%; src 0x154 base 0x154 insns 85/85; diffs 57: [4, 5, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]
|
||||
Evidence: build/da1/keyboard-1
|
||||
|
||||
keyboard-2 doSave__Q33ipl8keyboard7ManagerFv: Materialize comparison boolean before testing pending save.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 95.117645%; src 0x144 base 0x154 insns 81/85; --- insert mine 58:58 base 58:59
|
||||
Evidence: build/da1/keyboard-2
|
||||
|
||||
keyboard-3 doSave__Q33ipl8keyboard7ManagerFv: Use SDK BOOL for comparison helper and result.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 95.117645%; src 0x144 base 0x154 insns 81/85; --- insert mine 58:58 base 58:59
|
||||
Evidence: build/da1/keyboard-3
|
||||
|
||||
keyboard-4 doSave__Q33ipl8keyboard7ManagerFv: Separate locals for equality and combined save predicate.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 100.0%; src 0x154 base 0x154 insns 85/85; diffs 0: []
|
||||
Evidence: build/da1/keyboard-4
|
||||
|
||||
keyboard-5 doSave__Q33ipl8keyboard7ManagerFv: Explicit bool conversion for combined save predicate.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 95.117645%; src 0x144 base 0x154 insns 81/85; --- insert mine 58:58 base 58:59
|
||||
Evidence: build/da1/keyboard-5
|
||||
|
||||
keyboard-6 doSave__Q33ipl8keyboard7ManagerFv: Const equality and SDK BOOL combined predicate.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 100.0%; src 0x154 base 0x154 insns 85/85; diffs 0: []
|
||||
Evidence: build/da1/keyboard-6
|
||||
|
||||
keyboard-final doSave__Q33ipl8keyboard7ManagerFv: Keep two readable boolean locals and remove asm-only extern declarations.
|
||||
POOL IDENTICAL up to 28 (mine=28 base=28); 100.0%; src 0x154 base 0x154 insns 85/85; diffs 0: []
|
||||
Evidence: build/da1/keyboard-final
|
||||
|
||||
doSave CONVERTED. Final full gate build/da1/keyboard-full-gate.txt: GATE PASS, 32/32 exact unchanged, code 6024/6024, data 1184/1184; regressions 0; forbidden/readability 0; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. Exact by-value comparison helper plus separate equality and save-condition locals.
|
||||
|
||||
hasChannel-1 hasChannel__Q33ipl8savedata7ManagerCFUxPiPi: Read-only SInfo reference helper assembles each stored title; direct nested array access, two masks.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 86.676056%; src 0x11c base 0x11c insns 71/71; diffs 53: [0, 2, 3, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
Evidence: build/da1/hasChannel-1
|
||||
|
||||
hasChannel-2 hasChannel__Q33ipl8savedata7ManagerCFUxPiPi: Inline full title comparison helper; keeps masked comparisons together.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 81.014084%; src 0x12c base 0x11c insns 75/71; --- replace mine 0:1 base 0:1
|
||||
Evidence: build/da1/hasChannel-2
|
||||
|
||||
hasChannel-3 hasChannel__Q33ipl8savedata7ManagerCFUxPiPi: Const-reference comparison helper inputs instead of by-value inputs.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 81.014084%; src 0x12c base 0x11c insns 75/71; --- replace mine 0:1 base 0:1
|
||||
Evidence: build/da1/hasChannel-3
|
||||
|
||||
hasChannel-4 hasChannel__Q33ipl8savedata7ManagerCFUxPiPi: Block-scoped region mask inside each valid channel; direct indexed field loads.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.66197%; src 0x11c base 0x11c insns 71/71; diffs 54: [0, 2, 3, 8, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
|
||||
Evidence: build/da1/hasChannel-4
|
||||
|
||||
hasChannel-5 hasChannel__Q33ipl8savedata7ManagerCFUxPiPi: Const masks, pointer-to-const title helper, and target-side comparison operand order.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 86.676056%; src 0x11c base 0x11c insns 71/71; diffs 53: [0, 2, 3, 8, 9, 11, 12, 13, 14, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26]
|
||||
Evidence: build/da1/hasChannel-5
|
||||
|
||||
hasChannel provisionally KEPT ASM after five distinct compiled attempts. Best manual C++ 91.66197%, 71/71 instructions, 54 differences, different frame and invariant-hoist/register placement. Search on immutable candidate queued for shared srcsearch CPU slot; no original file mutation. Three prior simple-loop trials were not repeated.
|
||||
|
||||
prior-1 makePriorTitleIDList__Q33ipl8savedata7ManagerFPUxPUxUl: Photo-title replacement as const-reference inline helper; use direct indexed title accesses.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 75.53384%; src 0x1e8 base 0x214 insns 122/133; --- replace mine 12:13 base 12:14
|
||||
Evidence: build/da1/prior-1
|
||||
|
||||
prior-2 makePriorTitleIDList__Q33ipl8savedata7ManagerFPUxPUxUl: Const read helper and write helper around title-array indexing to preserve per-use address computation.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 80.22556%; src 0x1f0 base 0x214 insns 124/133; --- replace mine 12:13 base 12:14
|
||||
Evidence: build/da1/prior-2
|
||||
|
||||
prior-3 makePriorTitleIDList__Q33ipl8savedata7ManagerFPUxPUxUl: Inline photo replacement at use; unsigned input induction and early continue for empty slots.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 75.53384%; src 0x1e8 base 0x214 insns 122/133; --- replace mine 12:13 base 12:14
|
||||
Evidence: build/da1/prior-3
|
||||
|
||||
prior-4 makePriorTitleIDList__Q33ipl8savedata7ManagerFPUxPUxUl: Compute output index at nonempty-input use; separate const input title for comparison call.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 77.83459%; src 0x1f0 base 0x214 insns 124/133; --- insert mine 12:12 base 12:14
|
||||
Evidence: build/da1/prior-4
|
||||
|
||||
makePriorTitleIDList provisionally KEPT ASM. Four new distinct compiled source attempts, best helper candidate 80.22556%, 124/133 instructions. MWCC caches output/input addresses where target recomputes them and places photo mask differently. Search on immutable helper candidate queued.
|
||||
|
||||
tmp-1 makeTmpList__Q33ipl8savedata7ManagerFPUxUlPUxUl: Use ES_TITLE_TYPE and ES_TITLE_CODE macros for target-proven masking rather than truncated casts; direct title-list loops.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 100.0%; src 0x17c base 0x17c insns 95/95; diffs 0: []
|
||||
Evidence: build/da1/tmp-1
|
||||
|
||||
makeTmpList candidate exact on first new trial: 100.0%, 95/95, diffs 0, 3/3 pool. Target redundant and instructions come from ES_TITLE_TYPE/ES_TITLE_CODE macros. Retain pending full unit gate.
|
||||
|
||||
update-1 doUpdateChanInfos__Q33ipl8savedata7ManagerFPUx: Const-reference channel initialization helper, ordinary SInfo fields and ES title macros.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.9403%; src 0x110 base 0x10c insns 68/67; --- replace mine 5:7 base 5:7
|
||||
Evidence: build/da1/update-1
|
||||
|
||||
update-2 doUpdateChanInfos__Q33ipl8savedata7ManagerFPUx: Separate clearChannelInfo inline helper delays address formation for memset.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.9403%; src 0x110 base 0x10c insns 68/67; --- replace mine 5:7 base 5:7
|
||||
Evidence: build/da1/update-2
|
||||
|
||||
update-3 doUpdateChanInfos__Q33ipl8savedata7ManagerFPUx: Bind SInfo reference for one channel before testing and updating it.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 87.910446%; src 0x110 base 0x10c insns 68/67; --- replace mine 7:8 base 7:8
|
||||
Evidence: build/da1/update-3
|
||||
|
||||
update-4 doUpdateChanInfos__Q33ipl8savedata7ManagerFPUx: Pointer-to-const input and pointer output helper instead of references.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.9403%; src 0x110 base 0x10c insns 68/67; --- replace mine 5:7 base 5:7
|
||||
Evidence: build/da1/update-4
|
||||
|
||||
update-5 doUpdateChanInfos__Q33ipl8savedata7ManagerFPUx: Direct indexed stores with ES macros and a named comparison result; remove helper lifetime.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.9403%; src 0x110 base 0x10c insns 68/67; --- replace mine 5:7 base 5:7
|
||||
Evidence: build/da1/update-5
|
||||
|
||||
doUpdateChanInfos provisionally KEPT ASM after five new compiled variants: best C++ 91.9403%, 68/67 instructions. Extra per-page +0x30 address for memset forces different register allocation. Source search queued on direct-store candidate.
|
||||
|
||||
cache-1 pushTitleCache__Q33ipl8savedata7ManagerFUx: Use named title-type constants, NOMASK type extraction, repeated array accesses and one shrinking cache index.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.86207%; src 0xd8 base 0xe8 insns 54/58; --- replace mine 24:25 base 24:25
|
||||
Evidence: build/da1/cache-1
|
||||
|
||||
cache-2 pushTitleCache__Q33ipl8savedata7ManagerFUx: Unsigned previous slot index preserves separate predecessor address computation.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 100.0%; src 0xe8 base 0xe8 insns 58/58; diffs 0: []
|
||||
Evidence: build/da1/cache-2
|
||||
|
||||
cache-3 pushTitleCache__Q33ipl8savedata7ManagerFUx: Const-pointer inline cachedTitle accessor around predecessor read.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 91.86207%; src 0xd8 base 0xe8 insns 54/58; --- replace mine 24:25 base 24:25
|
||||
Evidence: build/da1/cache-3
|
||||
|
||||
cache-4 pushTitleCache__Q33ipl8savedata7ManagerFUx: Separate destination local and decrement the source index before its read.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 92.98276%; src 0xe4 base 0xe8 insns 57/58; --- replace mine 24:25 base 24:25
|
||||
Evidence: build/da1/cache-4
|
||||
|
||||
pushTitleCache candidate exact: cache-2 uses u32 previousIndex = index - 1 and normal indexed access, 100.0%, 58/58, diffs 0. No raw offsets or artificial assembly.
|
||||
Prior automated search: 23 trials, no gain over 124/133 instructions and 80.22556%. hasChannel automated search waited 7 minutes without acquiring a CPU slot; stopped pending retry after clean unit gate. First relative --out invocation failed to resolve mini/report paths; subsequent invocations use absolute output paths.
|
||||
|
||||
cache-final pushTitleCache__Q33ipl8savedata7ManagerFUx: Restore exact unsigned predecessor candidate with exact makeTmpList retained.
|
||||
POOL IDENTICAL up to 3 (mine=3 base=3); 100.0%; src 0xe8 base 0xe8 insns 58/58; diffs 0: []
|
||||
Evidence: build/da1/cache-final
|
||||
|
||||
SaveDataManager full clean gate build/da1/save-full-gate.txt: GATE PASS. makeTmpList and pushTitleCache CONVERTED; hasChannel, makePriorTitleIDList and doUpdateChanInfos retain original asm. 35/35 exact unchanged, code 7172/7172, data 968/968; regressions 0; forbidden/readability 0; required DOL hash unchanged. update source search ran 14 trials without improving 68/67 instructions. Stage each exact conversion separately.
|
||||
|
||||
cdb-delete-1 cdb_backup_delete_task___3iplFPv: Use typed CdbBackup methods and existing CDB API, preserve date arguments and declaration order.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.781815%; src 0xdc base 0xdc insns 55/55; diffs 2: [50, 51]
|
||||
Evidence: build/da1/cdb-delete-1
|
||||
|
||||
cdb-delete-2 cdb_backup_delete_task___3iplFPv: Complete via a reference-taking static inline finishBackup helper.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.781815%; src 0xdc base 0xdc insns 55/55; diffs 2: [50, 51]
|
||||
Evidence: build/da1/cdb-delete-2
|
||||
|
||||
cdb-delete-3 cdb_backup_delete_task___3iplFPv: Const dates and block-local const backup pointer initialized after the date calls.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.781815%; src 0xdc base 0xdc insns 55/55; diffs 2: [50, 51]
|
||||
Evidence: build/da1/cdb-delete-3
|
||||
|
||||
cdb-delete-4 cdb_backup_delete_task___3iplFPv: Return the void completion setter expression to expose final-use lifetime.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.781815%; src 0xdc base 0xdc insns 55/55; diffs 2: [50, 51]
|
||||
Evidence: build/da1/cdb-delete-4
|
||||
|
||||
cdb_backup_delete_task_ provisionally KEPT ASM after four distinct compiled C++ variants. Each is 99.781815%, 55/55 instructions, only diffs 50/51: lwz r31,0x1c and lwz r0,0x24 in reverse order. Scope/reference/const/return-form levers do not change epilogue scheduling.
|
||||
|
||||
cdb-move-1 cdb_backup_move_task___3iplFPv: Use typed backup methods and const date locals; keep separate free-size loads and search arguments.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.82609%; src 0x114 base 0x114 insns 69/69; diffs 2: [64, 65]
|
||||
Evidence: build/da1/cdb-move-1
|
||||
|
||||
cdb-move-2 cdb_backup_move_task___3iplFPv: Pointer-taking completion helper instead of direct member call.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.82609%; src 0x114 base 0x114 insns 69/69; diffs 2: [64, 65]
|
||||
Evidence: build/da1/cdb-move-2
|
||||
|
||||
cdb-move-3 cdb_backup_move_task___3iplFPv: Nonconst date inputs, const backup pointer and returned void completion expression.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.82609%; src 0x114 base 0x114 insns 69/69; diffs 2: [64, 65]
|
||||
Evidence: build/da1/cdb-move-3
|
||||
|
||||
cdb-move-4 cdb_backup_move_task___3iplFPv: Separate use of original worker argument for search and final typed completion.
|
||||
POOL IDENTICAL up to 2 (mine=2 base=2); 99.82609%; src 0x114 base 0x114 insns 69/69; diffs 2: [64, 65]
|
||||
Evidence: build/da1/cdb-move-4
|
||||
|
||||
cdb_backup_move_task_ provisionally KEPT ASM after four distinct compiled variants. Every trial 99.82609%, 69/69 instructions, only diffs 64/65: reverse epilogue loads of r31 and LR. Original CdbBackup.cpp restored in full. Searches use a local srcsearch copy whose definition finder skips forward declarations; shared script unchanged.
|
||||
|
||||
warning-1 warning_run__Q23ipl6SystemFv: Normal warning render/update loop using existing accessors and visibility restoration; preserve named fatal-state and reset predicates.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.66477%; src 0x2c0 base 0x2c0 insns 176/176; diffs 47: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 40, 50, 59, 61, 64, 69, 71]
|
||||
Evidence: build/da1/warning-1
|
||||
|
||||
warning-2 warning_run__Q23ipl6SystemFv: Bind System::Arg as an early const reference for framework operations.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.66477%; src 0x2c0 base 0x2c0 insns 176/176; diffs 47: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 40, 50, 59, 61, 64, 69, 71]
|
||||
Evidence: build/da1/warning-2
|
||||
|
||||
warning-3 warning_run__Q23ipl6SystemFv: Use one typed System::Arg pointer for member accesses throughout the loop.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 97.5%; src 0x2b8 base 0x2c0 insns 174/176; --- replace mine 8:10 base 8:10
|
||||
Evidence: build/da1/warning-3
|
||||
|
||||
warning-4 warning_run__Q23ipl6SystemFv: Nest the body under the positive not-resetting guard instead of an early return.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.66477%; src 0x2c0 base 0x2c0 insns 176/176; diffs 47: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 40, 50, 59, 61, 64, 69, 71]
|
||||
Evidence: build/da1/warning-4
|
||||
|
||||
warning-5 warning_run__Q23ipl6SystemFv: Use explicit loop exit when warning check finishes.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.66477%; src 0x2c0 base 0x2c0 insns 176/176; diffs 47: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 40, 50, 59, 61, 64, 69, 71]
|
||||
Evidence: build/da1/warning-5
|
||||
|
||||
warning-6 warning_run__Q23ipl6SystemFv: Static inline viewport/scissor setup helper changes boundaries for float-conversion temporaries.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.66477%; src 0x2c0 base 0x2c0 insns 176/176; diffs 47: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 40, 50, 59, 61, 64, 69, 71]
|
||||
Evidence: build/da1/warning-6
|
||||
|
||||
warning-7 warning_run__Q23ipl6SystemFv: Use a const SDK BOOL for saved visibility.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.52273%; src 0x2c0 base 0x2c0 insns 176/176; diffs 52: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 39, 40, 42, 44, 50, 54, 56]
|
||||
Evidence: build/da1/warning-7
|
||||
|
||||
warning-8 warning_run__Q23ipl6SystemFv: Declare saved visibility before reset guard, assign only on the active warning path.
|
||||
POOL IDENTICAL up to 52 (mine=52 base=52); 98.66477%; src 0x2c0 base 0x2c0 insns 176/176; diffs 47: [8, 9, 16, 19, 20, 21, 23, 25, 27, 30, 32, 35, 37, 40, 50, 59, 61, 64, 69, 71]
|
||||
Evidence: build/da1/warning-8
|
||||
|
||||
warning_run provisionally KEPT ASM. Eight compiled variants. Best 98.66477%, 176/176, 47 register-only diffs: global System::Arg base r31 instead of r28, visibility r28 instead of r29, integer conversion r29 instead of r30, sound base r30 instead of r31. Other instructions identical. Tried const/reference/pointer state, loop and guard directions, scoped viewport helper, BOOL and declaration order. Original System.cpp restored.
|
||||
|
||||
exception-1 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Use typed console APIs and KPAD loops; write only changed horizontal position as target proves.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 97.60204%; src 0x188 base 0x188 insns 98/98; diffs 39: [6, 9, 11, 12, 15, 16, 17, 19, 22, 23, 25, 26, 27, 28, 35, 36, 37, 39, 40, 41]
|
||||
Evidence: build/da1/exception-1
|
||||
|
||||
exception-2 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Static inline KPAD-read helper for one four-controller polling pass.
|
||||
COMPILE FAIL: initial text replacement also altered key_input before the helper definition. Restored it, then restricted the helper to exception_callback in exception-5. Compiler diagnostic: undefined identifier 'readExceptionControllers'. Full output: build/da1/exception-2/build.txt.
|
||||
Evidence: build/da1/exception-2
|
||||
|
||||
exception-3 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Declare horizontal and vertical scroll state before initial auto-scroll; assign each before use.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 97.85714%; src 0x188 base 0x188 insns 98/98; diffs 36: [6, 11, 12, 15, 17, 19, 23, 25, 26, 27, 28, 35, 36, 37, 39, 40, 41, 44, 48, 51]
|
||||
Evidence: build/da1/exception-3
|
||||
|
||||
exception-4 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Named const controller bound and const previous coordinates declared in x/y order.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 97.39796%; src 0x188 base 0x188 insns 98/98; diffs 39: [6, 9, 11, 12, 15, 16, 17, 19, 22, 23, 25, 26, 27, 28, 35, 36, 37, 39, 40, 41]
|
||||
Evidence: build/da1/exception-4
|
||||
|
||||
exception-5 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Restrict read-controller helper to callback; leave key_input unchanged.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 98.0102%; src 0x188 base 0x188 insns 98/98; diffs 28: [11, 23, 26, 27, 35, 37, 38, 39, 40, 41, 43, 44, 47, 48, 49, 55, 64, 66, 70, 72]
|
||||
Evidence: build/da1/exception-5
|
||||
|
||||
exception-6 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Declare scroll coordinates in natural x/y order before the introductory scroll.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 99.18367%; src 0x188 base 0x188 insns 98/98; diffs 13: [35, 39, 40, 41, 44, 48, 55, 76, 78, 82, 84, 89, 92]
|
||||
Evidence: build/da1/exception-6
|
||||
|
||||
exception-7 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Combine x/y declaration order with controller-read helper.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 98.46939%; src 0x188 base 0x188 insns 98/98; diffs 23: [9, 16, 22, 23, 35, 37, 38, 39, 40, 41, 43, 44, 47, 48, 49, 55, 76, 78, 82, 84]
|
||||
Evidence: build/da1/exception-7
|
||||
|
||||
exception-8 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Limit introductory auto-scroll cursor to its own scope; keep persistent coordinates outside.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 99.18367%; src 0x188 base 0x188 insns 98/98; diffs 13: [35, 39, 40, 41, 44, 48, 55, 76, 78, 82, 84, 89, 92]
|
||||
Evidence: build/da1/exception-8
|
||||
|
||||
exception-9 exception_callback__Q23ipl9ExceptionFPQ44nw4r2db6detail11ConsoleHead: Declare loop bound before persistent coordinates to separate its lifetime from the read cursor.
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0); 99.18367%; src 0x188 base 0x188 insns 98/98; diffs 13: [35, 39, 40, 41, 44, 48, 55, 76, 78, 82, 84, 89, 92]
|
||||
Evidence: build/da1/exception-9
|
||||
|
||||
exception_callback provisionally KEPT ASM. Eight successfully compiled variants plus one rejected helper placement that was immediately corrected. Best exception-6 is 99.18367%, 98/98, 13 register diffs: horizontal coordinate, controller bound and read-loop stride are assigned r26/r29/r27 rather than r29/r27/r26. Other code is instruction-identical. Source search running on immutable best candidate; source restored pending result.
|
||||
|
||||
compressGbaOdh data prerequisite: baseline packs four Huffman pointers and ten diagnostic strings into HufftreeData with raw message offsets. New C++ must use ordinary literals. Trial splits table from compiler-pooled diagnostic literals, replaces the five existing decompression offset calls with identical text, and converts compression normally. No symbol metadata changed; byte/pool and other-function output must still match before accepting.
|
||||
|
||||
odh-1 compressGbaOdh__9CArGBAOdhFPUcPUciiiUlPUci: Typed master/dimensions, normal retry loop and ordinary diagnostic literals; remove packed string blob.
|
||||
POOL IDENTICAL up to 10 (mine=10 base=10); 100.0%; src 0x194 base 0x194 insns 101/101; diffs 0: []
|
||||
Evidence: build/da1/odh-1
|
||||
|
||||
compressGbaOdh candidate exact on first reconstruction: 100.0%, 101/101, diffs 0. Ordinary diagnostic literals preserve pool 10/10 and all 459 emitted .data bytes versus target, whose remaining 5 bytes are alignment. .rodata 5856 and .sdata2 40 are byte-identical. No metadata edits: hufftreePtr source symbol now correctly contains 16 pointer bytes while original aggregate symbol spans 459 bytes; objdiff still reports every data section 100%. Existing decompressGbaOdh is 100.0%, 98/98, diffs 0; every other function score unchanged. Unit remains 26/28 exact, code 12876/14684, data 6360/6360. Removed five now-unused asm extern declarations.
|
||||
|
||||
odh-final compressGbaOdh__9CArGBAOdhFPUcPUciiiUlPUci: Remove unused asm externs; preserve ordinary string pooling and typed Huffman pointer table.
|
||||
POOL IDENTICAL up to 10 (mine=10 base=10); 100.0%; src 0x194 base 0x194 insns 101/101; diffs 0: []
|
||||
Evidence: build/da1/odh-final
|
||||
|
||||
Automated search outcomes: prior 23 compiled trials and update 14 compiled trials produced no gain. hasChannel first waited 7 minutes and its bounded retry waited 180 seconds without a slot. Cdb delete, Cdb move, warning_run and exception_callback also timed out at the shared 24-slot limiter before printing target counts or compiling any trial. Their results are supported by the manual source trials above, not by a claim of exhaustive automated search. No search process remains.
|
||||
|
||||
Open-function audit: hasChannel 5 compiled attempts; makePriorTitleIDList 4 plus 23 source-search trials; doUpdateChanInfos 5 plus 14 source-search trials; Cdb delete 4; Cdb move 4; warning_run 8; exception_callback 8 successful compilations plus one compiler-rejected helper placement. All seven original asm bodies restored. Converted functions: doSave, makeTmpList, pushTitleCache, compressGbaOdh.
|
||||
|
||||
## Final clean verification
|
||||
|
||||
Full non-quick gate across all six assigned units passes. Every unit measure in the full 1027-unit report is unchanged from the fresh bfe77b7f baseline. Of 1027 rebuilt source objects, only the three edited units have different object-file hashes; the other 1024 are byte-identical. All four converted functions are exact-name 100.0% with equal instruction counts and ctxdiff diffs 0. decompressGbaOdh also remains exact. Both odh string-argument audits check five calls each with zero candidates, skips or errors.
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/system/iplKeyboard] pool: IDENTICAL
|
||||
[src/system/iplKeyboard] objdiff: code 6024/6024 data 1184/1184 functions 32/32 fuzzy 100.0000 linked code 6024
|
||||
[src/system/iplKeyboard] instruction-exact functions: 32/32
|
||||
[src/system/iplSaveDataManager] pool: IDENTICAL
|
||||
[src/system/iplSaveDataManager] objdiff: code 7172/7172 data 968/968 functions 35/35 fuzzy 100.0000 linked code 7172
|
||||
[src/system/iplSaveDataManager] instruction-exact functions: 35/35
|
||||
[src/system/iplCdbBackup] pool: IDENTICAL
|
||||
[src/system/iplCdbBackup] objdiff: code 4012/4012 data 108/108 functions 26/26 fuzzy 100.0000 linked code 4012
|
||||
[src/system/iplCdbBackup] instruction-exact functions: 26/26
|
||||
[src/system/iplSystem] pool: IDENTICAL
|
||||
[src/system/iplSystem] objdiff: code 12456/12456 data 2228/2228 functions 63/63 fuzzy 100.0000 linked code 12456
|
||||
[src/system/iplSystem] instruction-exact functions: 63/63
|
||||
[src/system/iplException] pool: IDENTICAL
|
||||
[src/system/iplException] objdiff: code 1004/1004 data 32/32 functions 7/7 fuzzy 100.0000 linked code 1004
|
||||
[src/system/iplException] instruction-exact functions: 7/7
|
||||
[src/system/odh] pool: IDENTICAL
|
||||
[src/system/odh] objdiff: code 12876/14684 data 6360/6360 functions 26/28 fuzzy 99.5546 linked code 0
|
||||
[src/system/odh] instruction-exact functions: 26/28
|
||||
regressions vs baseline: 0
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
Unit counts, matched code and matched data before -> after are unchanged at the numbers above. The improvement is removal of four game asm bodies. odh retains its two preexisting unassigned C++ mismatches, LineConv11 at 98.08219% and huffmanDecoder at 95.57189%; it remains NonMatching and unlinked.
|
||||
|
||||
Evidence: build/da1/final-full-gate.txt, build/da1/final-ctxdiff.txt, build/da1/object-isolation.json, build/da1-baseline-report.json and build/da1-final-report.json. All seven remaining assigned asm bodies have their original bytes and at least four compiled C++ attempts recorded above. No push, PR, merge or rebase.
|
||||
Reference in New Issue
Block a user