Compare commits
85 Commits
fix/readme
...
agent/bitt
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b219624bc | ||
|
|
93e97b7ff1 | ||
|
|
d170fbb804 | ||
|
|
f710d11ff5 | ||
|
|
84d0c74f0a | ||
|
|
bdac66bb07 | ||
|
|
6f96cb5274 | ||
|
|
4aafd41e10 | ||
|
|
83efd95924 | ||
|
|
43375de179 | ||
|
|
a4d145c010 | ||
|
|
e0d3ef0345 | ||
|
|
32be36cb4e | ||
|
|
1b5b2da635 | ||
|
|
36cbab079f | ||
|
|
b7a06e9d82 | ||
|
|
b7d9c4fb65 | ||
|
|
e3095dfb97 | ||
|
|
f5a929c9d7 | ||
|
|
a41f565889 | ||
|
|
d54f8be29a | ||
|
|
81ba279958 | ||
|
|
57ccda3883 | ||
|
|
fd49a94c00 | ||
|
|
55ff13a222 | ||
|
|
d3f5682bc0 | ||
|
|
404a8675f1 | ||
|
|
878fda2a94 | ||
|
|
9131f07806 | ||
|
|
a3e3725c1f | ||
|
|
fc114afd44 | ||
|
|
409ef82dd8 | ||
|
|
98d8a5220f | ||
|
|
bb93f1dd8e | ||
|
|
140117ea91 | ||
|
|
e58cd9e734 | ||
|
|
a30b5cecb6 | ||
|
|
5dcbc4372f | ||
|
|
98239e660a | ||
|
|
be7ded2fdc | ||
|
|
fdd68ddd30 | ||
|
|
74dcb16a50 | ||
|
|
7c582f0e41 | ||
|
|
333eea81e9 | ||
|
|
a791e598a1 | ||
|
|
7654dc33e1 | ||
|
|
9c7d87ab00 | ||
|
|
885cdfeee6 | ||
|
|
cc94a7530c | ||
|
|
82da7899a1 | ||
|
|
bf8ebfa353 | ||
|
|
7649d9b1ec | ||
|
|
ce2130f867 | ||
|
|
20ba34a80f | ||
|
|
634d8ab6a1 | ||
|
|
a5e49ea578 | ||
|
|
5e0816c3f1 | ||
|
|
5d7760d341 | ||
|
|
a894ff5cb7 | ||
|
|
adea4fb5d1 | ||
|
|
e221614209 | ||
|
|
6619098ea7 | ||
|
|
e9c8986139 | ||
|
|
b9bda11dea | ||
|
|
7b8dbf2c96 | ||
|
|
b7a4105bd6 | ||
|
|
bc2b18090b | ||
|
|
674722c158 | ||
|
|
e81aed2882 | ||
|
|
7d6057adf6 | ||
|
|
16a170f944 | ||
|
|
0904bf9161 | ||
|
|
e5987de5ad | ||
|
|
11bd51b3a9 | ||
|
|
e4a9449256 | ||
|
|
b940710632 | ||
|
|
1fa33882ae | ||
|
|
aba50ea278 | ||
|
|
14a8b23adb | ||
|
|
b8931fae6f | ||
|
|
bcac23375a | ||
|
|
ed49ada973 | ||
|
|
fa0cb9b7b4 | ||
|
|
8ffaa9d25a | ||
|
|
cc812ad30e |
10
configure.py
10
configure.py
@@ -879,7 +879,7 @@ config.libs = [
|
||||
Object(NonMatching, "scene/setting/AOSSLink.c"),
|
||||
Object(Matching, "scene/setting/iplRakuRakuThread.cpp"),
|
||||
Object(NonMatching, "scene/setting/AOSS.c", extra_cflags=["-O4,p", "-inline off"]),
|
||||
Object(NonMatching, "scene/setting/ATERM.c", extra_cflags=["-O4,p", "-inline off"]),
|
||||
Object(NonMatching, "scene/setting/ATERM.c", extra_cflags=["-O4,p", "-inline on"]),
|
||||
]
|
||||
),
|
||||
IPLSection("settingSelect", [
|
||||
@@ -997,7 +997,7 @@ config.libs = [
|
||||
Object(Matching, "clib/zi8is.c"),
|
||||
Object(NonMatching, "clib/zi8match.c"),
|
||||
Object(Matching, "clib/zi8misc.c"),
|
||||
Object(NonMatching, "clib/zi8pud2.c"),
|
||||
Object(Matching, "clib/zi8pud2.c"),
|
||||
Object(Matching, "clib/Zi8punct.c"),
|
||||
Object(Matching, "clib/zi8space.c"),
|
||||
Object(NonMatching, "clib/zi8uwd.c"),
|
||||
@@ -1081,9 +1081,9 @@ config.libs = [
|
||||
Object(Matching, "nwc24/NWC24Parser.c"),
|
||||
Object(Matching, "nwc24/NWC24MsgCommit.c"),
|
||||
Object(Matching, "nwc24/NWC24MsgRead.c"),
|
||||
Object(NonMatching, "nwc24/NWC24MsgSubject.c"),
|
||||
Object(Matching, "nwc24/NWC24MsgSubject.c"),
|
||||
Object(Matching, "nwc24/NWC24Schedule.c"),
|
||||
Object(NonMatching, "nwc24/NWC24DateParser.c"),
|
||||
Object(Matching, "nwc24/NWC24DateParser.c"),
|
||||
Object(Matching, "nwc24/NWC24FriendList.c"),
|
||||
Object(Matching, "nwc24/NWC24SecretFList.c"),
|
||||
Object(Matching, "nwc24/NWC24UserId.c"),
|
||||
@@ -1826,7 +1826,7 @@ config.libs = [
|
||||
Object(Matching, "fa/pfs_unmount.c"),
|
||||
Object(Matching, "fa/pf_stub_unicode.c"),
|
||||
|
||||
Object(NonMatching, "fa/api/FAAttach.c"),
|
||||
Object(Matching, "fa/api/FAAttach.c"),
|
||||
Object(Matching, "fa/api/FABuffering.c"),
|
||||
Object(Matching, "fa/api/FACreate.c"),
|
||||
Object(Matching, "fa/api/FACreatedir.c"),
|
||||
|
||||
@@ -24,7 +24,7 @@ typedef struct BS2UpdateHeader {
|
||||
|
||||
typedef struct BS2UpdateEntry {
|
||||
// Update Meta Data
|
||||
u32 type; // 0x00
|
||||
vu32 type; // 0x00
|
||||
u32 attr; // 0x04
|
||||
u32 size; // 0x08
|
||||
u32 depend; // 0x0C
|
||||
|
||||
@@ -142,9 +142,6 @@ namespace textinput {
|
||||
|
||||
// TODO enum?
|
||||
int getInputType() const;
|
||||
#if defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void resetHoldingButton();
|
||||
#endif
|
||||
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
#if defined(MYTIMANAGER_IMPLEMENTATION) && defined(TI_CELLPHONE_IMPLEMENTATION)
|
||||
|
||||
@@ -69,6 +69,9 @@
|
||||
virtual bool updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data) override;
|
||||
virtual bool updateInput(input::HKBManager& hkbManager) override;
|
||||
#endif
|
||||
#if defined(TI_CELLPHONE_IMPLEMENTATION) || defined(TIINPUTFORM_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
|
||||
void resetHoldingButton();
|
||||
#endif
|
||||
#ifdef TI_CELLPHONE_IMPLEMENTATION
|
||||
virtual ~LayoutByNW4R();
|
||||
virtual void create(MEMAllocator* allocator) override;
|
||||
@@ -95,7 +98,6 @@
|
||||
virtual void changeSpaceKeyTop(const PaneNameToCharCode* keys);
|
||||
void setUpperCaseJP(bool enabled);
|
||||
void setLangKeyActive(bool enabled);
|
||||
void resetHoldingButton();
|
||||
|
||||
private:
|
||||
bool mbLineFeedButton;
|
||||
|
||||
@@ -563,26 +563,23 @@ static void TMCJPEGDEC_converterYUV420toRGB565(TMCCJPEGDecWork* work, s32 x, s32
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV420toRGB565edge(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
s32 chromaSkip;
|
||||
u16* output;
|
||||
s8 crValue;
|
||||
s32 yEnd;
|
||||
s32 tileRow;
|
||||
u8* texture;
|
||||
u8* luminance;
|
||||
s8* cb;
|
||||
s32 width;
|
||||
s8* cb;
|
||||
s8 crValue;
|
||||
s8* cr;
|
||||
s8 cbValue;
|
||||
s32 column;
|
||||
s32 xEnd;
|
||||
s8 cbValue;
|
||||
s32 yEnd;
|
||||
s32 red;
|
||||
s32 blue;
|
||||
u32 tileWidth;
|
||||
s32 height;
|
||||
TMCCJPEGDecState* state;
|
||||
s32 green;
|
||||
s32 lumaSkip;
|
||||
s32 chromaSkip;
|
||||
u32 tileWidth;
|
||||
s32 redOffset;
|
||||
s32 greenOffset;
|
||||
s32 blueOffset;
|
||||
@@ -619,16 +616,18 @@ static void TMCJPEGDEC_converterYUV420toRGB565edge(TMCCJPEGDecWork* work, s32 x,
|
||||
greenOffset = -(cbValue * 88 + crValue * 183) >> 8;
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
blue = *luminance++;
|
||||
red = blue + redOffset;
|
||||
green = blue + greenOffset;
|
||||
blue = blue + blueOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
|
||||
green = green > 255 ? 255 : green < 0 ? 0 : green;
|
||||
red = red > 255 ? 255 : red < 0 ? 0 : red;
|
||||
{
|
||||
s32 value = *luminance++;
|
||||
s32 red = value + redOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
s32 green = value + greenOffset;
|
||||
if ((blue | red | green) >> 8) {
|
||||
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
|
||||
green = green > 255 ? 255 : green < 0 ? 0 : green;
|
||||
red = red > 255 ? 255 : red < 0 ? 0 : red;
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] = ((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] = ((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
}
|
||||
luminance += lumaSkip;
|
||||
if (y & 1) {
|
||||
@@ -821,9 +820,6 @@ static void TMCJPEGDEC_converterYUV444toRGB565(TMCCJPEGDecWork* work, s32 x, s32
|
||||
s32 cbValue;
|
||||
s32 yEnd;
|
||||
u32 tileWidth;
|
||||
s32 green;
|
||||
s32 blue;
|
||||
s32 red;
|
||||
s32 height;
|
||||
|
||||
luminance = work->convBuf + 4;
|
||||
@@ -843,17 +839,19 @@ static void TMCJPEGDEC_converterYUV444toRGB565(TMCCJPEGDecWork* work, s32 x, s32
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbValue = (s8)*cb++;
|
||||
crValue = (s8)*cr++;
|
||||
red = *luminance++;
|
||||
green = red + (-(cbValue * 88 + crValue * 183) >> 8);
|
||||
blue = red + ((cbValue * 454) >> 8);
|
||||
red = red + ((crValue * 359) >> 8);
|
||||
if ((blue | green | red) >> 8) {
|
||||
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
|
||||
green = green > 255 ? 255 : green < 0 ? 0 : green;
|
||||
red = red > 255 ? 255 : red < 0 ? 0 : red;
|
||||
{
|
||||
s32 value = *luminance++;
|
||||
s32 green = value + (-(cbValue * 88 + crValue * 183) >> 8);
|
||||
s32 red = value + ((crValue * 359) >> 8);
|
||||
s32 blue = value + ((cbValue * 454) >> 8);
|
||||
if ((red | green | blue) >> 8) {
|
||||
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
|
||||
green = green > 255 ? 255 : green < 0 ? 0 : green;
|
||||
red = red > 255 ? 255 : red < 0 ? 0 : red;
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + (((red & 0xF8) << 8) + ((green & 0xFC) << 3));
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + (((red & 0xF8) << 8) + ((green & 0xFC) << 3));
|
||||
}
|
||||
luminance += rowSkip;
|
||||
cb += rowSkip;
|
||||
|
||||
@@ -517,9 +517,9 @@ static void TMCJPEGDEC_converterYUV422toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32 y) {
|
||||
s32 tileRow;
|
||||
s8 crValue;
|
||||
s32 chromaSkip;
|
||||
s8 crValue;
|
||||
s32 tileRow;
|
||||
u8* luminance;
|
||||
TMCCJPEGDecState* state;
|
||||
u8* texture;
|
||||
@@ -528,15 +528,15 @@ static void TMCJPEGDEC_converterYUV420toRGBA8(TMCCJPEGDecWork* work, s32 x, s32
|
||||
s32 green;
|
||||
s32 blue;
|
||||
s32 lumaSkip;
|
||||
s32 yEnd;
|
||||
s32 xEnd;
|
||||
u8* cb;
|
||||
u8* cr;
|
||||
s32 value;
|
||||
s32 column;
|
||||
u8* cr;
|
||||
s32 greenOffset;
|
||||
s32 xEnd;
|
||||
s32 yEnd;
|
||||
s32 tileWidth;
|
||||
s32 redOffset;
|
||||
u8* cb;
|
||||
s32 greenOffset;
|
||||
u16* output;
|
||||
s32 blueOffset;
|
||||
s32 red;
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
#include <zi8clib/zitypes.h>
|
||||
|
||||
typedef struct {
|
||||
ziU8 countOnly;
|
||||
ziU8 maxWordLength;
|
||||
ziU8 lookupMode;
|
||||
ziU8 suffixOnly;
|
||||
ziU8 controls[8];
|
||||
ziU32 maxCount;
|
||||
ziU16 capacity;
|
||||
ziU8 minWordLength;
|
||||
ziU8 flags;
|
||||
ziU16 candidateCapacity;
|
||||
ziU8 checkOnly;
|
||||
ziU8 reserved;
|
||||
} ZiCandidateOptions;
|
||||
|
||||
const ziWChar Zi8PunctTable[40] = {
|
||||
0xFF0C, 0x3002, 0x3001, 0xFF1A, 0xFF1F, 0xFF01, 0x3005, 0x2026,
|
||||
0x2015, 0xFF1B, 0xFF0E, 0x30FB, 0x201C, 0x201D, 0xFF08, 0xFF09,
|
||||
@@ -8,8 +23,8 @@ const ziWChar Zi8PunctTable[40] = {
|
||||
0xFFE1, 0x20AC, 0x203B, 0xFF20, 0x0000,
|
||||
};
|
||||
|
||||
ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) {
|
||||
ziS32 limit = ((ziU16*)__zi8_work_data)[8] - 1;
|
||||
ziU32 Zi8Punctuation(ziGetParam* param, ziPtr options ZI_NEED_WORK) {
|
||||
ziS32 limit = ((ZiCandidateOptions*)options)->capacity - 1;
|
||||
ziS32 count = 0;
|
||||
ziU8 i = 0;
|
||||
ziU16 fc = param->firstCandidate;
|
||||
@@ -21,7 +36,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) {
|
||||
}
|
||||
if (fc == 0) {
|
||||
count++;
|
||||
if (ZI_WORK->getcPhase == 0) {
|
||||
if (((ZiCandidateOptions*)options)->countOnly == 0) {
|
||||
param->candidates[i++] = Zi8PunctTable[j];
|
||||
if ((param->context & 0x10) != 0) {
|
||||
param->candidates[i++] = 0x20;
|
||||
@@ -33,7 +48,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (count >= (ziS32)ZI_WORK->targetCount) {
|
||||
if (count >= (ziS32)((ZiCandidateOptions*)options)->maxCount) {
|
||||
return count;
|
||||
}
|
||||
}
|
||||
@@ -42,7 +57,7 @@ ziS32 Zi8Punctuation(ziGetParam* param ZI_NEED_WORK) {
|
||||
}
|
||||
j++;
|
||||
}
|
||||
if (ZI_WORK->getcPhase == 0) {
|
||||
if (((ZiCandidateOptions*)options)->countOnly == 0) {
|
||||
param->letters = count;
|
||||
}
|
||||
return count;
|
||||
|
||||
@@ -23,7 +23,7 @@ typedef struct ziConversionTable {
|
||||
} ziConversionTable;
|
||||
const ziConversionTables Zi8CvrtTables = {0};
|
||||
ziU16 Zi8GetTableCount(ziU8, ziU8 ZI_NEED_WORK);
|
||||
ziPtr Zi8GetTableAddress(ziU8, ziU8 ZI_NEED_WORK);
|
||||
ziU32 Zi8GetTableAddress(ziU8, ziU8 ZI_NEED_WORK);
|
||||
ziWChar Zi8ConvertUC2UserKey(ziChar, ziU8 ZI_NEED_WORK);
|
||||
|
||||
ziWChar Zi8ConvertUC2WC(ziChar character, ziU8 language ZI_NEED_WORK) {
|
||||
@@ -37,7 +37,7 @@ ziWChar Zi8ConvertUC2WC(ziChar character, ziU8 language ZI_NEED_WORK) {
|
||||
return 0;
|
||||
}
|
||||
if (Zi8GetTableCount(language, 6, __zi8_work_data) != 0) {
|
||||
table = Zi8GetTableAddress(language, 6, __zi8_work_data);
|
||||
table = (ziU8*)Zi8GetTableAddress(language, 6, __zi8_work_data);
|
||||
if (table == 0) {
|
||||
Zi8LogError(0x6A4, __zi8_work_data);
|
||||
return 0;
|
||||
@@ -77,7 +77,7 @@ ziChar Zi8ConvertWC2UC(ziWChar character, ziU8 language ZI_NEED_WORK) {
|
||||
return 0;
|
||||
}
|
||||
if (Zi8GetTableCount(language, 7, __zi8_work_data) != 0) {
|
||||
table = Zi8GetTableAddress(language, 7, __zi8_work_data);
|
||||
table = (ziConversionTable*)Zi8GetTableAddress(language, 7, __zi8_work_data);
|
||||
if (table == 0) {
|
||||
Zi8LogError(0x6AE, __zi8_work_data);
|
||||
return 0;
|
||||
@@ -137,7 +137,7 @@ ziWChar Zi8ConvertUC2Key(ziChar character, ziU8 language ZI_NEED_WORK) {
|
||||
if (ZI_WORK->userKeys[language] != 0)
|
||||
return Zi8ConvertUC2UserKey(character, language, __zi8_work_data);
|
||||
if (Zi8GetTableCount(language, 8, __zi8_work_data) != 0) {
|
||||
table = Zi8GetTableAddress(language, 8, __zi8_work_data);
|
||||
table = (ziConversionTable*)Zi8GetTableAddress(language, 8, __zi8_work_data);
|
||||
if (table == 0) {
|
||||
Zi8LogError(0x6B8, __zi8_work_data);
|
||||
return 0;
|
||||
|
||||
@@ -15,28 +15,6 @@ typedef struct {
|
||||
|
||||
typedef struct { ziU8 keyLow; ziU8 keyHigh; ziU8 code; ziU8 flags; } Zi8AltSoundRecord;
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
ziU8 language;
|
||||
ziU8 getMode;
|
||||
ziU8 subLanguage;
|
||||
ziU8 context;
|
||||
ziU8 getOptions;
|
||||
ziWChar* elements;
|
||||
ziU8 elementCount;
|
||||
ziWChar* currentWord;
|
||||
ziU8 wordCharCount;
|
||||
ziWChar* candidates;
|
||||
ziU8 maxCandidates;
|
||||
ziU16 firstCandidate;
|
||||
ziU8 wordCandidates;
|
||||
ziU8 count;
|
||||
ziU8 letters;
|
||||
ziU8* scratch;
|
||||
ziPtr workspace;
|
||||
} Zi8OneKeyParam;
|
||||
|
||||
typedef struct {
|
||||
ziU8 countOnly;
|
||||
ziU8 maxSpellingLength;
|
||||
@@ -203,15 +181,15 @@ const ziWChar zi8PYfinalSpelling[64][4] = {
|
||||
|
||||
const unsigned long long Zi8SOpinyinArray = 0x0303010705000000ULL;
|
||||
|
||||
extern Zi8UInt Zi8Ord2Ord(ziU16, ziPtr);
|
||||
extern ziU16 Zi8Ord2Ord(ziU16, ziPtr);
|
||||
extern ziU8 Zi8LangSupported(ziU8, ziPtr);
|
||||
extern ziU16 Zi8GetTableCount(ziU8,ziU8,ziPtr);
|
||||
extern Zi8UInt Zi8GetTableAddress(ziU8,ziU8,ziPtr);
|
||||
extern void Zi8Memset();
|
||||
extern int _Zi8GetCandidates();
|
||||
extern void Zi8InitDupWordBuf();
|
||||
extern ziU16 Zi8GetPInfo(ziU16,ziWChar *,ziU8,ziPtr);
|
||||
extern ziU16 Zi8GetZInfo(ziU16,ziWChar *,ziU8,ziPtr);
|
||||
extern ziU32 Zi8GetTableAddress(ziU8,ziU8,ziPtr);
|
||||
extern void Zi8Memset(ziU8*,ziU32,ziS32);
|
||||
extern ziU8 _Zi8GetCandidates(ziGetParam*,ziPtr);
|
||||
extern void Zi8InitDupWordBuf(ziPtr);
|
||||
extern ziU32 Zi8GetPInfo(ziU32,ziWChar *,ziU8,ziPtr);
|
||||
extern ziU32 Zi8GetZInfo(ziU32,ziWChar *,ziU8,ziPtr);
|
||||
extern ziBool Zi8IsDupWordW(ziWChar *,ziU8,ziPtr);
|
||||
extern ziU8 Zi8GetFormatVersion(ziU8,ziPtr);
|
||||
extern ziU16 Zi8Uni2Ord(ziWChar,ziPtr);
|
||||
@@ -219,10 +197,10 @@ extern ziU16 Zi8GetPCode(ziU8 *,ziU8 *);
|
||||
extern ziU8 Zi8MatchOEMdata(ziWChar *,ziU8,ziU8,ziWChar *,ziU16,ziU8,ziU8,ziPtr);
|
||||
extern ziU8 Zi8MatchPUDdata(ziWChar *,ziU8,ziU8,ziWChar *,ziU16,ziU8,ziU8,ziPtr);
|
||||
extern ziWChar Zi8Ord2Uni(ziU16,ziPtr);
|
||||
extern Zi8UInt Zi8GetZHuwdPtr(ziU8 **,ziU16 *,ziPtr);
|
||||
extern int Zi8GetPyPhonetic();
|
||||
extern ziU8 Zi8GetBpmfPhonetic();
|
||||
extern int _Zi8CheckCandidates();
|
||||
extern ziU32 Zi8GetZHuwdPtr(ziU32*,ziU16*,ziPtr);
|
||||
extern ziU8 Zi8GetPyPhonetic(ziWChar*,ziU8,ziU16*,ziU16*,ziU8*,ziU16*,ziU16*,ziPtr);
|
||||
extern ziU8 Zi8GetBpmfPhonetic(ziWChar*,ziU8,ziU16*,ziU16*,ziU16*,ziU16*,ziPtr);
|
||||
extern ziU8 _Zi8CheckCandidates(ziGetParam*,ziPtr);
|
||||
|
||||
Zi8UInt Zi8SpellingZY(ziU16 *output,Zi8UInt key,ziU8 includeTone)
|
||||
{
|
||||
@@ -462,15 +440,15 @@ BACKWARD_SEARCH:
|
||||
goto BINARY_SEARCH;
|
||||
}
|
||||
}
|
||||
static Zi8UInt Zi8SetFindCand(ziU8 *foundCandidates,Zi8UInt ordinal,ziPtr work)
|
||||
static Zi8UInt Zi8SetFindCand(ziU8 *foundCandidates,ziU16 ordinal,ziPtr work)
|
||||
{
|
||||
Zi8UInt result;
|
||||
|
||||
ordinal = Zi8Ord2Ord(ordinal,work);
|
||||
result = (ziU8)((1 << ((int)(ordinal & 0xffff) % 8)) &
|
||||
foundCandidates[(int)(ordinal & 0xffff) / 8]);
|
||||
foundCandidates[(int)(ordinal & 0xffff) / 8] |=
|
||||
1 << ((int)(ordinal & 0xffff) % 8);
|
||||
result = (ziU8)((1 << ((int)ordinal % 8)) &
|
||||
foundCandidates[(int)ordinal / 8]);
|
||||
foundCandidates[(int)ordinal / 8] |=
|
||||
1 << ((int)ordinal % 8);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -506,7 +484,7 @@ LAB_return_false:
|
||||
return 0;
|
||||
}
|
||||
|
||||
Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Zi8OneKeyWork *work)
|
||||
ziU32 Zi8Get1KeyPressSpelling(ziGetParam *params,Zi8OneKeyOptions *options,Zi8OneKeyWork *work)
|
||||
{
|
||||
ziU8 candidateCount;
|
||||
ziBool exactLength;
|
||||
@@ -531,18 +509,18 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
|
||||
ziU16 *output;
|
||||
ziU8 *savedSearchOrder;
|
||||
ziU16 spellingBuffer[8];
|
||||
Zi8OneKeyParam searchParams;
|
||||
ziGetParam searchParams;
|
||||
|
||||
candidateCount = 0;
|
||||
totalCandidates = 0;
|
||||
optionsMask = params->getOptions;
|
||||
params->count = 0;
|
||||
params->letters = 0;
|
||||
params->completion = 0;
|
||||
optionsMask = optionsMask & ~0x10;
|
||||
optionsMask = optionsMask & ~0x20;
|
||||
optionsMask = optionsMask & ~0x40;
|
||||
if (options->maxSpellingLength == '\0') {
|
||||
params->count = 0;
|
||||
params->letters = 0;
|
||||
Zi8LogError(100,work);
|
||||
return 0;
|
||||
}
|
||||
@@ -820,7 +798,7 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
|
||||
savedSearchCount = work->searchOrderCount;
|
||||
convertedInput = false;
|
||||
savedSearchFlags = work->searchFlags;
|
||||
Zi8Memset(&searchParams,0,0x2c);
|
||||
Zi8Memset((ziU8*)&searchParams,0,0x2c);
|
||||
searchParams.getMode = 0;
|
||||
searchParams.subLanguage = 0x80;
|
||||
searchParams.context = 1;
|
||||
@@ -918,7 +896,7 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
|
||||
work->searchFlags = savedSearchFlags;
|
||||
work->searchOrder = savedSearchOrder;
|
||||
work->searchOrderCount = savedSearchCount;
|
||||
params->count = searchParams.count;
|
||||
params->letters = searchParams.letters;
|
||||
work->spellingOnly = 0;
|
||||
if (convertedInput) {
|
||||
if (params->getMode == '\x03') {
|
||||
@@ -937,7 +915,7 @@ Zi8UInt Zi8Get1KeyPressSpelling(Zi8OneKeyParam *params,Zi8OneKeyOptions *options
|
||||
}
|
||||
}
|
||||
if ((options->countOnly == '\0') && (params->getMode == '\x03')) {
|
||||
for (tableIndex = 0; tableIndex < params->count;) {
|
||||
for (tableIndex = 0; tableIndex < params->letters;) {
|
||||
while (*output != 0) {
|
||||
if (*output != 0x27) {
|
||||
*output++ |= 0xf300;
|
||||
@@ -1022,12 +1000,12 @@ nextSpelling:
|
||||
}
|
||||
}
|
||||
finishSpelling:
|
||||
params->count = candidateCount;
|
||||
params->letters = candidateCount;
|
||||
Zi8LogError(100,work);
|
||||
return totalCandidates;
|
||||
}
|
||||
|
||||
int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Zi8OneKeyWork *work)
|
||||
ziU32 Zi8Get1KeyPressCandidates(ziGetParam *params,Zi8OneKeyOptions *options,Zi8OneKeyWork *work)
|
||||
{
|
||||
ziU16 wordBuffer [64];
|
||||
ziU16 spelling [8];
|
||||
@@ -1046,7 +1024,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
ziU8 *phraseEntries;
|
||||
ziU16 *currentWord;
|
||||
ziU8 *entryCursor;
|
||||
ziU8 *userEntries;
|
||||
ziU32 userEntriesAddress;
|
||||
int duplicateIndex;
|
||||
ziU16 alternateCount;
|
||||
ziU16 ordinalCount;
|
||||
@@ -1148,8 +1126,8 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
}
|
||||
languageMask = languageMask << 4;
|
||||
remaining = params->firstCandidate;
|
||||
params->count = 0;
|
||||
params->letters = 0;
|
||||
params->completion = 0;
|
||||
inputLength = params->elementCount;
|
||||
if (inputLength != 0) {
|
||||
while (inputLength != 0) {
|
||||
@@ -1271,7 +1249,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
tableCursor = Zi8GetTableCount(1,9,work);
|
||||
}
|
||||
if (8 < inputLimit) {
|
||||
params->wordCandidates = 0;
|
||||
params->count = 0;
|
||||
goto finishCandidates;
|
||||
}
|
||||
for (index = 0; index < (int)(Zi8UInt)inputLimit; index++) {
|
||||
@@ -1357,7 +1335,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
output[outputIndex++] = candidateCharacter;
|
||||
}
|
||||
if (candidateCount >= params->maxCandidates || outputIndex > outputLimit) {
|
||||
params->wordCandidates = candidateCount;
|
||||
params->count = candidateCount;
|
||||
goto finishCandidates;
|
||||
}
|
||||
} else {
|
||||
@@ -1426,7 +1404,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
output[outputIndex++] = candidateCharacter;
|
||||
}
|
||||
if (candidateCount >= params->maxCandidates || outputIndex > outputLimit) {
|
||||
params->wordCandidates = candidateCount;
|
||||
params->count = candidateCount;
|
||||
goto finishCandidates;
|
||||
}
|
||||
} else {
|
||||
@@ -1547,7 +1525,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
output[outputIndex++] = firstOrdinal;
|
||||
}
|
||||
if (candidateCount >= params->maxCandidates || outputIndex > outputLimit) {
|
||||
params->wordCandidates = candidateCount;
|
||||
params->count = candidateCount;
|
||||
goto finishCandidates;
|
||||
}
|
||||
} else {
|
||||
@@ -1568,7 +1546,7 @@ nextPhrase:
|
||||
else {
|
||||
finishPhrases:
|
||||
if (params->wordCharCount != '\0') {
|
||||
params->wordCandidates = candidateCount;
|
||||
params->count = candidateCount;
|
||||
}
|
||||
}
|
||||
if ((options->countOnly == '\0') && (tableCursor != 0)) {
|
||||
@@ -1629,11 +1607,11 @@ nextSortedOrdinal:
|
||||
;
|
||||
}
|
||||
}
|
||||
if ((options->countOnly == '\0') && (ziU8)Zi8GetZHuwdPtr(&userEntries,&userCount,work) != 0)
|
||||
if ((options->countOnly == '\0') && (ziU8)Zi8GetZHuwdPtr(&userEntriesAddress,&userCount,work) != 0)
|
||||
{
|
||||
for (phraseOrdinal = 0; phraseOrdinal < userCount;) {
|
||||
if ((params->elementCount == '\0') || ((userEntries[1] & 0x80) != 0)) {
|
||||
userOrdinal = (ziU16)(userEntries[1] & 0x7f) << 8 | (ziU16)userEntries[2];
|
||||
if ((params->elementCount == '\0') || ((((ziU8*)userEntriesAddress)[1] & 0x80) != 0)) {
|
||||
userOrdinal = (ziU16)(((ziU8*)userEntriesAddress)[1] & 0x7f) << 8 | (ziU16)((ziU8*)userEntriesAddress)[2];
|
||||
phraseTable = syllableTable + (Zi8UInt)userOrdinal * 0xc;
|
||||
if (((*phraseTable & languageMask) != 0) &&
|
||||
((characterSetTable == 0 || ((characterSet & characterSetTable[(Zi8UInt)userOrdinal]) != 0)))) {
|
||||
@@ -1677,7 +1655,7 @@ nextSortedOrdinal:
|
||||
}
|
||||
nextUserOrdinal:
|
||||
phraseOrdinal++;
|
||||
userEntries = userEntries + 3;
|
||||
userEntriesAddress = userEntriesAddress + 3;
|
||||
}
|
||||
}
|
||||
phraseTable = syllableTable;
|
||||
@@ -1740,12 +1718,12 @@ finishCandidates:
|
||||
if ((emitWords) && (outputIndex != 0)) {
|
||||
output[outputIndex++] = 0;
|
||||
}
|
||||
params->count = candidateCount;
|
||||
params->letters = candidateCount;
|
||||
Zi8LogError(100,work);
|
||||
return totalCandidates;
|
||||
}
|
||||
|
||||
Zi8UInt Zi8ZHCheckSpelling(ziU16 *input,ziU16 *spelling,Zi8UInt inputLength,char *work)
|
||||
ziBool Zi8ZHCheckSpelling(ziWChar *input,ziWChar *spelling,ziU8 inputLength,ziPtr work)
|
||||
{
|
||||
int index;
|
||||
ziU8 result;
|
||||
@@ -1760,11 +1738,11 @@ Zi8UInt Zi8ZHCheckSpelling(ziU16 *input,ziU16 *spelling,Zi8UInt inputLength,char
|
||||
int syllableStart;
|
||||
int syllableLength;
|
||||
Zi8UInt tableOffset;
|
||||
ziU8 candidateBuffer [32];
|
||||
ziU8 phoneticCodes [32];
|
||||
ziU8 phoneticMasks [32];
|
||||
ziWChar candidateBuffer [16];
|
||||
ziU16 phoneticCodes [16];
|
||||
ziU16 phoneticMasks [16];
|
||||
ziU16 convertedSpelling [64];
|
||||
Zi8OneKeyParam getParam;
|
||||
ziGetParam getParam;
|
||||
ziU8 maskLow;
|
||||
ziU8 codeLow;
|
||||
ziU8 maskHigh;
|
||||
@@ -1805,7 +1783,7 @@ Zi8UInt Zi8ZHCheckSpelling(ziU16 *input,ziU16 *spelling,Zi8UInt inputLength,char
|
||||
}
|
||||
index = 0;
|
||||
syllableStart = index;
|
||||
for (; index < (int)(inputLength & 0xff); index = index + 1) {
|
||||
for (; index < (int)inputLength; index = index + 1) {
|
||||
switch (spelling[index]) {
|
||||
case 0xf331:
|
||||
toneMask = 1;
|
||||
@@ -1876,7 +1854,7 @@ nextInputCharacter:
|
||||
}
|
||||
else {
|
||||
if ((input[index] == 0x27) || (input[index] == 0xf360)) {
|
||||
if (index < (int)(inputLength & 0xff)) {
|
||||
if (index < (int)inputLength) {
|
||||
convertedSpelling[index] = input[index] = spelling[index];
|
||||
}
|
||||
else {
|
||||
@@ -1918,7 +1896,7 @@ nextInputCharacter:
|
||||
getParam.elementCount = (ziU8)index;
|
||||
getParam.currentWord = 0;
|
||||
getParam.wordCharCount = 0;
|
||||
getParam.candidates = (ziWChar *)candidateBuffer;
|
||||
getParam.candidates = candidateBuffer;
|
||||
getParam.maxCandidates = 1;
|
||||
getParam.firstCandidate = 0;
|
||||
if ((ziU8)_Zi8CheckCandidates(&getParam,work) != 0) {
|
||||
|
||||
@@ -138,11 +138,11 @@ extern ziU16 Zi8GetTableCount(ziU8 language, ziU8 table, ziPtr work);
|
||||
extern ziU8 Zi8IsDupWChar(ziWChar character, ziPtr work);
|
||||
extern ziU8 Zi8IsDupWordW(ziWChar* word, ziU8 length, ziPtr work);
|
||||
extern ziWChar Zi8Ord2Uni(ziU16 ordinal, ziPtr work);
|
||||
extern ziU8 Zi8MatchPhonetic(ziU8* phonetics, ZiChineseRecord* records,
|
||||
ziPtr indexTable, ziU16 indexCount, ziPtr dictionary,
|
||||
ZiChineseRecord* record, ziU16* mask, ziU16* match,
|
||||
ziU16* length, ZiChineseRecord** matchedRecord,
|
||||
int* matchedIndex, ziU8 wordMode, ziU8 partial,
|
||||
extern ziU8 Zi8MatchPhonetic(ziPtr phonetics, ziU8* records,
|
||||
ziPtr indexTable, ziU16 indexCount, ziU32 dictionary,
|
||||
ziU8* record, ziU16* mask, ziU16* match,
|
||||
ziU16* length, ziU8** matchedRecord,
|
||||
ziU8** matchedString, ziU8 wordMode, ziU8 partial,
|
||||
ziU8 oneCharacter, ziU16 excludedMask,
|
||||
ziU16 excludedMatch, ziU8 charset, ziU8 options,
|
||||
ziU16 ordinal, ziU16* tone, ziU8 spellingOnly,
|
||||
@@ -160,7 +160,7 @@ extern const ziU8 zi8CangjieCodes[25];
|
||||
extern const ziWChar ziPuncts[4];
|
||||
extern const ziWChar ziTones[4];
|
||||
const ziWChar zi8tones[4];
|
||||
extern ziU8 Zi8GetZHuwdPtr(ziU8** entries, ziU16* count, ziPtr work);
|
||||
extern ziU32 Zi8GetZHuwdPtr(ziU32* entries, ziU16* count, ziPtr work);
|
||||
extern ziBool Zi8IsComponent(ziWChar character, ziPtr work);
|
||||
extern ziBool Zi8IsCharacter(ziWChar character, ziPtr work);
|
||||
extern ziU8 Zi8MatchOEMdata(ziWChar* currentWord, ziU8 length, ziU8 language,
|
||||
@@ -199,7 +199,7 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
|
||||
ziU8 matchMode;
|
||||
int index;
|
||||
ziWChar* currentWord;
|
||||
ziU8* userEntries;
|
||||
ziU32 userEntriesAddress;
|
||||
ziU16 ordinalIndex;
|
||||
ziU16 tableIndex;
|
||||
ziU16 phraseOrdinal;
|
||||
@@ -614,10 +614,10 @@ static int zi8InternalGetZH(ziGetParam* request, ZiChineseOptions* options, ziPt
|
||||
case 56: case 59:
|
||||
if (((ziFuzzyZYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B2C.word)->fANDh) ordinalIndex = 0xF9FF;
|
||||
break;
|
||||
case 52: case 55:
|
||||
case 60: case 63:
|
||||
if (((ziFuzzyZYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B2C.word)->bANDp) ordinalIndex = 0xF9FF;
|
||||
break;
|
||||
case 60: case 63:
|
||||
case 52: case 55:
|
||||
if (((ziFuzzyZYPairs*)&((struct __zi8_work_data_s*)work)->unk_0x1B2C.word)->gANDk) ordinalIndex = 0xF9FF;
|
||||
break;
|
||||
case 38:
|
||||
@@ -1612,9 +1612,9 @@ phonetic_ordinal_search:
|
||||
record = records + phraseOrdinal * 12;
|
||||
candidateCount = 0;
|
||||
phoneticGroups = 0;
|
||||
if (!Zi8MatchPhonetic(phoneticTable, (ZiChineseRecord*)records, alternateTable, alternateCount,
|
||||
phraseTable, (ZiChineseRecord*)record, match.phon, match.phon2,
|
||||
&candidateCount, (ZiChineseRecord**)&record, (int*)&phoneticGroups,
|
||||
if (!Zi8MatchPhonetic(phoneticTable, records, alternateTable, alternateCount,
|
||||
(ziU32)phraseTable, record, match.phon, match.phon2,
|
||||
&candidateCount, &record, &phoneticGroups,
|
||||
0, 1, match.nCand, phoneticMask, phoneticMatch, charset, requireFull,
|
||||
phraseOrdinal, &candidateOrdinal, 0, work)) continue;
|
||||
if (charsetTable) {
|
||||
@@ -1754,10 +1754,10 @@ tone_candidates:
|
||||
user_character_search:
|
||||
if (((struct __zi8_work_data_s*)work)->uwdPtrCount && (getMode != 0 || !firstPhoneticPass) &&
|
||||
!options->countOnly && (match.nCand <= 1 || (getMode != 1 && getMode != 2)) &&
|
||||
Zi8GetZHuwdPtr(&userEntries, &userCount, work) && (getMode != 0 || match.nSeg <= 1)) {
|
||||
(ziU8)Zi8GetZHuwdPtr(&userEntriesAddress, &userCount, work) && (getMode != 0 || match.nSeg <= 1)) {
|
||||
userIndex = 0;
|
||||
while (userIndex < userCount) {
|
||||
candidateOrdinal = (ziU16)(userEntries[1] & 0x7F) << 8 | userEntries[2];
|
||||
candidateOrdinal = (ziU16)(((ziU8*)userEntriesAddress)[1] & 0x7F) << 8 | ((ziU8*)userEntriesAddress)[2];
|
||||
record = records + candidateOrdinal * 12;
|
||||
if (!(record[0] & charset)) goto user_character_next;
|
||||
character = ((ziU16)record[6] << 8) + record[7];
|
||||
@@ -1792,7 +1792,7 @@ user_character_search:
|
||||
(ziU8)Zi8SecMatchChar(record, componentTable, &match, 0, work)) candidateStatus = 1;
|
||||
break;
|
||||
case 1: case 2:
|
||||
if (request->elementCount && !(userEntries[1] & 0x80)) candidateStatus = 0;
|
||||
if (request->elementCount && !(((ziU8*)userEntriesAddress)[1] & 0x80)) candidateStatus = 0;
|
||||
else {
|
||||
candidateStatus = (match.first & (ziU16)Zi8GetPCode(phoneticTable, record)) == match.first2;
|
||||
if (!candidateStatus && (record[0] & 0x80) && !requireFull &&
|
||||
@@ -1827,7 +1827,7 @@ user_character_search:
|
||||
}
|
||||
user_character_next:
|
||||
++userIndex;
|
||||
userEntries += 3;
|
||||
userEntriesAddress += 3;
|
||||
}
|
||||
}
|
||||
if (!prefixLookup) goto phonetic_alt_continue;
|
||||
@@ -2323,9 +2323,9 @@ phonetic_ordinals:
|
||||
candidateCount = recordCount;
|
||||
phoneticGroups = 0;
|
||||
while (emittedCount < request->maxCandidates && candidateCount) {
|
||||
if (!Zi8MatchPhonetic(phoneticTable, (ZiChineseRecord*)records, alternateTable, alternateCount,
|
||||
phraseTable, (ZiChineseRecord*)record, match.phon, match.phon2,
|
||||
&candidateCount, (ZiChineseRecord**)&record, (int*)&phoneticGroups,
|
||||
if (!Zi8MatchPhonetic(phoneticTable, records, alternateTable, alternateCount,
|
||||
(ziU32)phraseTable, record, match.phon, match.phon2,
|
||||
&candidateCount, &record, &phoneticGroups,
|
||||
emitWords, singleCharacterPass, match.nCand, phoneticMask, phoneticMatch, charset,
|
||||
requireFull, recordCount, &candidateOrdinal, filteringMode, work)) break;
|
||||
ordinalIndex = recordCount - candidateCount - 1;
|
||||
@@ -2608,10 +2608,10 @@ static int Zi8NewMatchPhonetic(ziGetParam* request, ZiChineseRecord* records,
|
||||
ziU8* phonetics;
|
||||
int totalResults;
|
||||
int emittedCharacters;
|
||||
ZiChineseRecord* matchedRecord;
|
||||
ziU8* matchedRecord;
|
||||
ziU8* phoneticGroups;
|
||||
ziU8* candidateGroups;
|
||||
int matchedIndex;
|
||||
ziU8* matchedString;
|
||||
int capacity;
|
||||
ziU8* groupCandidates;
|
||||
ziU16 phoneticCount;
|
||||
@@ -2782,12 +2782,12 @@ next_group_candidate:
|
||||
}
|
||||
}
|
||||
if (stopAfterTone) {
|
||||
matchedRecord = records + character;
|
||||
matchedRecord = (ziU8*)(records + character);
|
||||
matchedLength = 0;
|
||||
matchedIndex = 0;
|
||||
if (!Zi8MatchPhonetic(phonetics, records, indexTable, indexCount,
|
||||
dictionary, matchedRecord, &mask, &match,
|
||||
&matchedLength, &matchedRecord, &matchedIndex,
|
||||
matchedString = 0;
|
||||
if (!Zi8MatchPhonetic(phonetics, (ziU8*)records, indexTable, indexCount,
|
||||
(ziU32)dictionary, matchedRecord, &mask, &match,
|
||||
&matchedLength, &matchedRecord, &matchedString,
|
||||
wordMode, 1, 1, excludedMask, excludedMatch,
|
||||
charset, request->getOptions & 0x40, character,
|
||||
&matchedTone, 0, work)) {
|
||||
|
||||
@@ -62,7 +62,7 @@ ziU8 Zi8InitializeDynamic(ziLanguageEntry* langEntries ZI_NEED_WORK) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
ziU8 Zi8IsZicorpSignature(ziU16* p, ziU16 len) {
|
||||
ziU8 Zi8IsZicorpSignature(ziU16* p, ziU16 len ZI_NEED_WORK) {
|
||||
if ((ziU16)len > 6 && p[0] == 0x7A && p[1] == 0x69 && p[2] == 0x63 &&
|
||||
p[3] == 0x6F && p[4] == 0x72 && p[5] == 0x70) {
|
||||
return 1;
|
||||
|
||||
@@ -254,7 +254,7 @@ ziBool Zi8PriMatchNextComp(ziU8* node, ziU8 mask0, ziU8 value0, ziU8 mask1, ziU8
|
||||
return 0;
|
||||
}
|
||||
|
||||
ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dictionaryAddress) {
|
||||
ziBool Zi8SecMatchComp(ziPtr nodeAddress, ziMatchParam* matchAddress, ziPtr dictionaryAddress ZI_NEED_WORK) {
|
||||
int chainIndex;
|
||||
ziU16 matchCode;
|
||||
ziU16 targetCode;
|
||||
@@ -506,7 +506,7 @@ pinyin_initial:
|
||||
convertedCount = Zi8PinyinInitials[value];
|
||||
if (convertedCount != 0) {
|
||||
if (outputIndex == 0) {
|
||||
*resultCount = *resultCount + 1;
|
||||
*resultCount += 1;
|
||||
}
|
||||
result++;
|
||||
initial[outputIndex] = 0x7E00;
|
||||
@@ -526,7 +526,7 @@ pinyin_initial:
|
||||
value = *current;
|
||||
if (value != 0x68 && value != 0xF368) goto scan_final;
|
||||
if (outputIndex == 0) {
|
||||
*resultCount = *resultCount + 1;
|
||||
*resultCount += 1;
|
||||
}
|
||||
final[outputIndex] += 0x200;
|
||||
*bestInitial = initial[0];
|
||||
@@ -567,7 +567,7 @@ scan_final:
|
||||
value -= 0xF361;
|
||||
if (value > 0x19) {
|
||||
if (outputIndex == 0) {
|
||||
*resultCount = *resultCount + 1;
|
||||
*resultCount += 1;
|
||||
}
|
||||
goto finish_final;
|
||||
}
|
||||
@@ -577,7 +577,7 @@ scan_final:
|
||||
pinyin[index] = (ziU8)value + 1;
|
||||
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) == 0) goto try_final_extension;
|
||||
if (outputIndex == 0) {
|
||||
*resultCount = *resultCount + 1;
|
||||
*resultCount += 1;
|
||||
}
|
||||
current++;
|
||||
index++;
|
||||
@@ -592,7 +592,7 @@ try_final_extension:
|
||||
pinyin[index + 1] = 0xFF;
|
||||
if (Zi8GetPyFinal(pinyin, &pyInitial, &pyFinal) != 0) {
|
||||
if (outputIndex == 0) {
|
||||
*resultCount = *resultCount + 1;
|
||||
*resultCount += 1;
|
||||
}
|
||||
pinyin[index + 1] = 0;
|
||||
current++;
|
||||
@@ -615,7 +615,7 @@ try_final_extension:
|
||||
finish_final:
|
||||
if ((index > 3) && (count != 0) && (((value = *current) == 0x27) || (value == 0xF360) || (value == 0x20))) {
|
||||
if (outputIndex == 0) {
|
||||
*resultCount = *resultCount + 1;
|
||||
*resultCount += 1;
|
||||
}
|
||||
current++;
|
||||
count--;
|
||||
@@ -705,11 +705,10 @@ finish_final:
|
||||
}
|
||||
}
|
||||
}
|
||||
outputIndex++;
|
||||
if (outputIndex > 0xf) break;
|
||||
if (++outputIndex > 0xf) break;
|
||||
}
|
||||
if ((result > 1) && (text[*resultCount - 1] >= 0xF341) && (text[*resultCount - 1] <= 0xF35A)) {
|
||||
*resultCount = *resultCount - 1;
|
||||
*resultCount -= 1;
|
||||
}
|
||||
return result;
|
||||
|
||||
@@ -743,9 +742,9 @@ check_row:
|
||||
return 0;
|
||||
}
|
||||
|
||||
ziS32 Zi8GetBpmfPhonetic(ziWChar* text, ziU8 count, ziU16* initial, ziU16* final, ziU16* bestInitial, ziU16* bestFinal ZI_NEED_WORK) {
|
||||
ziU8 Zi8GetBpmfPhonetic(ziWChar* text, ziU8 count, ziU16* initial, ziU16* final, ziU16* bestInitial, ziU16* bestFinal ZI_NEED_WORK) {
|
||||
ziU16 value;
|
||||
ziU32 resultCount = 0;
|
||||
ziU8 resultCount = 0;
|
||||
|
||||
Zi8LogError(0x64, ZI_WORK);
|
||||
if (count == 0) {
|
||||
|
||||
@@ -17,7 +17,7 @@ typedef struct ziPudHeader {
|
||||
ziU8 options[4];
|
||||
ziPudSection sections[1];
|
||||
} ziPudHeader;
|
||||
ziU32 Zi8_8147FD7C(ziWChar*, ziU8, ziU8, ziWChar*, ziU16, ziU8, ziU8 ZI_NEED_WORK);
|
||||
ziU8 Zi8_8147FD7C(ziWChar*, ziU8, ziU8, ziWChar*, ziU16, ziU8, ziU8 ZI_NEED_WORK);
|
||||
|
||||
ziU32 ZiIsPhoneticChar(ziWChar character) {
|
||||
if ((character < 0xF305 || character > 0xF329) && (character < 0xF361 || character > 0xF37A)) return 0;
|
||||
@@ -56,8 +56,11 @@ ziU8 ZADP_Zi8SetPDremoveOpt(ziU8 option, struct __zi8_work_data_s* __zi8_work_da
|
||||
Zi8LogError(100, __zi8_work_data);
|
||||
return previous;
|
||||
}
|
||||
ziU32 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziWChar* spelling, ziU16 spellingCapacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {
|
||||
int fallback = 0;
|
||||
ziU8 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziWChar* spelling, ziU16 spellingCapacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {
|
||||
struct {
|
||||
int fallback;
|
||||
ziPtr workspace;
|
||||
} match;
|
||||
ziU8* bytePattern;
|
||||
ziWChar folded;
|
||||
ziPudSection* section;
|
||||
@@ -68,6 +71,8 @@ ziU32 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar*
|
||||
ziU32 entrySize;
|
||||
ziPudHeader* table;
|
||||
ziU8* byteOutput;
|
||||
match.workspace = __zi8_work_data;
|
||||
match.fallback = 0;
|
||||
if (!(ZI_WORK->pudCount <= 16 && ZI_WORK->pudCount != 0 && ZI_WORK->pudTable[ZI_WORK->pudCount - 1] != 0)) {
|
||||
Zi8LogError(0x4B0, __zi8_work_data);
|
||||
return 0;
|
||||
@@ -88,8 +93,8 @@ ziU32 Zi8MatchPUDdata_ZHS(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar*
|
||||
Zi8LogError(0x4F6, __zi8_work_data);
|
||||
return 0;
|
||||
}
|
||||
ZI_WORK->unk_0x314 = section->count[0] * 0x100 + section->count[1];
|
||||
ZI_WORK->unk_0x310 = (ziU32)table + section->offset[0] * 0x100 + section->offset[1];
|
||||
ZI_WORK->unk_0x314 = ((ziU16)section->count[0] << 8) + (ziU16)section->count[1];
|
||||
ZI_WORK->unk_0x310 = (ziU32)table + (((ziU16)section->offset[0] << 8) + (ziU16)section->offset[1]);
|
||||
ZI_WORK->unk_0x318 = 0;
|
||||
}
|
||||
for (;;) {
|
||||
@@ -130,7 +135,7 @@ matchText:
|
||||
}
|
||||
}
|
||||
matched:
|
||||
if (fallback) {
|
||||
if (match.fallback) {
|
||||
ZI_WORK->unk_0x310 = 0;
|
||||
ZI_WORK->unk_0x318 = 0;
|
||||
ZI_WORK->unk_0x314 = 0;
|
||||
@@ -164,7 +169,7 @@ matched:
|
||||
}
|
||||
if (length == 1 && complete != 0 && continuation == 0) {
|
||||
complete = 0;
|
||||
fallback = 1;
|
||||
match.fallback = 1;
|
||||
ZI_WORK->unk_0x318 = 0;
|
||||
} else {
|
||||
ZI_WORK->unk_0x310 = 0;
|
||||
@@ -174,12 +179,12 @@ matched:
|
||||
}
|
||||
}
|
||||
}
|
||||
ziU32 Zi8MatchPUDdata(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziU8 complete, ziU8 continuation, struct __zi8_work_data_s* __zi8_work_data) {
|
||||
ziU32 result;
|
||||
ziU8 Zi8MatchPUDdata(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziU8 complete, ziU8 continuation, struct __zi8_work_data_s* __zi8_work_data) {
|
||||
ziU8 result;
|
||||
if (continuation == 0) __zi8_work_data->pudCount = 1;
|
||||
for (;;) {
|
||||
result = Zi8_8147FD7C(pattern, length, language, output, capacity, complete, continuation, __zi8_work_data);
|
||||
if ((ziU8)result != 0) break;
|
||||
if (result != 0) break;
|
||||
if (++__zi8_work_data->pudCount <= 16) {
|
||||
continuation = 0;
|
||||
} else {
|
||||
@@ -189,6 +194,6 @@ ziU32 Zi8MatchPUDdata(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* out
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ziU32 Zi8_8147FD7C(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {
|
||||
ziU8 Zi8_8147FD7C(ziWChar* pattern, ziU8 length, ziU8 language, ziWChar* output, ziU16 capacity, ziU8 complete, ziU8 continuation ZI_NEED_WORK) {
|
||||
return Zi8MatchPUDdata_ZHS(pattern, length, language, output, capacity, 0, 0, complete, continuation, __zi8_work_data);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include <zi8clib/zitypes.h>
|
||||
|
||||
ziU16 Zi8GetVersion() {
|
||||
ziU16 Zi8GetVersion(ziPtr __zi8_work_data) {
|
||||
return 1802;
|
||||
}
|
||||
|
||||
ziU16 Zi8GetBuildID() {
|
||||
ziU16 Zi8GetBuildID(ziPtr __zi8_work_data) {
|
||||
return 41;
|
||||
}
|
||||
|
||||
ziU16 Zi8GetOEMID() {
|
||||
ziU16 Zi8GetOEMID(ziPtr __zi8_work_data) {
|
||||
return 249;
|
||||
}
|
||||
|
||||
@@ -11,15 +11,15 @@ typedef struct {
|
||||
ziU8 characterLow;
|
||||
} ZiKoreanKeyEntry;
|
||||
|
||||
ziU32 Zi8_8148302C(ziU16 key, ziU8* table ZI_NEED_WORK) {
|
||||
ziU16 Zi8_8148302C(ziU16 key, ziU8* table ZI_NEED_WORK) {
|
||||
ziU32 value;
|
||||
ziU16 count;
|
||||
ziU32 i;
|
||||
ziU16 i;
|
||||
|
||||
count = Zi8GetTableCount(ZI8_LANG_KO, 9, ZI_WORK);
|
||||
for (i = 0; (ziU16)i < count; i++) {
|
||||
value = (ziU16)(((ziU16)table[((i & 0xFFFF) << 3) + (i & 0xFFFF) + 7] << 8) |
|
||||
table[((i & 0xFFFF) << 3) + (i & 0xFFFF) + 8]);
|
||||
for (i = 0; i < count; i++) {
|
||||
value = (ziU16)(((ziU16)table[(i << 3) + i + 7] << 8) |
|
||||
table[(i << 3) + i + 8]);
|
||||
if (value == key) {
|
||||
Zi8LogError(0x64, ZI_WORK);
|
||||
return i;
|
||||
@@ -313,7 +313,8 @@ ziU32 Zi8GetKOcandidates(ziGetParam* param, ZiKoreanCandidateOptions* options ZI
|
||||
param->candidates[0] = 0;
|
||||
}
|
||||
Zi8LogError(100, ZI_WORK);
|
||||
if (param->wordCharCount != 0) {
|
||||
if (param->wordCharCount == 0) goto scan_key_table;
|
||||
{
|
||||
if (((search.keyIndex = Zi8_8148302C(param->currentWord[0], keyTable, ZI_WORK)) != 0xFFFF) &&
|
||||
((((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->keyBytes[4] & 8) != 0)) {
|
||||
search.wordOffset = ((ZiKoreanKeyEntry*)(((search.keyIndex << 3) + search.keyIndex) + keyTable))->childLow |
|
||||
@@ -438,6 +439,7 @@ search_table:
|
||||
param->count = search.candidateCount;
|
||||
param->letters = search.candidateCount;
|
||||
}
|
||||
scan_key_table:
|
||||
if (param->elementCount > 9) {
|
||||
param->letters = 0;
|
||||
return 0;
|
||||
|
||||
@@ -280,10 +280,8 @@ savePhonetic:
|
||||
}
|
||||
if (buffers.phoneticInput[phoneticLength - 1] == 0xF360) {
|
||||
match->nCand--;
|
||||
bestInitial = previousInitial;
|
||||
bestFinal = previousFinal;
|
||||
final = bestFinal;
|
||||
initial = bestInitial;
|
||||
bestInitial = initial = previousInitial;
|
||||
bestFinal = final = previousFinal;
|
||||
goto savePhonetic;
|
||||
}
|
||||
if (match->nCand == 1) {
|
||||
|
||||
@@ -6,11 +6,6 @@ typedef struct FA_NAND_ATTACH {
|
||||
u32 size;
|
||||
} FA_NAND_ATTACH;
|
||||
|
||||
typedef struct FA_ATTACH_REQUEST {
|
||||
FADrvTbl* table;
|
||||
u32 count;
|
||||
} FA_ATTACH_REQUEST;
|
||||
|
||||
FADisk* gOpenDisk[26];
|
||||
FAPartition* gOpenPartition[26];
|
||||
typedef struct FA_DISK_INIT {
|
||||
@@ -34,13 +29,13 @@ static struct {
|
||||
} drvInitFunc = {diskInitTbl, 3};
|
||||
extern s32 pdm_open_disk(FA_DISK_INIT* table, FADisk** disk);
|
||||
extern s32 pdm_open_partition(FADisk* disk, u32 index, FAPartition** partition);
|
||||
extern s32 pfstub_attach(FA_ATTACH_REQUEST* request, FA_NAND_ATTACH* nand);
|
||||
extern s32 pfstub_attach(FADrvTbl** drives, const void* nand_data);
|
||||
extern s32 pfd_sddrv_is_media_insert(void);
|
||||
extern s32 pfd_mscdrv_is_media_insert(void);
|
||||
extern s32 pfd_mscdrv_is_media_insert(FADisk* disk);
|
||||
|
||||
FAError FAAttach(u32 device, char* nand_path, u32 nand_size, FADrvTbl* table) {
|
||||
FADisk* disk;
|
||||
FA_ATTACH_REQUEST request;
|
||||
FADrvTbl* drives[2];
|
||||
FA_NAND_ATTACH nand;
|
||||
s32 error;
|
||||
s32 index;
|
||||
@@ -65,16 +60,16 @@ FAError FAAttach(u32 device, char* nand_path, u32 nand_size, FADrvTbl* table) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
request.table = table;
|
||||
request.count = 0;
|
||||
drives[0] = table;
|
||||
drives[1] = NULL;
|
||||
if (device == 2) {
|
||||
memcpy(nand.path, nand_path, 78);
|
||||
nand.size = nand_size;
|
||||
}
|
||||
if (device == 2) {
|
||||
error = pfstub_attach(&request, &nand);
|
||||
error = pfstub_attach(drives, &nand);
|
||||
} else {
|
||||
error = pfstub_attach(&request, NULL);
|
||||
error = pfstub_attach(drives, NULL);
|
||||
}
|
||||
if (error != 0) {
|
||||
return -1;
|
||||
@@ -85,11 +80,11 @@ FAError FAAttach(u32 device, char* nand_path, u32 nand_size, FADrvTbl* table) {
|
||||
gOpenPartition[index] = table->pPart;
|
||||
if (device == 0) {
|
||||
if (pfd_sddrv_is_media_insert()) {
|
||||
request.table->stat |= 0x10;
|
||||
drives[0]->stat |= 0x10;
|
||||
}
|
||||
} else if (device == 1) {
|
||||
if (pfd_mscdrv_is_media_insert()) {
|
||||
request.table->stat |= 0x10;
|
||||
if (pfd_mscdrv_is_media_insert(disk)) {
|
||||
drives[0]->stat |= 0x10;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
static FAEjectCallback g_detach_func;
|
||||
static FAInsertCallback g_attach_func;
|
||||
|
||||
extern s32 uhf_msc_is_media_insert(void);
|
||||
extern s32 uhf_msc_is_media_insert(FADisk* disk);
|
||||
|
||||
s32 pfd_mscdrv_registar_callback(FAInsertCallback insert, FAEjectCallback eject) {
|
||||
g_attach_func = insert;
|
||||
@@ -11,6 +11,6 @@ s32 pfd_mscdrv_registar_callback(FAInsertCallback insert, FAEjectCallback eject)
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 pfd_mscdrv_is_media_insert(void) {
|
||||
return uhf_msc_is_media_insert();
|
||||
s32 pfd_mscdrv_is_media_insert(FADisk* disk) {
|
||||
return uhf_msc_is_media_insert(disk);
|
||||
}
|
||||
|
||||
@@ -318,58 +318,58 @@ s32 pfd_sddrv_init(FADisk* disk) {
|
||||
}
|
||||
if ((pfd_sddrv_flags(&g_pfd_sddrv_info) & 1) != 0) {
|
||||
OSReport("INFO SD Card driver is already initialize. pfd_sddrv_init()\n");
|
||||
if (disk == g_pfd_sddrv_info.disk) {
|
||||
return 0;
|
||||
}
|
||||
return -44;
|
||||
}
|
||||
if ((g_pfd_sddrv_info.flags & 4) == 0) {
|
||||
g_pfd_sddrv_info.bytes_per_sector = 0x200;
|
||||
pf_memset(&g_pfd_sddev, 0, 0x28);
|
||||
sd_result = ISD_InitCard();
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR:Failed to init SD Card Driver in pfd_sddrv_init()\n");
|
||||
return -40;
|
||||
}
|
||||
g_pfd_sddrv_info.flags |= 4;
|
||||
}
|
||||
pf_memset(&g_pfd_sddev, 0, 0x28);
|
||||
device = &g_pfd_sddev.device;
|
||||
sd_result = ISD_MountCard(0, &device);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR SD card can not mount [ret = 0x%x]. pfd_sddrv_init()\n", sd_result);
|
||||
return -41;
|
||||
}
|
||||
sd_result = ISD_GetDeviceStatus(device, &status);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR Failed to get sd card status. [ret = 0x%x]\n", sd_result);
|
||||
return 21;
|
||||
}
|
||||
if ((status & 1) != 0) {
|
||||
g_pfd_sddrv_info.media_inserted = 1;
|
||||
}
|
||||
g_pfd_sddrv_info.device = device;
|
||||
if (g_pfd_sddrv_info.media_inserted != 0) {
|
||||
g_event = 2;
|
||||
sd_result = ISD_RegisterDeviceIntrHandler(device, (SDDevIntrCallback)pfd_st_removal_callback, &g_event);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR:Failed to regist intr handler1 [ret = 0x%x] pfd_sddrv_init()\n", sd_result);
|
||||
ISD_UnmountCard(device);
|
||||
g_pfd_sddrv_info.device = 0;
|
||||
return -42;
|
||||
if (disk != g_pfd_sddrv_info.disk) {
|
||||
return -44;
|
||||
}
|
||||
} else {
|
||||
g_event = 1;
|
||||
sd_result = ISD_RegisterDeviceIntrHandler(device, (SDDevIntrCallback)pfd_st_inter_callback, &g_event);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR:Failed to regist intr handler1 [ret = 0x%x] pfd_sddrv_init()\n", sd_result);
|
||||
ISD_UnmountCard(device);
|
||||
g_pfd_sddrv_info.device = 0;
|
||||
return -42;
|
||||
if ((g_pfd_sddrv_info.flags & 4) == 0) {
|
||||
g_pfd_sddrv_info.bytes_per_sector = 0x200;
|
||||
pf_memset(&g_pfd_sddev, 0, 0x28);
|
||||
sd_result = ISD_InitCard();
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR:Failed to init SD Card Driver in pfd_sddrv_init()\n");
|
||||
return -40;
|
||||
}
|
||||
g_pfd_sddrv_info.flags |= 4;
|
||||
}
|
||||
pf_memset(&g_pfd_sddev, 0, 0x28);
|
||||
device = &g_pfd_sddev.device;
|
||||
sd_result = ISD_MountCard(0, &device);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR SD card can not mount [ret = 0x%x]. pfd_sddrv_init()\n", sd_result);
|
||||
return -41;
|
||||
}
|
||||
sd_result = ISD_GetDeviceStatus(device, &status);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR Failed to get sd card status. [ret = 0x%x]\n", sd_result);
|
||||
return 21;
|
||||
}
|
||||
if ((status & 1) != 0) {
|
||||
g_pfd_sddrv_info.media_inserted = 1;
|
||||
}
|
||||
g_pfd_sddrv_info.device = device;
|
||||
if (g_pfd_sddrv_info.media_inserted != 0) {
|
||||
g_event = 2;
|
||||
sd_result = ISD_RegisterDeviceIntrHandler(device, (SDDevIntrCallback)pfd_st_removal_callback, &g_event);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR:Failed to regist intr handler1 [ret = 0x%x] pfd_sddrv_init()\n", sd_result);
|
||||
ISD_UnmountCard(device);
|
||||
g_pfd_sddrv_info.device = 0;
|
||||
return -42;
|
||||
}
|
||||
} else {
|
||||
g_event = 1;
|
||||
sd_result = ISD_RegisterDeviceIntrHandler(device, (SDDevIntrCallback)pfd_st_inter_callback, &g_event);
|
||||
if (sd_result != 0) {
|
||||
OSReport("ERR:Failed to regist intr handler1 [ret = 0x%x] pfd_sddrv_init()\n", sd_result);
|
||||
ISD_UnmountCard(device);
|
||||
g_pfd_sddrv_info.device = 0;
|
||||
return -42;
|
||||
}
|
||||
}
|
||||
g_pfd_sddrv_info.disk = disk;
|
||||
g_pfd_sddrv_info.flags |= 1;
|
||||
}
|
||||
g_pfd_sddrv_info.disk = disk;
|
||||
g_pfd_sddrv_info.flags |= 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1361,19 +1361,20 @@ s32 pfd_sddrv_store_fat32_bpb_buf(PFD_SDDRV_FORMAT_DATA* format_data, u8* sector
|
||||
|
||||
static s32 pfd_sddrv_store_fat32_reserved_buf(u8* sector_buffer) {
|
||||
PFD_SDDRV_RESERVED_BOOT_SECTOR* reserved_boot_sector;
|
||||
s32 result = -30;
|
||||
|
||||
if (sector_buffer == 0) {
|
||||
return -30;
|
||||
if (sector_buffer != 0) {
|
||||
pf_memset(sector_buffer, 0, 0x200);
|
||||
reserved_boot_sector = (PFD_SDDRV_RESERVED_BOOT_SECTOR*)sector_buffer;
|
||||
if (((u32)reserved_boot_sector->signature.bytes & 1) != 0) {
|
||||
reserved_boot_sector->signature.bytes[0] = 0x55;
|
||||
reserved_boot_sector->signature.bytes[1] = 0xaa;
|
||||
} else {
|
||||
reserved_boot_sector->signature.value = 0x55aa;
|
||||
}
|
||||
result = 0;
|
||||
}
|
||||
pf_memset(sector_buffer, 0, 0x200);
|
||||
reserved_boot_sector = (PFD_SDDRV_RESERVED_BOOT_SECTOR*)sector_buffer;
|
||||
if (((u32)reserved_boot_sector->signature.bytes & 1) != 0) {
|
||||
reserved_boot_sector->signature.bytes[0] = 0x55;
|
||||
reserved_boot_sector->signature.bytes[1] = 0xaa;
|
||||
} else {
|
||||
reserved_boot_sector->signature.value = 0x55aa;
|
||||
}
|
||||
return 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
s32 pfd_sddrv_build_fat32_mbr_bpb(u32 total_sectors) {
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#include <private/fa/pdm.h>
|
||||
#include <revolution/types.h>
|
||||
#define MBR_WORD(buf, offset) \
|
||||
((pf_u32)(buf)[offset] + ((pf_u32)(buf)[(offset) + 1] << 8) + \
|
||||
((pf_u32)(buf)[(offset) + 2] << 16) + ((pf_u32)(buf)[(offset) + 3] << 24))
|
||||
static inline pf_u16 read_boot_u16(pf_u8* buf, pf_u32 offset) {
|
||||
if ((pf_u32)&buf[offset] & 1) { return (buf[offset + 1] << 8) | buf[offset]; }
|
||||
return PF_SWAP_16(*(pf_u16*)&buf[(offset + 1) & ~1]);
|
||||
@@ -11,11 +14,11 @@ static inline pf_u32 read_partition_u32(const pf_u8* buf, pf_u32 offset) {
|
||||
}
|
||||
|
||||
pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mbr) {
|
||||
pf_u32* p_start;
|
||||
pf_u32* p_count;
|
||||
pf_s16 index;
|
||||
pf_u32 start[4];
|
||||
pf_u32 count[4];
|
||||
pf_u32* p_start;
|
||||
pf_u32* p_count;
|
||||
*p_is_mbr = 0;
|
||||
if (buf[510] != 0x55 || buf[511] != 0xAA) { return 2; }
|
||||
p_start = start;
|
||||
@@ -75,15 +78,20 @@ pf_bool pdm_part_is_boot_sector(pf_u8* buf) {
|
||||
return is_boot;
|
||||
}
|
||||
|
||||
static inline pf_u32 read_relative_start_sector(pf_u32 base, const pf_u8* buf, pf_u32 offset) {
|
||||
return base + (buf[offset] + ((unsigned int)buf[offset + 1] << 8) +
|
||||
((unsigned int)buf[offset + 2] << 16) + ((unsigned int)buf[offset + 3] << 24));
|
||||
}
|
||||
|
||||
pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
|
||||
pf_u32 part_index = 0;
|
||||
pf_u32 requested = p_part->part_id;
|
||||
pf_u32 start[4];
|
||||
pf_u32 count[4];
|
||||
pf_u32 part_index = 0;
|
||||
pf_u32 sector;
|
||||
pf_u32 base;
|
||||
pf_u16 index;
|
||||
pf_u16 extended_index;
|
||||
pf_u32 base;
|
||||
pf_u32 sector;
|
||||
pf_u32 length;
|
||||
pf_bool is_mbr;
|
||||
pf_u32 success;
|
||||
@@ -95,14 +103,14 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
|
||||
if (err != 0) { return err; }
|
||||
pdm_part_is_master_boot_sector(buf, p_part->p_disk->disk_info.total_sectors, &is_mbr);
|
||||
if (is_mbr) {
|
||||
start[0] = read_partition_u32(buf, 454);
|
||||
start[1] = read_partition_u32(buf, 470);
|
||||
start[2] = read_partition_u32(buf, 486);
|
||||
start[3] = read_partition_u32(buf, 502);
|
||||
count[0] = read_partition_u32(buf, 458);
|
||||
count[1] = read_partition_u32(buf, 474);
|
||||
count[2] = read_partition_u32(buf, 490);
|
||||
count[3] = read_partition_u32(buf, 506);
|
||||
start[0] = MBR_WORD(buf, 454);
|
||||
start[1] = MBR_WORD(buf, 470);
|
||||
start[2] = MBR_WORD(buf, 486);
|
||||
start[3] = MBR_WORD(buf, 502);
|
||||
count[0] = MBR_WORD(buf, 458);
|
||||
count[1] = MBR_WORD(buf, 474);
|
||||
count[2] = MBR_WORD(buf, 490);
|
||||
count[3] = MBR_WORD(buf, 506);
|
||||
part_index = 0;
|
||||
for (index = 0; index < 4; index++) {
|
||||
sector = start[index];
|
||||
@@ -116,15 +124,15 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
|
||||
sector = base;
|
||||
for (extended_index = 0; extended_index < 2; extended_index++) {
|
||||
if (extended_index == 0) {
|
||||
sector = sector + read_partition_u32(buf, 454);
|
||||
length = read_partition_u32(buf, 458);
|
||||
sector = read_relative_start_sector(sector, buf, 454);
|
||||
length = MBR_WORD(buf, 458);
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
|
||||
if (err != 0) { return err; }
|
||||
if (requested == part_index) { p_part->start_sector = sector; p_part->total_sector = length; return 0; }
|
||||
part_index++;
|
||||
} else {
|
||||
sector = base + read_partition_u32(buf, 470);
|
||||
length = read_partition_u32(buf, 474);
|
||||
sector = read_relative_start_sector(base, buf, 470);
|
||||
length = MBR_WORD(buf, 474);
|
||||
if (sector == 0 || length == 0) { break; }
|
||||
err = pdm_disk_physical_read(p_part->p_disk, buf, sector, 1, 512, &success);
|
||||
if (err != 0) { return err; }
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <revolution/fa/pf_stub.h>
|
||||
|
||||
s32 pfstub_attach(FADrvTbl* drives, u32 mode) {
|
||||
s32 pfstub_attach(FADrvTbl** drives, const void* nand_data) {
|
||||
PF_STUB_MESSAGE message;
|
||||
|
||||
message.operation = 27;
|
||||
message.object = drives;
|
||||
message.callback = NULL;
|
||||
message.data = (void*)mode;
|
||||
message.data = nand_data;
|
||||
if (pfstub_com_massage(&message) == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -571,8 +571,14 @@ static inline f32 clamp_acc_value(f32 value, f32 limit) {
|
||||
}
|
||||
|
||||
static inline void smooth_acc_value(KPADInside* kpad, f32 value, f32* result) {
|
||||
f32 delta = value - *result;
|
||||
f32 amount = delta < 0.0f ? -delta : delta;
|
||||
f32 amount;
|
||||
f32 delta;
|
||||
delta = value - *result;
|
||||
if (delta < 0.0f) {
|
||||
amount = -delta;
|
||||
} else {
|
||||
amount = delta;
|
||||
}
|
||||
if (amount >= kpad->value9C) {
|
||||
amount = 1.0f;
|
||||
} else {
|
||||
@@ -612,12 +618,16 @@ static void read_kpad_acc(KPADInside* kpad, KPADSample* status) {
|
||||
kpad->status.acc_speed = (f32)sqrt(previous.z * previous.z + (previous.x * previous.x + previous.y * previous.y));
|
||||
calc_acc_horizon(kpad);
|
||||
calc_acc_vertical(kpad);
|
||||
if (status->error != 0 || status->device != 1) {
|
||||
return;
|
||||
}
|
||||
if (status->dataFormat != 4 && status->dataFormat != 5) {
|
||||
return;
|
||||
if (status->error == 0 && status->device == 1) {
|
||||
if (status->dataFormat == 4) {
|
||||
goto read_extension_acceleration;
|
||||
}
|
||||
if (status->dataFormat == 5) {
|
||||
goto read_extension_acceleration;
|
||||
}
|
||||
}
|
||||
return;
|
||||
read_extension_acceleration:
|
||||
{
|
||||
Vec extensionPrevious;
|
||||
raw.x = clamp_acc_value((f32)-(s32)status->extension.fs.accX * kpad->value4E8, kp_fs_acc_max);
|
||||
@@ -939,15 +949,20 @@ static void calc_dpd_variable(KPADInside* kpad, s8 valid) {
|
||||
f32 dx;
|
||||
f32 next;
|
||||
dx = value - kpad->status.dist;
|
||||
magnitude = dx < 0.0f ? -dx : dx;
|
||||
if (dx < 0.0f) {
|
||||
magnitude = -dx;
|
||||
} else {
|
||||
magnitude = dx;
|
||||
}
|
||||
if (magnitude >= kpad->value94) {
|
||||
magnitude = 1.0f;
|
||||
} else {
|
||||
magnitude = magnitude / kpad->value94;
|
||||
magnitude /= kpad->value94;
|
||||
magnitude *= magnitude;
|
||||
magnitude *= magnitude;
|
||||
}
|
||||
next = magnitude * kpad->value98 * dx;
|
||||
magnitude *= kpad->value98;
|
||||
next = magnitude * dx;
|
||||
kpad->status.dist_vec = next;
|
||||
if (next < 0.0f) {
|
||||
kpad->status.dist_speed = -next;
|
||||
@@ -958,12 +973,15 @@ static void calc_dpd_variable(KPADInside* kpad, s8 valid) {
|
||||
}
|
||||
}
|
||||
{
|
||||
f32 rotatedX = kpad->horizonTangent.x * kpad->dpdObjectDirection.x + kpad->horizonTangent.y * kpad->dpdObjectDirection.y;
|
||||
f32 midpointFactor = 0.5f;
|
||||
f32 scaleX = midpointFactor * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x);
|
||||
f32 scaleY = midpointFactor * (kpad->dpdState.candidates[0].y + kpad->dpdState.candidates[1].y);
|
||||
f32 rotatedX = kpad->dpdObjectDirection.x * kpad->horizonTangent.x + kpad->dpdObjectDirection.y * kpad->horizonTangent.y;
|
||||
f32 rotatedY = -kpad->dpdObjectDirection.y * kpad->horizonTangent.x + kpad->dpdObjectDirection.x * kpad->horizonTangent.y;
|
||||
f32 scaleX = 0.5f * (kpad->dpdState.candidates[0].x + kpad->dpdState.candidates[1].x);
|
||||
f32 scaleY = 0.5f * (kpad->dpdState.candidates[0].y + kpad->dpdState.candidates[1].y);
|
||||
delta.x = kpad->sensorBarScale * (kpad->sensorBarCenter.x - (rotatedX * scaleX - rotatedY * scaleY));
|
||||
delta.y = kpad->sensorBarScale * (kpad->sensorBarCenter.y - (rotatedY * scaleX + rotatedX * scaleY));
|
||||
f32 transformedX = rotatedX * scaleX - rotatedY * scaleY;
|
||||
f32 transformedY = rotatedY * scaleX + rotatedX * scaleY;
|
||||
delta.x = kpad->sensorBarScale * (kpad->sensorBarCenter.x - transformedX);
|
||||
delta.y = kpad->sensorBarScale * (kpad->sensorBarCenter.y - transformedY);
|
||||
point.x = -kpad->accelNormal.y * delta.x + kpad->accelNormal.x * delta.y;
|
||||
point.y = -kpad->accelNormal.x * delta.x - kpad->accelNormal.y * delta.y;
|
||||
if (kpad->status.dpd_valid_fg == 0) {
|
||||
@@ -1296,6 +1314,9 @@ static void read_kpad_stick(KPADInside* kpad, KPADSample* status) {
|
||||
}
|
||||
|
||||
s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
u32 changed;
|
||||
u16 heldButtons;
|
||||
KPADStatus* output;
|
||||
KPADInside* kpad = &inside_kpads[chan];
|
||||
s32 probe;
|
||||
BOOL interruptState;
|
||||
@@ -1303,17 +1324,15 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
u32 ringCount;
|
||||
s32 start;
|
||||
s32 sampleIndex;
|
||||
u32 remaining;
|
||||
s32 remaining;
|
||||
u32 remainingSamples;
|
||||
u32 buttons;
|
||||
u16 previousButtons;
|
||||
u32 changed;
|
||||
u32 extensionButtons;
|
||||
u32 coreButtons;
|
||||
u32 extensionButtons;
|
||||
u8 device;
|
||||
KPADSample latestSample;
|
||||
KPADSample* sample;
|
||||
KPADStatus* output;
|
||||
if (WPADGetStatus() != 3) {
|
||||
return 0;
|
||||
}
|
||||
@@ -1347,19 +1366,19 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
if (available > count) {
|
||||
available = count;
|
||||
}
|
||||
remaining = available;
|
||||
kpad->ringCount = 0;
|
||||
output = statuses + remaining;
|
||||
start = kpad->ringIndex - available;
|
||||
if (start < 0) {
|
||||
start += 16;
|
||||
}
|
||||
--output;
|
||||
{
|
||||
KPADStatus* copyOutput;
|
||||
sampleIndex = start;
|
||||
remaining = available;
|
||||
copyOutput = statuses + (available - 1);
|
||||
while (--remaining != 0) {
|
||||
copyOutput--;
|
||||
*(KPADSample*)copyOutput = kpad->ringData[sampleIndex];
|
||||
output--;
|
||||
*(KPADSample*)output = kpad->ringData[sampleIndex];
|
||||
sampleIndex++;
|
||||
if (sampleIndex >= 16) {
|
||||
sampleIndex = 0;
|
||||
@@ -1372,7 +1391,7 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
WPADAccGravityUnit gravity = {1, 1, 1};
|
||||
WPADAccGravityUnit extensionGravity = {1, 1, 1};
|
||||
WPADGetAccGravityUnit(chan, WPAD_ACC_GRAVITY_UNIT_CORE, &gravity);
|
||||
if (gravity.z * gravity.x * gravity.y != 0) {
|
||||
if (gravity.x * gravity.y * gravity.z != 0) {
|
||||
kpad->value4DC = 1.0f / gravity.x;
|
||||
kpad->value4E0 = 1.0f / gravity.y;
|
||||
kpad->value4E4 = 1.0f / gravity.z;
|
||||
@@ -1382,7 +1401,7 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
kpad->value4E4 = 0.01f;
|
||||
}
|
||||
WPADGetAccGravityUnit(chan, WPAD_ACC_GRAVITY_UNIT_FS, &extensionGravity);
|
||||
if (extensionGravity.z * extensionGravity.x * extensionGravity.y != 0) {
|
||||
if (extensionGravity.x * extensionGravity.y * extensionGravity.z != 0) {
|
||||
kpad->value4E8 = 1.0f / extensionGravity.x;
|
||||
kpad->value4EC = 1.0f / extensionGravity.y;
|
||||
kpad->value4F0 = 1.0f / extensionGravity.z;
|
||||
@@ -1395,8 +1414,8 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
output = statuses + available;
|
||||
--output;
|
||||
device = 0xFD;
|
||||
coreButtons = 0xFFFF;
|
||||
extensionButtons = 0xFFFF;
|
||||
coreButtons = 0xFFFF;
|
||||
buttons = 0xFFFF;
|
||||
do {
|
||||
output--;
|
||||
@@ -1433,18 +1452,20 @@ s32 KPADRead(s32 chan, KPADStatus* statuses, u32 count) {
|
||||
if (extensionButtons == 0xFFFF) {
|
||||
extensionButtons = kpad->status.ex_status.cl.hold;
|
||||
}
|
||||
buttons = (buttons & 0x9FFF) | (coreButtons & 0x6000);
|
||||
previousButtons = kpad->status.hold;
|
||||
changed = previousButtons ^ buttons;
|
||||
kpad->status.hold = buttons;
|
||||
kpad->status.trig = changed & buttons;
|
||||
heldButtons = (buttons & 0x9FFF) | (coreButtons & 0x6000);
|
||||
changed = heldButtons ^ previousButtons;
|
||||
kpad->status.hold = heldButtons;
|
||||
kpad->status.trig = changed & heldButtons;
|
||||
kpad->status.release = changed & previousButtons;
|
||||
if (device == 2) {
|
||||
previousButtons = kpad->status.ex_status.cl.hold;
|
||||
kpad->status.ex_status.cl.hold = (u16)extensionButtons;
|
||||
changed = previousButtons ^ (u16)extensionButtons;
|
||||
u16 previousExtensionButtons;
|
||||
previousExtensionButtons = kpad->status.ex_status.cl.hold;
|
||||
extensionButtons = (u16)extensionButtons;
|
||||
kpad->status.ex_status.cl.hold = extensionButtons;
|
||||
changed = extensionButtons ^ previousExtensionButtons;
|
||||
kpad->status.ex_status.cl.trig = changed & extensionButtons;
|
||||
kpad->status.ex_status.cl.release = changed & previousButtons;
|
||||
kpad->status.ex_status.cl.release = changed & previousExtensionButtons;
|
||||
}
|
||||
calc_button_repeat(kpad, device, ringCount);
|
||||
remainingSamples = available;
|
||||
@@ -1489,7 +1510,6 @@ void KPADInit(void) {
|
||||
f32 zero;
|
||||
f32 degreesToRadians;
|
||||
f32 one;
|
||||
f32* matrix;
|
||||
u32 i;
|
||||
s32 chan;
|
||||
BOOL enabled;
|
||||
@@ -1500,7 +1520,6 @@ void KPADInit(void) {
|
||||
one = 1.0f;
|
||||
zero = 0.0f;
|
||||
degreesToRadians = 0.017453292f;
|
||||
matrix = initial_rotation_matrix;
|
||||
kpad = inside_kpads;
|
||||
do {
|
||||
kpad->dpdEnable = 1;
|
||||
@@ -1528,9 +1547,9 @@ void KPADInit(void) {
|
||||
}
|
||||
referenceWidth = referenceWidth < referenceHeight ? referenceWidth : referenceHeight;
|
||||
initial_rotation_matrix[0] = one;
|
||||
matrix[1] = zero;
|
||||
matrix[2] = zero;
|
||||
matrix[3] = zero;
|
||||
initial_rotation_matrix[1] = zero;
|
||||
initial_rotation_matrix[2] = zero;
|
||||
initial_rotation_matrix[3] = zero;
|
||||
kpad->sensorBarScale = sensorDistance / referenceWidth;
|
||||
kpad->value9C = zero;
|
||||
kpad->value94 = zero;
|
||||
@@ -1549,18 +1568,18 @@ void KPADInit(void) {
|
||||
kpad->sensorHeightPending = 1;
|
||||
kpad->sensorBarPosition = 1;
|
||||
kpad->freeStyleAccelRotation = 0;
|
||||
matrix[4] = zero;
|
||||
initial_rotation_matrix[4] = zero;
|
||||
rotationElement = (f32)cos(degreesToRadians * sensor_bar_angle_degrees);
|
||||
matrix[5] = rotationElement;
|
||||
initial_rotation_matrix[5] = rotationElement;
|
||||
rotationElement = (f32)-sin(degreesToRadians * sensor_bar_angle_degrees);
|
||||
matrix[7] = zero;
|
||||
matrix[8] = zero;
|
||||
matrix[6] = rotationElement;
|
||||
initial_rotation_matrix[7] = zero;
|
||||
initial_rotation_matrix[8] = zero;
|
||||
initial_rotation_matrix[6] = rotationElement;
|
||||
rotationElement = (f32)sin(degreesToRadians * sensor_bar_angle_degrees);
|
||||
matrix[9] = rotationElement;
|
||||
initial_rotation_matrix[9] = rotationElement;
|
||||
rotationElement = (f32)cos(degreesToRadians * sensor_bar_angle_degrees);
|
||||
matrix[10] = rotationElement;
|
||||
matrix[11] = zero;
|
||||
initial_rotation_matrix[10] = rotationElement;
|
||||
initial_rotation_matrix[11] = zero;
|
||||
{
|
||||
i = 0;
|
||||
do {
|
||||
|
||||
@@ -8,13 +8,11 @@ void CDBCryptBufSysInit(CDBCryptBuf* cryptBuf) {
|
||||
cryptBuf->allocated = FALSE;
|
||||
}
|
||||
|
||||
// Some weird crap is going on with these functions.
|
||||
|
||||
CDBErr CDBCryptBufAllocate(CDBCryptBuf* cryptBuf) {
|
||||
CDBErr CDBCryptBufAllocate(CDBCryptBuf** cryptBuf) {
|
||||
CDBErr err = CDB_ERROR_OK;
|
||||
|
||||
if (s_cryptBuf->allocated == FALSE) {
|
||||
cryptBuf->buffer32[0] = (u32)&s_cryptBuf[err];
|
||||
*cryptBuf = &s_cryptBuf[err];
|
||||
s_cryptBuf[err].allocated = TRUE;
|
||||
return CDB_ERROR_OK;
|
||||
} else {
|
||||
@@ -23,12 +21,12 @@ CDBErr CDBCryptBufAllocate(CDBCryptBuf* cryptBuf) {
|
||||
}
|
||||
}
|
||||
|
||||
CDBErr CDBCryptBufFree(CDBCryptBuf* cryptBuf) {
|
||||
CDBErr CDBCryptBufFree(CDBCryptBuf** cryptBuf) {
|
||||
CDBErr err = CDB_ERROR_OK;
|
||||
|
||||
if ((CDBCryptBuf*)*cryptBuf->buffer32 == s_cryptBuf) {
|
||||
if (*cryptBuf == s_cryptBuf) {
|
||||
s_cryptBuf[err].allocated = FALSE;
|
||||
*cryptBuf->buffer32 = 0;
|
||||
*cryptBuf = NULL;
|
||||
return CDB_ERROR_OK;
|
||||
} else {
|
||||
CDBReportError("failed to free crypt buffer\n");
|
||||
|
||||
@@ -173,7 +173,7 @@ static const u32 AESiDecryptTable[] = {
|
||||
#define DECRYPT(a,b,c,d) (((ROTATE(AESiDecryptTable[((b)>>16)&255],16) ^ AESiDecryptTable[(d)&255]) ^ ROTATE(AESiDecryptTable[(a)>>24],24)) ^ ROTATE(AESiDecryptTable[((c)>>8)&255],8))
|
||||
#define SUBSTITUTE(table,a,b,c,d) ((((u32)table[(a)>>24]<<24) | table[(d)&255]) | (((u32)table[((b)>>16)&255]<<16) | ((u32)table[((c)>>8)&255]<<8)))
|
||||
|
||||
#define SUBSTITUTE_XOR(table,a,b,c,d) (((((u32)table[(a)>>24]<<24) ^ table[(d)&255]) ^ ((u32)table[((c)>>8)&255]<<8)) ^ ((u32)table[((b)>>16)&255]<<16))
|
||||
#define DECRYPT_FINAL(table,a,b,c,d,key) ((table[(d)&255] ^ ((u32)table[((c)>>8)&255]<<8)) ^ (((u32)table[((b)>>16)&255]<<16) ^ ((key) ^ ((u32)table[(a)>>24]<<24))))
|
||||
|
||||
void AESiEncryptBlock(AESContext* context, u32* output, const u32* input) {
|
||||
u32 rounds = context->rounds;
|
||||
@@ -204,16 +204,15 @@ void AESiDecryptBlock(AESContext* context, u32* output, const u32* input) {
|
||||
u32 round;
|
||||
for (round=1; round<context->rounds; ++round) {
|
||||
u32 word;
|
||||
u32* keys=context->keys + round*4;
|
||||
for (word=0; word<4; ++word) {
|
||||
u32 value=keys[word];
|
||||
u32 value=context->keys[round*4 + word];
|
||||
u32 twice=DOUBLE_BYTES(value);
|
||||
u32 four=DOUBLE_BYTES(twice);
|
||||
u32 eight=DOUBLE_BYTES(four)^value;
|
||||
u32 mixed=(ROTATE(eight,8) ^ (eight ^ four));
|
||||
mixed=(ROTATE(mixed,8) ^ (mixed ^ twice));
|
||||
mixed=(ROTATE(mixed,8) ^ (mixed ^ value));
|
||||
keys[word]=mixed;
|
||||
context->keys[round*4 + word]=mixed;
|
||||
}
|
||||
}
|
||||
context->needsTransform=0;
|
||||
@@ -228,10 +227,10 @@ void AESiDecryptBlock(AESContext* context, u32* output, const u32* input) {
|
||||
a=nextA^key[0]; b=nextB^key[1]; c=nextC^key[2]; d=nextD^key[3];
|
||||
key-=4;
|
||||
}
|
||||
output[0]=SUBSTITUTE_XOR(AESiInvSubShiftTable,a,d,c,b)^key[0];
|
||||
output[1]=SUBSTITUTE_XOR(AESiInvSubShiftTable,b,a,d,c)^key[1];
|
||||
output[2]=SUBSTITUTE_XOR(AESiInvSubShiftTable,c,b,a,d)^key[2];
|
||||
output[3]=SUBSTITUTE_XOR(AESiInvSubShiftTable,d,c,b,a)^key[3];
|
||||
output[0]=DECRYPT_FINAL(AESiInvSubShiftTable,a,d,c,b,key[0]);
|
||||
output[1]=DECRYPT_FINAL(AESiInvSubShiftTable,b,a,d,c,key[1]);
|
||||
output[2]=DECRYPT_FINAL(AESiInvSubShiftTable,c,b,a,d,key[2]);
|
||||
output[3]=DECRYPT_FINAL(AESiInvSubShiftTable,d,c,b,a,key[3]);
|
||||
}
|
||||
|
||||
BOOL NETAESCreateEx(AESContext* context, const void* key, u32 keyLength, const void* iv, const AESBlockMode* mode) {
|
||||
|
||||
@@ -75,25 +75,34 @@ static inline u32 rotateSum(u32 state, const u32* word, u32 constant, int shift)
|
||||
return ((state + (constant + left)) << shift) | ((constant + (state + right)) >> (32 - shift));
|
||||
}
|
||||
|
||||
static inline u32 rotateNextSum(u32 state, u32** cursor, u32 constant, int shift) {
|
||||
const u32* word = *cursor;
|
||||
u32 right = __lwbrx((void*)word, 0);
|
||||
u32 left = __lwbrx((void*)word, 0);
|
||||
++*cursor;
|
||||
return ((state + (constant + left)) << shift) | ((constant + (state + right)) >> (32 - shift));
|
||||
}
|
||||
|
||||
#define STEP_NEXT(a, b, c, d, f, word, n) ((a) = (b) + rotateNextSum((a) + (f), &(word), *constant, n))
|
||||
#define STEP(a, b, c, d, f, word, n) ((a) = (b) + rotateSum((a) + (f), word, *constant, n))
|
||||
|
||||
static void ProcessBlock(NETMD5Context* context) {
|
||||
static u32 constants[64] = {0xD76AA478, 0xE8C7B756, 0x242070DB, 0xC1BDCEEE, 0xF57C0FAF, 0x4787C62A, 0xA8304613, 0xFD469501, 0x698098D8, 0x8B44F7AF, 0xFFFF5BB1, 0x895CD7BE, 0x6B901122, 0xFD987193, 0xA679438E, 0x49B40821, 0xF61E2562, 0xC040B340, 0x265E5A51, 0xE9B6C7AA, 0xD62F105D, 0x02441453, 0xD8A1E681, 0xE7D3FBC8, 0x21E1CDE6, 0xC33707D6, 0xF4D50D87, 0x455A14ED, 0xA9E3E905, 0xFCEFA3F8, 0x676F02D9, 0x8D2A4C8A, 0xFFFA3942, 0x8771F681, 0x6D9D6122, 0xFDE5380C, 0xA4BEEA44, 0x4BDECFA9, 0xF6BB4B60, 0xBEBFBC70, 0x289B7EC6, 0xEAA127FA, 0xD4EF3085, 0x04881D05, 0xD9D4D039, 0xE6DB99E5, 0x1FA27CF8, 0xC4AC5665, 0xF4292244, 0x432AFF97, 0xAB9423A7, 0xFC93A039, 0x655B59C3, 0x8F0CCC92, 0xFFEFF47D, 0x85845DD1, 0x6FA87E4F, 0xFE2CE6E0, 0xA3014314, 0x4E0811A1, 0xF7537E82, 0xBD3AF235, 0x2AD7D2BB, 0xEB86D391};
|
||||
static u32 indices[48] = {0x00000001, 0x00000006, 0x0000000B, 0x00000000, 0x00000005, 0x0000000A, 0x0000000F, 0x00000004, 0x00000009, 0x0000000E, 0x00000003, 0x00000008, 0x0000000D, 0x00000002, 0x00000007, 0x0000000C, 0x00000005, 0x00000008, 0x0000000B, 0x0000000E, 0x00000001, 0x00000004, 0x00000007, 0x0000000A, 0x0000000D, 0x00000000, 0x00000003, 0x00000006, 0x00000009, 0x0000000C, 0x0000000F, 0x00000002, 0x00000000, 0x00000007, 0x0000000E, 0x00000005, 0x0000000C, 0x00000003, 0x0000000A, 0x00000001, 0x00000008, 0x0000000F, 0x00000006, 0x0000000D, 0x00000004, 0x0000000B, 0x00000002, 0x00000009};
|
||||
u32 a = context->a, b = context->b, c = context->c, d = context->d;
|
||||
u32* word;
|
||||
u32* constant;
|
||||
u32* index;
|
||||
int round;
|
||||
u32* block;
|
||||
u32* constant;
|
||||
int round;
|
||||
u32* word;
|
||||
block = context->buffer32;
|
||||
word = block;
|
||||
constant = constants;
|
||||
for (round = 0; round < 4; ++round) {
|
||||
STEP(a,b,c,d,(b & c) | (~b & d),word++,7); ++constant;
|
||||
STEP(d,a,b,c,(a & b) | (~a & c),word++,12); ++constant;
|
||||
STEP(c,d,a,b,(d & a) | (~d & b),word++,17); ++constant;
|
||||
STEP(b,c,d,a,(c & d) | (~c & a),word++,22); ++constant;
|
||||
STEP_NEXT(a,b,c,d,(b & c) | (~b & d),word,7); ++constant;
|
||||
STEP_NEXT(d,a,b,c,(a & b) | (~a & c),word,12); ++constant;
|
||||
STEP_NEXT(c,d,a,b,(d & a) | (~d & b),word,17); ++constant;
|
||||
STEP_NEXT(b,c,d,a,(c & d) | (~c & a),word,22); ++constant;
|
||||
}
|
||||
index = indices;
|
||||
for (round = 0; round < 4; ++round) {
|
||||
|
||||
@@ -7,8 +7,7 @@ s32 NHTTPi_strcmp(const char* left, const char* right) { return strcmp(left,righ
|
||||
void* NHTTPi_memclr(void* destination, u32 size) { return memset(destination,0,size); }
|
||||
|
||||
static int LowerCase(int character) {
|
||||
if((character>='A') & (character<='Z')) character+=32;
|
||||
return character;
|
||||
return ((character >= 'A') & (character <= 'Z')) ? character + 32 : character;
|
||||
}
|
||||
|
||||
s32 NHTTPi_strnicmp(const char* left, const char* right, s32 length) {
|
||||
@@ -127,12 +126,13 @@ s32 NHTTPi_intToStr(char* destination, u32 value) {
|
||||
}
|
||||
|
||||
s32 NHTTPi_compareToken(const char* left, const char* right) {
|
||||
for (;;) {
|
||||
int rightCharacter=LowerCase(*right);
|
||||
int leftCharacter=LowerCase(*left);
|
||||
if(leftCharacter!=rightCharacter) break;
|
||||
if(*left==0 || *left==' ') return 0;
|
||||
++left; ++right;
|
||||
u32 rawLeft;
|
||||
while (LowerCase((s8)(rawLeft = *(const u8*)left)) == LowerCase((s8)*(const u8*)right)) {
|
||||
if ((s8)rawLeft == 0 || (s8)rawLeft == ' ') {
|
||||
return 0;
|
||||
}
|
||||
++left;
|
||||
++right;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -158,20 +158,24 @@ s32 NHTTPi_strtonum(const char* string, u32 length) {
|
||||
}
|
||||
|
||||
s32 NHTTPi_Base64Encode(char* destination, const char* source) {
|
||||
static char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
const char* table=alphabet;
|
||||
char* output=destination;
|
||||
u32 length=strlen(source);
|
||||
s32 consumed=0;
|
||||
for(; consumed<(s32)length; consumed+=3) {
|
||||
output[0]=table[source[0]>>2];
|
||||
output[1]=table[((source[0]&3)<<4)+(source[1]>>4)];
|
||||
output[2]=table[((source[1]&15)<<2)+(source[2]>>6)];
|
||||
output[3]=table[source[2]&63];
|
||||
source+=3; output+=4;
|
||||
const char* table = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
char* output = destination;
|
||||
s32 length = strlen(source);
|
||||
s32 consumed = 0;
|
||||
|
||||
for (; consumed < length; consumed += 3) {
|
||||
output[0] = table[source[0] >> 2];
|
||||
output[1] = table[((source[0] & 3) << 4) + (source[1] >> 4)];
|
||||
output[2] = table[((source[1] & 15) << 2) + (source[2] >> 6)];
|
||||
output[3] = table[source[2] & 63];
|
||||
source += 3;
|
||||
output += 4;
|
||||
}
|
||||
if(consumed==length+1) output[-1]='=';
|
||||
else if(consumed==length+2) { output[-2]='='; output[-1]='='; }
|
||||
*output=0;
|
||||
if (consumed == length + 1) output[-1] = '=';
|
||||
else if (consumed == length + 2) {
|
||||
output[-2] = '=';
|
||||
output[-1] = '=';
|
||||
}
|
||||
*output = 0;
|
||||
return strlen(destination);
|
||||
}
|
||||
|
||||
@@ -7,8 +7,9 @@ s32 ConvertDateToDays(u16 year, u8 month, u8 day);
|
||||
void ConvertDaysToDate(u16* year, u8* month, u8* day, s32 days);
|
||||
|
||||
static inline BOOL IsLeapYear(u16 year) {
|
||||
s32 calendarYear = year;
|
||||
BOOL leap = FALSE;
|
||||
if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
|
||||
if ((calendarYear % 4 == 0 && calendarYear % 100 != 0) || calendarYear % 400 == 0)
|
||||
leap = TRUE;
|
||||
return leap;
|
||||
}
|
||||
@@ -152,7 +153,7 @@ NWC24Err NWC24iIsValidDate(u16 year, u8 month, u8 day) {
|
||||
s32 ConvertDateToDays(u16 year, u8 month, u8 day) {
|
||||
s32 daysOfYear;
|
||||
s32 yearOffset;
|
||||
s32 centuryLeapDays;
|
||||
s32 totalDays;
|
||||
s32 commonLeapDays;
|
||||
BOOL isLeapYear;
|
||||
|
||||
@@ -190,11 +191,10 @@ validDate:
|
||||
}
|
||||
|
||||
yearOffset = year - 1900;
|
||||
centuryLeapDays = (yearOffset + 299) / 400;
|
||||
daysOfYear += yearOffset * 365;
|
||||
daysOfYear += centuryLeapDays;
|
||||
totalDays = daysOfYear + (yearOffset + 299) / 400;
|
||||
commonLeapDays = (yearOffset - 1) / 4 - (yearOffset - 1) / 100;
|
||||
return daysOfYear + commonLeapDays;
|
||||
return totalDays + commonLeapDays;
|
||||
}
|
||||
|
||||
void ConvertDaysToDate(u16* year, u8* month, u8* day, s32 days) {
|
||||
@@ -231,7 +231,7 @@ void ConvertDaysToDate(u16* year, u8* month, u8* day, s32 days) {
|
||||
const u8* parsedMonth = month;
|
||||
previousDays = days;
|
||||
currentMonth = *parsedMonth;
|
||||
if (currentMonth == 2 && IsLeapYear(*year)) {
|
||||
if (*parsedMonth == 2 && IsLeapYear(*year)) {
|
||||
days -= 29;
|
||||
} else {
|
||||
days -= DAYS_OF_MONTH[currentMonth - 1];
|
||||
|
||||
@@ -687,10 +687,10 @@ NWC24Err NWC24IterateDlTaskEx(NWC24DlIterateWork* dlIterateWork, NWC24DlId* dlIt
|
||||
return NWC24_ERR_DONE;
|
||||
}
|
||||
|
||||
static inline NWC24Err SetDlTaskAccessTime(NWC24DlTask* dlTask, OSTime time) {
|
||||
static inline NWC24Err SetDlTaskAccessTime(const NWC24DlTask* dlTask, OSTime time) {
|
||||
NWC24Work* work = NWC24WorkP;
|
||||
DlTaskListHeader* header = work != NULL ? (DlTaskListHeader*)work->dlHead : NULL;
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
const DlTaskData* task = (const DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
u16 taskId;
|
||||
if (task == NULL) { result = NWC24_ERR_INVALID_VALUE; }
|
||||
@@ -706,19 +706,39 @@ static inline NWC24Err SetDlTaskAccessTime(NWC24DlTask* dlTask, OSTime time) {
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
static inline NWC24Err CheckDlTaskRetry(NWC24DlTask* dlTask, u8 retryCount) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
NWC24Err result = ValidateDlTask(dlTask, FALSE);
|
||||
u32 retryMask;
|
||||
if (result != NWC24_OK) { return result; }
|
||||
if (task->retryEnabled == 0) { return NWC24_ERR_INVALID_OPERATION; }
|
||||
retryMask = task->retryMask;
|
||||
if (retryMask == 0) { return NWC24_ERR_FATAL; }
|
||||
if (retryCount > 31) { return NWC24_ERR_INVALID_VALUE; }
|
||||
if ((retryMask & (1 << retryCount)) == 0) { return NWC24_ERR_DISABLED; }
|
||||
static inline NWC24Err CheckDlTaskForRetry(const DlTaskData* task) {
|
||||
DlTaskListHeader* header = NWC24WorkP == NULL ? NULL : (DlTaskListHeader*)NWC24WorkP->dlHead;
|
||||
if (task == NULL) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
if (header == NULL) {
|
||||
return NWC24_ERR_LIB_NOT_OPENED;
|
||||
}
|
||||
if (task->id != 0xffff && task->id >= header->maxTaskCount) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
return NWC24_OK;
|
||||
}
|
||||
static inline NWC24Err UpdateDlTaskAccessTime(NWC24DlTask* dlTask) {
|
||||
|
||||
static inline NWC24Err CheckDlTaskRetry(const NWC24DlTask* dlTask, u8 retryCount) {
|
||||
const DlTaskData* task = (const DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
result = CheckDlTaskForRetry(task);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
if (task->retryEnabled == 0) {
|
||||
return NWC24_ERR_INVALID_OPERATION;
|
||||
}
|
||||
if (task->retryMask == 0) {
|
||||
return NWC24_ERR_FATAL;
|
||||
}
|
||||
if (retryCount > 31) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
return ((1U << retryCount) & task->retryMask) == 0 ? NWC24_ERR_DISABLED : NWC24_OK;
|
||||
}
|
||||
static inline NWC24Err UpdateDlTaskAccessTime(const NWC24DlTask* dlTask) {
|
||||
OSTime universalTime;
|
||||
NWC24Err result = NWC24iGetUniversalTime(&universalTime);
|
||||
if (result >= NWC24_OK) {
|
||||
@@ -728,24 +748,61 @@ static inline NWC24Err UpdateDlTaskAccessTime(NWC24DlTask* dlTask) {
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline BOOL IsDlTaskWritableGroup(u32 groupId, u32 flags) {
|
||||
BOOL allowed = FALSE;
|
||||
if (flags & 0x40) {
|
||||
if (groupId == NWC24GetGroupId()) {
|
||||
allowed = TRUE;
|
||||
}
|
||||
}
|
||||
return allowed;
|
||||
}
|
||||
|
||||
static inline NWC24Err ValidateWritableDlTask(const NWC24DlTask* dlTask) {
|
||||
const DlTaskData* task = (const DlTaskData*)dlTask;
|
||||
DlTaskListHeader* header = GetCachedDlHeader();
|
||||
if (task == NULL) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
if (header == NULL) {
|
||||
return NWC24_ERR_LIB_NOT_OPENED;
|
||||
}
|
||||
if (!NWC24IsMsgLibOpenedByTool() && !IsDlTaskOwner(task->appId)) {
|
||||
BOOL allowed = IsDlTaskWritableGroup(task->groupId, task->flags);
|
||||
if (!allowed) {
|
||||
return NWC24_ERR_PROTECTED;
|
||||
}
|
||||
}
|
||||
if (task->id != 0xffff && task->id >= header->maxTaskCount) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
static inline NWC24Err ClearDlTaskError(NWC24DlTask* dlTask) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
result = ValidateWritableDlTask(dlTask);
|
||||
if (result != NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
task->unknown_0x20 = 0;
|
||||
task->unknown_0x1a = 0;
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
NWC24Err NWC24UpdateDlTask(NWC24DlTask* dlTask) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
DlTaskListHeader* header;
|
||||
u16 taskId;
|
||||
OSTime universalTime;
|
||||
NWC24Err result;
|
||||
|
||||
result = ValidateDlTask(dlTask, TRUE);
|
||||
result = ValidateWritableDlTask(dlTask);
|
||||
if (result != NWC24_OK) { return result; }
|
||||
taskId = task->id;
|
||||
if (taskId == 0xffff || taskId >= GetCachedDlHeader()->maxTaskCount) { return NWC24_ERR_INVALID_VALUE; }
|
||||
result = UpdateDlTaskAccessTime(dlTask);
|
||||
if (result < NWC24_OK) { return result; }
|
||||
result = ValidateDlTask(dlTask, TRUE);
|
||||
if (result == NWC24_OK) {
|
||||
task->unknown_0x20 = 0;
|
||||
task->unknown_0x1a = 0;
|
||||
}
|
||||
ClearDlTaskError(dlTask);
|
||||
if (task->retryEnabled == 1) {
|
||||
while ((result = CheckDlTaskRetry(dlTask, task->retryCount)) == NWC24_ERR_DISABLED) {
|
||||
task->retryCount = (task->retryCount + 1) & 0x1f;
|
||||
@@ -1044,6 +1101,7 @@ closeList:
|
||||
NWC24Err NWC24iCheckDlHeaderConsistency(DlTaskListHeader* header, BOOL repair) {
|
||||
NWC24DlTask task;
|
||||
NWC24DlTask* taskPointer = &task;
|
||||
NWC24DlTask* readTask = &task;
|
||||
NWC24DlId taskId;
|
||||
NWC24Err result;
|
||||
DlTaskListHeader* currentHeader;
|
||||
@@ -1060,7 +1118,7 @@ NWC24Err NWC24iCheckDlHeaderConsistency(DlTaskListHeader* header, BOOL repair) {
|
||||
if (currentHeader->entries[taskId].appId == 0) { result = NWC24_ERR_NOT_FOUND; }
|
||||
}
|
||||
if (result != NWC24_OK || !shouldRepair) { continue; }
|
||||
result = ReadDlTaskInline(taskPointer, taskId);
|
||||
result = ReadDlTaskInline(readTask, taskId);
|
||||
if (result < NWC24_OK) {
|
||||
if (ValidateDlTask(taskPointer, FALSE) == NWC24_OK) {
|
||||
result = DeleteDlTask(taskPointer);
|
||||
@@ -1227,32 +1285,44 @@ NWC24Err StoreDlTask(NWC24DlTask* dlTask) {
|
||||
return closeResult;
|
||||
}
|
||||
|
||||
static inline NWC24Err ValidateDlTaskUrl(NWC24DlTask* dlTask) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
DlTaskListHeader* header = GetCachedDlHeader();
|
||||
static inline NWC24Err CheckDlUrl(const DlTaskData* task) {
|
||||
const char* url = task->url;
|
||||
NWC24Err result;
|
||||
if (task->id >= header->maxTaskCount && task->id != 0xffff) { return NWC24_ERR_INVALID_VALUE; }
|
||||
{
|
||||
const char* url = task->url;
|
||||
result = NWC24iCheckStringLength(url, 7, 0x100);
|
||||
if (result >= NWC24_OK) {
|
||||
if (strncmp(url, "http://", 7) != 0 && strncmp(url, "https://", 8) != 0) { result = NWC24_ERR_FORMAT; }
|
||||
else { result = NWC24_OK; }
|
||||
}
|
||||
if (result < NWC24_OK) { return result; }
|
||||
return NWC24_OK;
|
||||
result = NWC24iCheckStringLength(url, 7, 0x100);
|
||||
if (result < NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
if (strncmp(url, "http://", 7) != 0 && strncmp(url, "https://", 8) != 0) {
|
||||
return NWC24_ERR_FORMAT;
|
||||
}
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
static inline NWC24Err FindFreeDlTask(NWC24DlTask* dlTask, u16 taskCount, u16 maxTaskCount) {
|
||||
static inline DlTaskEntry* GetDlTaskEntryHeader(u16 taskId) {
|
||||
return &GetCachedDlHeader()->entries[taskId];
|
||||
}
|
||||
|
||||
static inline NWC24Err ValidateDlTaskUrl(const NWC24DlTask* dlTask) {
|
||||
const DlTaskData* task = (const DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
if (task->id >= GetCachedDlHeader()->maxTaskCount && task->id != 0xffff) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
result = CheckDlUrl(task);
|
||||
if (result < NWC24_OK) {
|
||||
return result;
|
||||
}
|
||||
return NWC24_OK;
|
||||
}
|
||||
|
||||
static inline NWC24Err FindFreeDlTask(NWC24DlTask* dlTask, u32 taskCount, u32 maxTaskCount) {
|
||||
DlTaskListHeader* header = GetCachedDlHeader();
|
||||
NWC24DlId taskId;
|
||||
if (dlTask == NULL || taskCount > maxTaskCount || taskCount >= header->maxTaskCount || maxTaskCount > header->maxTaskCount) {
|
||||
return NWC24_ERR_INVALID_VALUE;
|
||||
}
|
||||
for (taskId = taskCount; taskId < maxTaskCount; taskId++) {
|
||||
header = GetCachedDlHeader();
|
||||
if (header->entries[taskId].appId == 0) {
|
||||
if (GetDlTaskEntryHeader(taskId)->appId == 0) {
|
||||
((DlTaskData*)dlTask)->id = taskId;
|
||||
return NWC24_OK;
|
||||
}
|
||||
@@ -1260,24 +1330,10 @@ static inline NWC24Err FindFreeDlTask(NWC24DlTask* dlTask, u16 taskCount, u16 ma
|
||||
return NWC24_ERR_FULL;
|
||||
}
|
||||
|
||||
static inline NWC24Err UpdateDlTaskInline(NWC24DlTask* dlTask) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
DlTaskListHeader* header;
|
||||
u16 taskId;
|
||||
OSTime universalTime;
|
||||
NWC24Err result;
|
||||
|
||||
result = ValidateDlTask(dlTask, TRUE);
|
||||
if (result != NWC24_OK) { return result; }
|
||||
taskId = task->id;
|
||||
if (taskId == 0xffff || taskId >= GetCachedDlHeader()->maxTaskCount) { return NWC24_ERR_INVALID_VALUE; }
|
||||
result = UpdateDlTaskAccessTime(dlTask);
|
||||
if (result < NWC24_OK) { return result; }
|
||||
result = ValidateDlTask(dlTask, TRUE);
|
||||
if (result == NWC24_OK) {
|
||||
task->unknown_0x20 = 0;
|
||||
task->unknown_0x1a = 0;
|
||||
}
|
||||
static inline NWC24Err RetryAndStoreDlTask(NWC24DlTask* dlTask) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
if (task->retryEnabled == 1) {
|
||||
while ((result = CheckDlTaskRetry(dlTask, task->retryCount)) == NWC24_ERR_DISABLED) {
|
||||
task->retryCount = (task->retryCount + 1) & 0x1f;
|
||||
@@ -1286,6 +1342,19 @@ static inline NWC24Err UpdateDlTaskInline(NWC24DlTask* dlTask) {
|
||||
}
|
||||
return StoreDlTask(dlTask);
|
||||
}
|
||||
|
||||
static inline NWC24Err UpdateDlTaskInline(NWC24DlTask* dlTask) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
|
||||
result = ValidateWritableDlTask(dlTask);
|
||||
if (result != NWC24_OK) { return result; }
|
||||
if (task->id == 0xffff || task->id >= GetCachedDlHeader()->maxTaskCount) { return NWC24_ERR_INVALID_VALUE; }
|
||||
result = UpdateDlTaskAccessTime(dlTask);
|
||||
if (result < NWC24_OK) { return result; }
|
||||
ClearDlTaskError(dlTask);
|
||||
return RetryAndStoreDlTask(dlTask);
|
||||
}
|
||||
NWC24Err AddTaskInternal(NWC24DlTask* dlTask, u16 taskCount, u16 maxTaskCount) {
|
||||
DlTaskData* task = (DlTaskData*)dlTask;
|
||||
NWC24Err result;
|
||||
|
||||
@@ -73,22 +73,28 @@ NWC24Err NWC24ReadMsgSubjectPublic(const NWC24MsgObj* msg, u16* subject, u32* su
|
||||
truncated = TRUE;
|
||||
}
|
||||
result = NWC24ReadMsgSubject(msg, (char*)work, subjectDataSize);
|
||||
if (result != NWC24_OK) {
|
||||
if (result == NWC24_ERR_OVERFLOW) {
|
||||
truncated = TRUE;
|
||||
} else {
|
||||
goto done;
|
||||
}
|
||||
switch (result) {
|
||||
case NWC24_OK:
|
||||
break;
|
||||
default:
|
||||
if (result == NWC24_ERR_OVERFLOW) {
|
||||
truncated = TRUE;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
charsetBuffer = NWC24WorkP->stringWork;
|
||||
result =
|
||||
NWC24DecodeMIMEHeaderFieldBody((u8*)charsetBuffer, 0x40, decodedData, decodedCapacity, &decodedSize, work, subjectDataSize);
|
||||
if (result != NWC24_OK) {
|
||||
if (result == NWC24_ERR_OVERFLOW) {
|
||||
truncated = TRUE;
|
||||
} else {
|
||||
goto done;
|
||||
}
|
||||
switch (result) {
|
||||
case NWC24_OK:
|
||||
break;
|
||||
default:
|
||||
if (result == NWC24_ERR_OVERFLOW) {
|
||||
truncated = TRUE;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
*subjectSize = originalSize;
|
||||
result =
|
||||
@@ -140,11 +146,15 @@ NWC24Err NWC24ReadMsgTextPublic(const NWC24MsgObj* msg, u16* text, u32* textSize
|
||||
}
|
||||
charsetBuffer = NWC24WorkP->stringWork + 0x20;
|
||||
result = NWC24ReadMsgTextEx(msg, (char*)work, textDataSize, charsetBuffer, 0x40);
|
||||
if (result != NWC24_OK) {
|
||||
if (result != NWC24_ERR_OVERFLOW) {
|
||||
goto done;
|
||||
}
|
||||
truncated = TRUE;
|
||||
switch (result) {
|
||||
case NWC24_OK:
|
||||
break;
|
||||
default:
|
||||
if (result == NWC24_ERR_OVERFLOW) {
|
||||
truncated = TRUE;
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
*textSize = originalSize;
|
||||
@@ -233,11 +243,12 @@ NWC24Err NWC24SetMsgSubjectAndTextPublic(NWC24MsgObj* msg, const u16* subject, u
|
||||
NWC24MsgObjPrivate* privateMsg = (NWC24MsgObjPrivate*)msg;
|
||||
NWC24Work* nwcWork;
|
||||
u32 textSourceSize;
|
||||
u32 textCapacity;
|
||||
u32 textWorkSize;
|
||||
BOOL is7Bit;
|
||||
NWC24Charset charset;
|
||||
u32 subjectWorkSize;
|
||||
u8* subjectWork;
|
||||
u32 subjectWorkSize;
|
||||
NWC24Err result;
|
||||
|
||||
if (((privateMsg->type & 0x100) == 0) || ((privateMsg->type & 0x200) != 0)) {
|
||||
@@ -273,7 +284,8 @@ NWC24Err NWC24SetMsgSubjectAndTextPublic(NWC24MsgObj* msg, const u16* subject, u
|
||||
if (NWC24ParseCharsetStr(&charset, nwcWork->stringWork) != NWC24_OK) {
|
||||
charset = 0;
|
||||
}
|
||||
textWorkSize = (workSize * textSize) / (textSize + subjectSize * 4);
|
||||
textCapacity = (workSize * textSize) / (textSize + subjectSize * 4);
|
||||
textWorkSize = textCapacity;
|
||||
subjectWorkSize = workSize - textWorkSize;
|
||||
subjectWork = work + textWorkSize;
|
||||
textSourceSize = textSize;
|
||||
|
||||
@@ -488,7 +488,7 @@ BOOL BS2StartLoadingTitle(ESTitleId titleId, ESTicketView *pTicketView) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void callback(s32 result) { LowReadResult = result; }
|
||||
static void callback(u32 result) { LowReadResult = result; }
|
||||
|
||||
ESError BS2ESGetTicketViews(IOSFd *descriptor, ESTitleId titleId, ESTicketView *views, u32 *count) {
|
||||
struct {
|
||||
@@ -725,7 +725,7 @@ void BS2StartGame() {
|
||||
BS2Report("DVDLowInit done\n");
|
||||
|
||||
LowReadResult = 0;
|
||||
DVDLowReadDiskID(&DiskID, (DVDLowCallback)callback);
|
||||
DVDLowReadDiskID(&DiskID, callback);
|
||||
while (LowReadResult == 0) {
|
||||
}
|
||||
|
||||
@@ -739,7 +739,7 @@ void BS2StartGame() {
|
||||
} else {
|
||||
OSReport("\nDisk error(%d) has occurred", LowReadResult);
|
||||
LowReadResult = 0;
|
||||
DVDLowRequestError((DVDLowCallback)callback);
|
||||
DVDLowRequestError(callback);
|
||||
while (LowReadResult == 0) {
|
||||
}
|
||||
driveError = DVDLowGetImmBufferReg() & 0xFF000000;
|
||||
@@ -769,10 +769,10 @@ disk_done:
|
||||
if (PartitionParams.numTmdBytes != 0) {
|
||||
DVDLowOpenPartitionWithTmdAndTicketView((u32)((DVDPartitionInfo *)GamePartition)->partition, &PartitionParams.ticketView,
|
||||
PartitionParams.numTmdBytes, &PartitionParams.tmd, PartitionParams.numCertBytes,
|
||||
PartitionParams.certificates, (DVDLowCallback)callback);
|
||||
PartitionParams.certificates, callback);
|
||||
} else {
|
||||
DVDLowOpenPartition((u32)((DVDPartitionInfo *)GamePartition)->partition, NULL, 0, NULL, &PartitionParams.tmd,
|
||||
(DVDLowCallback)callback);
|
||||
callback);
|
||||
}
|
||||
while (LowReadResult == 0) {
|
||||
}
|
||||
@@ -790,7 +790,7 @@ disk_done:
|
||||
} else {
|
||||
OSReport("\nDisk error(%d) has occurred", LowReadResult);
|
||||
LowReadResult = 0;
|
||||
DVDLowRequestError((DVDLowCallback)callback);
|
||||
DVDLowRequestError(callback);
|
||||
while (LowReadResult == 0) {
|
||||
}
|
||||
driveError = DVDLowGetImmBufferReg() & 0xFF000000;
|
||||
@@ -1357,9 +1357,10 @@ BS2State BS2Tick() {
|
||||
(*(u32 *)0x800030d4) = 0;
|
||||
DvdTransferred = 0;
|
||||
DvdTransferLength = 0;
|
||||
status = BS2NoDisk;
|
||||
AudioBufferUnconfigured = 1;
|
||||
CoverBlock.state = 0;
|
||||
if (BS2NoDisk != 0)
|
||||
if (status != 0)
|
||||
State = BS2_STT_NO_DISK;
|
||||
else if (BS2DriveReset != 0)
|
||||
State = BS2_STT_2;
|
||||
|
||||
@@ -23,10 +23,10 @@ s32 WADImportDVDForBS(const char* path, void* buffer, u32 length);
|
||||
s32 WADImportDVDExForBS(const char* path, void* buffer, u32 length);
|
||||
|
||||
static BS2UpdateEntry* pEntries = NULL;
|
||||
static u32 EntriesCount = 0;
|
||||
static volatile u32 EntriesCount = 0;
|
||||
static u32* pFlags = NULL;
|
||||
static void* MemAllocator = NULL;
|
||||
int State = 0;
|
||||
volatile int State = 0;
|
||||
BS2UpdateEntry* CurrentEntry = 0;
|
||||
static u32 RebootRequired = 0;
|
||||
static BOOL ContainsSeatTitles = 0;
|
||||
@@ -77,7 +77,8 @@ void BS2UpdateInit(void* allocator) {
|
||||
OSResumeThread(&Thread);
|
||||
}
|
||||
|
||||
static void* UpdateThread(void* argument) {
|
||||
static inline u32 BS2SelectUpdateEntries(void) {
|
||||
|
||||
BOOL missingFile;
|
||||
u32 selectedCount;
|
||||
u32 requiredBytes;
|
||||
@@ -89,7 +90,6 @@ static void* UpdateThread(void* argument) {
|
||||
u32 selectedSeatCount;
|
||||
BOOL regionValid;
|
||||
u32 titleRegion;
|
||||
s32 importResult;
|
||||
struct {
|
||||
u32 freeChannels;
|
||||
u32 freeBlocks;
|
||||
@@ -102,9 +102,6 @@ static void* UpdateThread(void* argument) {
|
||||
DVDFileInfo file;
|
||||
} scratch;
|
||||
|
||||
BS2Report("Start update thread\n");
|
||||
StartUpdate = 0;
|
||||
CancelUpdate = 0;
|
||||
missingFile = FALSE;
|
||||
selectedCount = 0;
|
||||
requiredBytes = 0;
|
||||
@@ -162,12 +159,12 @@ product_region_checked:
|
||||
if (!regionValid) {
|
||||
BS2Report("Error: failed to check product region.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
if (!SCGetProductAreaString(scratch.productArea, sizeof(scratch.productArea))) {
|
||||
BS2Report("Error: failed to get product information.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
strcpy(scratch.updatePath, "__update.inf");
|
||||
strcat(scratch.updatePath, ".");
|
||||
@@ -183,46 +180,46 @@ product_region_checked:
|
||||
if (DVDConvertPathToEntrynum(scratch.updatePath) < 0) {
|
||||
BS2Report("Error: update information file is not found.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
BS2Report("Error: update information file is not found.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
}
|
||||
BS2Report("%s is found.\n", scratch.updatePath);
|
||||
if (!DVDOpen(scratch.updatePath, &scratch.file)) {
|
||||
BS2Report("Error: failed to open update information file.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
if (DVDReadPrio(&scratch.file, &UpdateHeader0, sizeof(UpdateHeader0), 0, 2) < 0) {
|
||||
BS2Report("Error: failed to read update information header.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
if (UpdateHeader0.wadCount == 0) {
|
||||
BS2Report("Error: no entry.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
if (UpdateHeader0.wadCount > 32) {
|
||||
BS2Report("Error: found too many entries.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
UpdateHeader0.wadCount += UpdateHeader0.extraCount;
|
||||
if (UpdateHeader0.wadCount > BS2_UPDATE_ENTRY_COUNT) {
|
||||
BS2Report("Error: found too many extra entries.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
if (DVDReadPrio(&scratch.file, UPDATE_DISC_ENTRIES, UpdateHeader0.wadCount * sizeof(BS2UpdateEntry), 32, 2) < 0) {
|
||||
BS2Report("Error: failed to read update information.");
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
{
|
||||
BS2UpdateEntry *discEntries = UPDATE_DISC_ENTRIES;
|
||||
@@ -245,7 +242,7 @@ product_region_checked:
|
||||
BS2Report("Cannot get physical MEM2 size\n");
|
||||
State = 5;
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
if (DVDOpen(discEntries[index].path, &scratch.file) < 0) {
|
||||
BS2Report("%s is not found\n", discEntries[index].path);
|
||||
@@ -305,8 +302,10 @@ product_region_checked:
|
||||
BS2Report("Error: found too many extra entries.");
|
||||
goto seats_done;
|
||||
}
|
||||
seatEntries = &UPDATE_DISC_ENTRIES[UpdateHeader0.wadCount];
|
||||
selectedSeats = &EntriesToImport[selectedCount];
|
||||
seatEntries = UPDATE_DISC_ENTRIES;
|
||||
seatEntries += UpdateHeader0.wadCount;
|
||||
selectedSeats = EntriesToImport;
|
||||
selectedSeats += selectedCount;
|
||||
if (DVDReadPrio(&scratch.file, seatEntries, UpdateHeader1.wadCount * sizeof(BS2UpdateEntry), 32, 2) < 0) {
|
||||
BS2Report("Error: failed to read update information.");
|
||||
goto seats_done;
|
||||
@@ -408,7 +407,7 @@ seats_done:
|
||||
if (missingFile) {
|
||||
State = 5;
|
||||
selectedCount = 0;
|
||||
goto selection_done;
|
||||
goto selection_complete;
|
||||
}
|
||||
pEntries = EntriesToImport;
|
||||
pFlags = Flags1;
|
||||
@@ -424,8 +423,17 @@ seats_done:
|
||||
}
|
||||
}
|
||||
}
|
||||
selection_done:
|
||||
EntriesCount = selectedCount;
|
||||
selection_complete:
|
||||
return selectedCount;
|
||||
}
|
||||
|
||||
static void* UpdateThread(void* argument) {
|
||||
u32 index;
|
||||
s32 importResult;
|
||||
BS2Report("Start update thread\n");
|
||||
StartUpdate = 0;
|
||||
CancelUpdate = 0;
|
||||
EntriesCount = BS2SelectUpdateEntries();
|
||||
if (EntriesCount == 0) {
|
||||
State = 5;
|
||||
StartUpdate = 0;
|
||||
@@ -449,7 +457,7 @@ selection_done:
|
||||
UpdateProgress++;
|
||||
continue;
|
||||
}
|
||||
if (discEntries[UpdateProgress].type == 1) {
|
||||
if (((const BS2UpdateEntry *)discEntries)[UpdateProgress].type == 1) {
|
||||
BS2Report("BS2WADImportDVD : ");
|
||||
index = UpdateProgress;
|
||||
if (strcmp(getSuffix(discEntries[index].path), "wad") == 0) {
|
||||
@@ -502,8 +510,8 @@ selection_done:
|
||||
} else {
|
||||
State = 3;
|
||||
}
|
||||
UpdateProgress++;
|
||||
CurrentEntry = NULL;
|
||||
UpdateProgress++;
|
||||
break;
|
||||
}
|
||||
} else if (CancelUpdate != 0) {
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
typedef struct {
|
||||
u64 work[0xD0 / sizeof(u64)];
|
||||
} NETHMACContext;
|
||||
static const void* NETGetSHA1Interface(void);
|
||||
static void NETHMACInit(NETHMACContext* ctx, const void* interface, const void* key, u32 keyLen);
|
||||
static void NETHMACUpdate(NETHMACContext* ctx, const void* data, u32 len);
|
||||
static void NETHMACGetDigest(NETHMACContext* ctx, void* digest);
|
||||
extern const void* NETGetSHA1Interface(void);
|
||||
extern void NETHMACInit(NETHMACContext* ctx, const void* interface, const void* key, u32 keyLen);
|
||||
extern void NETHMACUpdate(NETHMACContext* ctx, const void* data, u32 len);
|
||||
extern void NETHMACGetDigest(NETHMACContext* ctx, void* digest);
|
||||
extern char VmReportFormat[];
|
||||
|
||||
#define CHANSVmDebugLength 1024
|
||||
@@ -54,7 +54,6 @@ const u64 VmMinusInf = 0xFFF0000000000000ULL;
|
||||
#define VM_READ_BE_U16(b, o) ((u16)((b)[(o)] << 8 | (b)[(o) + 1]))
|
||||
#define VM_READ_BE_U24(b, o) ((u32)((b)[(o)] << 16 | (b)[(o) + 1] << 8 | (b)[(o) + 2]))
|
||||
#define VM_MAKE_U64(hi, lo) ((u64)(u32)(hi) << 32 | (u64)(lo))
|
||||
#define VM_S64_FROM_U64(v) ((s64)(u32)((v) >> 32) << 32 | (u64)(u32)(v))
|
||||
|
||||
void CHANSVmDebugPrintf(const vmString format, ...) {
|
||||
va_list args;
|
||||
@@ -1414,7 +1413,7 @@ CHANSVmErr VmCmpGeq(CHANSVm* vm, CHANSVmObjType type, CHANSVmObjHdr* ret, CHANSV
|
||||
return VmCmpLeq(vm, type, ret, right, left);
|
||||
}
|
||||
|
||||
CHANSVmErr CHANSVmGetBoolean(CHANSVmObjHdr* ret, CHANSVmObjHdr* val) {
|
||||
CHANSVmErr CHANSVmGetBoolean(vmBoolInt* ret, CHANSVmObjHdr* val) {
|
||||
vmBoolInt result;
|
||||
switch (val->type) {
|
||||
case CHANS_VM_OBJ_TYPE_BLANK: {
|
||||
@@ -1448,7 +1447,7 @@ CHANSVmErr CHANSVmGetBoolean(CHANSVmObjHdr* ret, CHANSVmObjHdr* val) {
|
||||
}
|
||||
}
|
||||
if (ret != vmNull) {
|
||||
ret->value.bool_v = result;
|
||||
*ret = result;
|
||||
}
|
||||
return CHANS_VM_OK;
|
||||
}
|
||||
@@ -3070,20 +3069,22 @@ VmMethodDefine(String, Search) {
|
||||
return VmStringObjectIndex(VmInst, VmParentObj, VmReturnObj, 1, 1);
|
||||
}
|
||||
|
||||
VmMethodDefine(String, Replace) {
|
||||
static inline vmBoolInt VmReplaceStringContents(CHANSVm *VmInst, const CHANSVmObjHdr *VmParentObj, CHANSVmObjHdr *VmReturnObj) {
|
||||
CHANSVmObjHdr* arg0;
|
||||
CHANSVmObjHdr* arg1;
|
||||
vmString parentStr;
|
||||
vmString searchStr;
|
||||
vmString replaceStr;
|
||||
u32 parentLen;
|
||||
u32 srcOffs;
|
||||
u32 dstOffs;
|
||||
u32 searchLen;
|
||||
u32 replaceLen;
|
||||
u32 dstBufLen;
|
||||
vmString searchStr;
|
||||
vmString parentStr;
|
||||
vmString newStr;
|
||||
u32 dstBufLen;
|
||||
u32 replaceLen;
|
||||
u32 dstOffs;
|
||||
CHANSVmObjHdr* arg1;
|
||||
u32 searchLen;
|
||||
u32 srcOffs;
|
||||
u32 parentLen;
|
||||
u32 segLen;
|
||||
const vmStringObjVal *parentValue;
|
||||
const vmStringObjVal *searchValue;
|
||||
|
||||
if (((CHANSVmPrivate*)VmInst)->pActiveCtx->argc < 2) {
|
||||
goto return_input;
|
||||
@@ -3098,10 +3099,12 @@ VmMethodDefine(String, Replace) {
|
||||
goto return_input;
|
||||
}
|
||||
|
||||
parentLen = VmParentObj->value.string_v->len;
|
||||
searchLen = arg0->value.string_v->len;
|
||||
parentStr = VmParentObj->value.string_v->spData;
|
||||
searchStr = arg0->value.string_v->spData;
|
||||
parentValue = VmParentObj->value.string_v;
|
||||
searchValue = arg0->value.string_v;
|
||||
parentLen = parentValue->len;
|
||||
searchLen = searchValue->len;
|
||||
parentStr = parentValue->spData;
|
||||
searchStr = searchValue->spData;
|
||||
replaceStr = arg1->value.string_v->spData;
|
||||
replaceLen = arg1->value.string_v->len;
|
||||
|
||||
@@ -3169,12 +3172,16 @@ VmMethodDefine(String, Replace) {
|
||||
return VmReturnObj->value.string_v->len == dstOffs ? vmTrue : vmFalse;
|
||||
|
||||
return_input:
|
||||
return VmStringObjectDup(VmInst, VmReturnObj, VmParentObj) ? vmTrue : vmFalse;
|
||||
return VmStringObjectDup(VmInst, VmReturnObj, (CHANSVmObjHdr *)VmParentObj) ? vmTrue : vmFalse;
|
||||
|
||||
error:
|
||||
return 0;
|
||||
}
|
||||
|
||||
VmMethodDefine(String, Replace) {
|
||||
return VmReplaceStringContents(VmInst, VmParentObj, VmReturnObj);
|
||||
}
|
||||
|
||||
VmMethodDefine(String, Splice) {
|
||||
CHANSVmObjHdr* arg0;
|
||||
CHANSVmObjHdr* arg1;
|
||||
@@ -5133,7 +5140,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
|
||||
goto error;
|
||||
}
|
||||
argCount++;
|
||||
totalSize += (count + 1) / 2;
|
||||
totalSize += (s32)((u32)count + 1U) / 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -5423,7 +5430,7 @@ static vmBoolInt VmBlobPackCommon(CHANSVm* VmInst, CHANSVmObjHdr* VmParentObj, C
|
||||
goto error;
|
||||
}
|
||||
|
||||
bufSize = (count + 1) / 2;
|
||||
bufSize = (s32)((u32)count + 1U) / 2;
|
||||
if (!CHANSVmBlobHasSpace(parentBlob, bufSize)) {
|
||||
goto error;
|
||||
}
|
||||
@@ -6929,7 +6936,7 @@ static u8* VmGetOperand(CHANSVm* vm, u32 num, u32 offset) {
|
||||
}
|
||||
|
||||
static CHANSVmErr VmLoadImmInteger(CHANSVm* vm, CHANSVmObjHdr* obj, u8* buf, s32 count) {
|
||||
s64 acc = 0;
|
||||
u64 acc = 0;
|
||||
u8* p = buf;
|
||||
|
||||
while (count != 0) {
|
||||
@@ -6939,7 +6946,7 @@ static CHANSVmErr VmLoadImmInteger(CHANSVm* vm, CHANSVmObjHdr* obj, u8* buf, s32
|
||||
count--;
|
||||
}
|
||||
|
||||
return CHANSVmSetInteger(vm, obj, acc);
|
||||
return CHANSVmSetInteger(vm, obj, (vmInteger)acc);
|
||||
}
|
||||
|
||||
CHANSVmErr VmStore(CHANSVm* vm, CHANSVmObjHdr* dest, CHANSVmObjHdr* src) {
|
||||
@@ -7234,7 +7241,7 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
CHANSVmErr result;
|
||||
u32 newPos;
|
||||
u32 isTypeMatch;
|
||||
u32 shouldBranch;
|
||||
vmBoolInt shouldBranch;
|
||||
|
||||
if (pVm->bSignalUpdated != vmFalse && pVm->bSignalBlocked == vmFalse) {
|
||||
pVm->bSignalUpdated = vmFalse;
|
||||
@@ -7623,8 +7630,8 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
|
||||
case CHANS_VM_OP_LOG_NOT: {
|
||||
CHANSVmObjHdr* pAcc = &pVm->accumulator;
|
||||
u32 bResult;
|
||||
CHANSVmErr booleanResult = CHANSVmGetBoolean((CHANSVmObjHdr*)&bResult, pAcc);
|
||||
vmBoolInt bResult;
|
||||
CHANSVmErr booleanResult = CHANSVmGetBoolean(&bResult, pAcc);
|
||||
if (booleanResult == CHANS_VM_OK) {
|
||||
s32 boolVal = bResult ? 0 : 1;
|
||||
booleanResult = CHANSVmSetInteger(vm, pAcc, boolVal);
|
||||
@@ -7781,8 +7788,7 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
cmpHigh = 0;
|
||||
cmpLow = -2;
|
||||
cmpVal = VM_MAKE_U64(cmpHigh, cmpLow);
|
||||
fullVal = VM_S64_FROM_U64(tmp64);
|
||||
if ((u64)fullVal <= cmpVal) {
|
||||
if (tmp64 <= cmpVal) {
|
||||
arrayIdx = (u32)tmp64;
|
||||
goto set_index_ok;
|
||||
}
|
||||
@@ -8065,14 +8071,14 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
break;
|
||||
}
|
||||
case CHANS_VM_OP_BRANCH_FALSE: {
|
||||
result = CHANSVmGetBoolean((CHANSVmObjHdr*)&shouldBranch, &pVm->accumulator);
|
||||
result = CHANSVmGetBoolean(&shouldBranch, &pVm->accumulator);
|
||||
if (result == CHANS_VM_OK) {
|
||||
shouldBranch = !shouldBranch;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CHANS_VM_OP_BRANCH_TRUE: {
|
||||
result = CHANSVmGetBoolean((CHANSVmObjHdr*)&shouldBranch, &pVm->accumulator);
|
||||
result = CHANSVmGetBoolean(&shouldBranch, &pVm->accumulator);
|
||||
break;
|
||||
}
|
||||
case CHANS_VM_OP_BRANCH_ALWAYS: {
|
||||
|
||||
@@ -404,7 +404,9 @@ namespace textinput {
|
||||
|
||||
void LayoutByNW4R::createAnmPane_(MEMAllocator* allocator) {
|
||||
CandidateTextAnmPane* pane;
|
||||
for (u16 i = 0; i < ARRAY_LENGTH(scCandidatePaneData.panes); i++) {
|
||||
u16 j;
|
||||
u16 i;
|
||||
for (i = 0; i < ARRAY_LENGTH(scCandidatePaneData.panes); i++) {
|
||||
pane = NULL;
|
||||
const PaneToAnimation& p = scCandidatePaneData.panes[i];
|
||||
switch (p.type) {
|
||||
@@ -433,16 +435,18 @@ namespace textinput {
|
||||
|
||||
nw4r::ut::List_Append(&mAnmPanes, pane);
|
||||
|
||||
for (u16 j = 0; j < p.count; j++) {
|
||||
const AnimationFile* animation = p.pAnims[j];
|
||||
void* pResource = mpMultiArcResourceAccessor->GetResource(0, p.pAnims[j]->fileName);
|
||||
const char* forceAddName = p.forceAddName;
|
||||
u32 animationCount = p.count;
|
||||
for (j = 0; j < animationCount; j++) {
|
||||
const AnimationFile* const& animation = p.pAnims[j];
|
||||
void* pResource = mpMultiArcResourceAccessor->GetResource(0, animation->fileName);
|
||||
AnimTransformPane* transform =
|
||||
static_cast<AnimTransformPane*>(getLayout()->CreateAnimTransform(pResource, mpMultiArcResourceAccessor));
|
||||
|
||||
if (p.forceAddName == NULL) {
|
||||
if (forceAddName == NULL) {
|
||||
pane->addAnimation(allocator, animation->id, transform, false, true);
|
||||
} else {
|
||||
pane->forceAddAnimation(allocator, animation->id, transform, p.forceAddName, false, true);
|
||||
pane->forceAddAnimation(allocator, animation->id, transform, forceAddName, false, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1082,7 +1086,7 @@ namespace textinput {
|
||||
nw4r::lyt::TextBox* textPane = mpTextBoxPane[i]->getTextPane();
|
||||
nw4r::lyt::Bounding* boundPane = mpBoundingPane[i]->getBoundPane();
|
||||
nw4r::lyt::Size sz1 = textPane->GetSize();
|
||||
textPane->SetString(L"");
|
||||
textPane->SetString(scEmptyWChars);
|
||||
textPane->SetVisible(false);
|
||||
boundPane->SetSize(nw4r::lyt::Size(0.0f, sz1.height));
|
||||
}
|
||||
@@ -1683,9 +1687,9 @@ namespace textinput {
|
||||
|
||||
void UIOnOffButton::Create(nw4rmanager::Layout* layout) {
|
||||
gui::PaneManager* mgr = layout->getPaneManager();
|
||||
mpOnPictPane = mgr->searchPaneComponent("P_OnBtn");
|
||||
mpOnBoundPane = mgr->searchPaneComponent("B_OnBtn");
|
||||
mpOnAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane("P_OnBtn"));
|
||||
mpOnPictPane = mgr->searchPaneComponent(scP_OnBtn);
|
||||
mpOnBoundPane = mgr->searchPaneComponent(scB_OnBtn);
|
||||
mpOnAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(scP_OnBtn));
|
||||
mpOffPictPane = mgr->searchPaneComponent(scCandidatePaneData.tail);
|
||||
mpOffBoundPane = mgr->searchPaneComponent(scPaneNameTable);
|
||||
mpOffAnmPane = static_cast<OnOffAnmPane*>(layout->searchAnmPane(scCandidatePaneData.tail));
|
||||
|
||||
@@ -651,6 +651,24 @@ namespace textinput {
|
||||
setLanguage(getLanguage());
|
||||
}
|
||||
|
||||
static inline void initializeTogglePane(nw4rmanager::Layout& layout, void* const& inputModeTable,
|
||||
int inputMode, const char* paneName) {
|
||||
char textPaneName[17];
|
||||
memset(textPaneName, 0, sizeof(textPaneName));
|
||||
strncpy(textPaneName, paneName, strlen(paneName));
|
||||
textPaneName[0] = 'T';
|
||||
|
||||
nw4r::lyt::TextBox* textPane = static_cast<nw4r::lyt::TextBox*>(layout.getPane(textPaneName));
|
||||
nw4r::lyt::Pane* buttonPane = layout.getPane(paneName);
|
||||
const KeySet* keySet = static_cast<const LanguageDependencyData*>(inputModeTable)->keySets[inputMode];
|
||||
if (keySet == NULL) {
|
||||
buttonPane->SetVisible(false);
|
||||
} else {
|
||||
buttonPane->SetVisible(true);
|
||||
textPane->SetString(static_cast<const LanguageDependencyData*>(inputModeTable)->keySets[inputMode]->szKeySetName, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void LayoutByNW4R::init() {
|
||||
Base::init();
|
||||
|
||||
@@ -670,21 +688,7 @@ namespace textinput {
|
||||
setVisible("W_ChngTag_03", true);
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
const char* paneName = csPaneNameToggleAnimationKey[i].name;
|
||||
char textPaneName[17];
|
||||
memset(textPaneName, 0, sizeof(textPaneName));
|
||||
strncpy(textPaneName, paneName, strlen(paneName));
|
||||
textPaneName[0] = 'T';
|
||||
|
||||
nw4r::lyt::TextBox* textPane = static_cast<nw4r::lyt::TextBox*>(getPane(textPaneName));
|
||||
nw4r::lyt::Pane* buttonPane = getPane(paneName);
|
||||
const KeySet* keySet = static_cast<const LanguageDependencyData*>(mpInputModeTable)->keySets[i];
|
||||
if (keySet == NULL) {
|
||||
buttonPane->SetVisible(false);
|
||||
} else {
|
||||
buttonPane->SetVisible(true);
|
||||
textPane->SetString(static_cast<const LanguageDependencyData*>(mpInputModeTable)->keySets[i]->szKeySetName, 0);
|
||||
}
|
||||
initializeTogglePane(*this, mpInputModeTable, i, csPaneNameToggleAnimationKey[i].name);
|
||||
}
|
||||
|
||||
if (getLanguage() == JP) {
|
||||
|
||||
@@ -1169,7 +1169,7 @@ void LayoutByNW4R::create(MEMAllocator* allocator, EditBuffer* editBuffer) {
|
||||
setVisible("N_2line", true);
|
||||
mpPaneManager->setAllComponentTriggerTarget(false);
|
||||
mpPaneManager->setAllBoundingBoxComponentTriggerTarget(true);
|
||||
nw4r::lyt::Pane* pane = getPane(static_cast<const LanguagePaneData*>(mpLanguageData)->textBox);
|
||||
nw4r::lyt::Pane* pane = mpLayout->GetRootPane()->FindPaneByName(static_cast<const LanguagePaneData*>(mpLanguageData)->textBox, true);
|
||||
if (!pane) pane = mpLayout->GetRootPane()->FindPaneByName(getLanguageTextPane() ? static_cast<const LanguagePaneData*>(mpLanguageData)->textBox : "T_2l_TextBox", true);
|
||||
mpPaneManager->getPaneComponentByPane(pane)->setTriggerTarget(true);
|
||||
for (u32 buttonIndex = 0; buttonIndex < 2; ++buttonIndex) {
|
||||
@@ -1187,7 +1187,7 @@ void LayoutByNW4R::create(MEMAllocator* allocator, EditBuffer* editBuffer) {
|
||||
const char* bindingName = button.bindingName;
|
||||
count = button.count;
|
||||
for (u16 animationIndex = 0; animationIndex < count; ++animationIndex) {
|
||||
const InputFormAnimationFile* file = button.files[animationIndex];
|
||||
const InputFormAnimationFile* const& file = button.files[animationIndex];
|
||||
void* resource = mpMultiArcResourceAccessor->GetResource(0, file->fileName, NULL);
|
||||
AnimTransformPane* transform = static_cast<AnimTransformPane*>(getLayout()->CreateAnimTransform(resource, mpMultiArcResourceAccessor));
|
||||
if (!bindingName) animationPane->addAnimation(allocator, file->id, transform, false, true);
|
||||
@@ -1254,6 +1254,13 @@ void LayoutByNW4R::calc() {
|
||||
}
|
||||
}
|
||||
}
|
||||
static inline const char* selectInputTextName(const nw4rmanager::Layout& layout, const void* const& languageData) {
|
||||
if (layout.getPane(static_cast<const LanguagePaneData*>(languageData)->textBox)) {
|
||||
return static_cast<const LanguagePaneData*>(languageData)->textBox;
|
||||
}
|
||||
return "T_2l_TextBox";
|
||||
}
|
||||
|
||||
void LayoutByNW4R::setLanguage(Language language) {
|
||||
Base::setLanguage(language);
|
||||
if (language == CN) mpLanguageData = &csLanguageDependencyDataCHN__Q29textinput9inputform;
|
||||
@@ -1264,12 +1271,12 @@ void LayoutByNW4R::setLanguage(Language language) {
|
||||
else textName = static_cast<const LanguagePaneData*>(mpLanguageData)->textBox;
|
||||
mpLayoutData = textName;
|
||||
if (::strcmp(static_cast<const char*>(mpLayoutData), "T_2l_TextBox") != 0) setVisible("T_2l_TextBox", false);
|
||||
nw4r::lyt::Pane* pane = mpLayout->GetRootPane()->FindPaneByName(getLanguageTextPane() ? static_cast<const LanguagePaneData*>(mpLanguageData)->textBox : "T_2l_TextBox", true);
|
||||
nw4r::lyt::Pane* pane = mpLayout->GetRootPane()->FindPaneByName(selectInputTextName(*this, mpLanguageData), true);
|
||||
static_cast<nw4r::lyt::TextBox*>(pane)->SetString(L"", 0);
|
||||
const VisiblePanes* visibility = static_cast<const LanguagePaneData*>(mpLanguageData)->visibility;
|
||||
for (u16 index = 0; index < visibility->visibleCount; ++index) setVisible(visibility->visibleNames[index], true);
|
||||
for (u16 index = 0; index < visibility->hiddenCount; ++index) setVisible(visibility->hiddenNames[index], false);
|
||||
pane = mpLayout->GetRootPane()->FindPaneByName(getLanguageTextPane() ? static_cast<const LanguagePaneData*>(mpLanguageData)->textBox : "T_2l_TextBox", true);
|
||||
pane = mpLayout->GetRootPane()->FindPaneByName(selectInputTextName(*this, mpLanguageData), true);
|
||||
mpPaneManager->getPaneComponentByPane(pane)->setTriggerTarget(true);
|
||||
if (getPane("T_title_text")) {
|
||||
nw4r::lyt::TextBox* title = nw4r::ut::DynamicCast<nw4r::lyt::TextBox*>(getPane("T_title_text"));
|
||||
@@ -3071,7 +3078,9 @@ bool Base::onCursor(CursorPos* cursor) {
|
||||
f32 left = glyph.rect.left + GetCursorX();
|
||||
f32 top = glyph.rect.top + GetCursorY();
|
||||
f32 right = glyph.rect.right + GetCursorX();
|
||||
f32 bottomEdge = GetCursorY() + GetFontHeight();
|
||||
f32 cursorY = GetCursorY();
|
||||
f32 fontHeight = GetFontHeight();
|
||||
f32 bottomEdge = fontHeight + cursorY;
|
||||
candidateBackground.a = muGlobalAlpha;
|
||||
debug::drawBox_(left, top, right, bottomEdge, 0.0f, 1.0f, candidateBackground);
|
||||
SetupGX();
|
||||
@@ -3131,7 +3140,9 @@ bool Base::onCursor(CursorPos* cursor) {
|
||||
f32 left = glyph.rect.left + GetCursorX();
|
||||
f32 top = glyph.rect.top + GetCursorY();
|
||||
f32 right = glyph.rect.right + GetCursorX();
|
||||
f32 bottomEdge = GetCursorY() + GetFontHeight();
|
||||
f32 cursorY = GetCursorY();
|
||||
f32 fontHeight = GetFontHeight();
|
||||
f32 bottomEdge = fontHeight + cursorY;
|
||||
kanaBackground.a = muGlobalAlpha;
|
||||
debug::drawBox_(left, top, right, bottomEdge, 0.0f, 1.0f, kanaBackground);
|
||||
SetupGX();
|
||||
@@ -3177,7 +3188,7 @@ u32 Base::calcCursorPos(f32 x, f32 y) {
|
||||
info.character = *string;
|
||||
calcRect(info);
|
||||
lineBottom = lineTop + scale.y * (info.rect.bottom - info.rect.top);
|
||||
f32 right = cursorX + scale.x * (info.rect.right - info.rect.left);
|
||||
f32 right = cursorX + scale.x * info.rect.GetWidth();
|
||||
if (doWordWrap(mpString->getWCString(), pos, cursorX)) {
|
||||
if (localY >= lineTop && localY <= lineBottom) {
|
||||
if (pos != 0) return pos - 1;
|
||||
@@ -3186,14 +3197,14 @@ u32 Base::calcCursorPos(f32 x, f32 y) {
|
||||
lineTop += scale.y * getLineHeight();
|
||||
cursorX = getScale().x;
|
||||
lineBottom = lineTop + scale.y * (info.rect.bottom - info.rect.top);
|
||||
right = cursorX + scale.x * (info.rect.right - info.rect.left);
|
||||
right = cursorX + scale.x * info.rect.GetWidth();
|
||||
}
|
||||
if (right >= scale.x * (mRect.right - mRect.left)) {
|
||||
if (right >= scale.x * mRect.GetWidth()) {
|
||||
if (localY >= lineTop && localY <= lineBottom) return pos;
|
||||
lineTop += scale.y * getLineHeight();
|
||||
cursorX = getScale().x;
|
||||
lineBottom = lineTop + scale.y * (info.rect.bottom - info.rect.top);
|
||||
right = cursorX + scale.x * (info.rect.right - info.rect.left);
|
||||
right = cursorX + scale.x * info.rect.GetWidth();
|
||||
}
|
||||
if (x <= info.rect.left && localY >= lineTop && localY <= lineBottom) return pos;
|
||||
if (*string == L'\n') {
|
||||
@@ -3207,7 +3218,7 @@ u32 Base::calcCursorPos(f32 x, f32 y) {
|
||||
if (cursorX + 0.5f * (right - cursorX) > x) return pos;
|
||||
return pos + 1;
|
||||
}
|
||||
cursorX += scale.x * (info.rect.right - info.rect.left);
|
||||
cursorX += scale.x * info.rect.GetWidth();
|
||||
}
|
||||
++string;
|
||||
++pos;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
extern "C" {
|
||||
u8 KPRLookAhead(KPRQueue*, wchar_t*, u32);
|
||||
u32 KPRPutChar(KPRQueue*, wchar_t);
|
||||
u8 KPRPutChar(KPRQueue*, wchar_t);
|
||||
wchar_t KPRGetChar(KPRQueue*);
|
||||
void KPRClearQueue(KPRQueue*);
|
||||
void KPRInitQueue(KPRQueue*);
|
||||
@@ -141,6 +141,28 @@ wchar_t StringBase::getLastWChar() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
namespace {
|
||||
class CharacterOutput {
|
||||
public:
|
||||
CharacterOutput(wchar_t* output) : mpOutput(output), mCount(0) {
|
||||
mpOutput[0] = 0;
|
||||
}
|
||||
|
||||
void append(wchar_t ch) {
|
||||
mpOutput[mCount++] = ch;
|
||||
}
|
||||
|
||||
u16 finish() {
|
||||
mpOutput[mCount] = 0;
|
||||
return mCount;
|
||||
}
|
||||
|
||||
private:
|
||||
wchar_t* mpOutput;
|
||||
u32 mCount;
|
||||
};
|
||||
}
|
||||
|
||||
void Decolated::inputChar(wchar_t ch) {
|
||||
if (ch != 0xfffe) {
|
||||
wchar_t input[8];
|
||||
@@ -173,9 +195,9 @@ void Decolated::inputChar(wchar_t ch) {
|
||||
}
|
||||
nonKana:
|
||||
if (mTranslateMode == 3) {
|
||||
input[0] = ch;
|
||||
input[1] = 0;
|
||||
count = 1;
|
||||
CharacterOutput output(input);
|
||||
output.append(ch);
|
||||
count = output.finish();
|
||||
mKanaStream.mOutput[0] = 0;
|
||||
} else {
|
||||
count = 1;
|
||||
|
||||
@@ -298,7 +298,6 @@ void WithZi::update() {
|
||||
return;
|
||||
}
|
||||
|
||||
wchar_t* candidateOutput = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
|
||||
mSelectedCandidate = 0;
|
||||
s32 elementCount = static_cast<u16>(setElementBuffer());
|
||||
mSearch.language = getPredictLanguage();
|
||||
@@ -307,7 +306,7 @@ void WithZi::update() {
|
||||
mSearch.context = 1;
|
||||
mSearch.getOptions = 0x81;
|
||||
mSearch.elements = reinterpret_cast<wchar_t*>(ElementBuffer);
|
||||
mSearch.candidates = candidateOutput;
|
||||
mSearch.candidates = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
|
||||
mSearch.maxCandidates = 0x28;
|
||||
mSearch.elementCount = static_cast<u8>(elementCount);
|
||||
mSearch.firstCandidate = 0;
|
||||
@@ -355,25 +354,24 @@ void WithZi::update() {
|
||||
ChangeDictionaryLanguage(getPredictLanguage());
|
||||
u32 count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
|
||||
if (getPredictLanguage() == 1 && count == 0x61) {
|
||||
wchar_t* candidateOutput = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x200]);
|
||||
mSearch.firstCandidate = 0x61;
|
||||
mSearch.candidates = reinterpret_cast<wchar_t*>(&CandidatesBuffer[0x2c2]);
|
||||
mSearch.candidates = candidateOutput + 0xC2;
|
||||
mSearch.maxCandidates = 199;
|
||||
count = EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
|
||||
count += EZTXGetCandidates(&mSearch, mpDictionaryWork) & 0xff;
|
||||
mSearch.firstCandidate = 0;
|
||||
count += 0x61;
|
||||
mSearch.candidates = candidateOutput;
|
||||
}
|
||||
if (static_cast<s32>(count) > 0x28) {
|
||||
count = 0x28;
|
||||
}
|
||||
if (getPredictLanguage() == 1 && mbContextChanged != 0 &&
|
||||
(mbContextChanged = 0, mSearch.wordCharCount == 0)) {
|
||||
(mbContextChanged = 0, mSearch.count == 0)) {
|
||||
u32 length = mCurrentWordLength;
|
||||
u32 wordLength = wcslen((wchar_t*)LatestWord) & 0xff;
|
||||
u32 copied;
|
||||
u16* source = LatestWord + wordLength - length;
|
||||
for (copied = 0; copied < length; ++copied) {
|
||||
LatestWord[copied] = source[copied];
|
||||
LatestWord[copied] = LatestWord[(wordLength - length) + copied];
|
||||
}
|
||||
LatestWord[copied] = 0;
|
||||
mSearch.wordCharCount = wcslen((wchar_t*)LatestWord);
|
||||
@@ -409,8 +407,10 @@ void WithZi::update() {
|
||||
destination[1] = 0;
|
||||
} else if (getPredictLanguage() == 0x12) {
|
||||
u16* output = destination;
|
||||
while (*source >= 0x100) {
|
||||
*output++ = *source++;
|
||||
u16 character;
|
||||
while ((character = *source) >= 0x100) {
|
||||
*output++ = character;
|
||||
++source;
|
||||
}
|
||||
} else if (EZTXCopy(reinterpret_cast<wchar_t*>(destination), &mSearch, index & 0xff, mpDictionaryWork) == 0) {
|
||||
goto nextCandidate;
|
||||
@@ -430,6 +430,8 @@ void WithZi::update() {
|
||||
if (position == 0) *candidate = util::toWUpper(*candidate);
|
||||
else *candidate = util::toWLower(*candidate);
|
||||
break;
|
||||
case LM_3:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1778,30 +1778,38 @@ namespace ipl {
|
||||
}
|
||||
}
|
||||
|
||||
static inline f32 GetDragNameWidth(nw4r::lyt::TextBox* textBox, const NWC24FriendInfo& info) {
|
||||
f32 width = 0.0f;
|
||||
if (textBox == NULL) {
|
||||
return width;
|
||||
}
|
||||
const u16* name = info.attr.name;
|
||||
if (name == NULL) {
|
||||
return width;
|
||||
}
|
||||
textBox->GetFont()->GetWidth();
|
||||
for (; *name != 0; ++name) {
|
||||
width += textBox->GetFont()->GetCharWidth(*name);
|
||||
}
|
||||
return 0.01f + width;
|
||||
}
|
||||
|
||||
void Address::movePane_onDrag() {
|
||||
nw4r::math::VEC3 baseTrans = mpLayout->FindPaneByName("N_base_move")->GetTranslate();
|
||||
math::VEC2 pos = System::getControllerManager()->getController(mDrag.mChan)->getDpdProjectionPos();
|
||||
nw4r::lyt::TextBox* textBox = static_cast<nw4r::lyt::TextBox*>(mpLayout->FindPaneByName("T_name_move"));
|
||||
nw4r::lyt::TextBox* textBox = static_cast<nw4r::lyt::TextBox*>(mpLayout->GetRootPane()->FindPaneByName("T_name_move", true));
|
||||
|
||||
f32 width = 0.0f;
|
||||
if (textBox != NULL) {
|
||||
const u16* name = mpFriendCache->getInfo(mDrag.mButton + mDrag.mPage * BTN_MAX).attr.name;
|
||||
if (name != NULL) {
|
||||
textBox->GetFont()->GetWidth();
|
||||
for (; *name != 0; name++) {
|
||||
width += textBox->GetFont()->GetCharWidth(*name);
|
||||
}
|
||||
}
|
||||
}
|
||||
width += 0.01f;
|
||||
f32 width = GetDragNameWidth(textBox, mpFriendCache->getInfo(mDrag.mButton + mDrag.mPage * BTN_MAX));
|
||||
|
||||
nw4r::ut::Rect rect;
|
||||
nw4r::ut::Rect rect4x3;
|
||||
System::getProjectionRect(&rect);
|
||||
System::getProjectionRect4x3(&rect4x3);
|
||||
|
||||
if (baseTrans.x + width < pos.x) {
|
||||
mDragOffsetX = -((baseTrans.x + width) * (rect4x3.GetWidth() / rect.GetWidth()));
|
||||
f32 rightEdge = baseTrans.x + width;
|
||||
if (rightEdge < pos.x) {
|
||||
rightEdge *= rect4x3.GetWidth() / rect.GetWidth();
|
||||
mDragOffsetX = -rightEdge;
|
||||
} else {
|
||||
pos.x *= rect4x3.GetWidth() / rect.GetWidth();
|
||||
mDragOffsetX = -pos.x;
|
||||
@@ -1950,7 +1958,7 @@ namespace ipl {
|
||||
mInfos[index].attr.fdId = fdId;
|
||||
memset(mInfos[index].attr.name, 0, sizeof(mInfos[index].attr.name));
|
||||
wcsncpy((wchar_t*)getInfo(index).attr.name, name, 10);
|
||||
System::getNwc24Manager()->updateFriendInfo(&getInfo(index), index);
|
||||
System::getNwc24Manager()->updateFriendInfo(&mInfos[static_cast<s32>(index)], index);
|
||||
}
|
||||
|
||||
void FriendListCache::del(u32 index) {
|
||||
|
||||
@@ -140,7 +140,6 @@ void ipl::scene::AddressEdit::reset_gui() {
|
||||
}
|
||||
|
||||
|
||||
extern "C" void* __nw__FUl(u32);
|
||||
extern "C" BOOL RFLSearchOfficialData(const RFLCreateID*, u16*);
|
||||
|
||||
namespace ipl {
|
||||
@@ -584,15 +583,10 @@ create_mode_done:
|
||||
|
||||
ipl::System::getKeyboard()->init();
|
||||
|
||||
ipl::scene::TextBalloon* balloon = reinterpret_cast<ipl::scene::TextBalloon*>(__nw__FUl(0x3c));
|
||||
if (balloon != NULL) {
|
||||
f32 balloonWidth = 30.0f;
|
||||
f32 balloonHeight = 120.0f;
|
||||
EGG::Heap* heap = getHeap();
|
||||
ipl::math::VEC3 position(0.0f, 0.0f, 0.0f);
|
||||
balloon = new (balloon) ipl::scene::TextBalloon(heap, mpBalloonFile, "arc", "my_IplTopBalloon_a.brlyt", position, balloonHeight, balloonWidth);
|
||||
}
|
||||
mpBalloon = balloon;
|
||||
f32 margin4x3 = 30.0f;
|
||||
f32 margin16x9 = 120.0f;
|
||||
mpBalloon = new ipl::scene::TextBalloon(getHeap(), mpBalloonFile, "arc",
|
||||
"my_IplTopBalloon_a.brlyt", ipl::math::VEC3(0.0f, 0.0f, 0.0f), margin16x9, margin4x3);
|
||||
}
|
||||
|
||||
void ipl::scene::AddressEdit::stt_wait_decide_anm() {
|
||||
|
||||
@@ -45,7 +45,7 @@ struct CardThreadState {
|
||||
|
||||
MEMAllocator sAllocator_;
|
||||
static CardThreadState* sThread;
|
||||
extern "C" void* cardThreadMain();
|
||||
extern "C" void* cardThreadMain(void*);
|
||||
static char sCardSlotName[3] = "AB";
|
||||
|
||||
FileInfo* getCardDirState() {
|
||||
@@ -302,7 +302,7 @@ void initCardThread() {
|
||||
|
||||
OSInitMessageQueue(&sThread->responses, sThread->responseMessages, 0x10);
|
||||
OSInitMessageQueue(&sThread->requests, sThread->requestMessages, 0x10);
|
||||
OSCreateThread(&sThread->thread, (void* (*)(void*))cardThreadMain, 0,
|
||||
OSCreateThread(&sThread->thread, cardThreadMain, 0,
|
||||
sThread->stack + sizeof(sThread->stack), 0x8000, 0x11, 0);
|
||||
OSResumeThread(&sThread->thread);
|
||||
OSSendMessage(&sThread->requests, (OSMessage)10, 0);
|
||||
@@ -408,7 +408,7 @@ static inline void sendValidityResponse(u32 command, u32 valid) {
|
||||
OSSendMessage(&sThread->responses, (OSMessage)reply.value, 1);
|
||||
}
|
||||
|
||||
extern "C" void* cardThreadMain() {
|
||||
extern "C" void* cardThreadMain(void*) {
|
||||
struct CardThreadLocals {
|
||||
u8 compareName[6];
|
||||
u32 message;
|
||||
@@ -1004,27 +1004,29 @@ sectorSizeError:
|
||||
sectorSizeDone:
|
||||
;
|
||||
|
||||
result = 0;
|
||||
statusResult = __CARDGetStatusEx(slot, fileNo, &checkedStatus);
|
||||
if (statusResult >= 0) {
|
||||
switch (command) {
|
||||
case 2:
|
||||
if (checkedStatus.permission & 8) {
|
||||
result = -10;
|
||||
{
|
||||
s32 permissionResult = 0;
|
||||
statusResult = __CARDGetStatusEx(slot, fileNo, &checkedStatus);
|
||||
if (statusResult >= 0) {
|
||||
switch (command) {
|
||||
case 2:
|
||||
if (checkedStatus.permission & 8) {
|
||||
permissionResult = -10;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (checkedStatus.permission & 0x10) {
|
||||
permissionResult = -10;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (checkedStatus.permission & 0x10) {
|
||||
result = -10;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
permissionResult = CARDGetResultCode(slot);
|
||||
}
|
||||
if (permissionResult < 0) {
|
||||
reportCardThreadError(slot, command, permissionResult);
|
||||
goto finish;
|
||||
}
|
||||
} else {
|
||||
result = CARDGetResultCode(slot);
|
||||
}
|
||||
if (result < 0) {
|
||||
reportCardThreadError(slot, command, result);
|
||||
goto finish;
|
||||
}
|
||||
|
||||
result = __CARDGetStatusEx(slot, fileNo, &createStatus);
|
||||
@@ -1198,8 +1200,8 @@ copyIoDone:
|
||||
renamedStatus = moveStatus;
|
||||
memset(renamedStatus.company, 0, 2);
|
||||
memset(renamedStatus.gameName, 0, 4);
|
||||
memset(renamedStatus.fileName, 0, 0x20);
|
||||
do {
|
||||
memset(renamedStatus.fileName, 0, 0x20);
|
||||
sprintf((char*)renamedStatus.fileName, "Broken File%03d", attempt);
|
||||
result = __CARDSetStatusEx(slot, fileNo, &renamedStatus);
|
||||
if (result < 0 && result != -7) {
|
||||
|
||||
@@ -281,7 +281,11 @@ void MemoryCardManager::update_file_array(u8 slot) {
|
||||
memorycard::CardState* states = memorycard::getCardSlotState();
|
||||
states[slot].changed = 0;
|
||||
sort_file_array(slot);
|
||||
long command = mLastCmd;
|
||||
enum CardCommand {
|
||||
NoCommand, Format, Copy, Move, Delete,
|
||||
CopyComplete, MoveComplete, DeleteComplete, FormatComplete
|
||||
};
|
||||
CardCommand command = static_cast<CardCommand>(mLastCmd);
|
||||
if ((u32)(command - 1) <= 3) {
|
||||
if (mLastResult == -0x15) {
|
||||
mLastResult = memorycard::getCardLastCMDFCmdResult();
|
||||
|
||||
@@ -1266,10 +1266,9 @@ namespace ipl {
|
||||
memoPosition.x = translation.x;
|
||||
memoPosition.y = translation.y;
|
||||
memoPosition.z = translation.z;
|
||||
f32 bodyY = memoPosition.y;
|
||||
mpDialogLayout->FindPaneByName("header_header");
|
||||
nw4r::lyt::Pane* bodyPane = mpDialogLayout->FindPaneByName("header_body");
|
||||
|
||||
f32 bodyY = memoPosition.y;
|
||||
if (bodyY < 500.0f) {
|
||||
mpDialogLayout->draw("header_header");
|
||||
}
|
||||
@@ -1282,11 +1281,11 @@ namespace ipl {
|
||||
++child;
|
||||
}
|
||||
|
||||
s32 lineCount = 0;
|
||||
f32 messageOffset = 0.0f;
|
||||
f32 bodyHeight = bodyPane->GetSize().height;
|
||||
if (mNandTitleCount != 0) {
|
||||
const wchar_t* messageForCount = System::getMessage(0xCB);
|
||||
s32 lineCount = 0;
|
||||
const wchar_t* newline = wcsstr(messageForCount, L"\n");
|
||||
while (newline != NULL) {
|
||||
++lineCount;
|
||||
|
||||
@@ -1406,10 +1406,10 @@ namespace ipl {
|
||||
getCurrentTitleUsage(&bytes, &blocks);
|
||||
*titleCount = 0;
|
||||
|
||||
ESTitleId titleId;
|
||||
for (int page = MAX_CHANNEL_PAGE - 1; page >= 0; --page) {
|
||||
for (int order = 0; order < MAX_CHANNEL_INDEX; ++order) {
|
||||
int channelIndex = channelOrder[order];
|
||||
ESTitleId titleId;
|
||||
const channel::SEntry& channelInfo =
|
||||
System::getChannelManager()->mChannels[page][channelIndex];
|
||||
if (channelInfo.loadedBnr) {
|
||||
@@ -2710,23 +2710,19 @@ namespace ipl {
|
||||
nw4r::ut::Rect projection;
|
||||
System::getProjectionRect(&projection);
|
||||
GXRenderModeObj* renderMode = System::getRenderModeObj();
|
||||
f32 scissorWidth;
|
||||
f32 scissorY;
|
||||
f32 scissorX;
|
||||
f32 scissorY;
|
||||
f32 scissorWidth;
|
||||
f32 scissorHeight;
|
||||
u16 framebufferWidth;
|
||||
u16 framebufferHeight;
|
||||
|
||||
if (mState == 7 || mState == 12 || mState == 14) {
|
||||
nw4r::math::MTX44 matrix;
|
||||
f32 rightScale = projection.right / mScale.x;
|
||||
f32 leftScale = projection.left / mScale.x;
|
||||
f32 bottomScale = projection.bottom / mScale.y;
|
||||
f32 topScale = projection.top / mScale.y;
|
||||
f32 bottom = mPosition.y - bottomScale;
|
||||
f32 right = mPosition.x + rightScale;
|
||||
f32 left = mPosition.x + leftScale;
|
||||
f32 top = mPosition.y - topScale;
|
||||
f32 right = mPosition.x + projection.right / mScale.x;
|
||||
f32 left = mPosition.x + projection.left / mScale.x;
|
||||
f32 bottom = mPosition.y - projection.bottom / mScale.y;
|
||||
f32 top = mPosition.y - projection.top / mScale.y;
|
||||
MTXOrtho(matrix, top, bottom, left, right, -100.0f, 100.0f);
|
||||
|
||||
nw4r::math::VEC4 input(position.x, position.y, 0.0f, 1.0f);
|
||||
@@ -2734,14 +2730,13 @@ namespace ipl {
|
||||
nw4r::math::VEC4Transform(&transformed, &matrix, &input);
|
||||
framebufferWidth = renderMode->fbWidth;
|
||||
framebufferHeight = renderMode->efbHeight;
|
||||
scissorWidth = projection.GetWidth();
|
||||
const f32 projectionWidth = projection.GetWidth();
|
||||
scissorX = ((1.0f + transformed.x) * framebufferWidth / 2) -
|
||||
((mThumbOffsetX * mScale.x) * (framebufferWidth / projectionWidth));
|
||||
scissorY = (framebufferHeight - ((1.0f + transformed.y) * framebufferHeight / 2)) -
|
||||
(mThumbOffsetY * mScale.y);
|
||||
f32 widthScale = framebufferWidth / scissorWidth;
|
||||
scissorX = ((1.0f + transformed.x) * framebufferWidth / 2) -
|
||||
((mThumbOffsetX * mScale.x) * widthScale);
|
||||
scissorWidth = 2.0f * (mThumbOffsetX * mScale.x) *
|
||||
(framebufferWidth / scissorWidth);
|
||||
(framebufferWidth / projectionWidth);
|
||||
scissorHeight = 2.0f * (mThumbOffsetY * mScale.y);
|
||||
} else {
|
||||
framebufferWidth = renderMode->fbWidth;
|
||||
@@ -3411,7 +3406,7 @@ namespace ipl {
|
||||
case ::gui::EventHandler::ON_TRIG:
|
||||
if (mpScene->mState == 1 && controller != NULL) {
|
||||
BOOL writeProtected = mpScene->mpSDWorker->is_sd_write_protected();
|
||||
if (controller->pinchTrg() && SDChannelSelect::isChannelReady(channel) &&
|
||||
if (controller->pinchTrg() && iplSDChannelObj_hasAppMeta(channel) &&
|
||||
!mpScene->mbSDCardBroken) {
|
||||
if (!writeProtected) {
|
||||
mpScene->startDrag(controller, mpScene->mCurrentPage, index);
|
||||
@@ -3425,20 +3420,20 @@ namespace ipl {
|
||||
break;
|
||||
case ::gui::EventHandler::ON_DRAG:
|
||||
if (mpScene->mState == 1 && controller != NULL && controller->decide() &&
|
||||
SDChannelSelect::isChannelReady(channel)) {
|
||||
iplSDChannelObj_hasAppMeta(channel)) {
|
||||
mpScene->selectChannel(channel->getPage(), channel->getIndex());
|
||||
TVRCManager::getHandle()->setEnable(FALSE);
|
||||
}
|
||||
break;
|
||||
case ::gui::EventHandler::ON_POINT:
|
||||
if (mpScene->mState == 1 && SDChannelSelect::isChannelReady(channel)) {
|
||||
if (mpScene->mState == 1 && iplSDChannelObj_hasAppMeta(channel)) {
|
||||
iplSDChannelObj_startAppear(channel, 0);
|
||||
snd::getSystem()->startSE("WIPL_SE_CH_TARGETTING");
|
||||
controller->rumble(1);
|
||||
}
|
||||
break;
|
||||
case ::gui::EventHandler::ON_LEFT:
|
||||
if (mpScene->mState == 1 && SDChannelSelect::isChannelReady(channel)) {
|
||||
if (mpScene->mState == 1 && iplSDChannelObj_hasAppMeta(channel)) {
|
||||
iplSDChannelObj_startDisappear(channel, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -167,6 +167,11 @@ typedef struct AOSSKeySchedule {
|
||||
u32 length;
|
||||
} AOSSKeySchedule;
|
||||
|
||||
typedef struct AOSSKeyMaterial {
|
||||
u8 nonce[2];
|
||||
u8 address[8];
|
||||
} AOSSKeyMaterial;
|
||||
|
||||
typedef struct AOSSReceiveBuffer {
|
||||
s32 socket;
|
||||
u32 length;
|
||||
@@ -257,8 +262,7 @@ static AOSSRuntimeState s_runtime;
|
||||
static AOSSConfigData s_configData;
|
||||
static u8 s_networkBuffer[0x280];
|
||||
static struct {
|
||||
u8 keyNonce[2];
|
||||
u8 keyAddress[8];
|
||||
AOSSKeyMaterial key;
|
||||
u8 payload[0x5e];
|
||||
} s_packetState;
|
||||
static u32 s_crcTable[0x100];
|
||||
@@ -284,7 +288,9 @@ extern int AOSSi_WLANGetBSSList(void** list);
|
||||
extern int AOSSi_Status(int status);
|
||||
extern int AOSSi_SetNCDIPAddr(u32 ipAddress, u32 netmask, u32 gateway, u32 dns1, u32 dns2);
|
||||
extern int AOSSi_Sleep(u32 duration);
|
||||
extern int AOSSi_WLANConnect(void);
|
||||
struct AOSSConnection;
|
||||
struct AOSSConnectionStatus;
|
||||
extern int AOSSi_WLANConnect(struct AOSSConnection* connection, struct AOSSConnectionStatus* status);
|
||||
extern int SOPoll(AOSSPollDescriptor* descriptors, int count, s32 timeoutHigh, s32 timeoutLow);
|
||||
extern int SORecvFrom(int socket, void* buffer, int length, int flags, void* address);
|
||||
extern int SOSendTo(int socket, const void* buffer, int length, int flags, const void* address);
|
||||
@@ -617,6 +623,20 @@ int AOSS_Init_old(AOSSInitInput* input)
|
||||
}
|
||||
resultCode = 0xffffffff;
|
||||
} else {
|
||||
/* The original initialization path repeats this status check. */
|
||||
if (state != 0) {
|
||||
input->status = 0xf;
|
||||
if (s_accessPointConfig) {
|
||||
AOSSi_Free(s_accessPointConfig);
|
||||
s_accessPointConfig = 0;
|
||||
}
|
||||
if (s_accessPointList) {
|
||||
AOSSi_Free(s_accessPointList);
|
||||
s_accessPointList = 0;
|
||||
}
|
||||
resultCode = 0xffffffff;
|
||||
goto finish_initialization;
|
||||
}
|
||||
s_accessPointConfig = (int *)AOSSi_Alloc(0x58);
|
||||
if (s_accessPointConfig == 0) {
|
||||
input->status = 0xf;
|
||||
@@ -724,19 +744,15 @@ handle_initial_link:
|
||||
AOSSi_Free(s_accessPointList);
|
||||
s_accessPointList = 0;
|
||||
}
|
||||
requestResult = 0;
|
||||
state = 0;
|
||||
do {
|
||||
AOSSRequestRecord* currentRecord = &requestRecords.records[requestResult];
|
||||
u16 transactionId;
|
||||
memcpy(requestRecords.bytes + state,input->optionData,6);
|
||||
transactionId = rand();
|
||||
currentRecord->transactionId = transactionId;
|
||||
receivedLength = SOHtoNs(transactionId);
|
||||
currentRecord->transactionId = receivedLength;
|
||||
requestResult++;
|
||||
state += sizeof(AOSSRequestRecord);
|
||||
} while (requestResult < 3);
|
||||
{
|
||||
int recordIndex;
|
||||
for (recordIndex = 0; recordIndex < 3; recordIndex++) {
|
||||
memcpy(requestRecords.records[recordIndex].address, input->optionData, 6);
|
||||
requestRecords.records[recordIndex].transactionId = rand();
|
||||
requestRecords.records[recordIndex].transactionId =
|
||||
SOHtoNs(requestRecords.records[recordIndex].transactionId);
|
||||
}
|
||||
}
|
||||
s_socket = SOSocket(2,2,0);
|
||||
if (s_socket < 0) {
|
||||
input->status = 0xf;
|
||||
@@ -801,7 +817,7 @@ perform_request:
|
||||
if (s_socketStarted == 1) {
|
||||
s_socketStarted = 0;
|
||||
requestResult = SOCleanup();
|
||||
if (-1 < requestResult) goto request_socket_cleanup_complete;
|
||||
if (requestResult >= 0) goto request_socket_cleanup_complete;
|
||||
requestResult = -1;
|
||||
}
|
||||
else {
|
||||
@@ -890,7 +906,6 @@ request_socket_cleanup_complete:
|
||||
resultCode = 0xffffffff;
|
||||
goto finish_initialization;
|
||||
}
|
||||
initialSleep = remainingWait <= 100 ? remainingWait : 100;
|
||||
AOSSi_Sleep(remainingWait > 100 ? 100 : remainingWait);
|
||||
if (remainingWait > 100) initialSleep = 100;
|
||||
else initialSleep = remainingWait;
|
||||
@@ -943,73 +958,76 @@ request_socket_cleanup_complete:
|
||||
goto finish_initialization;
|
||||
}
|
||||
}
|
||||
requestResult = s_socket;
|
||||
switch (protocolState) {
|
||||
case 0:
|
||||
if (s_operationState != 2) {
|
||||
s_operationState = 2;
|
||||
AOSSi_Status(2);
|
||||
}
|
||||
requestResult = AOSSSendDiscoveryRequest(networkAddresses,&requestRecords,requestResult);
|
||||
break;
|
||||
case 1:
|
||||
if (s_operationState != 3) {
|
||||
s_operationState = 3;
|
||||
AOSSi_Status(3);
|
||||
}
|
||||
requestResult = AOSSSendHelloRequest(networkAddresses,&requestRecords,requestResult);
|
||||
{
|
||||
int sendResult;
|
||||
int requestSocket = s_socket;
|
||||
switch (protocolState) {
|
||||
case 0:
|
||||
if (s_operationState != 2) {
|
||||
s_operationState = 2;
|
||||
AOSSi_Status(2);
|
||||
}
|
||||
sendResult = AOSSSendDiscoveryRequest(networkAddresses,&requestRecords,requestSocket);
|
||||
break;
|
||||
case 1:
|
||||
if (s_operationState != 3) {
|
||||
s_operationState = 3;
|
||||
AOSSi_Status(3);
|
||||
}
|
||||
sendResult = AOSSSendHelloRequest(networkAddresses,&requestRecords,requestSocket);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
if (s_operationState != 5) {
|
||||
s_operationState = 5;
|
||||
AOSSi_Status(5);
|
||||
}
|
||||
packetWords = s_responseBuffer;
|
||||
memset(s_responseBuffer,0,0x5dc);
|
||||
memcpy(messageIdentity,&requestRecords.records[2],8);
|
||||
manufacturerLength = strlen(s_manufacturer);
|
||||
AOSSXorBufferWithKey(messageIdentity,8,s_manufacturer,manufacturerLength);
|
||||
receivedLength = SOHtoNs(1);
|
||||
packetWords->initialLength = receivedLength;
|
||||
packetWords->initialType = 0;
|
||||
packetWords->initialSequence = 0;
|
||||
packetWords->responseLength = SOHtoNs(0x3000);
|
||||
packetWords->responseType = 0;
|
||||
packetWords->finalLength = SOHtoNs(0);
|
||||
packetWords->finalSequence = SOHtoNs(0);
|
||||
packetWords->reserved = 0;
|
||||
packetWords->messageType = 0x11;
|
||||
memcpy(packetWords->messageIdentity,messageIdentity,8);
|
||||
memset(&replyAddress,0,8);
|
||||
replyAddress.family = 2;
|
||||
replyAddress.port = SOHtoNs(0x5790);
|
||||
replyAddress.address = SOHtoNl(s_runtime.ipAddress);
|
||||
if ((s8)s_runtime.active == 0) {
|
||||
replyAddress.address = 0xffffffff;
|
||||
}
|
||||
replyAddress.length = 8;
|
||||
SOSendTo(requestResult,packetWords,0x18,0,&replyAddress);
|
||||
requestResult = 0;
|
||||
break;
|
||||
case 2:
|
||||
if (s_operationState != 5) {
|
||||
s_operationState = 5;
|
||||
AOSSi_Status(5);
|
||||
}
|
||||
packetWords = s_responseBuffer;
|
||||
memset(s_responseBuffer,0,0x5dc);
|
||||
memcpy(messageIdentity,&requestRecords.records[2],8);
|
||||
manufacturerLength = strlen(s_manufacturer);
|
||||
AOSSXorBufferWithKey(messageIdentity,8,s_manufacturer,manufacturerLength);
|
||||
receivedLength = SOHtoNs(1);
|
||||
packetWords->initialLength = receivedLength;
|
||||
packetWords->initialType = 0;
|
||||
packetWords->initialSequence = 0;
|
||||
packetWords->responseLength = SOHtoNs(0x3000);
|
||||
packetWords->responseType = 0;
|
||||
packetWords->finalLength = SOHtoNs(0);
|
||||
packetWords->finalSequence = SOHtoNs(0);
|
||||
packetWords->reserved = 0;
|
||||
packetWords->messageType = 0x11;
|
||||
memcpy(packetWords->messageIdentity,messageIdentity,8);
|
||||
memset(&replyAddress,0,8);
|
||||
replyAddress.family = 2;
|
||||
replyAddress.port = SOHtoNs(0x5790);
|
||||
replyAddress.address = SOHtoNl(s_runtime.ipAddress);
|
||||
if ((s8)s_runtime.active == 0) {
|
||||
replyAddress.address = 0xffffffff;
|
||||
}
|
||||
replyAddress.length = 8;
|
||||
SOSendTo(requestSocket,packetWords,0x18,0,&replyAddress);
|
||||
sendResult = 0;
|
||||
|
||||
break;
|
||||
default:
|
||||
requestResult = -1;
|
||||
break;
|
||||
}
|
||||
if (requestResult == -1) {
|
||||
s_errorCode = protocolState + 0x1000;
|
||||
input->status = 0xf;
|
||||
if (s_accessPointConfig) {
|
||||
AOSSi_Free(s_accessPointConfig);
|
||||
s_accessPointConfig = (int *)0x0;
|
||||
break;
|
||||
default:
|
||||
sendResult = -1;
|
||||
break;
|
||||
}
|
||||
if (s_accessPointList) {
|
||||
AOSSi_Free(s_accessPointList);
|
||||
s_accessPointList = 0;
|
||||
if (sendResult == -1) {
|
||||
s_errorCode = protocolState + 0x1000;
|
||||
input->status = 0xf;
|
||||
if (s_accessPointConfig) {
|
||||
AOSSi_Free(s_accessPointConfig);
|
||||
s_accessPointConfig = (int *)0x0;
|
||||
}
|
||||
if (s_accessPointList) {
|
||||
AOSSi_Free(s_accessPointList);
|
||||
s_accessPointList = 0;
|
||||
}
|
||||
resultCode = 0xffffffff;
|
||||
goto finish_initialization;
|
||||
}
|
||||
resultCode = 0xffffffff;
|
||||
goto finish_initialization;
|
||||
}
|
||||
memset(packetBuffer,0,0x5f8);
|
||||
pollTime.seconds = timeoutMilliseconds / 1000;
|
||||
@@ -1028,10 +1046,12 @@ request_socket_cleanup_complete:
|
||||
if (0 < requestResult) goto process_received_packet;
|
||||
receivedPackets = receivedPackets + 1;
|
||||
if (receivedPackets > attemptCount) {
|
||||
switch (protocolState) {
|
||||
case 0: s_errorCode = 0xf; break;
|
||||
case 1: s_errorCode = 0x10; break;
|
||||
default: s_errorCode = 0x11; break;
|
||||
if (protocolState == 0) {
|
||||
s_errorCode = 0xf;
|
||||
} else if (protocolState == 1) {
|
||||
s_errorCode = 0x10;
|
||||
} else {
|
||||
s_errorCode = 0x11;
|
||||
}
|
||||
protocolResult = -1;
|
||||
goto close_protocol_socket;
|
||||
@@ -1098,8 +1118,7 @@ process_received_packet:
|
||||
}
|
||||
else {
|
||||
if (protocolState != requestResult) {
|
||||
protocolState = requestResult;
|
||||
if (requestResult != 2) goto perform_request;
|
||||
if (requestResult != 2) goto advance_protocol_state;
|
||||
if (s_socket != -1) {
|
||||
SOClose(s_socket);
|
||||
}
|
||||
@@ -1237,7 +1256,8 @@ wait_for_packet:
|
||||
goto finish_initialization;
|
||||
}
|
||||
AOSSi_Sleep(remainingWait > 100 ? 100 : remainingWait);
|
||||
initialSleep = remainingWait <= 100 ? remainingWait : 100;
|
||||
if (remainingWait > 100) initialSleep = 100;
|
||||
else initialSleep = remainingWait;
|
||||
}
|
||||
if (AOSSi_cancel_flag == 1) {
|
||||
input->status = 0xf;
|
||||
@@ -1294,15 +1314,18 @@ wait_for_packet:
|
||||
resultCode = 0xffffffff;
|
||||
goto finish_initialization;
|
||||
}
|
||||
advance_protocol_state:
|
||||
protocolState = requestResult;
|
||||
goto perform_request;
|
||||
}
|
||||
protocolState = requestResult;
|
||||
if (receivedPackets > waitSettings.halfwords.high) {
|
||||
switch (requestResult) {
|
||||
case 0: s_errorCode = 0xf; break;
|
||||
case 1: s_errorCode = 0x10; break;
|
||||
default: s_errorCode = 0x11; break;
|
||||
if (requestResult == 0) {
|
||||
s_errorCode = 0xf;
|
||||
} else if (requestResult == 1) {
|
||||
s_errorCode = 0x10;
|
||||
} else {
|
||||
s_errorCode = 0x11;
|
||||
}
|
||||
protocolResult = -1;
|
||||
goto close_protocol_socket;
|
||||
@@ -1322,8 +1345,7 @@ wait_for_packet:
|
||||
resultCode = 0xffffffff;
|
||||
goto finish_initialization;
|
||||
}
|
||||
if (retryDelay > 100) AOSSi_Sleep(100);
|
||||
else AOSSi_Sleep(retryDelay);
|
||||
AOSSi_Sleep(retryDelay > 100 ? 100 : retryDelay);
|
||||
if (retryDelay > 100) delayStep = 100;
|
||||
else delayStep = retryDelay;
|
||||
}
|
||||
@@ -1350,7 +1372,7 @@ close_protocol_socket:
|
||||
if (s_socketStarted == 1) {
|
||||
s_socketStarted = 0;
|
||||
state = SOCleanup();
|
||||
if (-1 < state) goto protocol_socket_cleanup_complete;
|
||||
if (state >= 0) goto protocol_socket_cleanup_complete;
|
||||
state = -1;
|
||||
}
|
||||
else {
|
||||
@@ -1884,10 +1906,9 @@ int AOSSDecryptMessage(AOSSDecryptionMessage* message) {
|
||||
s_errorCode = 2;
|
||||
result = -1;
|
||||
} else {
|
||||
memcpy(s_packetState.keyNonce, &encrypted->keyNonce, sizeof(encrypted->keyNonce));
|
||||
memcpy(s_packetState.keyAddress, s_accessPointName, sizeof(s_accessPointName));
|
||||
AOSSInitKeySchedule(&schedule, s_packetState.keyNonce,
|
||||
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), dataLength);
|
||||
memcpy(s_packetState.key.nonce, &encrypted->keyNonce, sizeof(encrypted->keyNonce));
|
||||
memcpy(s_packetState.key.address, s_accessPointName, sizeof(s_accessPointName));
|
||||
AOSSInitKeySchedule(&schedule, (const u8*)&s_packetState.key, sizeof(s_packetState.key), dataLength);
|
||||
|
||||
outputCursor = decryptedData;
|
||||
inputCursor = encrypted->data;
|
||||
@@ -2359,10 +2380,9 @@ int AOSSSendHelloRequest(void* packet, void* request, int socket) {
|
||||
if (construction.schedule.bytes != 0) {
|
||||
nonce = (u16)rand();
|
||||
memcpy(&payload->encrypted.key.nonce, &nonce, 2);
|
||||
memcpy(s_packetState.keyNonce, payload->encrypted.key.nonceBytes, 2);
|
||||
memcpy(s_packetState.keyAddress, s_accessPointName, 8);
|
||||
AOSSInitKeySchedule(&construction.schedule, s_packetState.keyNonce,
|
||||
sizeof(s_packetState.keyNonce) + sizeof(s_packetState.keyAddress), 8);
|
||||
memcpy(s_packetState.key.nonce, payload->encrypted.key.nonceBytes, 2);
|
||||
memcpy(s_packetState.key.address, s_accessPointName, 8);
|
||||
AOSSInitKeySchedule(&construction.schedule, (const u8*)&s_packetState.key, sizeof(s_packetState.key), 8);
|
||||
for (index = 0; index < 8; index++) {
|
||||
state = construction.schedule.bytes;
|
||||
firstIndex = (construction.schedule.i + 1) % construction.schedule.length & 0xff;
|
||||
@@ -2546,7 +2566,7 @@ int AOSSConnectAndAwaitHost(void* settings, void* config) {
|
||||
s32 connectionAttempts = 0;
|
||||
u32 ticksPerMillisecond;
|
||||
|
||||
if (AOSSi_WLANConnect() != 0) {
|
||||
if (AOSSi_WLANConnect(settings, config) != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ int AOSSi_EndLocal(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AOSSi_WLANGetBSSList(struct AOSSAccessPointList** output) {
|
||||
int AOSSi_WLANGetBSSList(void** output) {
|
||||
int result = -1;
|
||||
int startupRetries = 0;
|
||||
WDScanParam scan ATTRIBUTE_ALIGN(32);
|
||||
|
||||
@@ -542,7 +542,7 @@ s32 gAtermState;
|
||||
|
||||
void ATERMAlarmWakeQueue(OSAlarm* alarm, OSContext* context);
|
||||
s32 ATERMRunConfigProtocol(void);
|
||||
void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length);
|
||||
void ATERMMd5Update(AtermMd5Context* context, u8* input, u32 length);
|
||||
extern u8 gAtermDigestFill[64];
|
||||
extern u8* gAtermRequestOptions;
|
||||
int ATERMAesKeyWrap(u16* destination, u16* source, u32 length, void* key, u32 keyLength);
|
||||
@@ -1442,8 +1442,6 @@ s32 ATERMRunConfigProtocol(void) {
|
||||
AtermSocketAddress peerAddress;
|
||||
AtermThreadBuffer* response = (AtermThreadBuffer*)&gAtermConfigurationResult.responseLength;
|
||||
void* sessionKey = gAtermResponseBuffer.session.keyMaterial;
|
||||
AtermMd5Context digestContext;
|
||||
u8 digestLength[8];
|
||||
s32 socket = 0;
|
||||
s32 result = -5;
|
||||
s32 failed = 0;
|
||||
@@ -1617,13 +1615,11 @@ s32 ATERMRunConfigProtocol(void) {
|
||||
u32 checksum = 0;
|
||||
u8* cursor = gAtermConfigurationResult.packetBuffer;
|
||||
u8* packetEnd = packet->payload + payloadLength;
|
||||
u8* payload = packet->payload;
|
||||
u8* payload;
|
||||
for (; cursor < packetEnd; cursor++) {
|
||||
checksum += *cursor;
|
||||
}
|
||||
if ((u16)checksum != SONtoHs(*(u16*)packetEnd)) {
|
||||
payload = NULL;
|
||||
}
|
||||
payload = (u16)checksum == SONtoHs(*(u16*)packetEnd) ? packet->payload : NULL;
|
||||
if (payload == NULL) {
|
||||
payloadLength = 0;
|
||||
} else if (sequence != 3) {
|
||||
@@ -1652,6 +1648,8 @@ s32 ATERMRunConfigProtocol(void) {
|
||||
}
|
||||
{
|
||||
AtermProgress progress;
|
||||
AtermMd5Context digestContext;
|
||||
u8 digestLength[8];
|
||||
u32 authenticationTime = (u32)(OSGetTime() /
|
||||
(__mulhwu(reciprocal, OS_BUS_CLOCK >> 2) >> 6));
|
||||
u32 index;
|
||||
@@ -1664,7 +1662,7 @@ s32 ATERMRunConfigProtocol(void) {
|
||||
digestContext.state[1] = 0xEFCDAB89;
|
||||
digestContext.state[2] = 0x98BADCFE;
|
||||
digestContext.state[3] = 0x10325476;
|
||||
ATERMMd5Update(&digestContext, &authenticationTime, sizeof(authenticationTime));
|
||||
ATERMMd5Update(&digestContext, (u8*)&authenticationTime, sizeof(authenticationTime));
|
||||
digestLength[0] = digestContext.bitCountLow;
|
||||
digestLength[1] = digestContext.bitCountLow >> 8;
|
||||
digestLength[2] = digestContext.bitCountLow >> 16;
|
||||
@@ -1677,22 +1675,13 @@ s32 ATERMRunConfigProtocol(void) {
|
||||
ATERMMd5Update(&digestContext, gAtermDigestFill,
|
||||
digestBytes < 56 ? 56 - digestBytes : 120 - digestBytes);
|
||||
ATERMMd5Update(&digestContext, digestLength, sizeof(digestLength));
|
||||
response->authentication.digest[0] = digestContext.state[0];
|
||||
response->authentication.digest[1] = digestContext.state[0] >> 8;
|
||||
response->authentication.digest[2] = digestContext.state[0] >> 16;
|
||||
response->authentication.digest[3] = digestContext.state[0] >> 24;
|
||||
response->authentication.digest[4] = digestContext.state[1];
|
||||
response->authentication.digest[5] = digestContext.state[1] >> 8;
|
||||
response->authentication.digest[6] = digestContext.state[1] >> 16;
|
||||
response->authentication.digest[7] = digestContext.state[1] >> 24;
|
||||
response->authentication.digest[8] = digestContext.state[2];
|
||||
response->authentication.digest[9] = digestContext.state[2] >> 8;
|
||||
response->authentication.digest[10] = digestContext.state[2] >> 16;
|
||||
response->authentication.digest[11] = digestContext.state[2] >> 24;
|
||||
response->authentication.digest[12] = digestContext.state[3];
|
||||
response->authentication.digest[13] = digestContext.state[3] >> 8;
|
||||
response->authentication.digest[14] = digestContext.state[3] >> 16;
|
||||
response->authentication.digest[15] = digestContext.state[3] >> 24;
|
||||
for (index = 0; index < 4; index++) {
|
||||
u32 word = digestContext.state[index];
|
||||
response->authentication.digest[index * 4] = word;
|
||||
response->authentication.digest[index * 4 + 1] = word >> 8;
|
||||
response->authentication.digest[index * 4 + 2] = word >> 16;
|
||||
response->authentication.digest[index * 4 + 3] = word >> 24;
|
||||
}
|
||||
{
|
||||
u8* contextByte = (u8*)&digestContext;
|
||||
for (index = 0; index < sizeof(digestContext); index++) {
|
||||
@@ -1750,13 +1739,11 @@ s32 ATERMRunConfigProtocol(void) {
|
||||
u32 checksum = 0;
|
||||
u8* cursor = gAtermConfigurationResult.packetBuffer;
|
||||
u8* packetEnd = packet->payload + payloadLength;
|
||||
u8* payload = packet->payload;
|
||||
u8* payload;
|
||||
for (; cursor < packetEnd; cursor++) {
|
||||
checksum += *cursor;
|
||||
}
|
||||
if ((u16)checksum != SONtoHs(*(u16*)packetEnd)) {
|
||||
payload = NULL;
|
||||
}
|
||||
payload = (u16)checksum == SONtoHs(*(u16*)packetEnd) ? packet->payload : NULL;
|
||||
if (payload == NULL) {
|
||||
payloadLength = 0;
|
||||
} else if (sequence != 5) {
|
||||
@@ -2325,12 +2312,17 @@ void ATERMAesDecryptBlock(const u32* expandedKey, u32 rounds, const u8* input, u
|
||||
|
||||
void ATERMMd5Transform(u32 state[4], const u8 block[64]);
|
||||
|
||||
void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length) {
|
||||
u8* data = (u8*)input;
|
||||
static inline void atermMd5Copy(void* output, const void* input, u32 length) {
|
||||
u32 index;
|
||||
for (index = 0; index < length; index++) {
|
||||
((u8*)output)[index] = ((const u8*)input)[index];
|
||||
}
|
||||
}
|
||||
|
||||
void ATERMMd5Update(AtermMd5Context* context, u8* input, u32 length) {
|
||||
u32 bufferIndex = (context->bitCountLow >> 3) & 0x3F;
|
||||
u32 bytesToFill;
|
||||
u32 copiedBytes;
|
||||
u32 index;
|
||||
|
||||
context->bitCountLow += length << 3;
|
||||
if (context->bitCountLow < (length << 3)) {
|
||||
@@ -2339,20 +2331,16 @@ void ATERMMd5Update(AtermMd5Context* context, void* input, u32 length) {
|
||||
context->bitCountHigh += length >> 29;
|
||||
bytesToFill = 64 - bufferIndex;
|
||||
if (length >= bytesToFill) {
|
||||
for (copiedBytes = 0; copiedBytes < bytesToFill; copiedBytes++) {
|
||||
context->buffer8[bufferIndex + copiedBytes] = data[copiedBytes];
|
||||
}
|
||||
atermMd5Copy(&context->buffer8[bufferIndex], input, bytesToFill);
|
||||
ATERMMd5Transform(context->state, context->buffer8);
|
||||
for (copiedBytes = bytesToFill; copiedBytes + 63 < length; copiedBytes += 64) {
|
||||
ATERMMd5Transform(context->state, data + copiedBytes);
|
||||
ATERMMd5Transform(context->state, input + copiedBytes);
|
||||
}
|
||||
bufferIndex = 0;
|
||||
} else {
|
||||
copiedBytes = 0;
|
||||
}
|
||||
for (index = 0; index < length - copiedBytes; index++) {
|
||||
context->buffer8[bufferIndex + index] = data[copiedBytes + index];
|
||||
}
|
||||
atermMd5Copy(&context->buffer8[bufferIndex], &input[copiedBytes], length - copiedBytes);
|
||||
}
|
||||
|
||||
#define ATERM_MD5_STEP(A, B, C, D, WORD, CONSTANT, SHIFT, F) \
|
||||
|
||||
@@ -2481,25 +2481,28 @@ namespace ipl {
|
||||
|
||||
void Setting::convertRevIP(u8* destination, const char* address) {
|
||||
char ascii[20];
|
||||
int count = 0;
|
||||
int index;
|
||||
int componentStart;
|
||||
int count = 0;
|
||||
u32 value;
|
||||
u8 character;
|
||||
memset(ascii, 0, sizeof(ascii));
|
||||
utility::CharacterCode::UTF8ToANSI(reinterpret_cast<u8*>(ascii), address);
|
||||
int componentStart = 0;
|
||||
u8* output = destination;
|
||||
for (index = 0; index < 0x10; ++index) {
|
||||
u8 character = static_cast<u8>(ascii[index]);
|
||||
index = 0;
|
||||
componentStart = 0;
|
||||
for (; index < 0x10; ++index) {
|
||||
character = static_cast<u8>(ascii[index]);
|
||||
if (character == '.' || character == 0) {
|
||||
if (character == 0) {
|
||||
index = 0x10;
|
||||
}
|
||||
ascii[index] = 0;
|
||||
u32 value = atoi(ascii + componentStart);
|
||||
value = atoi(ascii + componentStart);
|
||||
if (value > 0xff) {
|
||||
value = 0xff;
|
||||
}
|
||||
if (count == 0) {
|
||||
*output = value;
|
||||
destination[count] = value;
|
||||
} else {
|
||||
destination[1] = destination[2];
|
||||
destination[2] = destination[3];
|
||||
@@ -2507,7 +2510,6 @@ namespace ipl {
|
||||
}
|
||||
componentStart = index + 1;
|
||||
++count;
|
||||
++output;
|
||||
if (count == 3 && index != 0x10) {
|
||||
value = atoi(ascii + componentStart);
|
||||
if (value > 0xff) {
|
||||
@@ -2704,6 +2706,7 @@ namespace ipl {
|
||||
}
|
||||
|
||||
void Setting::scanAP() {
|
||||
BOOL playing = FALSE;
|
||||
switch (unk_0x78) {
|
||||
case 1:
|
||||
memset(&mAPScanList.count, 0, 0x800);
|
||||
@@ -2752,7 +2755,8 @@ namespace ipl {
|
||||
case 6: {
|
||||
int animationIndex = unk_0x918;
|
||||
unk_0xB9C = 1;
|
||||
if (!mpMainLayout->getAnim(animationIndex)->isPlaying()) {
|
||||
playing |= mpMainLayout->getAnim(animationIndex)->isPlaying();
|
||||
if (!playing) {
|
||||
unk_0x78 = 5;
|
||||
setAPDraw();
|
||||
if (unk_0x91C[0] != 0) {
|
||||
@@ -2775,19 +2779,23 @@ namespace ipl {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
case 7: {
|
||||
int animationIndex = unk_0x918;
|
||||
unk_0xB9C = 1;
|
||||
if (!mpMainLayout->getAnim(unk_0x918)->isPlaying()) {
|
||||
playing |= mpMainLayout->getAnim(animationIndex)->isPlaying();
|
||||
if (!playing) {
|
||||
updateScroll();
|
||||
unk_0x78 = 6;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 8:
|
||||
resetAP();
|
||||
unk_0x91C[2] = 0;
|
||||
break;
|
||||
case 9:
|
||||
if (!mpMainLayout->getAnim(unk_0x918)->isPlaying()) {
|
||||
playing |= mpMainLayout->getAnim(unk_0x918)->isPlaying();
|
||||
if (!playing) {
|
||||
resetFuncMsgQ();
|
||||
unk_0x78 = 1;
|
||||
unk_0x918 = -1;
|
||||
|
||||
@@ -211,13 +211,13 @@ namespace ipl {
|
||||
systemDict = System::getZiDicData(i);
|
||||
}
|
||||
if (oemDict == NULL && System::getZiDicData(i) != NULL) {
|
||||
oemDict = System::getZiDicData(oemIndex);
|
||||
oemDict = System::getZiOemDicData(oemIndex - EZTX_LANG_MAX);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0, oemIndex = EZTX_LANG_MAX; i < EZTX_LANG_MAX; i++, oemIndex++) {
|
||||
u8* usedSystemDict = System::getZiDicData(i);
|
||||
u8* usedOemDict = System::getZiDicData(oemIndex);
|
||||
u8* usedOemDict = System::getZiOemDicData(oemIndex - EZTX_LANG_MAX);
|
||||
|
||||
usedSystemDict = usedSystemDict != NULL ? usedSystemDict : systemDict;
|
||||
if (usedOemDict == NULL) {
|
||||
|
||||
@@ -466,19 +466,21 @@ static const u8 gArDeconvPlttTbl[3072] = {
|
||||
0x00, 0xD5, 0x00, 0xD6, 0x00, 0xD8, 0x00, 0xDA, 0x00, 0xDC, 0x00, 0xDE, 0x00, 0xDF, 0x00, 0xE1
|
||||
};
|
||||
|
||||
static const u32 gArDc_luminance_huffTable[] = {
|
||||
0x00018002, 0x00030000, 0xC003C004, 0x80050001, 0x00020003, 0x00040005,
|
||||
0x80010006, 0x80010007, 0x80010008, 0x80010009, 0x8001000A, 0x8001000B,
|
||||
static const u16 gArDc_luminance_huffTable[] = {
|
||||
0x0001, 0x8002, 0x0003, 0x0000, 0xC003, 0xC004, 0x8005, 0x0001,
|
||||
0x0002, 0x0003, 0x0004, 0x0005, 0x8001, 0x0006, 0x8001, 0x0007,
|
||||
0x8001, 0x0008, 0x8001, 0x0009, 0x8001, 0x000A, 0x8001, 0x000B,
|
||||
};
|
||||
|
||||
static const u32 gArDc_chrominance_huffTable[] = {
|
||||
0x0001C002, 0x80030000, 0x00010002, 0x80010003, 0x80010004, 0x80010005,
|
||||
0x80010006, 0x80010007, 0x80010008, 0x80010009, 0x8001000A, 0x8001000B,
|
||||
static const u16 gArDc_chrominance_huffTable[] = {
|
||||
0x0001, 0xC002, 0x8003, 0x0000, 0x0001, 0x0002, 0x8001, 0x0003,
|
||||
0x8001, 0x0004, 0x8001, 0x0005, 0x8001, 0x0006, 0x8001, 0x0007,
|
||||
0x8001, 0x0008, 0x8001, 0x0009, 0x8001, 0x000A, 0x8001, 0x000B,
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
struct HufftreeData {
|
||||
const u32* tables[4];
|
||||
const u16* tables[4];
|
||||
char messages[0x1BB];
|
||||
};
|
||||
#pragma pack()
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# BS2 low-level DVD completion callback contract
|
||||
|
||||
Base: `9c7d87ab008df7e35558321e3ca297a887d35c44`.
|
||||
Leaf: `agent/bittle/bs2-dvd-callback-contract`, 43U only.
|
||||
|
||||
## Source evidence
|
||||
|
||||
`DVDLowCallback` is `void (*)(u32 intType)`. BS2Mach defined its completion
|
||||
callback with a signed s32 parameter and cast it to the unsigned function
|
||||
pointer type at five registration sites. DVDLowContext stores DVDLowCallback,
|
||||
and the original exact doTransactionCallback dispatches through that type.
|
||||
The callback simply publishes the received word to volatile u32 LowReadResult.
|
||||
Use the unsigned parameter directly and remove the five casts.
|
||||
|
||||
The original callback symbol at 0x8137BA1C is local, while baseline source
|
||||
emitted it globally. All references are private to BS2Mach.c. Restore static
|
||||
linkage in a separate measured follow-on; no other function/global changes.
|
||||
|
||||
Original evidence was checked independently against the DOL:
|
||||
|
||||
- Five registration sites contain ten address-materialization relocations
|
||||
resolving to callback 0x8137BA1C
|
||||
- The callback stores the entire r3 word to LowReadResult 0x81698A54, then
|
||||
returns; the actual SDA base is 0x8169E040
|
||||
- Original dispatcher invocation is at 0x8154F8C8; doTransactionCallback
|
||||
remains instruction-exact, 46/46 instructions
|
||||
- All 123 direct calls in BS2StartGame and BS2StartGCGame agree with original
|
||||
raw destinations; their request-buffer widths/offsets and ABI inputs agree
|
||||
- Ordinary NAND completion has its separate signed-result/block contract
|
||||
and is untouched
|
||||
|
||||
## Separately measured trials
|
||||
|
||||
1. Unsigned callback parameter and removal of five casts only. Entire MWCC
|
||||
object byte-identical to baseline, SHA256
|
||||
`b853f8e58ead247dd8d333f4a7413e56b9c9e92341ad1bf54034fdf2f2be93b6`.
|
||||
Full report byte-identical across 1,027 units.
|
||||
2. Add static linkage. Only callback's symbol binding changes, global to
|
||||
local, matching the original. Every other symbol record and all 1,461
|
||||
relocation sites/types/target identities/addends remain unchanged.
|
||||
All five allocated sections retain identical contents, extents, flags
|
||||
and alignment, including BSS/SBSS extents. Final object SHA256
|
||||
`154cd050a7295a1178de648a2abacf311cc2b4c96548926eb6d77eedb177c2e4`.
|
||||
Full report again byte-identical to baseline.
|
||||
|
||||
Whole-object identity is claimed only for trial 1; trial 2 changes metadata.
|
||||
No matching/fuzzy percentage gain or change in boot behavior is claimed.
|
||||
|
||||
## Tests and gates
|
||||
|
||||
- Fresh baseline configured with `python3 configure.py --version 43U
|
||||
--wrapper ../toolchain/wibo-build/wibo`; full source/report/DOL build passes
|
||||
- Candidate object built separately for both trials; final full invocation
|
||||
`WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja all_source
|
||||
build/43U/report.json build/43U/ok` passes
|
||||
- Pool identical: 91/91 strings
|
||||
- All 25 exact functions independently retain zero instruction differences;
|
||||
callback remains 2/2 instructions at .text+0xA68, STB_LOCAL as original
|
||||
- Unit unchanged: 25/29 exact functions, 5,112/16,980 matched code bytes,
|
||||
155,504/158,528 matched data bytes, fuzzy 99.09658%
|
||||
- Literal advisory: 28 functions, 97 arguments, no candidates or errors;
|
||||
skips only BS2Tick because its extents differ
|
||||
- DOL SHA1 `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- `git diff --check` passes
|
||||
|
||||
Host compiler test extracts the baseline and final callback definitions with
|
||||
fixed-width host equivalents. Direct assignment to DVDLowCallback fails for
|
||||
the signed baseline under -Werror=incompatible-pointer-types and succeeds for
|
||||
the final definition. The final callback preserves 200,007 tested words under
|
||||
UBSan, including 0, 1, 2, 0x40, INT32_MAX, 0x80000000 and UINT32_MAX.
|
||||
This is a compile-time function-type counterexample; GCC UBSan is not claimed
|
||||
to detect the baseline's incompatible indirect call.
|
||||
|
||||
Private evidence: `/tmp/bs2-boot-contract/` and workspace-parent
|
||||
`validation/bs2-boot-contract-20261003/`. Original binary/disassembly is not
|
||||
committed. No shared header, volatility, Run body, state, or linking change.
|
||||
53
tools/decomp-assist/CHANSVm-boolean-output-20261003.md
Normal file
53
tools/decomp-assist/CHANSVm-boolean-output-20261003.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# CHANSVm boolean output contract
|
||||
|
||||
Base: `fc114afd44065fb99f9ff2fe2969f393a504fe03` (43U).
|
||||
Leaf: `agent/bittle/chans-scalar-contracts`.
|
||||
|
||||
## Correction and evidence
|
||||
|
||||
`CHANSVmGetBoolean` writes an optional four-byte `vmBoolInt` result, but its
|
||||
source formal described a `CHANSVmObjHdr*`. All three callers cast addresses
|
||||
of scalar locals to that object pointer. The original helper's only output
|
||||
write is a word store at `0x8144C664`. Its Step call destinations at
|
||||
`0x81456B08`, `0x81457584`, and `0x814575B0` were verified directly in the
|
||||
original DOL, as were 48 nonrelocated helper words and its direct callees.
|
||||
|
||||
The actual MWCC layout probe confirms object alignment/size 8/16 and scalar
|
||||
alignment/size 4/4. Step's two conditional-branch callers pass sp+0x0C, which
|
||||
has scalar alignment but not object alignment. Declaring a whole object at
|
||||
that address is an incorrect source contract even though the generated
|
||||
helper only performs one word store.
|
||||
|
||||
Use `vmBoolInt*` as the output formal, assign through `*ret`, make both
|
||||
receiving locals `vmBoolInt`, and remove all three casts. No shared header
|
||||
contains a declaration, and no header changed. A repository-wide source
|
||||
search found exactly this definition and these three calls. A complete
|
||||
original-object relocation scan found only those calls plus ten labels in
|
||||
the helper's own switch table; no additional callback was found.
|
||||
|
||||
## Tests and gates
|
||||
|
||||
- Source-extracted baseline reproduces a UBSan misaligned-object access when
|
||||
passed a four-byte-aligned, non-eight-byte-aligned scalar destination.
|
||||
- Candidate passes 1,283 typed-output cases, corresponding null-output calls,
|
||||
and surrounding-byte canaries. Coverage includes all 256 discriminator
|
||||
values, signed integer boundaries, zero/nonzero string lengths, finite
|
||||
floating values, signed zero, infinities, NaN, and error/no-write paths.
|
||||
- This is a focused host helper harness with a modeled object layout and
|
||||
`isnan` shim, not full VM or Wii runtime execution. Target layout was
|
||||
independently checked with the configured MWCC compiler.
|
||||
- Entire compiled object is byte-identical, including code, data, symbols
|
||||
and relocations. SHA256:
|
||||
`5bf3f4a0a404e2a574287c16de81d702a1402d9fca416455e84dc1df67c9eb76`.
|
||||
- All 1,027 report units unchanged. Exact CHANS functions 222/233; exact code
|
||||
38,136/53,564; data 6,904/6,904. GetBoolean remains 100%; Step 96.98723%.
|
||||
- Pool: 125/125 identical. `git diff --check` passes.
|
||||
- Full 43U `all_source`, report, and `ok` gates pass with the existing cached
|
||||
tools selected through documented configure overrides. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Artifacts: `/tmp/chans-step-abi/`, including `test_boolean.py`, the MWCC
|
||||
alignment probe, `check_boolean_original.py`, and build/test results.
|
||||
No original binary or disassembly is committed.
|
||||
|
||||
GATE: coherent scalar-output source correction; no fuzzy/exact/data/link gain.
|
||||
79
tools/decomp-assist/CHANSVm-hmac-linkage-20261003.md
Normal file
79
tools/decomp-assist/CHANSVm-hmac-linkage-20261003.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# CHANSVm HMAC external declarations
|
||||
|
||||
Base: `20ba34a80f9d0a09c4a8fad51352f0dd97d84be0` (43U).
|
||||
Leaf: `agent/bittle/chans-hmac-linkage`.
|
||||
|
||||
## Source evidence
|
||||
|
||||
The four HMAC/SHA1 helper declarations at the top of `CHANSVm.c` had
|
||||
`static` linkage but no definitions in that translation unit. A fresh MWCC
|
||||
compile emitted four warning 10532 diagnostics. The definitions in
|
||||
`libs/RevoEX/src/net/sha1.c` and `hmac.c` have external linkage;
|
||||
`CDBRecord.c` already declares these imports `extern`.
|
||||
|
||||
The original CHANS object imports all four as `STB_GLOBAL`, `SHN_UNDEF`.
|
||||
The baseline source object instead imported them as `STB_LOCAL`,
|
||||
`SHN_UNDEF`. Change only the four declaration storage classes to `extern`.
|
||||
Do not change the context, parameter types, shared headers, or linking flags.
|
||||
|
||||
Independent original-DOL call decoding agrees with the extracted relocations:
|
||||
|
||||
| Caller | Call address | Destination | Import |
|
||||
| --- | --- | --- | --- |
|
||||
| VmBlobCalcHMAC | 0x81452720 | 0x81494144 | NETGetSHA1Interface |
|
||||
| VmBlobCalcHMAC | 0x81452734 | 0x814944EC | NETHMACInit |
|
||||
| VmBlobCalcHMAC | 0x81452744 | 0x81494728 | NETHMACUpdate |
|
||||
| VmBlobCalcHMAC | 0x81452750 | 0x81494738 | NETHMACGetDigest |
|
||||
| VmBlobCalcRangeHMAC | 0x814528F4 | 0x81494144 | NETGetSHA1Interface |
|
||||
| VmBlobCalcRangeHMAC | 0x81452908 | 0x814944EC | NETHMACInit |
|
||||
| VmBlobCalcRangeHMAC | 0x81452918 | 0x81494728 | NETHMACUpdate |
|
||||
| VmBlobCalcRangeHMAC | 0x81452924 | 0x81494738 | NETHMACGetDigest |
|
||||
|
||||
The ABI contracts agree: Init takes context/interface/key/u32 length in
|
||||
r3-r6, Update takes context/data/u32 length, and GetDigest takes
|
||||
context/output. The interface helper returns its pointer in r3.
|
||||
Original caller context addresses are sp+8 and sp+0x10. The exact HMAC
|
||||
implementation uses the interface at 0x00-0x1B, key length at 0x1C,
|
||||
96-byte digest state at 0x20, and 64-byte key at 0x80, totaling 0xC0.
|
||||
The existing CHANS opaque context reserves 0xD0 with 8-byte alignment.
|
||||
That storage is unchanged. Caller opaque types and callee named types
|
||||
remain separate declarations; this change fixes linkage only, not complete
|
||||
cross-translation-unit type compatibility.
|
||||
|
||||
## Validation
|
||||
|
||||
- Configured 43U with `../toolchain/wibo-build/wibo`; fresh baseline full
|
||||
source/report/DOL build passed, followed by a forced owned-object rebuild.
|
||||
- Baseline emitted exactly four warning 10532 diagnostics; candidate emitted
|
||||
none. No other compiler warning appeared in the candidate object build.
|
||||
- The four imports now have exactly the original symbol records, including
|
||||
global undefined binding. Every other symbol record is unchanged.
|
||||
- All six allocated sections retain identical contents, extents, alignment,
|
||||
type and flags, including the NOBITS section's extent.
|
||||
- All 2,010 relocation sites, types, symbol identities and addends are
|
||||
unchanged. Comparison resolves symbol indexes because binding changes
|
||||
can reorder the ELF symbol table.
|
||||
- All 1,027 unit report records are unchanged. CHANS: fuzzy 99.4341%,
|
||||
exact code 38,136/53,564 bytes, exact functions 222/233,
|
||||
matched data 6,904/6,904 bytes.
|
||||
- Independently compared all 222 exact functions against original
|
||||
instruction streams, with zero differences.
|
||||
- The two HMAC callers remain 64/64 and 119/119 instructions, diffs 0.
|
||||
- Pool: identical 125/125 entries. Literal advisory: 233 functions,
|
||||
40 arguments, no candidates, errors, or skips.
|
||||
- Eight call destinations and 392 nonrelocated instruction words across
|
||||
the two callers and four helpers agree with original DOL bytes.
|
||||
- Final `WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja all_source
|
||||
build/43U/report.json build/43U/ok` passes; DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`. `git diff --check` passes.
|
||||
|
||||
Whole-object identity is intentionally not claimed: symbol bindings changed.
|
||||
SHA256 before:
|
||||
`f971cabf817dba7e5cb240df01e1e8f814bb0a973e357a594d031046a56e691b`.
|
||||
SHA256 after:
|
||||
`5bf3f4a0a404e2a574287c16de81d702a1402d9fca416455e84dc1df67c9eb76`.
|
||||
|
||||
Private reproducibility artifacts are under
|
||||
`validation/chans-hmac-linkage-20261003/` in the workspace parent and
|
||||
`/tmp/chans-hmac-linkage/`. No original binary or disassembly is committed.
|
||||
This is a source declaration correction with no decompilation percentage gain.
|
||||
57
tools/decomp-assist/CHANSVm-immediate-width-20261003.md
Normal file
57
tools/decomp-assist/CHANSVm-immediate-width-20261003.md
Normal file
@@ -0,0 +1,57 @@
|
||||
# CHANSVm immediate integer accumulation
|
||||
|
||||
Base: `a52b3390` on `agent/bittle/chans-scalar-contracts` (43U).
|
||||
This isolated commit follows, but does not alter, the boolean-output correction.
|
||||
|
||||
## Correction
|
||||
|
||||
`VmLoadImmInteger` assembled bytes by repeatedly left-shifting a signed
|
||||
64-bit accumulator. An eight-byte immediate beginning with 0x80 through
|
||||
0xFF can overflow that signed shift on the final iteration. Use an unsigned
|
||||
64-bit accumulator, then convert the final word to the existing signed
|
||||
`vmInteger` argument of `CHANSVmSetInteger`.
|
||||
|
||||
The original helper at `0x81455D88` shifts and combines high/low 32-bit words
|
||||
modulo 64 bits. It reads unsigned bytes in big-endian order. Short immediate
|
||||
widths do not sign-extend: one-byte 0xFF is 255, not -1. The target tail call
|
||||
preserves VM/object in r3/r4 and supplies high/low value words in r5/r6.
|
||||
Step's two call sites supply counts 1, 2, 4, or 8 for immediate loads, and
|
||||
1 for binary immediate operations. No negative-width caller was found.
|
||||
|
||||
Unsigned shifts are defined. The final out-of-range unsigned-to-signed
|
||||
conversion is implementation-defined in C; configured MWCC probes verify
|
||||
bit-preserving conversion for bit 63, all bits set, and dynamic input.
|
||||
The dynamic conversion emits only a return instruction. Host GCC tests
|
||||
independently verify the selected implementation's behavior. No universal
|
||||
portable-C conversion claim is made.
|
||||
|
||||
## Verification
|
||||
|
||||
- Source-extracted baseline UBSan fails while assembling `80 00 00 00 00
|
||||
00 00 00`. The candidate passes 315,813 cases: every combination of
|
||||
0x00/0x7F/0x80/0xFF at widths 1/2/4/8, generated inputs, and zero width.
|
||||
Tests check value bits, VM/object callback arguments, and propagated result.
|
||||
- A bounded interpreter executes the original helper's 16 nonbranch-tail
|
||||
instruction words, independently checked against the original DOL.
|
||||
The tail branch destination is verified as `CHANSVmSetInteger`.
|
||||
All 165,813 original-DOL cases agree with an independent big-endian
|
||||
unsigned reference and with r3/r4/r5:r6 call contracts.
|
||||
- These are focused host/helper-slice tests, not complete VM or Wii runtime
|
||||
execution. Counts outside the observed 1/2/4/8 contract are not generally
|
||||
validated; zero was checked as an additional no-read boundary.
|
||||
- VmLoadImmInteger remains exact: 17/17 instructions, ctxdiff 0 differences.
|
||||
- Entire CHANSVm.o remains byte-identical to both the preceding commit and
|
||||
initial branch baseline, including code/data/symbols/relocations. SHA256:
|
||||
`5bf3f4a0a404e2a574287c16de81d702a1402d9fca416455e84dc1df67c9eb76`.
|
||||
- All 1,027 report units remain unchanged. All 222 exact functions were
|
||||
independently compared with the original and have zero differences.
|
||||
- Pool: 125/125. Literal advisory: 233 functions, 40 arguments, no
|
||||
candidates/errors/skips. `git diff --check` passes.
|
||||
- Full 43U `all_source`, report, and `ok` gate passes with existing cached
|
||||
tooling. DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Artifacts: `/tmp/chans-step-abi/test_immediate.py`,
|
||||
`check_immediate_original.py`, conversion probe, and build/test results.
|
||||
No original binary or disassembly is committed.
|
||||
|
||||
GATE: source-width correctness correction; no fuzzy/exact/data/link gain.
|
||||
71
tools/decomp-assist/CHANSVm-index-width-20261003.md
Normal file
71
tools/decomp-assist/CHANSVm-index-width-20261003.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# CHANSVm string-index width correction
|
||||
|
||||
Baseline: `7b8dbf2c96aa9b4490df35932850c59886f76be3` in the prepared
|
||||
`agent/bittle/chinese-code-width` leaf. Before editing, the owned CHANSVm source
|
||||
was also identical to the available `origin/main` at `6619098e`. The earlier
|
||||
Chinese investigation remains unchanged. Only CHANSVm.c and this log change.
|
||||
|
||||
## Correction
|
||||
|
||||
The SET_INDEX string path parsed into a `u64`, reconstructed that value through
|
||||
`VM_S64_FROM_U64`, then cast it back to `u64` for the bound check. The macro's
|
||||
signed 64-bit high-word left shift overflows when the parsed value has bit 63
|
||||
set. For example, parsing "-1" reaches a signed shift of 4294967295 by 32.
|
||||
|
||||
Compare the original `u64` directly against the existing `0xFFFFFFFE` bound.
|
||||
Remove the now-unused macro. The integer and floating paths are unchanged.
|
||||
This removes undefined source behavior; it does not claim a change to the
|
||||
current MWCC executable, a fuzzy gain, or a new exact function.
|
||||
|
||||
## Original evidence
|
||||
|
||||
- Original CHANSVmStep is at `0x81456354`, with extent `0x1394`.
|
||||
- `0x814563B8` and `0x814563BC` establish the bound's high and low words as
|
||||
zero and `0xFFFFFFFE`.
|
||||
- The parsed-string check at `0x81456E90` through `0x81456EB4` reads the two
|
||||
parsed words and performs an unsigned two-word comparison. Values greater
|
||||
than the bound select the existing SET_INDEX error; accepted values forward
|
||||
their low word as the index.
|
||||
- These instruction words were checked directly against the original DOL,
|
||||
independently of relocation matching. The DOL has the required SHA1 below.
|
||||
- CHANSVmParseInt calls `strtoull` and stores its unsigned result. The local MSL
|
||||
implementation (`strtoul.c`, lines 327–348) explicitly applies a negative sign
|
||||
in unsigned width. Both helpers are already exact in the live report.
|
||||
- Prior CHANSVm attempt logs were checked; the typed integer/float comparison
|
||||
work did not address this signed reconstruction in the parsed-string path.
|
||||
|
||||
## Tests and measurements
|
||||
|
||||
- Baseline source-extracted UBSan harness fails on "-1" with signed left-shift
|
||||
overflow. The candidate passes 300,028 parsed-value and unsigned-boundary
|
||||
cases without a sanitizer error.
|
||||
- Inputs include zero, `0xFFFFFFFE`, `0xFFFFFFFF`, `0x100000000`, signed-64
|
||||
boundaries, maximum unsigned-64, negative decimal strings, parse failures,
|
||||
and deterministic generated values. The unusual unsigned parsing of
|
||||
"-18446744073709551615" to 1 remains accepted, matching the existing parser.
|
||||
- A separate bounded interpreter executes the original DOL comparison slice
|
||||
for 300,010 values, checking its error branch and accepted index against an
|
||||
independent high-word/low-word bound reference. Every case passes.
|
||||
- These are focused host/slice tests, not complete VM or Wii runtime tests.
|
||||
The parser harness uses a UTF-16-to-ASCII shim and host `strtoull`; MSL's
|
||||
negative-sign behavior was also checked in its local source.
|
||||
- Entire compiled object, including all code, data and relocations, is
|
||||
byte-identical before/after. SHA256:
|
||||
`f971cabf817dba7e5cb240df01e1e8f814bb0a973e357a594d031046a56e691b`.
|
||||
- Complete 1,027-unit report is unchanged. CHANSVmStep remains 96.98723%,
|
||||
1,253/1,253 instructions. Unit fuzzy remains 99.4341%.
|
||||
- Exact functions remain 222/233, each individually checked with ctxdiff:
|
||||
zero differences. Exact code remains 38,136/53,564 bytes; data 6,904/6,904.
|
||||
- Pool: 125/125 strings identical. Literal advisory: 233 functions, 40 arguments,
|
||||
no candidates, skips or errors.
|
||||
- Full 43U `all_source`, report and `ok` gates pass using the assigned wrapper
|
||||
and WIBO_SJIS_MISSING_IMPORTS=1. `git diff --check` passes.
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Private local reproduction files are in `/tmp/chans-index-width/`, including
|
||||
baseline/candidate sources and objects, test_width.py, check_original.py,
|
||||
sanitizer output, original-address checks, pool/literal results and build logs.
|
||||
No original binary or disassembly is committed. No header, metadata, compiler,
|
||||
linking, other-region, remote, or register-allocation change was made.
|
||||
|
||||
GATE: source-width correctness fix; compiler output and all progress preserved.
|
||||
88
tools/decomp-assist/CHANSVm-pack-rounding-20261003.md
Normal file
88
tools/decomp-assist/CHANSVm-pack-rounding-20261003.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# CHANSVm packed-hex count rounding
|
||||
|
||||
Base: `a30b5cecb68f4549ef83565a567cc5dd7bd4c0de` (43U).
|
||||
Leaf: `agent/bittle/chans-pack-union`.
|
||||
|
||||
## Retained source-width correction
|
||||
|
||||
The sizing and writing passes of `VmBlobPackCommon` both computed
|
||||
`(count + 1) / 2` in signed 32-bit arithmetic for hexadecimal strings.
|
||||
The existing parser accepts `H2147483647`, making the addition overflow.
|
||||
Both sites now add in unsigned 32-bit width, convert the wrapped word to
|
||||
`s32`, then perform the existing signed division.
|
||||
|
||||
This preserves the target's unusual boundary behavior. It does not change
|
||||
`INT_MAX` into a positive rounded-up size. The original result is
|
||||
`-1073741824`; the writing pass forwards its signed extension to the existing
|
||||
`CHANSVmBlobHasSpace` check, which rejects negative sizes. All surrounding
|
||||
count, size, allocation, and error checks are unchanged.
|
||||
|
||||
Unsigned addition is defined modulo 2^32. Converting an out-of-range `u32`
|
||||
to `s32` is implementation-defined in C, not signed-overflow undefined
|
||||
behavior. Separate MWCC probes confirm the configured 32-bit compiler's
|
||||
bit-preserving conversion: `0x80000000` becomes `INT_MIN`, and `0xffffffff`
|
||||
becomes -1. Its dynamic rounding probe emits the same add, arithmetic-shift,
|
||||
and carry-add sequence as the original. The host GCC harness uses explicit
|
||||
32-bit typedefs and independently confirms that conversion behavior.
|
||||
This is not a claim of portable behavior for every possible C implementation.
|
||||
|
||||
## Original and prior-work evidence
|
||||
|
||||
- Original `VmBlobPackCommon`: address `0x81453670`, extent `0xA70`.
|
||||
- Sizing-pass rounding: relative `+0x320` through `+0x330`.
|
||||
- Writing-pass rounding and signed call argument: `+0x940` through `+0x954`.
|
||||
- Those words agree directly with the original DOL, independently of the
|
||||
extracted object's relocations.
|
||||
- Earlier CHANS logs covered count validation, padding, parser locals,
|
||||
declaration orders, loop structure, and source/getter types. No earlier
|
||||
packed-hex `count + 1` wrap correction was found.
|
||||
|
||||
## Validation
|
||||
|
||||
- Source-extracted baseline arithmetic fails UBSan at `INT_MAX + 1`.
|
||||
- Candidate passes 1,000,022 direct arithmetic inputs and 11 source-extracted
|
||||
parser cases, including `H2147483647`, neighboring odd/even limits, zero,
|
||||
ordinary counts, `H*` (-1), and the existing overflowing-digit rejection.
|
||||
Star-derived string lengths include zero and the largest u32 byte lengths.
|
||||
- Two bounded original-DOL instruction interpreters each pass 1,000,013
|
||||
inputs against an independent widened-arithmetic reference, including
|
||||
INT_MAX neighbors, negative boundaries, and generated nonnegative counts.
|
||||
The second slice also verifies signed 64-bit argument extension.
|
||||
- These are focused parser/arithmetic/slice tests, not complete VM or Wii
|
||||
runtime tests. The parser is unchanged and is not generally proven free
|
||||
from other arithmetic issues.
|
||||
- Entire CHANSVm object is byte-identical before/after, including code,
|
||||
data, symbols and relocations. SHA256:
|
||||
`5bf3f4a0a404e2a574287c16de81d702a1402d9fca416455e84dc1df67c9eb76`.
|
||||
- All 1,027 report units are unchanged. CHANS exact functions: 222/233;
|
||||
exact code: 38,136/53,564; exact data: 6,904/6,904.
|
||||
- All 222 objdiff-exact functions independently have identical original
|
||||
instruction streams. PackCommon remains 97.949104%, 668/668 instructions;
|
||||
CHANSVmStep remains 96.98723%, 1,253/1,253 instructions.
|
||||
- Pool: 125/125 identical. Literal advisory: 233 functions, 40 arguments,
|
||||
no candidates, errors, or skips. `git diff --check` passes.
|
||||
|
||||
- Final full 43U `all_source`, report, and `ok` gates pass. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
- The initial final-build run stopped when an automatic BSTool refresh was
|
||||
blocked. Its resume attempt found that the process had ended. The final
|
||||
build used configure.py's supported explicit paths to the existing cached
|
||||
compiler, binutils, DTK, objdiff, sjiswrap, and BSTool. No executable was
|
||||
replaced and no download was needed. All 1,027 source objects were rebuilt.
|
||||
- The final object and complete report remain identical to their fresh
|
||||
baseline after that full rebuild.
|
||||
|
||||
GATE: source-width correctness correction; zero fuzzy, exact, data, or linking
|
||||
metric changes. The unit remains NonMatching and no linking flags changed.
|
||||
|
||||
## Rejected separate scratch-buffer trial
|
||||
|
||||
Before the overflow change, one bounded trial replaced PackCommon's cast-based
|
||||
scratch array with a union whose integer-width members were all used.
|
||||
MWCC removed two scratch-clearing stores: 668 -> 666 instructions, fuzzy
|
||||
97.949104% -> 97.500000%. The trial was fully restored; the restored whole
|
||||
object was verified byte-identical before starting the overflow change.
|
||||
No union change is retained, and no declaration or register sweep was run.
|
||||
|
||||
Reproduction artifacts are in `/tmp/chans-pack-rounding/` and
|
||||
`/tmp/chans-pack-union/`. No original binary or disassembly is committed.
|
||||
79
tools/decomp-assist/allhands-address-drag.attempts.md
Normal file
79
tools/decomp-assist/allhands-address-drag.attempts.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# Address drag-width reconstruction, 2026-10-03 UTC
|
||||
|
||||
Base `e4a94492`, branch `agent/bittle/address-drag-reconstruction`, 43U only.
|
||||
Only `src/scene/address/iplAddress.cpp` and this log changed. Headers, metadata,
|
||||
linking flags, other worktrees and earlier attempt logs are untouched.
|
||||
|
||||
## Recovered behavior and source structure
|
||||
|
||||
The original movePane_onDrag null-text-box and null-name exits skip the 0.01f
|
||||
text-width margin. The baseline incorrectly added that margin unconditionally.
|
||||
This was visible in the original branch destinations and also documented in
|
||||
older fz10 attempts, but the incomplete correction had not been retained.
|
||||
|
||||
The new typed inline GetDragNameWidth helper receives the text box and a reference
|
||||
to the real friend record. It evaluates the record address before entering the
|
||||
measurement path, checks the text box, then derives/checks the name address.
|
||||
This recovers the target's two early-exit regions, delayed name-member address,
|
||||
font calls, character-width loop, and successful-only margin. An empty but valid
|
||||
name still receives the margin, as the target does. The existing unused GetWidth
|
||||
call and per-character GetFont lookup remain present.
|
||||
|
||||
The text box lookup now spells out the root-pane FindPaneByName call already
|
||||
used by layout::Object's wrapper. An explicit right-edge value preserves the
|
||||
existing single-precision add, ratio multiply, and negation sequence; it does
|
||||
not combine ratios, reassociate operations, or change the comparison. Together,
|
||||
these source boundaries make the complete function instruction-exact.
|
||||
|
||||
## Attempts
|
||||
|
||||
- Read scene4, data-d7, sol-med and fz10 drag-width evidence before iterating.
|
||||
- Moving only the margin to the measured branch improved 92.451614 -> 93.741936%.
|
||||
The target's margin-first addition reached 93.80645%.
|
||||
- Computing the typed friend-record reference before the guard reached 98.064514%.
|
||||
- A nullable name-pointer helper reached 98.741936% but 156/155 instructions.
|
||||
The friend-record-reference helper recovered 155/155 and 99.80645%.
|
||||
- An explicit projected right-edge accumulator recovered the target FP register
|
||||
lifetime and reached 99.870964%. Mutating the translation vector instead grew
|
||||
the function and was rejected.
|
||||
- Direct root-pane lookup resolved the last four receiver/literal register
|
||||
operands, reaching 100.0%. No parameter or declaration sweep was used.
|
||||
- No new assembly, use-site volatile, dummy storage, padding, uninitialized
|
||||
values, compiler-option changes or linking experiments were introduced.
|
||||
|
||||
## Verification
|
||||
|
||||
Before -> after:
|
||||
- movePane_onDrag: 92.451614 -> 100.0% objdiff; 153 -> 155 instructions against
|
||||
target 155; ctxdiff diffs 0 across the whole 0x26C-byte function.
|
||||
- Unit fuzzy: 99.69818 -> 99.89328%.
|
||||
- Exact functions 97/101 -> 98/101; matched code 21236 -> 21856 / 23988 bytes.
|
||||
- Data 1964/1964 (100%) and linked status unchanged.
|
||||
- Fresh baseline/candidate object comparison: all 97 previously objdiff-exact
|
||||
function streams are unchanged. Raw .data, .rodata, .sbss, .sdata, .sdata2 and
|
||||
.ctors bytes/extents are unchanged.
|
||||
- Pool: all 81 strings identical to target.
|
||||
- Literal audit: 86 arguments checked across 100 functions, no candidates or
|
||||
errors. FriendListCache::update is skipped for its pre-existing size mismatch.
|
||||
- Full 1027-unit report has no exact-function/code/data/fuzzy regressions.
|
||||
- Full 43U build and build/43U/ok passed. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Host behavior verification extracts the production helper and method bodies and
|
||||
uses deterministic UI/controller/font stubs. With -fno-fast-math,
|
||||
-ffp-contract=off and undefined-behavior/bounds sanitizers, all 200,000 geometry
|
||||
cases agree bit-for-bit with an independent target-ordered FP reference. Coverage
|
||||
includes 66,667 null-text-box cases, empty/nonempty UTF-16 names, page offsets,
|
||||
varied projection widths, both clamp branches and comparison boundaries. Font
|
||||
lookup/width/character-call counts are also checked. Embedded name arrays are
|
||||
valid objects; invalid-record/null-name pointer execution and Wii runtime UI
|
||||
behavior are not claimed.
|
||||
|
||||
Private evidence: `/tmp/address-drag-reconstruction/` contains baseline/final
|
||||
reports and source objects, drag-final.ctx, pool/literal audits, full-build.log,
|
||||
validate_drag.py and drag-tests.log, plus the rejected source experiments. No
|
||||
retail assembly or binary is included in this commit.
|
||||
|
||||
GATE: movePane_onDrag exact, behavior correction verified, all prior exact/data
|
||||
metrics preserved. Other unit remainders and linking remain open. Frozen for
|
||||
independent parent validation.
|
||||
20
tools/decomp-assist/allhands-aoss-call-contract.attempts.md
Normal file
20
tools/decomp-assist/allhands-aoss-call-contract.attempts.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# AOSS WLAN connection argument contract
|
||||
|
||||
Base 9c7d87ab, 43U. This correction is separate from the key-material representation work.
|
||||
|
||||
AOSSConnectAndAwaitHost receives settings and config pointers but previously called AOSSi_WLANConnect through a false no-argument declaration. The actual callee takes a connection record and status output. In the original caller, incoming r3/r4 are forwarded untouched to the first call; the callee preserves r3/r4 and consumes both. The compiler happened to retain the same register contents despite the missing source arguments, hiding this defect behind exact generated code.
|
||||
|
||||
The local declaration now uses forward-declared struct AOSSConnection and struct AOSSConnectionStatus, matching the existing tags in AOSSLink.c. The wrapper explicitly passes settings and config. No shared header or AOSSLink.c edit. All three original outer callsites supply r3 = sp+0xb8 (settings) and r4 = s_accessPointConfig, matching the source caller expressions. No arguments are reordered or synthesized.
|
||||
|
||||
Validation:
|
||||
- Configured/built 43U using the approved wibo wrapper and WIBO_SJIS_MISSING_IMPORTS=1
|
||||
- AOSSConnectAndAwaitHost remains 60/60 instructions, ctxdiff zero
|
||||
- Every code/data/relocation section, section header, and symbol record is byte-identical to baseline; only five compiler-generated anonymous local symbol spellings change in .strtab
|
||||
- Full-project objdiff report unchanged: AOSS unit 97.71665% fuzzy, 16/21 exact, 6436 exact code bytes and 3928/3928 data bytes; no matching gain claimed
|
||||
- Pool identical, 1/1 strings; literal audit checks 12 arguments across 19 functions, no candidates/errors; AOSS_Init_old and AOSSSendHelloRequest are skipped for their existing unequal sizes
|
||||
- ASan/UBSan extracted-production wrapper harness passes 30,600 cases, asserting actual typed callee pointer identities, driver/startup failures, host readiness, cancellation, all retry boundaries and the original timeout behavior (cleanup and status clear, then return zero). No network calls occur; platform functions are controlled stubs
|
||||
- LeakSanitizer disabled for ptrace restriction; address/undefined instrumentation enabled
|
||||
- Full 43U build and ok gate pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
Private reproducible evidence: /tmp/aoss-key-call-contracts, with original caller/callee disassembly retained privately under /tmp/aoss-decrypt-audit.
|
||||
26
tools/decomp-assist/allhands-aoss-key-material.attempts.md
Normal file
26
tools/decomp-assist/allhands-aoss-key-material.attempts.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# AOSS contiguous key-material representation
|
||||
|
||||
Base candidate: 00b02c27 (the separate WLAN argument-contract correction). Original branch base: 9c7d87ab. 43U only.
|
||||
|
||||
## Evidence and focused change
|
||||
|
||||
The original decryptor copies two raw nonce bytes and eight access-point bytes into consecutive positions of s_packetState, then passes that base and length 10 to AOSSInitKeySchedule. The original hello sender builds the same key. The key-schedule helper actually indexes all ten bytes; its instruction stream and resolved calls match the source exactly.
|
||||
|
||||
Previously the caller passed keyNonce[2] with length sizeof(keyNonce)+sizeof(keyAddress), relying on indexing beyond the first array member. AOSSKeyMaterial now represents the complete key as named nonce[2] and address[8] members. s_packetState embeds this key object, followed by its unchanged payload[0x5e]. Each schedule call uses a const u8 byte view of the complete key object with sizeof(key), so the byte span belongs to the object being viewed.
|
||||
|
||||
Only the two nonce copies, two address copies, and two key-schedule calls in AOSSDecryptMessage/AOSSSendHelloRequest are updated. No other packet representation, algorithm, checksum, byte order, allocation, validation, state transition, header or protocol change. No added storage, alignment, padding or assembly.
|
||||
|
||||
## Layout and gates
|
||||
|
||||
- Key size 10, nonce offset 0, address offset 2, packet payload offset 10, packet-state size 104, natural byte alignment unchanged
|
||||
- Entire compiled AOSS.o is byte-identical to 00b02c27, including all payloads, symbol spellings and relocations
|
||||
- Full-project objdiff unchanged from branch baseline: unit 97.71665% fuzzy, 16/21 exact, 6436 exact code bytes, 3928/3928 data bytes; no matching gain claimed
|
||||
- DecryptMessage remains 97.74143%, 321/321 instructions and the same 87 allocation/operand differences
|
||||
- Pool identical, 1/1; literal-reference audit still checks 12 arguments in 19 functions without candidates/errors, with the same two unequal-size skips (AOSS_Init_old and AOSSSendHelloRequest)
|
||||
- ASan/UBSan extracted-production harness passes 68,423 cases: all 65,536 nonce byte combinations with varied addresses against an independent schedule model; every valid payload length 0..0x5c0; checksum/allocation/manufacturer/control error paths; 1,024 hello sender encryption round trips. It asserts key layout/content, unchanged trailing payload, output copy/checksum order and allocation cleanup. The production decryptor, sender, key scheduling, CRC table and name check execute; manufacturer scrambling and transport are controlled stubs, with no network activity
|
||||
- The separate 30,600-case WLAN pointer/host-wait validator is rerun and passes
|
||||
- LeakSanitizer disabled for ptrace restriction; address and undefined-behavior instrumentation enabled
|
||||
- Full 43U build and ok gate pass; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
Private reproducible validators, reports and build logs: /tmp/aoss-key-call-contracts. Original disassembly remains private in /tmp/aoss-decrypt-audit.
|
||||
@@ -0,0 +1,28 @@
|
||||
# AOSS scan-result output-slot contract
|
||||
|
||||
Base: bf8ebfa3; 43U. One source line changed in AOSSLink.c.
|
||||
|
||||
## Evidence
|
||||
|
||||
Both actual callers are in AOSS.c. They declare AOSSi_WLANGetBSSList(void**) and pass &s_accessPointList, whose type is void*. The former definition instead accepted AOSSAccessPointList**, a different cross-translation-unit function type and an incompatible lvalue for publishing through that void* slot.
|
||||
|
||||
The definition now accepts void**. Internal list allocation, record types, parsing, callbacks, retries and ownership are unchanged. Assigning the typed internal list to *output now performs the ordinary C object-pointer-to-void* conversion. No AOSS.c/header or protocol change.
|
||||
|
||||
The read-only scan audit found no missing behavior: 227/227 instructions, 25 differences explained by real counter/descriptor register allocation plus independent constant/channel-store scheduling. Count and descriptor fields are unsigned halfwords; descriptor length scales by two. Scan capacity is 0x3200 bytes, output records are 84 bytes, and all 12 rate-mask entries fit the 16-byte rate array. Output remains published even if later cleanup/unlock failure changes the return value, as the target and callers require. No missing validation or unused-field initialization was invented.
|
||||
|
||||
Call-boundary verification pins actual ABI inputs, not just names or freely renamed registers: WD_Startup consumes flags in r3; WD_GetInfo the info pointer in r3; WD_Scan the scan pointer, buffer and length in r3/r4/r5; NCDUnlockWirelessDriver the saved positive driver ID in r3; the release callback receives 0/buffer/0 in r3/r4/r5. NCDLockWirelessDriver and WD_Cleanup genuinely take no caller arguments. Implementations were inspected, and all nine named AOSS/NCD/WD helper bodies additionally compare exactly with original instructions and resolved relocation destinations.
|
||||
|
||||
## Gates
|
||||
|
||||
- Baseline configured with the 43U wibo wrapper and built with WIBO_SJIS_MISSING_IMPORTS=1
|
||||
- Entire AOSSLink.o is byte-identical before/after, including payload, symbols and relocations
|
||||
- Full-project objdiff reports identical; no matching gain claimed
|
||||
- Unit remains 99.007286% fuzzy, 12/14 exact functions, 668 exact code bytes, 2432/2432 data bytes
|
||||
- GetBSSList remains 98.48018%, 227/227 instructions, same 25 differences
|
||||
- Pool empty and identical; literal audit examines all 14 functions with no candidates/errors/skips (zero string arguments)
|
||||
- ASan/UBSan host harness uses the extracted production scan/allocation/free functions and actual source structure declarations. Passes 18,825 scenarios: every 12-bit rate mask with all four mode-bit values, 200 variable-length descriptors exactly filling scan capacity, SSID width boundaries, callback/driver/allocation failures, retry limits, cancellation, partial-scan status, publication followed by cleanup/unlock failures, and actual void* output-slot canaries. Expected results and published fields are checked independently
|
||||
- LeakSanitizer disabled for the execution environment's ptrace restriction; address and undefined-behavior instrumentation remain enabled
|
||||
- Full build, build/43U/ok and git diff --check pass
|
||||
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
|
||||
Private evidence and reproducible host validator: /tmp/aoss-scan-output-contract. Earlier original disassembly/call evidence remains private in /tmp/aoss-bss-audit.
|
||||
@@ -0,0 +1,26 @@
|
||||
# CDB crypt-buffer ownership contract
|
||||
|
||||
Base: 20ba34a8, 43U. Focused source correction after the read-only CDBRecordEncrypt audit found only register-allocation differences in that function.
|
||||
|
||||
## Evidence and change
|
||||
|
||||
CDBRecord.c already declares CDBCryptBufAllocate and CDBCryptBufFree with CDBCryptBuf** parameters. Its callers supply the address of the record's crypt-buffer pointer slot. CDBCrypt.c instead declared CDBCryptBuf* and accessed buffer32[0] as a u32-encoded pointer, producing incompatible cross-translation-unit function types and describing the caller's pointer slot as an entire crypt-buffer object.
|
||||
|
||||
Both definitions now take CDBCryptBuf** and use direct typed pointer loads/stores. Allocation assigns the pool pointer; free compares the owned pointer and clears the slot to NULL. The existing pool-index expression, flag update order, diagnostics and failure behavior are retained. The obsolete placeholder comment is removed. No header, payload layout, pool extent, Encrypt implementation, or linking change.
|
||||
|
||||
## Validation
|
||||
|
||||
- Configure: `python3 configure.py --version 43U --wrapper ../toolchain/wibo-build/wibo`
|
||||
- Build: `WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja`
|
||||
- Entire compiled CDBCrypt.o is byte-identical to the baseline, including all code/data, symbols and relocations
|
||||
- CDBCryptBufAllocate: 36/36 instructions, ctxdiff zero
|
||||
- CDBCryptBufFree: 33/33 instructions, ctxdiff zero
|
||||
- Unit remains 100% fuzzy, 3/3 exact functions, 296/296 code bytes and 80/80 data bytes
|
||||
- Full-project before/after objdiff reports are identical; no metric gain is claimed
|
||||
- Pool identical: 2/2 strings; literal-reference audit: 2 arguments across all 3 functions, no candidates/errors/skips
|
||||
- Host test compiles the production source with the actual CDBCryptBuf layout and minimal platform/error stubs. AddressSanitizer and UBSan pass 50,036 ownership transitions, including every combination of six representative allocation flags and null/owned/foreign pointer slots, 10,000 randomized state cases, and 10,000 allocate/reallocate/free/refree cycles. Checks cover pointer-slot canaries, complete payload preservation, allocation flag, return value and diagnostic count
|
||||
- LeakSanitizer is disabled because it cannot run under this execution environment's ptrace; the harness makes no heap allocations. Address and undefined-behavior instrumentation remain enabled
|
||||
- Full 43U build and build/43U/ok pass; DOL SHA1 is 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
Private reproducible evidence is in /tmp/cdb-buffer-ownership (baseline object, full reports, host validator and build log). Original objects/disassembly from the preceding read-only audit remain private under /tmp/cdb-record-encrypt-audit.
|
||||
@@ -0,0 +1,55 @@
|
||||
# Bpmf consumed-count return contract, 2026-10-03
|
||||
|
||||
Base: 029dd7ea on the Chinese source-reconstruction leaf. Previous candidates
|
||||
are unchanged. Owned source: zi8match.c / Zi8GetBpmfPhonetic only.
|
||||
This is type-correctness reconstruction with zero percentage gain.
|
||||
|
||||
## Evidence and change
|
||||
|
||||
All three source callers declare Zi8GetBpmfPhonetic as returning ziU8:
|
||||
zi81key.c, zi8space.c and zprepare.c. The definition instead returned ziS32
|
||||
and used a ziU32 resultCount. Its result is the consumed Bopomofo character
|
||||
count: the four sequential initial/medial/final/tone stages can increment it
|
||||
at most four times, and all failure paths return zero. There is no negative
|
||||
result or full-word quantity to communicate.
|
||||
|
||||
Changing only the return type to ziU8 introduced return narrowing and made
|
||||
the previously exact function nonexact (98.64078%, exact count8 ->7). That
|
||||
isolated trial was rejected. Recovering the counter's own byte type along
|
||||
with the byte return restored the entire309-instruction exact function.
|
||||
The retained two-line change therefore aligns all caller declarations and
|
||||
the bounded consumed-count representation without explicit casts or masks.
|
||||
No caller, shared header, parameter or control flow is changed.
|
||||
|
||||
## Other remaining-helper inspection
|
||||
|
||||
A fresh Zi8GetPyPhonetic audit found718/718 instructions. One fixed bijection
|
||||
among its six differing callee-saved registers makes every instruction,
|
||||
branch destination, call and relocation identical. It remains nonexact;
|
||||
the register map is diagnostic only and was not encoded in source.
|
||||
|
||||
Zi8GetPyFinal remains53/53 instructions with eight differences in two table
|
||||
row-address calculations. Each computes the same table +8*row address into
|
||||
the same result register, uses identical byte-column offsets4 and5, and has
|
||||
no live-out dependence on the differing temporary. No type/access/flow defect
|
||||
was found in either nonexact helper, and no allocation sweep was performed.
|
||||
|
||||
## Validation
|
||||
|
||||
Baseline object: /tmp/ezi-pinyin-contract/baseline.o.
|
||||
Fresh full report: /tmp/ezi-bpmf-byte-full-report.json.
|
||||
Full build: /tmp/ezi-bpmf-byte-full-build.log.
|
||||
Detailed checks: /tmp/ezi-bpmf-byte-verification.txt.
|
||||
|
||||
All1027 full-report unit measures are unchanged. zi8match remains99.53004%
|
||||
fuzzy,8/10 exact functions,5172/8256 exact code and728/728 exact data.
|
||||
All emitted .text/.rodata/extab/extabindex lengths, payload bytes and canonical
|
||||
relocations are baseline-identical. No new exact function or percentage gain
|
||||
is claimed. Each of the eight existing exact functions has ctxdiff diffs0
|
||||
and identical instruction counts; Zi8GetBpmfPhonetic remains309/309.
|
||||
|
||||
Pool first: identical and empty. Full43U build passes with the approved
|
||||
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No remote, linking, shared-header, metadata, assembly,
|
||||
volatile, artificial storage, forced-register or undefined-value change.
|
||||
@@ -0,0 +1,75 @@
|
||||
# Chinese phonetic callee contract, 2026-10-02
|
||||
|
||||
Base: 654c65dd; branch agent/bittle/chinese-source-reconstruction.
|
||||
Changed source: libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c only.
|
||||
This is type-correctness work with zero code-generation or percentage gain.
|
||||
|
||||
## Callee evidence
|
||||
|
||||
The actual Zi8MatchPhonetic definition in zi8match.c takes a byte-addressed
|
||||
12-byte dictionary, a native-width ziU32 dictionary address, a byte record
|
||||
pointer, and two byte-pointer outputs. In particular its stringOffset output
|
||||
is ziU8**: it tests *stringOffset, compares a sound cursor against it, and
|
||||
writes the sound cursor to it. It is not an integer index output.
|
||||
|
||||
The old zi8cgetc declaration instead described records and the record output
|
||||
with a different struct-pointer type, the dictionary address as ziPtr, and
|
||||
the string output as int*. The two engine calls cast &phoneticGroups to
|
||||
int*. The third call, in Zi8NewMatchPhonetic, supplied an address-taken int
|
||||
matchedIndex even though the callee wrote a pointer through it.
|
||||
|
||||
The corrected local declaration now has exactly the callee's parameter
|
||||
representations and compatible C types:
|
||||
- ziPtr for the opaque phonetic table
|
||||
- ziU8* for the dictionary and current record
|
||||
- ziU32 for the packed-table address
|
||||
- ziU8** for the current-record and string-cursor outputs
|
||||
- the unchanged matching halfword, byte and workspace parameter types
|
||||
|
||||
All three call sites were inspected and updated. The engine's real byte
|
||||
pointer variables can now be passed by address directly, without incompatible
|
||||
pointer-to-pointer casts. The small exact helper retains its typed dictionary
|
||||
array but passes its byte address and uses actual byte-pointer output locals;
|
||||
matchedString names the recovered cursor role. No shared header or callee
|
||||
implementation is changed, and the pointer-to-native-word cast is explicit
|
||||
only at the callee's existing native-address argument boundary.
|
||||
|
||||
## Isolated investigation
|
||||
|
||||
- Native 12-byte dictionary table indexing: codegen/metrics unchanged
|
||||
- Named dictionary-record stride: codegen/metrics unchanged
|
||||
- String-pointer output correction alone: codegen/metrics unchanged
|
||||
- Complete callee contract, all three call sites: codegen/metrics unchanged
|
||||
|
||||
Only the callee-contract correction is retained. These are source-type
|
||||
checks, not register/declaration-order permutations. The previously parked
|
||||
halfword-result and component-cursor experiments were not repeated in this
|
||||
candidate or combined incidentally.
|
||||
|
||||
## Validation
|
||||
|
||||
Baseline: /tmp/ezi-chinese-recon-baseline.json.
|
||||
Final full report: /tmp/ezi-chinese-contract-full-report.json.
|
||||
Full build: /tmp/ezi-chinese-contract-full-build.log.
|
||||
Detailed checks: /tmp/ezi-chinese-contract-verification.txt.
|
||||
|
||||
All 1027 full-report unit measures are unchanged. Unit fuzzy remains
|
||||
96.65468%; zi8InternalGetZH remains 96.27482%. Exact functions remain 5/8,
|
||||
exact code 4168/47816, and exact data 144/536. No metric gain is claimed.
|
||||
|
||||
Compared with a preserved baseline object, every owned code/data section has
|
||||
identical length, payload bytes and canonical relocation tuples:
|
||||
.text 47816, .sdata2 16, .sbss2 8, .data 392, extab 48, extabindex 72.
|
||||
The NOBITS section is checked by extent; all other payloads compare bytewise.
|
||||
|
||||
Pool first: identical and empty. All five baseline exact functions retain
|
||||
ctxdiff diffs 0 with identical instruction counts:
|
||||
Zi8SetFindCand 50, ZiGetNextPhonetic 31, ZiPartialMatch 51,
|
||||
Zi8NewMatchPhonetic 755, Zi8GetChineseCandidates 155.
|
||||
The unmatched engine remains 10676/10676 instructions; its code payload and
|
||||
relocations are baseline-identical as well.
|
||||
|
||||
Full 43U build passes with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1.
|
||||
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No linking, remote, metadata, shared-header, assembly,
|
||||
volatile, artificial storage or register-forcing changes.
|
||||
@@ -0,0 +1,75 @@
|
||||
# Chinese user-dictionary address contract, 2026-10-03
|
||||
|
||||
Base: `5dcbc437`; branch `agent/bittle/chinese-uwd-address-contract`.
|
||||
Changed source: `libs/RVLMiddleware/eZiText/src/clib/zi8cgetc.c` only.
|
||||
This is a type-correctness correction with no matching-percentage gain.
|
||||
|
||||
## Source and target evidence
|
||||
|
||||
The exact `Zi8GetZHuwdPtr` definition in `zi8ZHuwd.c` returns `ziU32` and
|
||||
writes a native `ziU32` address through its first argument. It clears that
|
||||
word on failure, or stores the selected dictionary address and adds its
|
||||
eight-byte header on success. Its second output is a halfword entry count;
|
||||
its third argument is the workspace. Both return paths produce zero or one.
|
||||
|
||||
The original objects contain exactly two executable references, from
|
||||
`Zi8Get1KeyPressCandidates` and `zi8InternalGetZH`, plus the callee's own
|
||||
exception-index reference. The accepted one-key source already uses the
|
||||
definition's native address representation and explicitly narrows status.
|
||||
|
||||
The Chinese caller passes its stack word at 0x10C in r3, its halfword at
|
||||
0x9A in r4, and the workspace in r5. After the call it explicitly narrows
|
||||
the returned status to a byte. It loads the address word to decode bytes
|
||||
at offsets one and two, checks a flag through the same address, and advances
|
||||
that address by three for each entry. The address output does not escape
|
||||
anywhere else.
|
||||
|
||||
The correction agrees with the real definition: the local extern returns
|
||||
`ziU32` and takes `ziU32*`; `userEntriesAddress` has that native unsigned
|
||||
word type. The three byte reads use explicit byte-pointer views, the loop
|
||||
keeps its increment by three, and the status test has an explicit byte cast.
|
||||
No additional local, helper, shared-header change, control-flow change or
|
||||
unrelated prototype correction is included.
|
||||
|
||||
## Validation
|
||||
|
||||
Fresh baseline: `/tmp/ezi-chinese-uwd-baseline.json`.
|
||||
Fresh final report: `/tmp/ezi-chinese-uwd-final.json`.
|
||||
Full build: `/tmp/ezi-chinese-uwd-full-build.log`.
|
||||
Detailed checks: `/tmp/ezi-chinese-uwd-verification.txt`.
|
||||
|
||||
All 1027 complete source objects are byte-identical to the fresh baseline,
|
||||
including `zi8cgetc.o` and its symbol/relocation metadata. The entire decoded
|
||||
1027-unit report is identical. Unit fuzzy remains 96.65468%; engine fuzzy
|
||||
remains 96.27482%, with 10676/10676 instructions. Exact functions remain 5/8,
|
||||
exact code 4168/47816 bytes, and matched data 144/536 bytes.
|
||||
|
||||
Pool checked first: identical and empty. All five exact functions retain
|
||||
ctxdiff diffs zero: Zi8SetFindCand 50 instructions, ZiGetNextPhonetic 31,
|
||||
ZiPartialMatch 51, Zi8NewMatchPhonetic 755, Zi8GetChineseCandidates 155.
|
||||
The existing advisory flow audit still agrees on 168 ordered calls, 1594
|
||||
mapped direct branches and all 98 generated switch destinations. This
|
||||
normalization is diagnostic, not an exact-match claim for the engine.
|
||||
|
||||
Full 43U build passes with the approved wrapper and
|
||||
`WIBO_SJIS_MISSING_IMPORTS=1`. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`. `git diff --check` passes.
|
||||
No return-width experiments, artificial storage, assembly, volatile use,
|
||||
linking changes or remote operations were performed.
|
||||
|
||||
## Read-only remainder review
|
||||
|
||||
Both large engines were compared with current main before editing. Their
|
||||
sources were unchanged. Chinese's remaining normalized instruction gaps
|
||||
are return-copy placement, the already-tested component-cursor reload,
|
||||
and the two previously parked paired-phonetic halfword conversions. Those
|
||||
experiments were not repeated.
|
||||
|
||||
Alpha's early initialized dictionary index remains necessary in the
|
||||
reconstructed source: highlighted-output capacity exits reach optional
|
||||
dictionary-count finalization before the dictionary loop. The target's
|
||||
unused workspace store supplies no demonstrated source lifetime. Previous
|
||||
attempts already cover separate/direct exclusion results, dictionary-kind
|
||||
switches, candidate-skip order, updated-count comparisons and prefix append
|
||||
forms. This pass found no new supported alpha lifetime or control-flow
|
||||
representation to trial, and left alpha unchanged.
|
||||
@@ -0,0 +1,67 @@
|
||||
# Chinese Zhuyin initial dispatch correction, 2026-10-02
|
||||
|
||||
Parent: 1b1a944a on base 654c65dd. The pointer-contract candidate is unchanged.
|
||||
Changed source: two case-label lines in zi8cgetc.c / zi8InternalGetZH.
|
||||
This is a demonstrated behavioral correction; aggregate metrics are neutral.
|
||||
|
||||
## Discovery
|
||||
|
||||
A complete fresh flow audit checked the compiler-generated switch tables as
|
||||
well as direct branches. All 1594 mapped direct branches and all 168 ordered
|
||||
helper calls agreed before this change. However, four of the 98 generated
|
||||
switch relocation entries dispatched to the wrong semantic bodies. A direct
|
||||
branch-only audit cannot see that defect, and the linear effect audit compares
|
||||
both bodies without knowing which switch cases reach them.
|
||||
|
||||
The relevant switch uses the phonetic initial (match.phon2[index] >> 9),
|
||||
subtracts case 24 for its 40-entry table and rejects indexes greater than39.
|
||||
The table starts at .data+0x58. Its four incorrect entries were:
|
||||
|
||||
- .data+0xC8, case52: source selected bANDp; target selects gANDk
|
||||
- .data+0xD4, case55: source selected bANDp; target selects gANDk
|
||||
- .data+0xE8, case60: source selected gANDk; target selects bANDp
|
||||
- .data+0xF4, case63: source selected gANDk; target selects bANDp
|
||||
|
||||
The bodies are identified by their actual tests of the workspace word at
|
||||
0x1B2C: bANDp tests the bit at MSB-relative position10, while gANDk tests
|
||||
position11. Both successful bodies store the same phonetic mask0xF9FF, but
|
||||
they consult independent user fuzzy-pair settings. Crossing the labels
|
||||
therefore changes behavior, even though both body instruction shapes match.
|
||||
Target cases52/55 enter function+0x1288 (position11), while60/63 enter+0x1264
|
||||
(position10). Current compiled bodies are four bytes later, and the corrected
|
||||
entries now select their corresponding semantic bodies.
|
||||
|
||||
The fix swaps only the two case-label pairs, preserving body/source order,
|
||||
header layout, tests, masks, all other cases and function size. It does not
|
||||
change shared bitfield names to compensate for the bad dispatch.
|
||||
|
||||
## Verification
|
||||
|
||||
Fresh report: /tmp/ezi-chinese-switch-full-report.json.
|
||||
Full build: /tmp/ezi-chinese-switch-full-build.log.
|
||||
Detailed gates: /tmp/ezi-chinese-switch-verification.txt.
|
||||
Switch/direct-flow audit: /tmp/ezi-chinese-switch-flow-audit.txt.
|
||||
|
||||
After correction, all 98 switch entries have corresponding target semantic
|
||||
destinations, with zero destination mismatches. The four table extents remain
|
||||
44,44,160,144 bytes. The 1594 mapped direct branches and168 ordered helper
|
||||
calls also still agree. This is an advisory relocation/control-flow check,
|
||||
not formal whole-program equivalence or a claim of exact assembly.
|
||||
|
||||
Every code/data section size and payload is baseline-identical. All normalized
|
||||
relocations are unchanged except exactly the four corrected .data entries.
|
||||
The .text section, extab and extabindex are unchanged byte-for-byte. The
|
||||
engine stays10676/10676 instructions with the same0x4E0 frame.
|
||||
|
||||
All1027 unit measures are unchanged with no regressions. Unit fuzzy remains
|
||||
96.65468%; engine fuzzy96.27482%. Exact functions5/8, code4168/47816 and
|
||||
matched data144/536 are preserved. The switch section remains unmatched
|
||||
because case body addresses still differ from the target; no percentage or
|
||||
new exact function is claimed.
|
||||
|
||||
All five previously exact functions still have ctxdiff diffs0 and identical
|
||||
instruction counts. Pool first: identical and empty. Full43U build passes
|
||||
with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No shared header, metadata, link flag, assembly,
|
||||
volatile, register/storage workaround, or remote action was changed.
|
||||
@@ -0,0 +1,57 @@
|
||||
# Secondary component matcher workspace formal, 2026-10-02
|
||||
|
||||
Parent: bfcc8a44. Scope extension to zi8match.c was coordinated before editing.
|
||||
Changed source: the Zi8SecMatchComp definition's parameter list only.
|
||||
This is an interface correction with no percentage or code-generation gain.
|
||||
|
||||
## All-caller and callee evidence
|
||||
|
||||
A source-wide search finds one caller, in zi8InternalGetZH, and its explicit
|
||||
four-argument declaration. A scan of every extracted43U object's relocation
|
||||
tables likewise finds exactly one text reference, in zi8cgetc.o. The only
|
||||
other direct symbol reference is the function's own extabindex entry.
|
||||
No function-pointer data reference or second callsite was found.
|
||||
|
||||
The target caller at zi8InternalGetZH+0x8380 supplies the component cursor,
|
||||
match object, dictionary base and workspace in argument registers3..6.
|
||||
The workspace is the same saved incoming pointer used by the surrounding
|
||||
engine helpers. This agrees with the reconstructed caller and its declaration.
|
||||
|
||||
The target callee is68 instructions /0x110 bytes and does not consume the
|
||||
incoming fourth argument. Every path that reads register6 first defines a
|
||||
new temporary there; no incoming workspace load or use is present. The
|
||||
missing fourth formal is therefore an unused workspace parameter, consistent
|
||||
with neighboring component matchers' ZI_NEED_WORK convention. Removing the
|
||||
caller argument would contradict the target call sequence.
|
||||
|
||||
Added ZI_NEED_WORK to the existing definition, preserving its first three
|
||||
formals and entire body. No local or storage was added, no value was made
|
||||
volatile, and no register/spill was forced. The existing shared macro simply
|
||||
expands to the same ziPtr workspace formal already declared by the caller.
|
||||
No shared header or caller change was needed.
|
||||
|
||||
## Validation
|
||||
|
||||
Before-object: /tmp/ezi-chinese-reconstruction/zi8match-before-work-formal.o.
|
||||
Fresh full report: /tmp/ezi-component-contract-full-report.json.
|
||||
Build log: /tmp/ezi-component-contract-full-build.log.
|
||||
Detailed checks: /tmp/ezi-component-contract-verification.txt.
|
||||
|
||||
All owned emitted sections have identical lengths, payloads and normalized
|
||||
relocations: .text8256, .rodata528, extab80, extabindex120. The compiler
|
||||
comment section is also unchanged. Symbol entries, relocation records and
|
||||
section extents are unchanged; only compiler-generated anonymous extab names
|
||||
in .strtab advance numerically after the additional formal. The entire object
|
||||
file is therefore not byte-identical, but its emitted code/data and relocation
|
||||
meaning are identical. No symbol-metadata edits were made to hide this.
|
||||
|
||||
All1027 full-report unit measures are unchanged. zi8match remains8/10 exact,
|
||||
5172/8256 exact code,728/728 exact data and99.53004% unit fuzzy. All eight
|
||||
baseline exact functions have ctxdiff diffs0 and identical instruction counts;
|
||||
Zi8SecMatchComp remains68/68 instructions,0x110 bytes and exact100%.
|
||||
|
||||
Pool first: identical and empty. Full43U build passes with the approved
|
||||
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No remote, linking, shared-header, assembly, metadata,
|
||||
artificial storage or undefined-value change.
|
||||
@@ -0,0 +1,78 @@
|
||||
# Conversion table-address contract, 2026-10-03
|
||||
|
||||
Base: 20ba34a8. Owned source: zconvert.c only. This candidate corrects a
|
||||
cross-unit declaration; it has no percentage gain.
|
||||
|
||||
## Definition-backed correction
|
||||
|
||||
zaddress.c defines Zi8GetTableAddress as returning ziU32. It forwards the
|
||||
ziU32 result of Zi8GetTableData, whose address case explicitly converts the
|
||||
computed dictionary pointer to an integer address. Its target wrapper
|
||||
forwards the full register result without a byte or halfword narrowing.
|
||||
|
||||
zconvert.c instead declared the same function as returning ziPtr. Correct
|
||||
that local declaration to ziU32 and explicitly convert the returned address
|
||||
at the three existing table-pointer assignments: ziU8* for UC2WC, and
|
||||
ziConversionTable* for WC2UC and UC2Key. These are the only four source-line
|
||||
changes. No callee, shared header, lookup representation or control flow is
|
||||
changed.
|
||||
|
||||
## Read-only UC2Key investigation
|
||||
|
||||
The original remaining function is 207 instructions / 828 bytes, with 18
|
||||
register-operand differences. Exchanging the two diagnostic work/key register
|
||||
names makes every instruction, branch destination, memory operand, call and
|
||||
relocation annotation identical. The mapping is only used by the audit and
|
||||
is not expressed in source.
|
||||
|
||||
The existing packed representation agrees with target accesses:
|
||||
|
||||
- Serialized header count is a big-endian byte pair at offsets 0 and 1.
|
||||
- Serialized entries have an eight-byte stride. First/last/value are byte
|
||||
pairs at offsets 0/2/6; the intervening flags pair is not read here.
|
||||
- A ranged mapped-key result is another big-endian byte pair, reached via
|
||||
header + 8 + entry value + 2 * (character - first).
|
||||
- The native fallback range instead uses halfword first/last fields at 0/2
|
||||
and a word pointer-or-character union at 4. A singleton explicitly keeps
|
||||
the low byte of the word; mapped keys use native halfword loads.
|
||||
- The native default object is exactly 32 zero bytes, with no target data
|
||||
content or relocation supporting a different field layout.
|
||||
|
||||
The declared halfword result is also correct. The original reference scan
|
||||
finds only three executable callers plus the function's exception-index
|
||||
reference. PUD and UWD pass a byte character and narrow the return to a
|
||||
halfword before comparing their halfword pattern. WC2Key forwards the result
|
||||
without additional narrowing. The user-key helper definition likewise
|
||||
returns a halfword, including the EFFx key range. GetTableCount's declaration
|
||||
already agrees with its halfword-returning definition and target narrowing.
|
||||
|
||||
Prior fz2/fz21 attempts already cover const views, key widths, pointer/local
|
||||
lifetimes, result initialization, expression grouping, and declaration order.
|
||||
No new packed-width or control-flow defect was found. No allocation trial
|
||||
was repeated.
|
||||
|
||||
## Verification
|
||||
|
||||
Fresh configure and baseline full build used 43U, the approved wibo wrapper,
|
||||
and WIBO_SJIS_MISSING_IMPORTS=1. Pool checked first: identical and empty.
|
||||
After the four-line correction, all 1,027 source objects are entirely
|
||||
byte-identical to their baseline hashes, and the complete 1,027-unit report
|
||||
is identical. The owned .text, .rodata, extab and extabindex payloads and
|
||||
canonical relocations were additionally compared explicitly.
|
||||
|
||||
Unchanged unit: 99.83696% fuzzy, 3/4 exact functions, 1,380/2,208 exact code
|
||||
bytes, and 112/112 exact data bytes. UC2Key remains 99.565216%.
|
||||
All existing exact functions retain ctxdiff zero differences:
|
||||
UC2WC 124 instructions; WC2UC 199; WC2Key 22.
|
||||
|
||||
Final full 43U build passes. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No assembly, artificial storage, volatile, metadata,
|
||||
linking flags, shared-header edits, other-region builds or remote writes.
|
||||
|
||||
Private local verification artifacts:
|
||||
- /tmp/ezi-conversion-baseline.json
|
||||
- /tmp/ezi-conversion-final-report.json
|
||||
- /tmp/ezi-conversion-final-build.log
|
||||
- /tmp/ezi-conversion-verification.txt
|
||||
- /tmp/ezi-conversion-caller-audit.txt
|
||||
@@ -0,0 +1,51 @@
|
||||
# Korean empty-context flow recovery, 2026-10-03
|
||||
|
||||
Base: 1fa33882; branch agent/bittle/korean-candidate-reconstruction.
|
||||
Owned source: zkokeyp.c / Zi8GetKOcandidates only.
|
||||
|
||||
## Target evidence
|
||||
|
||||
The first context-length test at target function+0x158 sends an empty current
|
||||
word directly to+0x730, the input-length/key-table scan setup. The compiled
|
||||
source instead sent this case to its+0x6C8, the prefix-search result copy and
|
||||
candidate cleanup. That block corresponds to target+0x6BC, which is reached
|
||||
only after a nonempty context lookup attempt or word-table search.
|
||||
|
||||
Added an explicit empty-context guard to a label immediately before the
|
||||
existing input-length check. The nonempty prefix-search paths still enter
|
||||
search_table and perform the original result/candidate cleanup. The change
|
||||
recovers the target control-flow edge without moving any body or introducing
|
||||
storage, helper calls, or artificial register constraints. The old edge did
|
||||
not necessarily change visible output for initialized empty context; this
|
||||
is a target-flow correction, not a claim of a newly demonstrated user bug.
|
||||
|
||||
## Validation
|
||||
|
||||
Fresh baseline: /tmp/ezi-korean-recon-baseline.json.
|
||||
Fresh final report: /tmp/ezi-korean-flow-full-report.json.
|
||||
Full build: /tmp/ezi-korean-flow-full-build.log.
|
||||
Detailed gates: /tmp/ezi-korean-flow-verification.txt.
|
||||
|
||||
Zi8GetKOcandidates: 97.96712% ->97.97459%.
|
||||
Unit fuzzy: 98.65385% ->98.65769%.
|
||||
Exact functions remain1/7, exact code332/5200, matched data96/180.
|
||||
All1027 units were checked: the unit fuzzy gain is the only changed measure,
|
||||
with no code/data/function or fuzzy regressions. No new exact function claimed.
|
||||
|
||||
The source object differs from its preserved baseline at exactly one .text
|
||||
payload byte, the corrected branch displacement. All section sizes and all
|
||||
canonical relocation tuples remain unchanged. .data40, extab56 and
|
||||
extabindex84 are byte-identical to baseline. The unit's existing exact
|
||||
Zi8_81483118 remains83/83 instructions and ctxdiff diffs0, with its exact
|
||||
10-entry generated switch table unchanged.
|
||||
|
||||
Pool first: identical and empty. Main still673/669 instructions; the known
|
||||
extra zero materialization, two lookup-result narrowings and return-value
|
||||
move remain. All92 mapped direct main branches now preserve their target
|
||||
destinations; the17 ordered helper calls agree. The filter's43 direct branches
|
||||
also agree. These are advisory correspondence checks, not an exactness claim.
|
||||
|
||||
Full43U build passes with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1.
|
||||
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No header, metadata, linking, remote, assembly,
|
||||
volatile, dummy-storage or forced-register changes.
|
||||
@@ -0,0 +1,76 @@
|
||||
# Korean lookup halfword contract, 2026-10-03
|
||||
|
||||
Parent: dea3851e; its empty-context correction is unchanged.
|
||||
Owned source: zkokeyp.c / Zi8_8148302C and its two local callers.
|
||||
|
||||
## Recovered type boundary
|
||||
|
||||
The lookup traverses a table whose count is ziU16, comparing and addressing
|
||||
records through a halfword index, and returns either that index or0xFFFF.
|
||||
For countN<=65535, successful indexes are0..N-1. The loop exits atN; a
|
||||
halfword index cannot wrap on any traversed iteration. There is no need for
|
||||
a full-word index or return value in this contract.
|
||||
|
||||
Both callers store the result into the halfword search.keyIndex. The target
|
||||
stores the returned register directly through the halfword store. The first
|
||||
caller then narrows for its assignment-value comparison, while the second
|
||||
reloads the halfword for comparison. The current full-word declaration made
|
||||
MWCC emit an additional narrowing before both stores.
|
||||
|
||||
Recovered the helper's ziU16 return and ziU16 loop index together, then used
|
||||
the typed index directly in the loop condition and nine-byte address
|
||||
expressions. The old explicit masks were the reconstruction of those same
|
||||
halfword promotions while the local had the wrong full-word type. They are
|
||||
not stripped from a full-word value or replaced by register constraints.
|
||||
|
||||
The resulting helper body is byte-for-byte identical to its previous body,
|
||||
including its59 instructions and resolved calls. This demonstrates that the
|
||||
same lookup operations and return representation are preserved while its
|
||||
callers recover the target halfword assignment boundary. Both source callers
|
||||
are in this unit. A scan of all extracted target objects found the same two
|
||||
text references and only the helper's own extabindex reference otherwise.
|
||||
No shared declaration or header changes are needed.
|
||||
|
||||
## Separate trials
|
||||
|
||||
A native unsigned-int return alone and explicit caller-store casts were
|
||||
codegen-neutral and were not retained. The coherent halfword index/return
|
||||
pair is the sole selected candidate. No old Chinese ABI experiment or
|
||||
arbitrary declaration/register sweep was repeated.
|
||||
|
||||
## Validation
|
||||
|
||||
Baseline: /tmp/ezi-korean-flow-full-report.json.
|
||||
Fresh full report: /tmp/ezi-korean-lookup-full-report.json.
|
||||
Full build: /tmp/ezi-korean-lookup-full-build.log.
|
||||
Detailed gates: /tmp/ezi-korean-lookup-verification.txt.
|
||||
|
||||
Zi8GetKOcandidates: 97.97459% ->98.146484%.
|
||||
Unit fuzzy: 98.65769% ->98.746155%.
|
||||
Relative to initial1fa33882, unit98.65385% ->98.746155%.
|
||||
Exact functions remain1/7, exact code332/5200, matched data96/180.
|
||||
All1027 unit measures and all per-function fuzzy scores were checked: the
|
||||
Korean unit/main-function gains are the only metric changes, with no
|
||||
regressions. No new exact function or complete unit is claimed.
|
||||
|
||||
Every other function's disassembly is baseline-identical, including the
|
||||
changed lookup helper. The existing exact packing helper remains83/83
|
||||
instructions and ctxdiff diffs0. Main shrinks673 ->671 instructions versus
|
||||
target669, from0xA84 to0xA7C versus target0xA74. Its0x60 frame is preserved.
|
||||
The remaining normalized differences are one zero materialization and one
|
||||
call-result move; no further width or flow difference is identified.
|
||||
|
||||
.data40 and extab56 retain identical payloads and canonical relocations.
|
||||
The already-unmatched84-byte extabindex changes only its main-function size
|
||||
byte at0x4F,0x84 ->0x7C; its score remains97.61904%, and exact-data accounting
|
||||
is unchanged. No real data object or section extent was changed.
|
||||
|
||||
Pool first: identical and empty. All92 mapped main branches preserve their
|
||||
corrected target destinations; all17 helper calls correspond. An associative,
|
||||
register-value-aware advisory audit pairs all163 store/call/branch effects
|
||||
without differences. These checks are not formal equivalence or exactness
|
||||
claims. Full43U build passes with the approved wrapper and
|
||||
WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No linking, remote, header, assembly, volatile,
|
||||
dummy-storage, undefined-value or forced-register change.
|
||||
@@ -0,0 +1,96 @@
|
||||
# One-key call and parameter contracts, 2026-10-03
|
||||
|
||||
Base: 674722c1; branch agent/bittle/onekey-contract-reconstruction.
|
||||
Owned source: zi81key.c only. This is source-type correctness work with no
|
||||
percentage gain. No callee implementation or shared header was changed.
|
||||
|
||||
## Retained, definition-backed boundaries
|
||||
|
||||
- Replaced the private ziGetParam replica with the existing shared type.
|
||||
The old replica's bytes at 0x20/0x21/0x22 were named
|
||||
wordCandidates/count/letters. The established shared type names those
|
||||
count/letters/completion. All accesses were renamed by their offsets;
|
||||
no field was moved or read/written at a different address. The unused last
|
||||
word retains the same target size. Dispatcher return declarations and the
|
||||
two public candidate-count return types now agree on their byte/full-word
|
||||
roles, respectively.
|
||||
- Added the actual _Zi8GetCandidates and _Zi8CheckCandidates prototypes,
|
||||
using ziGetParam pointers. Their explicit byte-result handling is preserved.
|
||||
- Recovered Zi8Ord2Ord's actual ziU16 return together with the local duplicate
|
||||
helper's ziU16 ordinal parameter. Ordinary typed uses replace the explicit
|
||||
halfword masks of the former full-word local. Correcting only the external
|
||||
return lost the exact helper; this coherent pair preserves all 50 of its
|
||||
instructions and every caller instruction.
|
||||
- Zi8GetPInfo and Zi8GetZInfo actually accept a ziU32 phonetic code and return
|
||||
ziU32. Corrected their local declarations; the existing caller's explicit
|
||||
byte result conversion remains.
|
||||
- Added the actual Py/Bpmf phonetic prototypes. This exposed two scratch
|
||||
arrays declared as 32 bytes despite receiving 16 halfword outputs. They
|
||||
are now 16-element ziU16 arrays, preserving their 32-byte extents. The
|
||||
candidate output buffer is likewise 16 ziWChars instead of 32 bytes plus
|
||||
a cast. No new storage or alignment directive was added.
|
||||
- Zi8GetZHuwdPtr writes a native ziU32 address through its first parameter.
|
||||
Its local declaration and address-taken receiving variable now use that
|
||||
actual type. Byte decoding uses an explicit view of userEntriesAddress;
|
||||
address stepping remains three bytes. This removes the incompatible
|
||||
pointer-to-pointer/integer-output contract without an extra temporary.
|
||||
- Zi8GetTableAddress, Zi8Memset and Zi8InitDupWordBuf local declarations now
|
||||
agree with their actual definitions. The parameter object is cleared
|
||||
through the memset callee's byte view.
|
||||
- Zi8ZHCheckSpelling now agrees with its caller in zi8alpha.c: byte Boolean
|
||||
return, byte input count, and opaque workspace pointer. Its result was
|
||||
already a byte; removing the input's redundant full-word masks preserves
|
||||
the entire existing exact body.
|
||||
|
||||
The authoritative definitions are in zi8getc2.c, zi8misc.c, zi8cinfo.c,
|
||||
zi8match.c and zi8ZHuwd.c. The public count-return declarations are in
|
||||
zi8getc2.c; the spelling-check declaration is in zi8alpha.c. Only the owned
|
||||
file was edited. The private option/work views remain in place; this is not
|
||||
an attempt to consolidate every library type or repair every declaration.
|
||||
|
||||
## Isolated trials
|
||||
|
||||
- PInfo/ZInfo actual declaration pair: neutral
|
||||
- Bare Py/Bpmf prototypes: compile error exposing byte-array/halfword-pointer
|
||||
disagreement; fixed by correctly typed same-size output buffers
|
||||
- Ord2Ord return only: duplicate helper 100 -> 98.8%; rejected
|
||||
- Ord2Ord return plus typed ordinal: original exact helper restored, neutral
|
||||
- Shared request type and offset-preserving field names: neutral
|
||||
- Typed dispatcher prototypes with shared request type: neutral
|
||||
- Phonetic and candidate halfword output buffers: neutral
|
||||
- Native user-dictionary address contract: neutral
|
||||
- Public return/input boundaries: neutral
|
||||
- Final retained combined contracts: all code/data and metrics unchanged
|
||||
|
||||
Other coherent local spelling/alternate-phonetic parameter-width trials were
|
||||
neutral and are not included without an external declaration disagreement.
|
||||
The PUD return/caller-byte trial on the new baseline dropped unit fuzzy to
|
||||
97.782295% and exact data 1280 -> 1232; it was rejected and is not included.
|
||||
No blanket byte-cast, declaration-order or register-allocation sweep was used.
|
||||
|
||||
## Verification
|
||||
|
||||
Baseline report: /tmp/ezi-onekey-contract-baseline.json.
|
||||
Baseline object: /tmp/ezi-onekey-contract/baseline.o.
|
||||
Final report: /tmp/ezi-onekey-focused-full-report.json.
|
||||
Full build: /tmp/ezi-onekey-focused-final-build.log.
|
||||
Detailed gates: /tmp/ezi-onekey-focused-verification.txt.
|
||||
|
||||
All 1027 unit measures are unchanged. Unit fuzzy remains 98.23523%; main
|
||||
candidate engine remains 96.41927%. Exact functions remain 5/9, exact code
|
||||
3952/21460, and matched data 1280/1388. No new exact function or percentage
|
||||
gain is claimed.
|
||||
|
||||
All owned emitted sections have baseline-identical lengths, payloads and
|
||||
canonical relocations: .text 21496, .rodata 1152, .data 44, .sdata2 8,
|
||||
extab 72 and extabindex 108. All nine functions have baseline-identical
|
||||
disassembly, not only equivalent scores. Each of the five existing exact
|
||||
functions still has ctxdiff diffs 0 and identical instruction counts:
|
||||
Zi8IsMatch1Key 97, MatchAltSound1Key 341, Zi8SetFindCand 50,
|
||||
ZiIsSupportedPhonetic 81, Zi8ZHCheckSpelling 419.
|
||||
|
||||
Pool first: identical and empty. Full 43U build passes with the approved
|
||||
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No linking, remote, metadata, new assembly, volatile
|
||||
workaround, dummy storage, undefined value or forced-register change.
|
||||
@@ -0,0 +1,51 @@
|
||||
# PUD byte-return producer contract, 2026-10-03
|
||||
|
||||
Base: a894ff5c; branch agent/bittle/pud-return-contract.
|
||||
Owned source: zi8pud2.c only. The copied cache was refreshed by a configured
|
||||
full 43U build before recording the baseline. No caller or header changed.
|
||||
|
||||
## Producer and caller evidence
|
||||
|
||||
Every Zi8MatchPUDdata_ZHS exit returns zero, one, or an explicitly byte-cast
|
||||
copied count. Zi8_8147FD7C forwards that result directly. Zi8MatchPUDdata
|
||||
receives it, tests its byte value, and returns it; it never consumes any
|
||||
higher result bits. The target wrapper retains exactly this data flow.
|
||||
|
||||
All external callers use byte-return declarations: zi8alpha.c and zi81key.c
|
||||
for Zi8MatchPUDdata, and zi8cgetc.c for Zi8MatchPUDdata_ZHS. The previously
|
||||
attempted caller-side full-word corrections were therefore based on a
|
||||
misreconstructed producer chain rather than a demonstrated wide result.
|
||||
|
||||
Recovered ziU8 returns for all three functions and their local forward
|
||||
declaration, plus ziU8 for the wrapper result local. Its test now uses the
|
||||
typed byte directly. The explicit cast of copied in the actual producer
|
||||
remains. Changing the coherent chain preserves the complete compiled object;
|
||||
no compensating caller masks, local aliases, storage or register constraints
|
||||
are required.
|
||||
|
||||
## Validation
|
||||
|
||||
Baseline report: /tmp/ezi-pud-baseline.json.
|
||||
Baseline object: /tmp/ezi-pud-return-contract/baseline.o.
|
||||
Final report: /tmp/ezi-pud-return-full-report.json.
|
||||
Full build: /tmp/ezi-pud-return-full-build.log.
|
||||
Detailed gates: /tmp/ezi-pud-return-verification.txt.
|
||||
|
||||
The complete zi8pud2.o file is byte-identical to baseline, including symbol
|
||||
strings. Every function's disassembly is unchanged. All 1027 full-report
|
||||
unit measures are unchanged: unit fuzzy 98.88764%, ZHS 98.32204%, exact
|
||||
functions 6/7, exact code 720/2136 and exact data 48/120. This is a contract
|
||||
correction, not a percentage gain or a new exact function.
|
||||
|
||||
All six existing exact functions retain ctxdiff diffs 0 and identical counts:
|
||||
ZiIsPhoneticChar 16, ZiGetZHWordSize 31, Zi8CopyZHSpelling 33,
|
||||
ZADP_Zi8SetPDremoveOpt 21, Zi8MatchPUDdata 50, Zi8_8147FD7C 29.
|
||||
The unmatched producer remains 349/354 instructions. Allocated section sizes,
|
||||
payloads and canonical relocations are unchanged: .text 2116, extab 48,
|
||||
extabindex 72.
|
||||
|
||||
Pool first: identical and empty. Full 43U build passes with the approved
|
||||
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No remote, linking, metadata, header, caller,
|
||||
assembly, volatile, dummy-storage or undefined-value change.
|
||||
@@ -0,0 +1,77 @@
|
||||
# PUD packed-header halfword decoding, 2026-10-03
|
||||
|
||||
Parent: a71dfa9c; its byte-return correction is unchanged.
|
||||
Owned source: two expressions in zi8pud2.c / Zi8MatchPUDdata_ZHS.
|
||||
|
||||
## Recovered arithmetic and widths
|
||||
|
||||
The eight-byte PUD section record contains two-byte big-endian count and
|
||||
offset fields. The target separately promotes each of their four component
|
||||
bytes through a halfword boundary before shifting or adding. The source
|
||||
previously expressed plain byte arithmetic and omitted those four target
|
||||
conversions.
|
||||
|
||||
Restored explicit ziU16 promotions for count[0], count[1], offset[0] and
|
||||
offset[1]. The offset is now decoded as one grouped big-endian value before
|
||||
adding the table base. This reproduces the target's base/high/low load and
|
||||
addition order, without a new local, helper, casted memory access or storage.
|
||||
|
||||
Bounded isolated trials, all retaining 6 exact functions and 48 exact data:
|
||||
- Halfword promotions with the existing offset association:
|
||||
ZHS 98.52542%, unit 99.02247%
|
||||
- Conventional grouped high/low offset sum:
|
||||
ZHS 99.717514%, unit 99.81274%; selected
|
||||
- Grouped low/high offset sum:
|
||||
ZHS 99.10452%, unit 99.406364%; rejected
|
||||
- Grouped multiplication form:
|
||||
ZHS 99.10452%, unit 99.406364%; rejected
|
||||
|
||||
All 65,536 possible packed values preserve the decoded count. Another
|
||||
524,288 offset/base combinations, covering eight bases including 32-bit
|
||||
wrap boundaries for every packed value, preserve the computed address.
|
||||
These arithmetic tests supplement the target instruction correspondence.
|
||||
|
||||
## Remaining workspace snapshot
|
||||
|
||||
The target stores its incoming workspace pointer once into frame 0x24 at
|
||||
function +0x3C. A width-aware access and address-provenance audit finds no
|
||||
read, overlapping use, or address escape for that slot. The workspace stays
|
||||
in its existing saved register. The only ordinary local whose address is
|
||||
passed to a helper is the halfword at frame 0x0E. Save/restore addresses the
|
||||
separate upper frame region. No source-visible distinct alias role was found.
|
||||
|
||||
That single dead store remains absent. No unused local, dummy assignment,
|
||||
padding, volatile or forced spill was added to manufacture it.
|
||||
|
||||
## Validation
|
||||
|
||||
Fresh final report: /tmp/ezi-pud-packed-full-report.json.
|
||||
Full build: /tmp/ezi-pud-packed-full-build.log.
|
||||
Detailed gates: /tmp/ezi-pud-packed-verification.txt.
|
||||
Snapshot audit: /tmp/ezi-pud-work-snapshot-audit.txt.
|
||||
|
||||
Zi8MatchPUDdata_ZHS: 98.32204% -> 99.717514%.
|
||||
Unit fuzzy: 98.88764% -> 99.81274%, about 19.76 weighted bytes gained.
|
||||
Exact functions remain 6/7, exact code 720/2136, exact data 48/120.
|
||||
All 1027 units and their per-function fuzzy scores were checked with no
|
||||
regressions; this unit/producer improvement is the only measure change.
|
||||
|
||||
Producer instructions: 349 -> 353 versus target 354.
|
||||
Producer size: 0x574 -> 0x584 versus target 0x588; frame remains 0x60.
|
||||
After accounting solely for the missing dead store and its four-byte branch
|
||||
destination displacement, every remaining instruction is identical, including
|
||||
registers, immediates, calls and memory operands. All 65 direct branches and
|
||||
13 calls correspond. This is not an exact match: the missing instruction
|
||||
and function extent are explicitly retained as unresolved.
|
||||
|
||||
All six existing exact functions retain ctxdiff diffs 0 and identical counts.
|
||||
The 48-byte extab is baseline-identical. The already-unmatched 72-byte
|
||||
extabindex changes only the producer extent byte at 0x2B, 0x74 -> 0x84;
|
||||
canonical relocations and its 98.61111% score are unchanged. No real data
|
||||
object, section extent or metadata declaration was changed.
|
||||
|
||||
Pool first: identical and empty. Full 43U build passes with the approved
|
||||
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No remote, linking, header, new assembly, volatile,
|
||||
dummy-storage, undefined-value or forced-register changes.
|
||||
@@ -0,0 +1,83 @@
|
||||
# Punctuation options receiver, 2026-10-03
|
||||
|
||||
Base: bf8ebfa3. Owned source: Zi8punct.c only. This is a source-contract
|
||||
correction with unchanged generated code and no percentage gain.
|
||||
|
||||
## Actual call and receiver
|
||||
|
||||
All original-object references show exactly one executable caller,
|
||||
Zi8GetCandidatesOrCount, plus the punctuation function's exception-index
|
||||
reference. At that call the fixed ABI positions are:
|
||||
|
||||
- r3: the candidate request
|
||||
- r4: the candidate options object
|
||||
- r5: the workspace
|
||||
|
||||
The dispatcher preserves these three incoming pointers separately. Its
|
||||
_GetCandidates/_CheckCandidates producers create the existing 24-byte
|
||||
ZiCandidateOptions object, initialize capacity from the workspace, and pass
|
||||
its address as the second argument. The dispatcher then writes maxCount
|
||||
from the workspace before calling the punctuation helper.
|
||||
|
||||
The punctuation target reads a byte at options +0, a word at options +0x0C,
|
||||
and a halfword at options +0x10. These are countOnly, maxCount and capacity.
|
||||
It overwrites incoming r5 before reading it, so the third workspace formal
|
||||
is present in the caller contract but unused by this implementation.
|
||||
|
||||
The reconstructed definition previously omitted that third formal and named
|
||||
the second argument workspace. It consequently described options accesses
|
||||
using unrelated workspace fields at coincidentally equal offsets.
|
||||
|
||||
## Minimal correction
|
||||
|
||||
Copy the existing private ZiCandidateOptions type verbatim from zi8getc2.c;
|
||||
no shared header or producer is changed. Its complete layout is reused,
|
||||
including its established fields, without introducing any object, extra
|
||||
storage or invented padding. A fixed-target-width layout check confirms
|
||||
size 24 and the three accessed offsets 0/0x0C/0x10.
|
||||
|
||||
The definition now takes request, opaque options and workspace, and accesses
|
||||
the real options fields through the private view. Its ziU32 result agrees
|
||||
with the sole caller's declaration. All locals, comparisons, loops, output
|
||||
stores and branch directions remain unchanged. The unused workspace formal
|
||||
recovers an argument already supplied by the target caller; it does not
|
||||
manufacture state or instructions.
|
||||
|
||||
## Verification
|
||||
|
||||
Fresh configured 43U baseline and candidate full builds pass with the approved
|
||||
wrapper and WIBO_SJIS_MISSING_IMPORTS=1. Pool first: identical and empty.
|
||||
All allocated payloads and canonical relocations are baseline-identical:
|
||||
.text 300, .rodata 80, extab 8 and extabindex 12 bytes. The only complete-object
|
||||
difference is two anonymous symbol-number characters in nonallocated .strtab.
|
||||
All other 1,026 source objects are byte-identical to baseline.
|
||||
|
||||
Zi8Punctuation stays 75/75 instructions with ctxdiff zero differences. Unit
|
||||
code 300/300, data 100/100, and 1/1 exact functions remain 100%. The entire
|
||||
1,027-unit objdiff report is unchanged. Full 43U DOL SHA1 remains
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d. git diff --check passes.
|
||||
|
||||
Private evidence: /tmp/ezi-options-punct-{report.json,build.log,verification.txt},
|
||||
/tmp/ezi-options-baseline.json and /tmp/ezi-new-receiver-refs.txt.
|
||||
No remote changes, other-region builds, assembly, linking flags, forced
|
||||
registers, volatile, dummy assignments or shared-header edits.
|
||||
|
||||
## Broader read-only ABI audit
|
||||
|
||||
The original-object call inventory covered 20 remaining nonexact functions,
|
||||
excluding the already resolved one-key/PUD/conversion work: 337 direct calls
|
||||
and one OEM callback. A symbolic-expression comparison pins each value to
|
||||
its actual ABI argument register and outgoing stack slot; it does not apply
|
||||
a global argument-register permutation. After applying only the previously
|
||||
proven alpha scalar-frame offset mapping, all 338 call argument expressions
|
||||
agree. The callback's four arguments and stored callback target also agree.
|
||||
No external tail branch was found; indirect non-call branches are switches.
|
||||
A separate incoming-register/stack-use audit found no additional live
|
||||
argument beyond a callee's reconstructed parameter list. These are diagnostic
|
||||
checks, not a formal whole-program equivalence proof.
|
||||
|
||||
The declaration/definition scan identified the separate missing workspace
|
||||
formal on Zi8IsZicorpSignature. Three exact version-query helpers also have
|
||||
old-style empty definitions despite receiving an unused workspace in their
|
||||
exact caller; those are outside this candidate. No allocation experiments
|
||||
were performed.
|
||||
@@ -0,0 +1,35 @@
|
||||
# Signature-check workspace formal, 2026-10-03
|
||||
|
||||
Parent: 8a0aa7ce; its punctuation-options correction is preserved unchanged.
|
||||
Owned source: zi8initd.c / Zi8IsZicorpSignature only.
|
||||
|
||||
The local declaration in zi8alpha.c takes word, halfword length and workspace.
|
||||
An original-object reference scan finds exactly one caller and no function
|
||||
pointer or other address escape. The target AlphaGetCandidates call puts the
|
||||
word in r3, narrows the length into r4, and moves its preserved workspace into
|
||||
r5 immediately before calling Zi8IsZicorpSignature.
|
||||
|
||||
The callee's current definition omitted the third formal. Its target reads
|
||||
only r3/r4; r5 never appears anywhere in its 48 instructions. It has no calls
|
||||
or tail target. Add the existing ZI_NEED_WORK formal to align the definition
|
||||
with the actual caller and its declaration. The argument is genuinely passed
|
||||
but unused. No local, assignment, storage, volatility or forced spill is added.
|
||||
The body and all other declarations remain unchanged.
|
||||
|
||||
Validation after this separate change:
|
||||
- The complete zi8initd object is byte-identical to the fresh baseline
|
||||
- Zi8IsZicorpSignature remains 48/48 instructions, ctxdiff zero differences
|
||||
- Zi8InitializeDynamic remains 128/128 instructions, ctxdiff zero differences
|
||||
- Unit code 704/704, data 20/20 and 2/2 exact functions remain 100%
|
||||
- The complete 1,027-unit report is identical to baseline and the preceding
|
||||
punctuation-only report; all source objects except punctuation's already
|
||||
documented nonallocated symbol-name difference are byte-identical
|
||||
- Owned allocated sections and canonical relocations are unchanged
|
||||
- Pool is identical and empty; full configured 43U build passes
|
||||
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
This is contract reconstruction only, with no percentage gain. No shared
|
||||
header, caller, linking flag, assembly, other-region build or remote change.
|
||||
Private evidence: /tmp/ezi-options-signature-{report.json,build.log,verification.txt}
|
||||
and /tmp/ezi-new-receiver-refs.txt.
|
||||
@@ -0,0 +1,41 @@
|
||||
# Version-query workspace formals, 2026-10-03
|
||||
|
||||
Base: 9c7d87ab. Owned source: zi8ver.c only. This is source-contract
|
||||
reconstruction with no percentage gain.
|
||||
|
||||
The local declarations in zi8getc2.c already describe Zi8GetVersion,
|
||||
Zi8GetOEMID and Zi8GetBuildID as taking one ziPtr workspace. The definitions
|
||||
instead had old-style empty parameter lists. Add only the existing workspace
|
||||
formal to those three definitions. Bodies, constants, return types, callers
|
||||
and headers are unchanged.
|
||||
|
||||
A fresh scan of all original objects finds exactly four executable references:
|
||||
Zi8GetEngineSignature calls GetVersion twice, GetOEMID once and GetBuildID
|
||||
once. There are no other address references or function-pointer escapes.
|
||||
That caller preserves its incoming second argument, workspace, in r28 and
|
||||
moves it to the fixed first-argument register r3 immediately before each call.
|
||||
The workspace register is not redefined between its incoming copy and the
|
||||
final restore. No argument-register permutation is used for this check.
|
||||
|
||||
Each original callee consists of exactly two instructions: load its existing
|
||||
constant into r3, then return. Thus each overwrites r3 before any read of its
|
||||
incoming value. There is no helper or tail target. The formal is unused in
|
||||
this implementation but is established by every declaration and target call;
|
||||
it adds no local state, storage or assignment.
|
||||
|
||||
Fresh configure and baseline/final full 43U builds used the approved wrapper
|
||||
and WIBO_SJIS_MISSING_IMPORTS=1. Pool first: identical and empty. The entire
|
||||
owned object, all 1,027 source objects, and the complete 1,027-unit objdiff
|
||||
report are byte-for-byte / structurally identical to baseline. All allocated
|
||||
payloads and canonical relocations also match the original target.
|
||||
|
||||
Each helper remains 2/2 instructions with ctxdiff-equivalent zero differences.
|
||||
Unit exact code remains 24/24 bytes and functions 3/3; there are no allocated
|
||||
data bytes. Full build passes and DOL SHA1 remains
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d. git diff --check passes.
|
||||
|
||||
Private evidence: /tmp/ezi-version-baseline.json,
|
||||
/tmp/ezi-version-final-report.json, /tmp/ezi-version-final-build.log and
|
||||
/tmp/ezi-version-verification.txt. No linking, assembly, volatile, forced
|
||||
registers, dummy assignments, shared-header edits, other-region builds or
|
||||
remote writes.
|
||||
102
tools/decomp-assist/allhands-input-form.attempts.md
Normal file
102
tools/decomp-assist/allhands-input-form.attempts.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# Input-form source reconstruction, 2026-10-02/03 UTC
|
||||
|
||||
Base `cc812ad3`, branch `agent/bittle/input-form-reconstruction`, 43U only.
|
||||
Only `src/keyboard/tiInputForm.cpp` and this log are changed. Existing attempt
|
||||
logs, headers, metadata, compiler settings, linking flags and assembly bodies
|
||||
are untouched.
|
||||
|
||||
## Retained changes and target evidence
|
||||
|
||||
### LayoutByNW4R::create
|
||||
|
||||
The first language text-pane lookup in the target loads the layout's root pane
|
||||
and invokes FindPaneByName with the recursive flag. The old source instead
|
||||
invoked the Layout virtual getPane slot. The retained source directly expresses
|
||||
the root-pane lookup, recovering two missing instructions and the correct call
|
||||
receiver path. The later const getLanguageTextPane fallback remains intact.
|
||||
|
||||
The animation loop in the target keeps the address of the selected files[] slot.
|
||||
It loads the file for GetResource, then reloads that slot after the resource and
|
||||
animation-transform calls to obtain the animation ID. The old source captured
|
||||
the file pointer once. A const reference to the existing typed pointer slot now
|
||||
expresses the target's lifetime and recovers the other two missing loads. No
|
||||
new storage, qualifier forcing, table entry, or helper was introduced.
|
||||
|
||||
Together these changes restore the target's 356-instruction body. The fallback
|
||||
name-selection block still schedules some receiver loads differently, and most
|
||||
remaining differences concern register allocation. This is not an exact match.
|
||||
|
||||
### Base::calcCursorPos
|
||||
|
||||
The source now uses the already defined Rect::GetWidth accessor for glyph and
|
||||
form widths. That existing accessor computes exactly right minus left. The
|
||||
change preserves the arithmetic, hit-test inequalities, wrap/newline paths,
|
||||
scroll handling, recursive fallback, and all helper calls. It recovers more of
|
||||
the target's rectangle-expression boundaries at unchanged body size. Height
|
||||
accessors and midpoint operand reversal did not improve the result and were not
|
||||
retained. No new geometry abstraction or arithmetic reassociation was added.
|
||||
|
||||
## Attempts and rejected alternatives
|
||||
|
||||
- Read the previous sol-high-inputform and data-d4 logs. Revisited their concrete
|
||||
root-query and file-slot defects under the user's current partial-decompilation
|
||||
priority; did not repeat the historical declaration searches.
|
||||
- Tested the two create corrections independently and together. Explicit fallback
|
||||
selector locals produced the same code. Duplicating the root lookup in both
|
||||
fallback branches grew the function to 363 instructions and was rejected.
|
||||
- Tested small inline fallback-lookup wrappers; they added source complexity
|
||||
without improving the retained result. A trial binding the derived layout
|
||||
pointer to a base pointer reference did not compile and was restored.
|
||||
- Existing width and height accessors and midpoint operand order were tested
|
||||
independently. Only the width accessor change is retained.
|
||||
- No artificial allocation sweep, new assembly, use-site volatile, dummy storage,
|
||||
undefined input, padding, header edit, or linking experiment was used.
|
||||
|
||||
## Gates
|
||||
|
||||
Before -> after:
|
||||
- calcCursorPos: 91.622696 -> 93.05215% fuzzy, 326/326 instructions unchanged;
|
||||
final raw ctxdiff 50 differences (baseline 52, including existing relocation
|
||||
aliases and floating-point scheduling/allocation differences).
|
||||
- LayoutByNW4R::create: 95.02809 -> 96.40169% fuzzy, 352 -> 356 instructions against
|
||||
target 356; final ctxdiff 155 differences.
|
||||
- Unit fuzzy: 99.578094 -> 99.6535%.
|
||||
- Existing objdiff-exact symbols: 218/221 unchanged; exact code 46980/50656 bytes;
|
||||
matched data 3772/3772 (100%); linked status unchanged.
|
||||
- Independently rebuilt the baseline and candidate objects. All 218 previously
|
||||
objdiff-100 symbols have identical baseline/candidate instruction streams.
|
||||
This preserves the pre-existing distinction between objdiff and raw ctxdiff
|
||||
exactness rather than claiming every alias-normalized symbol has diffs 0.
|
||||
- Baseline/candidate raw .data, .rodata, .bss, .sdata, .sbss, .sdata2 and .ctors
|
||||
section bytes and extents are identical. All 20 pool strings match the target.
|
||||
- Literal audit: 20 arguments checked, 221 functions analyzed, no candidates,
|
||||
skips or errors. Target-sized create is now included in that audit.
|
||||
- Full 1027-unit report: no exact-function, exact-code, data or fuzzy regressions.
|
||||
- Full 43U build and build/43U/ok passed, again after rebuilding the baseline and
|
||||
restoring the candidate. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
## Focused behavior coverage and limits
|
||||
|
||||
A private host harness extracts the production baseline/candidate calcCursorPos
|
||||
bodies without rewriting them, supplies the same Rect::GetWidth expression, and
|
||||
uses deterministic font/scale/wrap stubs. Compiled with single-precision float,
|
||||
-fno-fast-math and -ffp-contract=off, it checks returned positions, helper-call
|
||||
traces and wrap counters across empty text, newlines, forced word wraps, width
|
||||
wraps, boundary hits, scale, non-positive scroll and recursive fallback.
|
||||
|
||||
159,320 terminating cases agreed. Another 680 synthetic font/wrap states reached
|
||||
the same 1,000-scale-call model budget with identical traces in both versions;
|
||||
no termination claim is made for those states. The initial unrestricted harness
|
||||
also reached its budget in the baseline, so this is equivalence coverage for the
|
||||
accessor change, not proof of general termination or a newly diagnosed Wii bug.
|
||||
The layout/resource creation path is validated by target call/load evidence and
|
||||
the real 43U compile; no Wii UI/runtime execution is claimed.
|
||||
|
||||
Private local evidence: `/tmp/input-form-reconstruction/` contains baseline/final
|
||||
reports and object copies, pool/literal audits, both final ctxdiffs, build logs,
|
||||
validate_cursor.py and cursor-tests.log, plus rejected experiments. No retail
|
||||
assembly or binary is committed or uploaded.
|
||||
|
||||
GATE: validated partial source/control/data-flow reconstruction; no regressions.
|
||||
Exact matching and linking remain open. Candidate frozen for parent validation.
|
||||
@@ -0,0 +1,238 @@
|
||||
# RGB565420 edge bounded declaration search
|
||||
|
||||
Base: `32be36cb4e57bdaf05af9bbccc0a4ff6a63cb1aa`; branch
|
||||
`agent/bittle/jpeg-edge-declaration-search`; 43U only.
|
||||
|
||||
The function at entry exactly matched the merged pixel-lifetime candidate
|
||||
from #1061. Its function-text SHA256 was
|
||||
`b0117318407c1fb445baef7534c6f0d28908412e0e8c26bc113efc4ed956f57f`.
|
||||
The contiguous leading block at source lines 566..585 contains twenty existing
|
||||
uninitialized scalar/pointer declarations. Initialized pixel locals at 620..623
|
||||
were excluded. Earlier tex1 coverage used the older function-wide RGB locals;
|
||||
the #1061 evidence explicitly records no declaration search on its new body.
|
||||
|
||||
## Authorized search and stop
|
||||
|
||||
Ran the unchanged repository tool exactly once:
|
||||
|
||||
```sh
|
||||
WIBO_SJIS_MISSING_IMPORTS=1 NINJA=../.venv/bin/ninja \
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python \
|
||||
tools/decomp-assist/declsearch.py \
|
||||
libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565 \
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge --lines 566 585 --max-evals 32
|
||||
```
|
||||
|
||||
Structural/positional trajectory: `(4,65)` -> `(4,58)`.
|
||||
The tool stopped at 32 distinct scored orders, then rebuilt its retained order.
|
||||
This was the finite evaluation cap, not exhaustion of the final neighborhood.
|
||||
There was no custom search, extra variant, helper edit, or initializer move.
|
||||
|
||||
The sole retained source change swaps the leading declarations of `column`
|
||||
(s32) and `crValue` (s8). Both are genuinely used uninitialized scalar locals.
|
||||
All expression tokens, initialization statements, scopes, helper bodies,
|
||||
clamps, arithmetic, and pointer steps remain byte-for-byte unchanged.
|
||||
There are no floating-point operations in this converter.
|
||||
|
||||
## Fresh official result
|
||||
|
||||
- Function fuzzy: 95.570175 -> 95.96491%
|
||||
- Instruction count: 114/114; ctxdiff differences: 65 -> 58
|
||||
- Unit fuzzy: 96.58538 -> 96.61449%
|
||||
- Exact remains 7/13; matched code remains 2648/6184 bytes
|
||||
- No allocated non-code sections; data remains 100%
|
||||
- Global fuzzy: 99.71971 -> 99.71977%; all exact/link/data totals unchanged
|
||||
- Full report: zero function/unit regressions; only this unit changes
|
||||
- Only this function's bytes change; all twelve sibling bodies are identical
|
||||
to the saved pre-search object
|
||||
- All seven existing exact siblings remain objdiff 100% and ctxdiff zero
|
||||
|
||||
This is partial fuzzy progress, not an exact or linking result.
|
||||
|
||||
## Gates
|
||||
|
||||
Full 43U build and `ninja build/43U/ok`: PASS.
|
||||
DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
Pool before and after: identical, zero strings. `git diff --check`: PASS.
|
||||
Literal audit: no candidates/errors; twelve functions analyzed, unchanged
|
||||
setter skipped for unequal function sizes.
|
||||
|
||||
The unchanged prior pixel oracle passed 8,721 vectors / 26,163 object executions
|
||||
against the candidate, original, and its saved pre-#1061 baseline: 808 edge-size
|
||||
cases, 256 dimension-branch cases, 6,400 saturation cases, and 1,257 aligned
|
||||
input/output overlaps wholly inside the actual conversion buffer. Every one of
|
||||
114 instructions was exercised in each object. The interpreter checks every
|
||||
non-stack byte, LR, stack pointer, and preserved GPRs. Valid rows exercise both
|
||||
column parities; odd input x remains outside the existing asserted contract.
|
||||
The prior oracle's bounded-input and interpreter limitations still apply;
|
||||
this is not formal equivalence or Wii runtime validation.
|
||||
|
||||
## Unsearched neighborhood, read-only count
|
||||
|
||||
For twenty declarations, the retained order has:
|
||||
|
||||
- 190 distinct pair-swap neighbors
|
||||
- 361 distinct remove/insert move neighbors
|
||||
- 19 neighbors common to both sets
|
||||
- 532 distinct neighbors in their union
|
||||
|
||||
The tool's deterministic enumeration reaches the sole improvement at evaluation
|
||||
27: swapping zero-based positions 1 and 8. Five new final-order neighbors are
|
||||
then scored before reaching 32. The initial order is also a final-order neighbor
|
||||
(the inverse swap), giving 6 covered and 526 unscored final-order neighbors.
|
||||
This count was reproduced without compiling any additional order. It is inferred
|
||||
from the unchanged tool, its logged single improvement and final 32-build count.
|
||||
A fresh official run lacks the prior cache and would repeat those six neighbors;
|
||||
533 total evaluations can cover one fixed order plus its entire neighborhood if
|
||||
no intervening improvement causes the tool to restart from another order.
|
||||
No continuation run was performed.
|
||||
|
||||
## Evidence
|
||||
|
||||
`/tmp/jpeg-edge-declaration-search/` contains `search-output.txt`, baseline and
|
||||
candidate reports, the saved pre-search object, `candidate.ctx`, `full-build.log`,
|
||||
`verification.txt`, `audit-output.txt`, `audit-results.json`, and `neighborhood.json`.
|
||||
The read-only `verify.py` asserts the source consists of exactly the two-line
|
||||
swap and compares reports, allocated sections, and sibling object bytes.
|
||||
The prior oracle remains `/tmp/jpeg-pixel-lifetime/audit.py`, unchanged.
|
||||
No remote writes, link flags, shared headers, or tool changes.
|
||||
|
||||
## Separately authorized 533-evaluation continuation
|
||||
|
||||
The preceding 32-evaluation candidate was preserved on its own branch. A new
|
||||
branch, `agent/bittle/jpeg-edge-order-finish`, starts at base `32be36cb` with that
|
||||
candidate cherry-picked as `81df2b4e26f36c1b63a74840754ea720dc4f1c72`.
|
||||
The 95.96491% baseline was rebuilt and freshly measured before proceeding.
|
||||
|
||||
Ran the unchanged official command above exactly once more, changing only
|
||||
`--max-evals 32` to `--max-evals 533`. The same twenty leading uninitialized
|
||||
declarations remained the complete writable search range. All source outside
|
||||
that block was checked byte-for-byte against the entry source, and the block's
|
||||
declaration multiset was unchanged. No initialized local, scope, expression,
|
||||
helper, type, array, or evaluation-order edit occurred.
|
||||
|
||||
The structural/positional trajectory was:
|
||||
|
||||
```text
|
||||
(4,58) -> (4,57) -> (4,56) -> (4,55) -> (4,52) -> (4,49)
|
||||
-> (4,48) -> (4,44) -> (4,43) -> (4,39) -> (4,35)
|
||||
```
|
||||
|
||||
The tool stopped after 533 distinct scored orders and rebuilt its retained
|
||||
order. The evaluation cap stopped this run; a local fixed point was not reached.
|
||||
There was no extra search or source variant afterward.
|
||||
|
||||
### Final measured result and repeated gates
|
||||
|
||||
- Function fuzzy: 95.96491 -> 97.850876%; compared with merged #1061: 95.570175%
|
||||
- Unit fuzzy: 96.61449 -> 96.753555%; compared with merged #1061: 96.58538%
|
||||
- 114/114 instructions; ctxdiff differences: 58 -> 35
|
||||
- Global fuzzy on this branch: 99.71977 -> 99.72007%
|
||||
- Exact remains 7/13; matched code 2648/6184 bytes; link/data totals unchanged
|
||||
- Zero full-report function/unit regressions; only this unit changes
|
||||
- Only the targeted function body changes; all twelve siblings remain
|
||||
byte-identical to the saved 95.96491% entry object
|
||||
- All seven exact siblings remain objdiff 100% and ctxdiff zero
|
||||
- Empty allocated non-code sections and empty string pool unchanged
|
||||
- Full 43U build, `ninja build/43U/ok`, and `git diff --check`: PASS
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- Literal audit: no candidates/errors; twelve functions analyzed; unchanged
|
||||
setter skipped for unequal size
|
||||
- The unchanged prior oracle again passes all 8,721 vectors / 26,163 object
|
||||
executions with complete 114-instruction coverage in all three objects
|
||||
|
||||
The same bounded-oracle limitations listed above apply. This is partial fuzzy
|
||||
progress and does not add an exact function or change linking.
|
||||
|
||||
Final source SHA256:
|
||||
`3b0ed19e076c09dfbcd841fc63b79e48ef0ae84703bd4148fdac56c8cfd2c6d3`.
|
||||
|
||||
### Final neighborhood coverage
|
||||
|
||||
The new final order again has 532 distinct one-swap/one-move neighbors. The
|
||||
official tool restarts its neighborhood after an improvement; ten improvements
|
||||
therefore moved the center during the finite run.
|
||||
|
||||
An exact final-neighbor coverage count is unavailable: the unchanged tool logs
|
||||
score improvements and its final declaration order, but does not retain the
|
||||
identity of each intermediate tested order. No identities were invented.
|
||||
Read-only enumeration establishes these conservative bounds:
|
||||
|
||||
- The final order itself, the starting order, and the first tested swap are
|
||||
three scored orders outside the final neighbor set
|
||||
- The last improving parent is a scored final-order neighbor
|
||||
- Between 1 and 530 of 532 final neighbors were scored in this continuation
|
||||
- At least 2 final neighbors remain unscored; the neighborhood is not exhausted
|
||||
|
||||
These bounds concern the continuation, not a claim of cumulative coverage
|
||||
across other runs. No further continuation was performed or implied.
|
||||
|
||||
### Continuation artifacts
|
||||
|
||||
`/tmp/jpeg-edge-order-finish/` contains the complete score trajectory, freshly
|
||||
rebuilt baseline report/object/source, candidate report, `candidate.ctx`, full
|
||||
build log, independent verification output, unchanged-oracle output/results,
|
||||
and read-only neighborhood calculation results. Its `verify.py` checks that
|
||||
only the leading-declaration order changes, then checks full reports, exact
|
||||
siblings, all sibling bytes and allocated non-code sections.
|
||||
|
||||
The separately preserved 32-evaluation branch is unchanged. The final source
|
||||
and this combined evidence log are ready for independent review as one PR.
|
||||
No remote writes occurred.
|
||||
|
||||
## Final authorized fixed-point check
|
||||
|
||||
A final separate branch, `agent/bittle/jpeg-edge-order-fixedpoint`, preserves
|
||||
the validated source on current main `a4d145c0` through cherry-picked commits
|
||||
`8b2366be` and `a4f3d380`. The 97.850876% baseline was rebuilt and freshly
|
||||
measured before the search. Its source is identical to the preceding frozen
|
||||
candidate `7423b762`.
|
||||
|
||||
Ran the same unchanged official command once with `--max-evals 1200`, still
|
||||
restricted to source lines 566..585 and the same twenty uninitialized
|
||||
scalar/pointer declarations. No other source region was writable by this run.
|
||||
|
||||
Actual result:
|
||||
|
||||
```text
|
||||
start (4, 35)
|
||||
best (4, 35) after 533 builds; source restored
|
||||
```
|
||||
|
||||
There were zero improvements. The run stopped at a local fixed point before
|
||||
its 1200-evaluation cap. Its 533 scored orders comprise the baseline plus all
|
||||
532 distinct pair-swap/remove-insert neighbors of that baseline. The center
|
||||
never moved, so complete final-neighborhood coverage is established directly
|
||||
from the unchanged deterministic tool and its count. No inferred intermediate
|
||||
permutations are needed.
|
||||
|
||||
This is a fixed point under declsearch's structural/positional comparator.
|
||||
Official objdiff fuzzy was measured at entry and exit, both 97.850876%; the
|
||||
tool does not measure official fuzzy for each intermediate neighbor. No claim
|
||||
of globally optimal fuzzy score or exhaustion of multi-step permutations is made.
|
||||
No additional run followed the fixed point.
|
||||
|
||||
### Retained-source verification on current main
|
||||
|
||||
The complete source and whole RGB565 object are byte-identical to the freshly
|
||||
rebuilt 97.850876% entry baseline. The complete 1027-unit report is identical
|
||||
before and after the final full rebuild, with zero function/unit regressions.
|
||||
|
||||
- Function fuzzy remains 97.850876%; unit fuzzy remains 96.753555%
|
||||
- 114/114 instructions, 35 ctxdiff differences; exact remains 7/13
|
||||
- All seven exact siblings remain objdiff 100% and ctxdiff zero
|
||||
- Allocated non-code sections remain empty; pool identical, zero strings
|
||||
- Full 43U build, `ninja build/43U/ok`, and `git diff --check`: PASS
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- Literal audit: no candidates/errors; twelve functions analyzed, unchanged
|
||||
setter skipped for unequal size
|
||||
- Unchanged pixel oracle: all 8,721 vectors / 26,163 object executions pass,
|
||||
with full 114-instruction coverage and the previously documented limitations
|
||||
- Current-base global fuzzy: 99.72187%; this neutral search changes no totals
|
||||
|
||||
Final evidence is in `/tmp/jpeg-edge-order-fixedpoint/`: baseline report,
|
||||
object and source; full trajectory; candidate report; full build log; verification
|
||||
output; pixel-oracle output/results; and exact neighborhood counts. Source SHA256
|
||||
remains `3b0ed19e076c09dfbcd841fc63b79e48ef0ae84703bd4148fdac56c8cfd2c6d3`.
|
||||
Only this evidence append is new in the final check; the best source is retained.
|
||||
No remote writes, new variants, helper changes, or initialized-local edits.
|
||||
99
tools/decomp-assist/allhands-jpeg-pixel-lifetime.attempts.md
Normal file
99
tools/decomp-assist/allhands-jpeg-pixel-lifetime.attempts.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# RGB565420 edge pixel lifetime
|
||||
|
||||
Base: `57ccda3883537a308568c03924af2cebf2d8a789`, branch
|
||||
`agent/bittle/jpeg-pixel-lifetime`, 43U only. One authorized source trial;
|
||||
no additional variants, header/configuration changes, or remote writes.
|
||||
|
||||
## Source reconstruction
|
||||
|
||||
The existing exact RGB565444 sibling has a pixel-scoped independent luminance
|
||||
value and pixel-scoped RGB locals. Apply that lifetime boundary to RGB565420
|
||||
edge, retaining its current chroma sampling and every address/step expression.
|
||||
Initialize red, blue, then green, matching original instructions 60..62 after
|
||||
the luminance load at 58. The original overflow reduction at 63..64 is
|
||||
blue/red/green; that existing source expression remains unchanged, as do clamps
|
||||
and the RGB565 packing expression. No declaration-permutation search was used.
|
||||
|
||||
Chroma products are bounded signed integer arithmetic. For signed byte Cb/Cr,
|
||||
red/green/blue offsets stay within [-180,178], [-135,135], and [-227,225]. Adding
|
||||
an unsigned luminance byte cannot overflow s32. There are no floating-point
|
||||
operations. Removing the blue variable's temporary ownership of luminance and
|
||||
limiting RGB lifetimes to the pixel does not add or remove input reads or output
|
||||
writes. The arithmetic order changes only among independent initialized scalars.
|
||||
|
||||
The historical tex1 log records a different sibling-template trial at
|
||||
96.00877%, discarded for being nonexact. Its original source is unavailable;
|
||||
this candidate is an independently measured reconstruction, not that artifact.
|
||||
|
||||
## Measured result
|
||||
|
||||
- `TMCJPEGDEC_converterYUV420toRGB565edge`: 94.692986 -> 95.570175%
|
||||
- 114/114 instructions; ctxdiff differences 73 -> 65
|
||||
- Unit fuzzy: 96.5207 -> 96.58538%
|
||||
- Exact functions remain 7/13; matched code remains 2648/6184 bytes
|
||||
- No allocated non-code sections in source or original; data remains 100%
|
||||
- Global fuzzy: 99.71608 -> 99.7162%; all exact/link/data totals unchanged
|
||||
- No function- or unit-level regressions across the full 1027-unit report
|
||||
- Only this function's body differs from the saved baseline object; all twelve
|
||||
sibling function bodies are byte-identical to baseline
|
||||
- Seven existing exact functions remain objdiff 100% and ctxdiff zero
|
||||
|
||||
This is partial fuzzy progress, not an exact match or linking result.
|
||||
|
||||
## Validation
|
||||
|
||||
Pool checks before the trial and after the full build: identical, zero strings.
|
||||
The full 43U build passed. `ninja build/43U/ok` passed with no work pending.
|
||||
DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
`git diff --check` passed. Literal-reference audit: no candidates/errors;
|
||||
twelve functions analyzed, unchanged nonexact setter skipped for unequal size.
|
||||
|
||||
A focused independent scalar pixel model was compared with the compiled
|
||||
candidate, original, and saved baseline through the existing bounded PPC
|
||||
interpreter. All 8,721 vectors passed (26,163 object executions):
|
||||
|
||||
- 808 cases covering every valid edge width and height for scales 1/2/4/8,
|
||||
both starting-row parities, and even-column residues 0/2 within a tile
|
||||
- 256 cases covering both width/height selection branches, zero/full/partial
|
||||
extents, row parity and column residues
|
||||
- 6,400 saturation cases: all 256 luminance values crossed with all Cb/Cr
|
||||
pairs from {-128,-1,0,1,127}
|
||||
- 1,257 aligned input/output overlaps; every output byte stays inside the
|
||||
actual 0x184-byte convBuf backing array and state remains separate
|
||||
|
||||
All 114 instructions in candidate, original, and baseline were exercised.
|
||||
Every non-stack byte, including guards, was compared against the scalar model.
|
||||
The interpreter also checked LR, stack pointer, and GPR14..GPR31 preservation.
|
||||
Odd input x is excluded by the existing entry assertion; valid multi-pixel
|
||||
rows exercise both odd/even column paths. Unsupported scales and invalid
|
||||
pointers are not asserted valid API inputs. These are bounded interpreter
|
||||
checks, not formal equivalence or Wii runtime validation. The existing integer
|
||||
interpreter's limitations remain; no FPU, MMIO, exception or timing model is used.
|
||||
|
||||
## Reproduction artifacts
|
||||
|
||||
Local evidence directory: `/tmp/jpeg-pixel-lifetime/`.
|
||||
- `baseline-report.json`, `baseline-rgb.o`: saved before source edits
|
||||
- `candidate-report.json`, `candidate.ctx`: focused candidate measurements
|
||||
- `full-build.log`: full build output
|
||||
- `audit.py`, `audit-results.json`, `audit-output.txt`: independent pixel model
|
||||
and targeted differential evidence
|
||||
|
||||
The test script reads the current candidate object, current original object,
|
||||
and saved baseline object. It does not write repository source or original
|
||||
binary bytes. Re-run from this worktree:
|
||||
|
||||
```sh
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python /tmp/jpeg-pixel-lifetime/audit.py
|
||||
```
|
||||
|
||||
Build configuration uses cached approved tools:
|
||||
|
||||
```sh
|
||||
../.venv/bin/python configure.py --version 43U \
|
||||
--wrapper ../toolchain/wibo-build/wibo --compilers build/compilers \
|
||||
--dtk build/tools/dtk --objdiff build/tools/objdiff-cli \
|
||||
--sjiswrap build/tools/sjiswrap.exe
|
||||
WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja
|
||||
build/tools/objdiff-cli report generate -p . -o build/43U/report.json -f json
|
||||
```
|
||||
@@ -0,0 +1,70 @@
|
||||
# Keyboard dictionary accessor contract, 2026-10-03 UTC
|
||||
|
||||
Base `1fa33882`, branch `agent/bittle/keyboard-manager-reconstruction`.
|
||||
Only two calls in `src/system/iplKeyboard.cpp` and this log are changed. 43U only;
|
||||
no header, metadata, compiler-setting, assembly, linking or data edits.
|
||||
|
||||
## Source defect and retained correction
|
||||
|
||||
Manager::create's two dictionary loops use an OEM index in the range 10..19.
|
||||
They passed that index to System::getZiDicData(int), which is currently defined
|
||||
as `smArg.mZiDicData.sys[i]`. The sys subarray has ten elements. Thus the source
|
||||
expressed the OEM reads beyond that subarray's bounds, despite landing at the
|
||||
intended adjacent OEM bytes on the target compiler.
|
||||
|
||||
The retained calls use the already existing System::getZiOemDicData accessor,
|
||||
passing the OEM-relative index `oemIndex - EZTX_LANG_MAX` (0..9). This accessor
|
||||
indexes the actual ten-element oem subarray. The target loads from the combined
|
||||
system/OEM table base plus four times the absolute OEM index; the corrected
|
||||
accessor computes the same addresses through the proper object member.
|
||||
No shared accessor or data layout is changed. The existing system-dictionary
|
||||
presence check governing fallback selection is preserved, as the target proves.
|
||||
|
||||
This is a source-correctness improvement, not a new exact match or a matching-
|
||||
percentage gain. The entire generated source .text section remains byte-identical.
|
||||
|
||||
## Other investigations
|
||||
|
||||
- Read the prior fz1 and data-d1 construction/index/memo-copy attempts.
|
||||
- The existing zero-argument twenty-entry dictionary accessor also preserved
|
||||
the baseline score. The dedicated OEM accessor was preferred for its explicit
|
||||
index domain and object-member contract.
|
||||
- Using the system index directly for OEM lookup or changing to an independent
|
||||
zero-based OEM counter changed induction lowering and reduced similarity;
|
||||
those forms were not retained.
|
||||
- Explicit allocation followed by placement construction was tried for the arc
|
||||
link, resource accessor and allocator. It did not improve output, so those
|
||||
larger changes and the extra include were discarded.
|
||||
- No declaration/register sweep, artificial storage, volatile cast, padding,
|
||||
assembly, header change or linking experiment was used.
|
||||
|
||||
## Verification
|
||||
|
||||
Baseline -> candidate:
|
||||
- Manager::create: 94.00944 -> 94.00944%, 318/318 instructions unchanged.
|
||||
- Unit fuzzy: 98.73506 -> 98.73506%.
|
||||
- Exact functions 31/32, exact code 4752/6024, data 1184/1184 (100%), and linked
|
||||
status unchanged. Exact matching of create remains open.
|
||||
- Fresh baseline and candidate object builds: all 32 reported function instruction
|
||||
streams are identical. Entire source .text (6240 bytes), .data (1161 bytes),
|
||||
.sdata (6 bytes) and .sdata2 (8 bytes) are byte-identical.
|
||||
- Pool: all 28 strings identical to target.
|
||||
- Literal audit: 25 arguments, 32 functions, no candidates, skips or errors.
|
||||
- Full 1027-unit report has no exact-function/code/data/fuzzy regressions.
|
||||
- Full 43U build and build/43U/ok passed. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
A host harness extracts the actual production dictionary loops and uses bounded
|
||||
system/OEM accessor stubs. Compiled with undefined-behavior/bounds sanitizers,
|
||||
it passes all 1,048,576 combinations of ten system and ten OEM availability bits.
|
||||
The independent reference checks the target's fallback-selection rule, every
|
||||
result pointer, the preserved language IDs and both final table sentinels.
|
||||
No Wii resource-loading or UI runtime execution is claimed.
|
||||
|
||||
Private evidence: `/tmp/keyboard-manager-reconstruction/` contains baseline/final
|
||||
reports and object copies, pool/literal audits, full-build.log, source experiments,
|
||||
validate_dictionaries.py and dictionary-tests.log. No retail assembly or binary
|
||||
is included in this commit.
|
||||
|
||||
GATE: source accessor bounds corrected with byte-identical generated code and
|
||||
no matching/data regressions. Frozen for parent validation; no completion claim.
|
||||
82
tools/decomp-assist/allhands-md5-cursor.attempts.md
Normal file
82
tools/decomp-assist/allhands-md5-cursor.attempts.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# MD5 sequential word consumption, 2026-10-03
|
||||
|
||||
Base: `fc114afd`. Source scope: `libs/RevoEX/src/net/md5.c` only. This is a
|
||||
validated partial reconstruction under the user's decompiled-first priority,
|
||||
not an exact match or linking change. Prior accepted source and logs remain.
|
||||
|
||||
## Selected source form
|
||||
|
||||
The first sixteen MD5 steps consume the existing sixteen-word context block
|
||||
sequentially. Each step reads the selected word twice with the byte-reversed
|
||||
intrinsic, then advances its local cursor by one word. The original performs
|
||||
those paired loads before each four-byte cursor increment. `rotateNextSum`
|
||||
expresses that consumption through the actual cursor's address, and is used
|
||||
only by the four first-round step sites. The cursor begins at `buffer32`, ends
|
||||
one-past its sixteen words and never escapes. No additional state is stored.
|
||||
|
||||
The other three rounds select nonsequential words through the existing index
|
||||
table and therefore retain the non-consuming `rotateSum` helper. Both helpers
|
||||
use the same unsigned arithmetic and paired endian loads. The small duplicated
|
||||
rotation expression supports these two different pointer contracts; duplication
|
||||
is not itself a reason for the gain. There are no new helper families, XOR
|
||||
regroupings, arbitrary ordering hints, volatile qualifiers or register forcing.
|
||||
|
||||
This exact source form was previously measured at 94.98366% in the grouping
|
||||
work, but rejected because it duplicated the small rotation body for a partial
|
||||
gain. Fresh review selected it under the current acceptance priority. Only this
|
||||
archived form was compiled; no new variant sweep was performed.
|
||||
|
||||
## Pinned contracts and scoped instruction audit
|
||||
|
||||
Original ProcessBlock consumes only incoming r3. State occupies context bytes
|
||||
0..15, the untouched u64 byte count 16..23, and the owned block 24..87.
|
||||
The exact Update API copies each complete block there; exact GetDigest builds
|
||||
its final block there. ProcessBlock has no calls, external buffer, callback or
|
||||
count dependency. No missing input or width defect was found.
|
||||
|
||||
Both compiled streams have four CTR=4 loops and reduce to the same independent
|
||||
64-step MD5 recurrence in a private symbolic PPC instruction model. Arbitrary
|
||||
initial state words and arbitrary message words are retained symbolically;
|
||||
normalization uses only unsigned addition/XOR identities, commutative Boolean
|
||||
operations and the observed split-rotation identity. Both streams execute
|
||||
1,107 instructions, 128 paired little-endian message loads, 64 constant loads
|
||||
and 48 index loads. The selected addresses match all four MD5 word schedules.
|
||||
All 64 constants and 48 indices match their standard formulas. The only object
|
||||
writes are the four final state words, at offsets 0,4,8,12. This scoped model
|
||||
is additional evidence, not a general compiler-equivalence proof.
|
||||
|
||||
## Fresh gates
|
||||
|
||||
- ProcessBlock: 94.30719 -> 94.98366% fuzzy, 306/306 instructions.
|
||||
Positional ctxdiff differences decrease 215 -> 212; it is still nonexact.
|
||||
- Unit: 96.179825 -> 96.63377%; exact functions 3/4 and exact code 600/1824
|
||||
unchanged. Data remains 456/456 (100%), with no linking change.
|
||||
- All three public APIs remain byte-identical to baseline and instruction-exact
|
||||
against original: Init 16/16, Update 60/60, GetDigest 74/74, diffs 0.
|
||||
- All 448 .data bytes are unchanged and identical to original. The .sdata byte
|
||||
remains 0x80; the existing source size 1 / target size 8 alignment difference
|
||||
is unchanged. No padding or section changes were introduced.
|
||||
- Empty pools identical. Literal-reference audit analyzes all four functions,
|
||||
with zero candidates/errors and no string arguments to check.
|
||||
- Full 1,027-unit before/after report: only MD5 changes; no exact function,
|
||||
exact code, data or fuzzy regression. Post-build final report equals the
|
||||
candidate report.
|
||||
- 3,088 production-C digest/chunking comparisons against hashlib pass, including
|
||||
standard vectors, one million `a` bytes, 1,500 seeded messages and block/final
|
||||
padding boundaries. Padding is supplied externally; host testing does not
|
||||
exercise GetDigest's PPC-endian length stores.
|
||||
- 20,000 direct production ProcessBlock checks against an independent scalar
|
||||
compression recurrence pass with ASan/UBSan. Arbitrary initial states and
|
||||
blocks cover unsigned overflow; count, input block and surrounding canaries
|
||||
stay unchanged. Leak detection is disabled because it is unsupported under
|
||||
this environment's ptrace; address and undefined-behavior checks are enabled.
|
||||
- Full 43U build and build/43U/ok pass. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Private evidence: `/tmp/md5-cursor-revalidation/` contains the reports, source
|
||||
snapshots, instruction audit, host tests, sanitizer output, pool/literal/ctxdiff
|
||||
results and build logs. Read-only preselection audit is preserved separately in
|
||||
`/tmp/md5-processblock-audit/`. No original assembly or binary is committed.
|
||||
|
||||
GATE: passing partial instruction-structure gain, frozen for independent review;
|
||||
exact matching and linking remain open.
|
||||
104
tools/decomp-assist/allhands-md5-declaration-order.attempts.md
Normal file
104
tools/decomp-assist/allhands-md5-declaration-order.attempts.md
Normal file
@@ -0,0 +1,104 @@
|
||||
# MD5 bounded declaration-order continuation, 2026-10-03
|
||||
|
||||
Base: `b7a06e9d`, after the accepted sequential cursor helper from `55ff13a2`.
|
||||
Only `libs/RevoEX/src/net/md5.c` and this log change. The parent authorized one
|
||||
bounded official declaration search after confirming this source had not been
|
||||
searched. No remote operation, extra search or custom variant was performed.
|
||||
|
||||
## Authorized range and run
|
||||
|
||||
Original lines 93..97 contain only five existing uninitialized declarations:
|
||||
word, constant, index, round, block. The initialized state words on line 92,
|
||||
static arrays, all assignments, expressions, scopes and both helpers stay
|
||||
byte-for-byte unchanged. These independent scalar/pointer declarations have
|
||||
no initialization side effects; every value is still assigned before use.
|
||||
|
||||
The earlier four-leaves-r11 search used different rotation code and a larger
|
||||
block containing initialized state declarations. The accepted grouping and
|
||||
cursor-helper attempts explicitly did not search this exact source.
|
||||
|
||||
After a fresh 43U baseline build and pool check, ran exactly once:
|
||||
|
||||
WIBO_SJIS_MISSING_IMPORTS=1 NINJA=../.venv/bin/ninja \
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python -u \
|
||||
tools/decomp-assist/declsearch.py libs/RevoEX/src/net/md5 ProcessBlock \
|
||||
--version 43U --lines 93 97 --max-evals 23
|
||||
|
||||
The official structural/positional score trajectory was:
|
||||
(5,212) -> (5,209) -> (5,202) -> (5,197).
|
||||
The selected order is index, block, constant, round, word.
|
||||
|
||||
The run stopped at its 23-unique-evaluation bound, not a proven local fixed
|
||||
point. The final order has 22 distinct swap/move neighbors, and the original
|
||||
order is outside that neighborhood. Covering the final order, its entire
|
||||
neighborhood and the already-tested original would require at least 24
|
||||
unique evaluations. A later separately authorized finite continuation could
|
||||
therefore be useful; none was run here. The tool's final rebuild is additional
|
||||
to its 23 evaluations. This is not an exhaustive search of all 120 orders.
|
||||
|
||||
## Fresh retention gates
|
||||
|
||||
- ProcessBlock: 94.98366 -> 95.55556% fuzzy, 306/306 instructions. Positional
|
||||
ctxdiff decreases 212 -> 197; the official structural score remains 5.
|
||||
- Unit: 96.63377 -> 97.01755%. Exact functions 3/4, code 600/1824 and data
|
||||
456/456 remain unchanged. This is a partial matching gain; linking is unchanged.
|
||||
- NETMD5Init 16/16, NETMD5Update 60/60 and NETMD5GetDigest 74/74 remain literally
|
||||
instruction-exact against original and unchanged from baseline.
|
||||
- .data 448 bytes and the existing .sdata byte/extent are unchanged. Empty
|
||||
pools identical. Literal advisory analyzes all four functions without
|
||||
candidates, skips or errors; there are no string arguments to check.
|
||||
- Full 1,027-unit reports show only MD5 improved, with no fuzzy, exact-function,
|
||||
exact-code or data regression. The final report equals the candidate report.
|
||||
- A fresh symbolic PPC instruction audit reduces the compiled candidate and
|
||||
original to the same unsigned 64-step MD5 recurrence, with identical selected
|
||||
addresses for 128 LE message loads, 64 constants and 48 indices. Only the four
|
||||
state words are written; count and block remain untouched.
|
||||
- Production C passes 3,088 known-answer/seeded digest and chunking checks.
|
||||
RFC1321 padding is supplied externally; GetDigest's platform-endian stores
|
||||
remain instruction-exact and outside little-endian host test coverage.
|
||||
- Production ProcessBlock passes 20,000 arbitrary-state/block comparisons with
|
||||
ASan/UBSan, preserving count, input block and canaries. Leak detection is
|
||||
disabled for ptrace; address and undefined-behavior instrumentation is enabled.
|
||||
- Full 43U build and build/43U/ok pass. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`. git diff --check passes.
|
||||
|
||||
Private evidence: `/tmp/md5-declaration-order/` contains the exact search log,
|
||||
source/object snapshots, reports, symbolic/host/sanitizer checks, pool/ctxdiff/
|
||||
literal output and build logs. The read-only eligibility screen is separately
|
||||
preserved in `/tmp/md5-declaration-screen/`. Original assembly/objects stay private.
|
||||
|
||||
GATE: passing bounded five-declaration-only partial gain, frozen for independent
|
||||
review. No initializer, expression, statement, type, scope or helper changed.
|
||||
|
||||
## Finite continuation: local fixed point
|
||||
|
||||
Prepared base `32be36cb` plus cherry-picked source candidate `31dffe1b`.
|
||||
Fresh configure/build verified ProcessBlock 95.55556% before the continuation.
|
||||
The parent authorized exactly one further official run over the same five
|
||||
uninitialized declarations, with --lines 93 97 --max-evals 120. No source type,
|
||||
initializer, assignment, expression, scope or helper was changed.
|
||||
|
||||
The run started and finished at (5,197), without any intermediate improvement.
|
||||
It stopped after 23 unique evaluations: the selected order and all 22 distinct
|
||||
swap/move neighbors. This is a local fixed point of the official tool's scoring
|
||||
and neighborhood, not the 120-evaluation cap or an exhaustive global optimum.
|
||||
No additional run is authorized or planned.
|
||||
|
||||
The tool restored its initial source byte-for-byte. The complete rebuilt MD5
|
||||
object and full 1,027-unit before/after/final reports are also byte-identical.
|
||||
ProcessBlock remains 95.55556%, 306/306 instructions, 197 positional differences;
|
||||
unit 97.01755%, exact APIs 3/4, code 600/1824 and data 456/456 are preserved.
|
||||
Pool remains identical and all three public APIs remain instruction-exact.
|
||||
Fresh full 43U build and build/43U/ok pass, with DOL SHA1 unchanged at
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
No semantic harness was rerun for the neutral continuation: both the entire
|
||||
source and compiled object are identical to its already-validated baseline.
|
||||
The earlier symbolic, 3,088-vector and 20,000-sanitizer gates therefore remain
|
||||
applicable without claiming new test runs. This continuation changes only this
|
||||
log; the source candidate from `31dffe1b` is preserved for consolidated review.
|
||||
|
||||
Private continuation evidence: `/tmp/md5-order-finish/`, including search.log,
|
||||
source/object baseline, identical reports, pool/ctxdiff results and full gates.
|
||||
GATE: neutral finite continuation closed at local fixed point; prior source gain
|
||||
preserved, no further declaration search performed.
|
||||
99
tools/decomp-assist/allhands-nhttp-stdlib.attempts.md
Normal file
99
tools/decomp-assist/allhands-nhttp-stdlib.attempts.md
Normal file
@@ -0,0 +1,99 @@
|
||||
# NHTTP stdlib source reconstruction, 2026-10-02
|
||||
|
||||
Base `b26e248b`, branch `agent/bittle/nhttp-source-reconstruction`, 43U only.
|
||||
Owned source: `libs/RevoEX/src/nhttp/NHTTP_stdlib_RVL.c`. No headers, metadata,
|
||||
configuration, linking flags, binary data, or other source files changed.
|
||||
The earlier `four-leaves-r9.attempts.md` and other worker logs are untouched.
|
||||
|
||||
## Target-grounded changes
|
||||
|
||||
### NHTTPi_compareToken
|
||||
|
||||
The target enters through its case-folded equality test, then checks the raw left
|
||||
byte for NUL/space before advancing the two pointers. It retains the unsigned
|
||||
byte separately and sign-extends it for both the case fold and termination check.
|
||||
The baseline unconditional loop placed that control-flow boundary differently
|
||||
and compiled to 44 instructions rather than the target's 45.
|
||||
|
||||
The retained while condition captures the raw u8 load and explicitly sign-extends
|
||||
it into LowerCase. The body reuses that captured byte for termination. LowerCase
|
||||
returns its conditional value directly, preserving the target's separate folded
|
||||
value lifetime. This recovers the complete 45-instruction control-flow shape.
|
||||
The common helper's other callers remain unchanged at the instruction level.
|
||||
A separate token-only helper gave the same result; it was removed to avoid
|
||||
unnecessary duplication.
|
||||
|
||||
Remaining differences: two initial constant loads are reversed, and eight
|
||||
instruction operands use different scratch/callee-saved registers. This is not
|
||||
an exact match.
|
||||
|
||||
### NHTTPi_Base64Encode
|
||||
|
||||
The target retains signed length/padding comparisons. The length local is now
|
||||
s32, matching those comparisons without the previous mixed-sign comparisons.
|
||||
Each quartet snapshots its three signed input bytes before writing the output,
|
||||
then combines each later byte's high fragment with the preceding byte's masked
|
||||
low fragment. This expresses the target's byte-load and index dependency
|
||||
structure more closely, preserving the 119-instruction body size.
|
||||
|
||||
The target and existing implementation use signed byte shifts, a NUL-terminated
|
||||
input, and full three-byte reads even for a short final group. This candidate does
|
||||
not broaden the API to arbitrary binary data or repair those original constraints.
|
||||
The repository's caller supplies a separate temporary source and authorization
|
||||
output buffer (`d_nhttp.c`, NHTTP_CreateRequest proxy authorization path).
|
||||
|
||||
## Experiments
|
||||
|
||||
- Recovered the previously logged loop-test/raw-byte/ternary-fold approach rather
|
||||
than repeat register/declaration searches. Local conditional-loop alternatives
|
||||
were measured against the target before retaining the compact while condition.
|
||||
- One exploratory assignment/read condition was found to be unsequenced. It was
|
||||
withdrawn, never behavior-tested, and is not part of the retained source.
|
||||
- Signed/unsigned/raw byte representations and explicit sextet fragments were
|
||||
checked against target load/sign-extension evidence. Signed byte snapshots
|
||||
with the retained index grouping gave the best compact source.
|
||||
- Stream-cursor forms generated identical code and were not retained.
|
||||
- A separate quartet helper improved Base64 only 67.63025 -> 67.79832%; it was
|
||||
discarded as unnecessary source expansion. There is no new helper in the diff.
|
||||
- No declaration/register sweep, inline assembly, use-site volatile, dummy value,
|
||||
padding, compiler-option change, or linking experiment was performed.
|
||||
|
||||
## Verification
|
||||
|
||||
Before -> after:
|
||||
- NHTTPi_compareToken: 54.622223 -> 98.844444% fuzzy; 44 -> 45 instructions against
|
||||
target 45. Final ctxdiff: 10 positional differences.
|
||||
- NHTTPi_Base64Encode: 60.285713 -> 67.63025% fuzzy; 119/119 instructions unchanged.
|
||||
Final ctxdiff: 67 positional differences (baseline 58); aligned objdiff improves
|
||||
despite that positional metric. Exact dependency scheduling remains open.
|
||||
- Unit fuzzy: 87.93594 -> 93.03203%.
|
||||
- Exact functions 11/14, exact code 1388/2248, data 112/112 (100%) and linked status
|
||||
are unchanged. All 11 previously exact functions have ctxdiff diffs 0.
|
||||
- The unchanged strnicmp remains 99.76471%, 51/51 instructions, two constant-order
|
||||
differences. LowerCase's other exact users remain exact.
|
||||
- Pool: the one alphabet string is identical. .data's 65 bytes and .rodata's
|
||||
36 bytes equal the prefixes of their 72-byte/40-byte target sections. Existing
|
||||
trailing target alignment extents are unchanged; no padding was introduced.
|
||||
- Literal-reference audit: 14 functions analyzed, no candidates, skips or errors;
|
||||
zero statically addressed call arguments, so this is not a separate proof of
|
||||
complete data matching.
|
||||
- Full 1027-unit report: zero exact-function/code/data/fuzzy regressions.
|
||||
- Full 43U build and build/43U/ok passed. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Host behavior validation compiles both unchanged production sources (baseline
|
||||
and candidate) with -fsigned-char and fixed-width SDK type shims:
|
||||
- 75,536 compareToken cases: all 65,536 first-byte pairs plus 10,000 seeded
|
||||
multi-byte/case-fold/mismatch cases, against an independent token reference.
|
||||
- 3,033 Base64 cases: known answers, every length 0..1024, and 2,000 seeded ASCII
|
||||
strings up to 4096 bytes, against Python base64. Return length, NUL terminator
|
||||
and a 16-byte output canary are checked. Inputs have readable zero tail bytes
|
||||
for the original full-triplet reads. High-bit/binary inputs are not claimed.
|
||||
|
||||
Private local evidence: `/tmp/nhttp-source-reconstruction/` contains baseline and
|
||||
final reports, all function ctxdiffs, pool/literal audits, full-build.log,
|
||||
validate_nhttp.py, vectors.log, and the rejected local experiments. No retail
|
||||
assembly or binary is included in this commit.
|
||||
|
||||
GATE: validated partial control/data-flow/type reconstruction; no regressions.
|
||||
Exact matching and linking remain open. Frozen for independent parent validation.
|
||||
@@ -0,0 +1,75 @@
|
||||
# NHTTP token byte-role recovery, 2026-10-03
|
||||
|
||||
Base: `81ba2799`. One authorized two-line trial in
|
||||
`libs/RevoEX/src/nhttp/NHTTP_stdlib_RVL.c`. No other function, shared helper,
|
||||
header, compiler setting or linking configuration was changed.
|
||||
|
||||
## Source roles and historical evidence
|
||||
|
||||
NHTTPi_compareToken retains the raw left byte across its folded comparison,
|
||||
then signs that raw value again for the matched NUL/space termination test.
|
||||
The target loads the right byte and folds its signed value first, then loads
|
||||
the left byte into a separate zero-extended word before signing/folding it.
|
||||
The raw left word remains separate from both folded comparison results.
|
||||
|
||||
Use u32 for that actual zero-extended raw-left value, and express the right
|
||||
input through the same explicit u8-load/s8-conversion boundary as the left.
|
||||
No extra local, helper, load, dummy use or register-forcing construct is added.
|
||||
The shared LowerCase helper and literal termination tests are unchanged.
|
||||
This is data-representation reconstruction, not a changed byte-domain contract.
|
||||
|
||||
The perm2 attempt log had measured 99.51111% for the word-lived raw left byte
|
||||
and 99.73333% with the right raw-byte conversion, but discarded both solely
|
||||
because they were nonexact. Those old temporary sources are unavailable here;
|
||||
the minimal form was independently reconstructed from current source and
|
||||
original instructions. Only that one two-line form was compiled this round.
|
||||
|
||||
## Byte, ordering and termination proof
|
||||
|
||||
- All 256 byte values were checked against the target's actual carry-based
|
||||
signed comparisons. Only ASCII A..Z gain 32; bytes 128..255 remain signed
|
||||
negative values for comparison, preserving equality with the same raw byte.
|
||||
- A private interpreter executes the original 45-instruction function on all
|
||||
65,536 byte pairs plus five multi-byte/high-bit/termination cases. Return
|
||||
values and ordered byte-read traces agree with the proposed semantics.
|
||||
- The compiled candidate differs from original only at two initial li
|
||||
instructions: zero and 'Z' are initialized in the opposite order. They write
|
||||
distinct registers before either value is used and do not change condition
|
||||
state. After commuting those two independent instructions, all 45 match
|
||||
literally, including right-before-left loads, both signed conversions,
|
||||
folded comparisons, pointer advances and the saved raw-byte stop test.
|
||||
- A matched NUL or literal space returns 0; every mismatch returns -1. Other
|
||||
whitespace bytes are ordinary token data. The comparison still happens
|
||||
before termination, and no new dereference or store is introduced.
|
||||
|
||||
## Fresh gates
|
||||
|
||||
- NHTTPi_compareToken: 98.844444 -> 99.73333%, 45/45 instructions, two residual
|
||||
constant-scheduling differences. This is not an exact match.
|
||||
- Unit: 99.88612 -> 99.9573%; exact functions 12/14 and code 1864/2248 preserved;
|
||||
data 112/112 preserved. Linking unchanged.
|
||||
- All 13 unrelated functions' instruction streams and resolved relocations are
|
||||
identical to baseline, including the 12 exact functions. Every allocated data
|
||||
byte and section extent is unchanged. Pool 1/1 identical.
|
||||
- Literal-reference advisory: all 14 functions analyzed, no candidates, skips
|
||||
or errors; this function has no string arguments at external calls.
|
||||
- Full 1,027-unit reports show only compareToken improved, with no fuzzy,
|
||||
exact-function, exact-code or data regression. Post-build final report equals
|
||||
the candidate report.
|
||||
- Production C: 75,536 exhaustive byte-pair and seeded token comparisons pass
|
||||
against an independent ASCII-fold/literal-termination reference for both
|
||||
baseline and candidate.
|
||||
- ASan/UBSan: 95,504 byte-pair, seeded token, aliased and overlapping-input
|
||||
comparisons pass; all input bytes remain unchanged. The harness extracts
|
||||
actual production function/helper bodies and uses signed-char host settings.
|
||||
Leak detection is disabled for ptrace; address/UB instrumentation is enabled.
|
||||
- Full 43U build and build/43U/ok pass. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`. git diff --check passes.
|
||||
|
||||
Private evidence: `/tmp/nhttp-token-byte-roles/` contains source/object snapshots,
|
||||
reports, host/sanitizer harnesses and results, pool/literal/ctxdiff and build logs.
|
||||
The prior read-only byte proof and proposed diff are preserved separately in
|
||||
`/tmp/nhttp-token-recovery-screen/`. Original assembly and objects remain private.
|
||||
|
||||
GATE: passing two-line partial recovery, frozen for independent review.
|
||||
No additional constant-order or register trial was attempted.
|
||||
@@ -0,0 +1,89 @@
|
||||
# NWC24 writable-task validation recovery, 2026-10-03
|
||||
|
||||
Base: `57ccda38`. One bounded source trial in
|
||||
`libs/RevoEX/src/nwc24/NWC24Download.c`; 43U only. This is a partial
|
||||
instruction-structure gain, not an exact match, behavior fix or linking change.
|
||||
|
||||
## Recovery screening and source rationale
|
||||
|
||||
Older exact-only attempts had restored valid partials: pk2 records a task-view
|
||||
permission helper at 98.695656%; structural round12 records more extensive
|
||||
permission/access/retry forms up to 99.48617%. Their temporary source artifacts
|
||||
are absent in this workspace. This candidate was reconstructed from current
|
||||
source and original instructions, not copied from an unavailable best snapshot.
|
||||
Only the smallest writable validation operation was tried; no retry helper,
|
||||
AddTaskInternal, compareToken or ATERM variant was mixed into it.
|
||||
|
||||
The new private `ValidateWritableDlTask(const NWC24DlTask*)` returns the same
|
||||
NWC24Err as the existing validator with write=TRUE. It reads the actual task
|
||||
view and snapshots its cached header. In the owner-mismatch fallback, it reads
|
||||
flags and the u16 group ID into operation-local values, initializes a real
|
||||
permission result false, and makes it true only when bit 0x40 permits the group
|
||||
query and the IDs match. These values belong to that validation operation;
|
||||
none is dummy state, an optimization barrier or artificial spill.
|
||||
|
||||
Only NWC24UpdateDlTask's two existing writable validation calls use this helper.
|
||||
The shared validator and all other callers stay unchanged. The second call
|
||||
reacquires the current header and repeats tool/owner/group permission checks
|
||||
after the time update. Its failure deliberately suppresses only the two reset
|
||||
stores, rather than returning early; the original retry/store behavior remains.
|
||||
No object is allocated, freed or written by the new helper. No pointer escapes,
|
||||
public type changes, flags, assembly, padding or forced register use is added.
|
||||
|
||||
## Original call/data-flow checks
|
||||
|
||||
- Target and candidate place all nine direct calls at identical instruction
|
||||
indices: tool/app/group queries, universal-time query, signed divide helper,
|
||||
repeated tool/app/group queries, final StoreDlTask.
|
||||
- Tool query precedes owner query, and group query occurs only after both fail
|
||||
and flags bit 0x40 is set. The three query callees consume no incoming argument;
|
||||
their actual implementations read process/library metadata.
|
||||
- Both group IDs are loaded before NWC24GetGroupId and compared as u16 after
|
||||
the call. Flags are u32; the permission result is BOOL. The task/header are
|
||||
read-only, and the cached header lifetime survives the query sequence.
|
||||
- Null task/header return -3/-9 before metadata queries. Permission failure is
|
||||
-7. The 0xFFFF sentinel and u16 maximum-count checks retain their ordering.
|
||||
- The time-output pointer remains the same eight-byte stack slot; __div2i still
|
||||
receives the high/low time words and signed divisor 60. StoreDlTask receives
|
||||
the original task pointer. No file/resource cleanup is owned by this helper.
|
||||
- Current unsigned retry-mask semantics, retry loop, time helper, ID rechecks
|
||||
and second-failure behavior are unchanged.
|
||||
|
||||
## Fresh measurements and validation
|
||||
|
||||
- NWC24UpdateDlTask: 95.00395 -> 98.695656%; source 249 -> 253 instructions,
|
||||
target 253. Frame 0x30 -> target 0x20. Positional ctxdiff 250 -> 43 differences.
|
||||
- Unit: 99.252884 -> 99.55186%; exact functions 27/30 and exact code 9304/12496
|
||||
preserved; data 80/80 preserved. No linking changes.
|
||||
- Every other one of the 29 functions has identical instructions and resolved
|
||||
relocations versus the baseline, including all 27 exact functions.
|
||||
- Every allocated data byte and section extent is unchanged. Existing source/
|
||||
target alignment extents (.data 49/56 and .sbss 4/8) are unchanged; .sdata 16/16.
|
||||
- Pool 3/3 identical. Literal advisory: 29 functions, 5 arguments, no candidates
|
||||
or errors; unchanged AddTaskInternal is skipped because its size differs
|
||||
from original. It remains 97.7182% and was not edited.
|
||||
- Full 1,027-unit reports show only UpdateDlTask improved and no exact-function,
|
||||
code, data or fuzzy regressions. Final post-build report equals candidate.
|
||||
- ASan/UBSan: 262,144 exhaustive u16 group/flag cases, mutating the task group
|
||||
during the group query to verify captured-value semantics. Seven directed
|
||||
cases check nulls, sentinel/range behavior, tool/owner short-circuiting and
|
||||
successful/failed second-validation stores.
|
||||
- ASan/UBSan: 60,000 baseline/candidate Update scenarios compare return values,
|
||||
task/header bytes, selected work pointer and ordered external call traces.
|
||||
They cover metadata-query/time/store statuses, ID boundaries, group/owner
|
||||
mismatches, retry counts/masks including bit 31, signed times, and controlled
|
||||
task/header/work mutations at query boundaries. Actual production helper
|
||||
bodies are extracted unchanged; metadata/time/store I/O is stubbed. No network
|
||||
or file operation is performed. Leak detection is disabled for ptrace;
|
||||
address and undefined-behavior instrumentation remain enabled.
|
||||
- Full 43U build and build/43U/ok pass. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
- git diff --check passes.
|
||||
|
||||
Private evidence: `/tmp/nwc24-write-permission/` contains baseline/candidate
|
||||
sources and objects, reports, disassembly audit, host test generator/harness,
|
||||
pool/ctxdiff/literal results and build logs. The preceding read-only screen is
|
||||
in `/tmp/network-partial-recovery-screen/`. No retail assembly/binary is committed.
|
||||
|
||||
GATE: single justified partial recovery passes; frozen for independent review.
|
||||
Historical 99.48617% is not claimed. Exact matching and linking remain open.
|
||||
79
tools/decomp-assist/allhands-odh-node-types.attempts.md
Normal file
79
tools/decomp-assist/allhands-odh-node-types.attempts.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# ODH Huffman node-type reconstruction, 2026-10-03 UTC
|
||||
|
||||
Base `a894ff5c`, branch `agent/bittle/odh-huffman-node-types`, 43U only.
|
||||
Changed only the two tree declarations/initializers and their local pointer
|
||||
record in `src/system/odh.cpp`, plus this log. No headers, public signatures,
|
||||
metadata, linking flags, forced alignment or padding changed.
|
||||
|
||||
## Evidence and source correction
|
||||
|
||||
The decoder reads its tree entries and leaf categories with zero-extending
|
||||
16-bit loads. Edges use the low 14 bits as relative halfword indices, while the
|
||||
top two bits indicate terminal left/right branches. Leaves hold categories0..11.
|
||||
The earlier source represented each pair of entries as one packed const u32 and
|
||||
then accessed it through u16 pointers. HufftreeData likewise described the trees
|
||||
as const u32 pointers, although every decoder use expects halfword entries.
|
||||
|
||||
Both tables are now explicit const u16 arrays, each with 24 actual entries.
|
||||
HufftreeData::tables holds const u16 pointers. This removes the mismatched u32
|
||||
object/u16 access representation, rather than changing the Huffman algorithm.
|
||||
Every original word was split into its high and low halfwords in the target's
|
||||
big-endian order; no value, tree edge or byte was added, removed or reordered.
|
||||
|
||||
The decoder's existing u16** parameter, its exact mangled public symbol, the C
|
||||
ODH entry points and every caller are unchanged. The existing caller casts retain
|
||||
the established ABI; no decoder writes a tree entry. Component0 uses the luma
|
||||
value tree, components1/2 the chroma value tree, and all use the existing luma
|
||||
prefix tree for zero-run categories. Request initialization starts at byte16,
|
||||
bit offset0; successful decoding commits normalized offsets0..7.
|
||||
|
||||
## Read-only decoder audit
|
||||
|
||||
Prior sol-low, sol-high and fz10 attempts were reviewed. The existing decoder is
|
||||
306/306 instructions with register allocation differences. Four-byte lookahead,
|
||||
big-endian word assembly, unsigned bit-buffer operations, predictor selection,
|
||||
DC/AC sign reconstruction, zero-run writes, EOB, success-only cursor/bit-count
|
||||
commit, and error-path partial coefficient/predictor writes agree with target.
|
||||
No additional algorithmic or stream-boundary behavior was invented.
|
||||
|
||||
Malformed overlong zero runs can exceed a nominal64-coefficient block in both
|
||||
the source and original target; changing that behavior is outside this focused
|
||||
type correction. Arbitrary table contents or invalid request states are likewise
|
||||
not claimed to have acquired validation.
|
||||
|
||||
## Verification
|
||||
|
||||
- Each tree remains exactly48 bytes. Fresh source bytes, old packed-u32 bytes,
|
||||
and original split-object payloads agree byte-for-byte.
|
||||
- Exhaustive tree-path validation: all512 nine-bit luma prefixes and all2048
|
||||
eleven-bit chroma prefixes agree with independent canonical Huffman codes,
|
||||
including each valid leaf and the depth-limit invalid path.
|
||||
- Fresh baseline/candidate builds: all28 reported function instruction streams
|
||||
are unchanged. Entire .text14964, .data459, .rodata5856 and .sdata2 40 bytes
|
||||
are identical, with the same section alignments. Defined function/object
|
||||
symbol names, bindings, types and sizes are unchanged.
|
||||
- Decoder remains95.57189%,306/306; unit remains99.55462%; exact26/28 and code
|
||||
12876/14684; data6360/6360 (100%) and linking unchanged. No matching gain claimed.
|
||||
- Pool: all10 strings identical to target.
|
||||
- Literal audit:14 arguments across28 functions, no candidates, skips or errors.
|
||||
- Full1027-unit report: zero exact-function/code/data/fuzzy regressions.
|
||||
- Full43U build and build/43U/ok passed. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
A host harness compiles the actual production decoder body and the new u16 table
|
||||
initializers with fixed-width types and strict aliasing enabled. It passes24000
|
||||
cases against an independent canonical-code bit reader:6657 successes and17343
|
||||
truncation/malformed-code failures. Coverage includes components0/1/2, starting
|
||||
bit offsets0..7, positive/negative DC and AC values, zero runs, EOB, full blocks,
|
||||
4-byte-lookahead boundaries, invalid tree codes and run signs, output canaries,
|
||||
predictors and request-state commit. Malformed overlong zero runs are excluded;
|
||||
whole-image/Wii runtime execution is not claimed.
|
||||
|
||||
Private evidence: `/tmp/odh-node-types/` contains baseline/final reports and
|
||||
source objects, tree-proof.log, pool/literal audits, full-build.log,
|
||||
validate_decoder.py and decoder-tests.log. The earlier read-only decoder audit
|
||||
is in `/tmp/odh-decoder-audit/`. No retail assembly or binary is committed or
|
||||
uploaded.
|
||||
|
||||
GATE: real halfword node types reconstructed, ABI and all compiled bytes/metrics
|
||||
preserved, tree and decoder behavior verified. Frozen for parent validation.
|
||||
102
tools/decomp-assist/aoss-init-reconstruction-20261002.md
Normal file
102
tools/decomp-assist/aoss-init-reconstruction-20261002.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# AOSS initialization source reconstruction, 2026-10-02
|
||||
|
||||
Baseline 3d3448e3. Only src/scene/setting/AOSS.c changed; ATERM, AOSSLink,
|
||||
headers, metadata, and linking remain untouched. Read AGENTS and the AOSS,
|
||||
round-five/six/seven, and fz1 attempt records before starting.
|
||||
|
||||
## Retained source boundaries
|
||||
|
||||
1. Restore the repeated initial-address status check and its cleanup block.
|
||||
In the target AOSS_Init_old object, the first address-setup error path ends
|
||||
at 0x6EC, followed by a second check and cleanup at 0x6F0-0x730 before the
|
||||
access-point allocation at 0x734. This check is redundant on the successful
|
||||
edge, but the original retains the complete branch and cleanup. A short
|
||||
source comment explains why it is not folded away in the reconstruction.
|
||||
2. Give the send operation a local result separate from its socket descriptor.
|
||||
The target keeps the socket snapshot through send setup, but consumes each
|
||||
send return directly at the common result test. The previous source reused
|
||||
one long-lived variable for both roles and copied both call results into a
|
||||
saved register before testing them.
|
||||
3. Restore two explicit zero/one/default timeout-error chains. Target error
|
||||
dispatch tests state zero first, then one, rather than using the previous
|
||||
switch's range dispatch.
|
||||
4. Publish the next protocol state at the common reconnection join. The target
|
||||
carries the returned state through reconnect processing, then assigns the
|
||||
protocol-state local once. The old source assigned it before reconnect and
|
||||
repeated the assignment afterward.
|
||||
5. Traverse the three request records with one actual array index. Both the
|
||||
six-byte address copy and the transaction-ID conversion use the same record.
|
||||
The previous source maintained an independent byte offset as well as the
|
||||
array index, producing a redundant second induction variable.
|
||||
6. Restore retry and cleanup boundaries: one conditional-argument sleep call,
|
||||
no unused pre-sleep delay assignment, consistent large-delay-first update,
|
||||
and the target's nonnegative socket-cleanup test.
|
||||
|
||||
All changes are ordinary initialized C. No new qualifiers, helpers, assembly,
|
||||
register declarations, data padding, or source/metadata pins were used.
|
||||
|
||||
## Measurements
|
||||
|
||||
| Cumulative source form | Init fuzzy | Instructions / 1584 |
|
||||
| --- | ---: | ---: |
|
||||
| Baseline | 93.78725% | 1575 |
|
||||
| Timeout error chains | 94.41288% | 1571 |
|
||||
| Also scoped send result | 94.454544% | 1569 |
|
||||
| Also repeated address guard | 95.45013% | 1586 |
|
||||
| Also receive-state join | 95.51326% | 1585 |
|
||||
| Also request-record array traversal | 95.78409% | 1583 |
|
||||
| Also retry/cleanup boundaries | 96.18624% | 1581 |
|
||||
|
||||
The instruction count need not monotonically approach the target: several
|
||||
changes remove extra source instructions while the guard restores an omitted
|
||||
block. Final Init remains nonexact. Unit fuzzy improves 96.777916% -> 97.71665%.
|
||||
Exact functions remain 16/21, exact code 6436/16192, and data 3928/3928.
|
||||
Every other AOSS function and every other unit's report remains unchanged.
|
||||
|
||||
Rejected experiments, all restored:
|
||||
|
||||
- Moving the receive-state join alone regressed the original baseline; it
|
||||
improved the retained scope/guard reconstruction when retested there.
|
||||
- Grouping timeout/receive/descriptors into one real polling context regressed
|
||||
Init 95.51326 -> 95.29293. No stack-layout aggregate was retained.
|
||||
- Deriving the current request record from an explicit byte cursor regressed
|
||||
95.51326 -> 95.423615; the final ordinary array traversal improved it.
|
||||
- Original extracted BSS symbols have global binding, but making the actual
|
||||
CRC table global changed no instructions. Global packet-state/runtime
|
||||
definitions changed no instructions and regressed data; all restored.
|
||||
|
||||
## Hello and remaining limits
|
||||
|
||||
AOSSSendHelloRequest stays at 92.190475%, 271/273 instructions. Its target
|
||||
materializes separate runtime/CRC/key-state bases; the source hoists a shared
|
||||
BSS base. The fresh audit found no omitted packet, CRC, key-schedule, or socket
|
||||
operation. Prior loop/temporary/register permutations were not repeated.
|
||||
|
||||
Init still differs in default-option object boundaries, redundant target
|
||||
link-result branches, polling scratch lifetimes/stack slots, and register and
|
||||
instruction scheduling. The preexisting initialized result fallback remains:
|
||||
no undefined read was introduced to imitate the target's uncertain early
|
||||
register use. No full-function, unit, or project-completion claim is made.
|
||||
|
||||
## Verification
|
||||
|
||||
- Configured only 43U with ../toolchain/wibo-build/wibo
|
||||
- WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja all_source build/43U/report.json build/43U/ok
|
||||
- Pool identical (one ordinary .data string); every allocated data section is
|
||||
byte-identical to the fresh baseline and all five report 100%
|
||||
- All 16 exact functions freshly verified with ctxdiff, zero differences
|
||||
- Literal audit: 10 arguments across 16 exact functions; no skipped functions,
|
||||
candidates, or errors
|
||||
- Complete reports: only AOSS changes; its only improved function is Init;
|
||||
no per-function, code, data, or cross-unit regression
|
||||
- Focused native C harness passes 65536 retry spans, 20003 timeout-error states,
|
||||
and 65536 three-record initializations with boundary canaries. These check
|
||||
the rewritten local algorithms; they do not simulate network initialization
|
||||
- Harness source/executable: /tmp/aoss-reconstruction-harness.c and the same
|
||||
path without .c in the current executor
|
||||
- git diff --check passes
|
||||
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
|
||||
GATE: nonregression, exact-function preservation, complete data, pool, focused
|
||||
native tests, full 43U build, and DOL checks pass. Frozen for independent parent
|
||||
review; this is partial source reconstruction only.
|
||||
990
tools/decomp-assist/big1.attempts.md
Normal file
990
tools/decomp-assist/big1.attempts.md
Normal file
@@ -0,0 +1,990 @@
|
||||
# big1 max round
|
||||
|
||||
43U only. Worker scope: src/BS2/BS2Mach, src/scene/setting/AOSS, src/BS2/BS2Update, src/channelScript/CHANSVm
|
||||
HEAD bdd15186a7a7ead832da3fc5e2688bf0552a4b4f
|
||||
origin/main bdd15186a7a7ead832da3fc5e2688bf0552a4b4f
|
||||
|
||||
## src/BS2/BS2Mach
|
||||
Initial instruction-exact 24/29. Objdiff {"fuzzy_match_percent": 98.159485, "total_code": "16980", "matched_code": "4940", "matched_code_percent": 29.093052, "total_data": "158528", "matched_data": "155504", "matched_data_percent": 98.092445, "total_functions": 29, "matched_functions": 24, "matched_functions_percent": 82.75862, "total_units": 1}
|
||||
POOL IDENTICAL up to 91 (mine=91 base=91)
|
||||
|
||||
Open Run 16.744186%; 172 bytes.
|
||||
Open BS2StartGame 98.72774%; 1572 bytes.
|
||||
Open BS2StartGCGame 99.5614%; 912 bytes.
|
||||
Open CheckBS2CommandStatus 99.50739%; 1624 bytes.
|
||||
Open BS2Tick 98.230415%; 7760 bytes.
|
||||
## src/scene/setting/AOSS
|
||||
Initial instruction-exact 15/21. Objdiff {"fuzzy_match_percent": 96.777916, "total_code": "16192", "matched_code": "6436", "matched_code_percent": 39.748024, "total_data": "3928", "matched_data": "3928", "matched_data_percent": 100.0, "total_functions": 21, "matched_functions": 16, "matched_functions_percent": 76.190475, "total_units": 1}
|
||||
POOL IDENTICAL up to 1 (mine=1 base=1)
|
||||
|
||||
Open AOSS_Init_old 93.78725%; 6336 bytes.
|
||||
Open AOSSDecryptMessage 97.74143%; 1284 bytes.
|
||||
Open AOSSApplyAuthOptions 98.77193%; 456 bytes.
|
||||
Open AOSSSendHelloRequest 92.190475%; 1092 bytes.
|
||||
Open AOSSXorBufferWithKey 98.605446%; 588 bytes.
|
||||
## src/BS2/BS2Update
|
||||
Initial instruction-exact 9/10. Objdiff {"fuzzy_match_percent": 94.23001, "total_code": "4052", "matched_code": "400", "matched_code_percent": 9.871669, "total_data": "10488", "matched_data": "10488", "matched_data_percent": 100.0, "total_functions": 10, "matched_functions": 9, "matched_functions_percent": 90.0, "total_units": 1}
|
||||
POOL IDENTICAL up to 55 (mine=55 base=55)
|
||||
|
||||
Open UpdateThread 93.59803%; 3652 bytes.
|
||||
## src/channelScript/CHANSVm
|
||||
Initial instruction-exact 221/233. Objdiff {"fuzzy_match_percent": 99.364426, "total_code": "53564", "matched_code": "37608", "matched_code_percent": 70.211334, "total_data": "6904", "matched_data": "6904", "matched_data_percent": 100.0, "total_functions": 233, "matched_functions": 221, "matched_functions_percent": 94.849785, "total_units": 1}
|
||||
POOL IDENTICAL up to 125 (mine=125 base=125)
|
||||
|
||||
Open CHANSVmConvertToFloatFromStr 97.59036%; 332 bytes.
|
||||
Open VmDateDtor 94.96703%; 364 bytes.
|
||||
Open VmStringReplace 97.878784%; 528 bytes.
|
||||
Open VmStringSplit 98.04054%; 888 bytes.
|
||||
Open CHANSVmFormatString 99.84919%; 1724 bytes.
|
||||
Open VmBlobGetHexString 98.71951%; 328 bytes.
|
||||
Open VmBlobPackCommon 97.949104%; 2672 bytes.
|
||||
Open VmBlobUnpack 98.452614%; 2068 bytes.
|
||||
Open VmWinEmuWrite 99.62687%; 268 bytes.
|
||||
Open CHANSVmAddExe 99.625984%; 1016 bytes.
|
||||
Open CHANSVmLinkModules 98.677246%; 756 bytes.
|
||||
Open CHANSVmStep 96.46608%; 5012 bytes.
|
||||
|
||||
## src/BS2/BS2Mach::BS2Tick
|
||||
Remote bdd15186, owned source UNCHANGED, local objdiff 98.230415%.
|
||||
- ATTEMPT BS2Tick: reset progress pointer before partition stores through a dedicated inline initializer; source feebdf09ee6c; 98.230415%; instructions 1934/1940; structural/operand (136, 1665); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: read boot console code and write device code through distinct typed helpers; source 0da822d85d78; 98.230415%; instructions 1934/1940; structural/operand (136, 1665); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: compute game partition offset before the cached versus DVD path; source 24a6f27be2be; BUILD FAILED /MSL/include -i libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/BS2/BS2Mach.c -o build/43U/src/src/BS2 && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/BS2/BS2Mach.d build/43U/src/src/BS2/BS2Mach.d ### mwcceppc.exe Compiler: # File: src\BS2\BS2Mach.c # -------------------------- # 1165: case 0x26: { # Error: ^^^^ # (10169) illegal use of keyword # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT BS2Tick: compute game partition offset before both cached and DVD branches; source 679382637c01; 98.4732%; instructions 1934/1940; structural/operand (131, 1665); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: read-only disc header and separate read-only disc title view; source 1257019edfae; 98.48866%; instructions 1935/1940; structural/operand (132, 1703); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: calculate banner alignment by removing the actual address remainder; source ab0b8724bcda; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: carry both IOS words in one native version value before storing low then high; source 52473c630592; 98.6665%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: store IOS low word before reading and storing IOS high word; source a57c902cb098; 98.423195%; instructions 1936/1940; structural/operand (121, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: encode title-prefix dispatch as the original D R S T switch cases; source 330c30a0c312; 98.59175%; instructions 1937/1940; structural/operand (110, 1699); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: use native loader output locals ordered length address offset; source 7814326d92a8; 98.66392%; instructions 1936/1940; structural/operand (147, 1702); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSS_Init_old
|
||||
Remote 786a2dd3, owned source UNCHANGED, local objdiff 93.78725%.
|
||||
Structural audit: instructions 1575/1584, structural/operand (1141, 1524).
|
||||
Data audit: AOSS, BS2Update and CHANSVm already have 100% named/data measures. BS2Mach .bss/.sbss/.sdata are 100%; .data is pooled literals plus four jump tables with relocation targets in nonexact functions. No unmatched real named object or unjustified extent correction identified.
|
||||
|
||||
Checkpoint: four-unit quick GATE PASS, full 43U build ok, DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d, regressions 0, forbidden additions 0, readability warnings 0. BS2Tick 98.230415 -> 98.6768%; 1934 -> 1936 of 1940 instructions; no new exact function yet. Evidence /tmp/big1.gate-first.txt.
|
||||
- ATTEMPT AOSS_Init_old: model the two independent default wait halfwords as named constant objects; source d1fefb8e620a; 93.67803%; instructions 1574/1584; structural/operand (1130, 1300); exact 15; data 3920; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: independent default arrays retain the target halfword loads; source d2b427a6baff; 93.88952%; instructions 1574/1584; structural/operand (1128, 1297); exact 15; data 3920; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: derive transaction record after random generation from the same byte cursor; source 5c8b5ebeec65; 93.68813%; instructions 1573/1584; structural/operand (1138, 1523); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: place send and receive address lifetimes in their target stack declaration order; source d643ade7e48d; 93.79419%; instructions 1575/1584; structural/operand (195, 1524); exact 15; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: use zero-first timeout branch sequence instead of a three-way switch; source 65a027183cc1; 94.179924%; instructions 1573/1584; structural/operand (185, 1519); exact 15; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: use matching zero-first timeout sequence after state dispatch; source e264e471f42f; 94.420456%; instructions 1571/1584; structural/operand (165, 1516); exact 15; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: read connection-state word with the target unsigned comparison; source bacde7f2d0bc; 94.31881%; instructions 1571/1584; structural/operand (163, 1516); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: share retry sleep call after choosing the bounded duration; source 02df5a9ef693; 94.48674%; instructions 1570/1584; structural/operand (154, 1510); exact 15; data 3928; regress []; RETAINED.
|
||||
Target AOSS_Init_old reads r14 at 0xa20 before any assignment to r14 in the function. Existing initialized initializationResult retains defined source behavior; recreating an uninitialized value is forbidden and was not attempted.
|
||||
|
||||
## src/BS2/BS2Update::UpdateThread
|
||||
Remote bf6bc87f, owned source UNCHANGED, local objdiff 93.59803%.
|
||||
Structural audit: instructions 904/913, structural/operand (97, 745).
|
||||
EntriesCount volatile proof: target UpdateThread 0xc2c stw r17,EntriesCount; 0xc30 lwz r0,EntriesCount, immediately rereads the stored global with no intervening instruction. Change is local to this static definition; other units cannot observe its definition qualifier.
|
||||
- ATTEMPT UpdateThread: declare asynchronously published entry count volatile at its definition; source c23cf5584600; 93.90471%; instructions 905/913; structural/operand (94, 747); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: use an immutable view when validating input update entries; source cf860c856a75; BUILD FAILED /include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/BS2/BS2Update.c -o build/43U/src/src/BS2 && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/BS2/BS2Update.d build/43U/src/src/BS2/BS2Update.d ### mwcceppc.exe Compiler: # File: src\BS2\BS2Update.c # ---------------------------- # 255: discEntries[index].size = scratch.file.length; # Error: ^ # (10179) illegal assignment to constant # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT UpdateThread: form the selected seat pointer after reading the seat file; source 23c61edba9da; 93.76999%; instructions 905/913; structural/operand (98, 748); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: use a read-only disc entry view during the import loop; source 51b4d2f7f9ec; BUILD FAILED /include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/BS2/BS2Update.c -o build/43U/src/src/BS2 && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/BS2/BS2Update.d build/43U/src/src/BS2/BS2Update.d ### mwcceppc.exe Compiler: # File: src\BS2\BS2Update.c # ---------------------------- # 447: CurrentEntry = &discEntries[UpdateProgress]; # Error: ^ # (10209) illegal implicit conversion from 'const struct BS2UpdateEntry *' # to # 'struct BS2UpdateEntry *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT UpdateThread: read-only import view with mutable entry publication through the real table; source b2940a9daf08; 93.77875%; instructions 905/913; structural/operand (95, 747); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: recompute import failure title from the real table instead of the cached view; source 3c5af61789ff; 93.56955%; instructions 905/913; structural/operand (96, 747); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: start the capacity totals before selected count to reflect target live ranges; source a94c0c8c97ec; 93.89923%; instructions 905/913; structural/operand (94, 748); exact 9; data 10488; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmConvertToFloatFromStr
|
||||
Remote bf6bc87f, owned source UNCHANGED, local objdiff 97.59036%.
|
||||
Structural audit: instructions 83/83, structural/operand (2, 2).
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: parse floating strings through a const input-object view; source 08f3842e7fed; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmStep
|
||||
Remote bf6bc87f, owned source UNCHANGED, local objdiff 96.46608%.
|
||||
Structural audit: instructions 1253/1253, structural/operand (65, 313).
|
||||
disasm_fn.py stops at the first unsupported paired-single save. Both required dumps were run; /tmp/big1.step.{target,ours}.full.asm supplements them with per-instruction decoding and relocation names. Target uses explicit zero-count branch and a pretested countdown loop; source uses arithmetic normalization and posttested loop. Frames both 0xf0; operand scratch at 0x60.
|
||||
- ATTEMPT CHANSVmStep: normalize the requested instruction count with the target explicit branch; source b4399d1d991c; 96.86832%; instructions 1254/1253; structural/operand (60, 1229); exact 221; data 2232; regress []; restored.
|
||||
- ATTEMPT CHANSVmStep: use the target pretested instruction countdown loop; source 85374133139a; 96.09896%; instructions 1258/1253; structural/operand (86, 1242); exact 221; data 2232; regress []; restored.
|
||||
- ATTEMPT CHANSVmStep: access opcode result types directly instead of keeping a live table pointer; source f4b87f4270c2; 96.322426%; instructions 1254/1253; structural/operand (83, 1094); exact 221; data 2232; regress []; restored.
|
||||
Discarded pretested-loop trial above used a mismatched tail substitution; it is excluded from distinct valid coverage. Following trials decrement inside the loop and preserve the target exit semantics.
|
||||
- ATTEMPT CHANSVmStep: complete pretested countdown with one decrement after each interpreted instruction; source bbe417f69a7a; 96.26656%; instructions 1254/1253; structural/operand (65, 1237); exact 221; data 2232; regress []; restored.
|
||||
- ATTEMPT CHANSVmStep: combine native zero-count normalization and complete pretested countdown; source fc94f5ea0968; 96.8332%; instructions 1255/1253; structural/operand (60, 1229); exact 221; data 2232; regress []; restored.
|
||||
- ATTEMPT CHANSVmStep: keep copies indexed through their named scratch fields at inline boundaries; source b7504e908356; BUILD FAILED e -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/channelScript/CHANSVm.c -o build/43U/src/src/channelScript && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/channelScript/CHANSVm.d build/43U/src/src/channelScript/CHANSVm.d ### mwcceppc.exe Compiler: # File: src\channelScript\CHANSVm.c # ------------------------------------ # 7761: int typeByte = &scratch.copies[0]->type; # Error: ^^ # (10499) a pointer/array type was expected for this operation instead of # 'struct CHANSVmObjHdr' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
|
||||
## src/BS2/BS2Mach::BS2StartGCGame
|
||||
Remote bf6bc87f, owned source DIFFERS: inspect remote before experimenting, local objdiff 99.5614%.
|
||||
|
||||
## src/BS2/BS2Mach::BS2StartGCGame
|
||||
Remote bf6bc87f, owned source UNCHANGED, local objdiff 99.5614%.
|
||||
Structural audit: instructions 228/228, structural/operand (2, 7).
|
||||
- ATTEMPT BS2StartGCGame: poll existing volatile DVD command state directly as the target does; source 037ee4dd017f; 97.82895%; instructions 228/228; structural/operand (4, 9); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGCGame: put timer frequency first in the native 64-bit clock product; source 62468e7959ef; 99.429825%; instructions 228/228; structural/operand (2, 11); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGCGame: combine direct volatile cover polling with frequency-first clock multiplication; source 600487df3cf1; 97.697365%; instructions 228/228; structural/operand (4, 13); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGCGame: use a const command-block view for cover polling and native clock product; source f70c0636b462; 97.697365%; instructions 228/228; structural/operand (4, 13); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::CheckBS2CommandStatus
|
||||
Remote 27abfe81, owned source UNCHANGED, local objdiff 99.50739%.
|
||||
Structural audit: instructions 406/406, structural/operand (2, 2).
|
||||
- ATTEMPT CheckBS2CommandStatus: publish cache-command flag before computing the partition byte count; source ec11f8913900; 99.48276%; instructions 406/406; structural/operand (2, 4); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT CheckBS2CommandStatus: read partition count from an immutable TOC view; source 9deaa5878d9b; 99.50739%; instructions 406/406; structural/operand (2, 2); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT CheckBS2CommandStatus: read the partition count before publishing cache completion then round its bytes; source fee8dd9e67a9; 99.445816%; instructions 406/406; structural/operand (2, 7); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::Run
|
||||
Remote 1f0eb50f, owned source UNCHANGED, local objdiff 16.744186%.
|
||||
Structural audit: instructions 11/43, structural/operand (40, 42).
|
||||
- ATTEMPT Run: guard the cache loop then use its native posttested block countdown; source 2d3f1492b5af; 11.976745%; instructions 11/43; structural/operand (42, 43); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT Run: use an indexed counted cache-block traversal; source 7e48cf01d356; 16.744186%; instructions 11/43; structural/operand (40, 42); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT Run: keep the entry callback typed separately from cache traversal; source 68ead673d9b4; 16.744186%; instructions 11/43; structural/operand (40, 42); exact 24; data 155504; regress []; restored.
|
||||
Run remains an ABI trampoline: the target zeroes r2-r31 and r1, sets LR to entryPoint, and returns directly into it. Ordinary C preserves the ABI; new assembly and uninitialized values are forbidden. All three cache-loop/callback forms restored.
|
||||
|
||||
## src/BS2/BS2Mach::BS2StartGame
|
||||
Remote 1f0eb50f, owned source UNCHANGED, local objdiff 98.72774%.
|
||||
Structural audit: instructions 393/393, structural/operand (4, 10).
|
||||
- ATTEMPT BS2StartGame: use the SDK-declared volatile PI register through a typed register pointer; source 0f002cb4ee53; 98.72774%; instructions 393/393; structural/operand (4, 10); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGame: put the precomputed DI enable mask before the loaded register value; source 66df856a1c6c; 98.71501%; instructions 393/393; structural/operand (4, 10); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGame: poll the cover block through an immutable command view; source 449060454a23; 98.72774%; instructions 393/393; structural/operand (4, 10); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSDecryptMessage
|
||||
Remote 1f0eb50f, owned source UNCHANGED, local objdiff 97.74143%.
|
||||
Structural audit: instructions 321/321, structural/operand (2, 89).
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmConvertToFloatFromStr
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 97.59036%.
|
||||
Structural audit: instructions 83/83, structural/operand (2, 2).
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: initialize the parse end pointer at its local declaration; source 6799748b27b4; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: read the object type directly at the parse branch boundary; source 76ea6ee2c272; 95.180725%; instructions 83/83; structural/operand (2, 3); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: widen the local type tag to its natural comparison width; source 9429a50f549b; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSDecryptMessage
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 97.74143%.
|
||||
Structural audit: instructions 321/321, structural/operand (2, 89).
|
||||
- ATTEMPT AOSSDecryptMessage: derive cipher state after calculating the next stream index; source 57165f16c767; 97.74143%; instructions 321/321; structural/operand (2, 89); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSDecryptMessage: place the keystream byte before the input byte in XOR expression; source 0caf30a1b22e; 97.74143%; instructions 321/321; structural/operand (2, 89); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSDecryptMessage: use an immutable input message view while retaining the writable output payload; source 0366d2d5dc6b; 97.74143%; instructions 321/321; structural/operand (2, 89); exact 15; data 3928; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSApplyAuthOptions
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 98.77193%.
|
||||
Structural audit: instructions 114/114, structural/operand (0, 22).
|
||||
- ATTEMPT AOSSApplyAuthOptions: reuse the response record cursor for the nested option traversal; source f32e89b5aae4; 96.18421%; instructions 114/114; structural/operand (2, 38); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSApplyAuthOptions: initialize accumulated flags immediately after validation and before record search; source 199c114043b3; 96.97369%; instructions 114/114; structural/operand (3, 26); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSApplyAuthOptions: use the input length itself as the mutable traversal length; source 23c89be53628; 98.20175%; instructions 114/114; structural/operand (0, 32); exact 15; data 3928; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSSendHelloRequest
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 92.190475%.
|
||||
Structural audit: instructions 271/273, structural/operand (33, 254).
|
||||
- ATTEMPT AOSSSendHelloRequest: compute the hello-record checksum with one complete byte traversal; source 62cfc775fc13; 87.02198%; instructions 270/273; structural/operand (43, 266); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSSendHelloRequest: read request records through a const payload view; source b65700d357f7; 92.190475%; instructions 271/273; structural/operand (33, 254); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSSendHelloRequest: derive cipher state after advancing the schedule index; source ef030a5a74e4; 92.190475%; instructions 271/273; structural/operand (33, 254); exact 15; data 3928; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSXorBufferWithKey
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 98.605446%.
|
||||
Structural audit: instructions 147/147, structural/operand (2, 36).
|
||||
- ATTEMPT AOSSXorBufferWithKey: form each XOR byte with the key mask as its first operand; source af3b0a3e996c; 97.993195%; instructions 147/147; structural/operand (2, 46); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSXorBufferWithKey: keep the byte XOR in an unsigned word before storing the byte; source 5788be6f728c; 98.605446%; instructions 147/147; structural/operand (2, 36); exact 15; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSSXorBufferWithKey: update packet bytes with a direct compound XOR; source 7fa4dbc9d5a9; 98.23129%; instructions 147/147; structural/operand (2, 46); exact 15; data 3928; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmFormatString
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 99.84919%.
|
||||
Structural audit: instructions 431/431, structural/operand (0, 13).
|
||||
- ATTEMPT CHANSVmFormatString: read the converted source object through a const object view; source 22c45d4d7f1a; 99.84919%; instructions 431/431; structural/operand (0, 13); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmFormatString: scope the converted string object with the string-format branch; source d00bd2acb89a; 99.84919%; instructions 431/431; structural/operand (0, 13); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmFormatString: load the source string length before incrementing the format argument cursor; source e47a93d20ac4; 99.19489%; instructions 433/431; structural/operand (29, 132); exact 220; data 2232; regress ['VmBlobFill']; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmDateDtor
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 94.96703%.
|
||||
Structural audit: instructions 91/91, structural/operand (5, 7).
|
||||
- ATTEMPT VmDateDtor: read fields directly from the calendar local after the calendar helper returns; source 43d213e09f16; 89.14286%; instructions 90/91; structural/operand (11, 85); exact 220; data 6904; regress ['VmBlobFill']; restored.
|
||||
- ATTEMPT VmDateDtor: read calendar name tables through const pointer-entry views; source 650a83106ab7; 91.62637%; instructions 91/91; structural/operand (30, 63); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmDateDtor: isolate calendar formatting in a typed inline read-only calendar helper; source cb719e233153; 80.14286%; instructions 98/91; structural/operand (33, 84); exact 220; data 6904; regress ['VmBlobFill']; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringReplace
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 97.878784%.
|
||||
Structural audit: instructions 132/132, structural/operand (0, 40).
|
||||
- ATTEMPT VmStringReplace: load search payload length before the parent payload length; source fe576a4d2273; 97.992424%; instructions 132/132; structural/operand (0, 40); exact 221; data 6904; regress []; RETAINED.
|
||||
- ATTEMPT VmStringReplace: declare input byte views inside the validated argument payload region; source ff6e49dfad3a; BUILD FAILED /include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/channelScript/CHANSVm.c -o build/43U/src/src/channelScript && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/channelScript/CHANSVm.d build/43U/src/src/channelScript/CHANSVm.d ### mwcceppc.exe Compiler: # File: src\channelScript\CHANSVm.c # ------------------------------------ # 3100: const char* parentStr = VmParentObj->value.string_v->spData; # Error: ^^^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT VmStringReplace: initialize input and output cursors in traversal order; source 45cfca463149; 97.954544%; instructions 132/132; structural/operand (0, 41); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringSplit
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 98.04054%.
|
||||
Structural audit: instructions 222/222, structural/operand (0, 66).
|
||||
- ATTEMPT VmStringSplit: keep the delimiter argument as a const object view after conversion; source 42c5506b1761; BUILD FAILED VL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/channelScript/CHANSVm.c -o build/43U/src/src/channelScript && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/channelScript/CHANSVm.d build/43U/src/src/channelScript/CHANSVm.d ### mwcceppc.exe Compiler: # File: src\channelScript\CHANSVm.c # ------------------------------------ # 3258: CHANSVmConvertObjectType(VmInst, CHANS_VM_OBJ_TYPE_STRING, arg0); # Error: ^ # (10209) illegal implicit conversion from 'const struct CHANSVmObjHdr *' to # 'struct CHANSVmObjHdr *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT VmStringSplit: load source and delimiter lengths before their byte views; source 3ef334cea05b; 97.96397%; instructions 222/222; structural/operand (2, 76); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringSplit: normalize zero-delimiter element traversal as a counted for loop; source 72b421800c7b; 97.96397%; instructions 222/222; structural/operand (2, 68); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmBlobGetHexString
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 98.71951%.
|
||||
Structural audit: instructions 82/82, structural/operand (0, 14).
|
||||
- ATTEMPT VmBlobGetHexString: read hexadecimal source bytes and digit characters through const views; source f11f1776011f; 98.71951%; instructions 82/82; structural/operand (0, 14); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmBlobGetHexString: use one advancing destination cursor for both hexadecimal characters; source e83f180ba7cb; 88.53658%; instructions 77/82; structural/operand (14, 40); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmBlobGetHexString: load each input byte once before selecting both hexadecimal digits; source 3876a1dc4063; 92.36585%; instructions 81/82; structural/operand (11, 36); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringReplace
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 97.992424%.
|
||||
Structural audit: instructions 132/132, structural/operand (0, 40).
|
||||
- ATTEMPT VmStringReplace: keep parent, search, and replacement byte buffers as const input views; source 2eff216b221b; 97.992424%; instructions 132/132; structural/operand (0, 40); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringSplit
|
||||
Remote e9114959, owned source UNCHANGED, local objdiff 98.04054%.
|
||||
Structural audit: instructions 222/222, structural/operand (0, 66).
|
||||
- ATTEMPT VmStringSplit: keep source and delimiter bytes as const input views; source f3a96f95b2fa; 98.04054%; instructions 222/222; structural/operand (0, 66); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmFormatString
|
||||
Remote 45aaeb16, owned source UNCHANGED, local objdiff 99.84919%.
|
||||
Structural audit: instructions 431/431, structural/operand (0, 13).
|
||||
- ATTEMPT CHANSVmFormatString: separate the temporary string object lifetime from the formatted byte length; source 47f052bd0f87; 99.84919%; instructions 431/431; structural/operand (0, 13); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmBlobPackCommon
|
||||
Remote 45aaeb16, owned source UNCHANGED, local objdiff 97.949104%.
|
||||
Structural audit: instructions 668/668, structural/operand (0, 244).
|
||||
- ATTEMPT VmBlobPackCommon: read source blob descriptors through const pointers; source 285844da5341; 97.949104%; instructions 668/668; structural/operand (0, 244); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmBlobPackCommon: load the high integer word before the low word in integer packing; source da34f1b29bad; 97.949104%; instructions 668/668; structural/operand (0, 244); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmBlobPackCommon: initialize format traversal before argument traversal in packing; source b5ddd715f33b; 97.949104%; instructions 668/668; structural/operand (0, 244); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmBlobUnpack
|
||||
Remote 45aaeb16, owned source UNCHANGED, local objdiff 98.452614%.
|
||||
Structural audit: instructions 517/517, structural/operand (0, 141).
|
||||
- ATTEMPT VmBlobUnpack: read the unpack format through a const wide-character view; source ceb7d96fa71c; 98.452614%; instructions 517/517; structural/operand (0, 141); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmBlobUnpack: initialize decoded-buffer words in their memory order; source 2b671815931d; 98.448746%; instructions 517/517; structural/operand (2, 143); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmBlobUnpack: initialize format traversal before result-element traversal in unpacking; source ea2dbd1d2bba; 98.44294%; instructions 517/517; structural/operand (0, 142); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmWinEmuWrite
|
||||
Remote 45aaeb16, owned source UNCHANGED, local objdiff 99.62687%.
|
||||
Structural audit: instructions 67/67, structural/operand (0, 5).
|
||||
- ATTEMPT VmWinEmuWrite: read the converted document string through a const object view; source fbab2e4baed3; 99.62687%; instructions 67/67; structural/operand (0, 5); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmWinEmuWrite: calculate string extent before initializing its byte cursor; source c1191ce56414; 99.62687%; instructions 67/67; structural/operand (0, 5); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmWinEmuWrite: use a counted block traversal for document encoding; source c2c25edecf0a; 99.62687%; instructions 67/67; structural/operand (0, 5); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmAddExe
|
||||
Remote 45aaeb16, owned source UNCHANGED, local objdiff 99.625984%.
|
||||
Structural audit: instructions 254/254, structural/operand (0, 16).
|
||||
- ATTEMPT CHANSVmAddExe: retain the executable-type argument as an explicit scalar; source e81b2f9afb42; 99.625984%; instructions 254/254; structural/operand (0, 16); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmAddExe: read module-header validation fields through a const descriptor view; source 4b55dbb9eea2; 99.625984%; instructions 254/254; structural/operand (0, 16); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmAddExe: derive the executable payload through its typed module member; source 2dd735c854a6; 98.19292%; instructions 254/254; structural/operand (7, 26); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmLinkModules
|
||||
Remote 45aaeb16, owned source UNCHANGED, local objdiff 98.677246%.
|
||||
Structural audit: instructions 189/189, structural/operand (0, 43).
|
||||
- ATTEMPT CHANSVmLinkModules: read dispatch table entries through a const table view; source 99fcdb1d7c09; 98.677246%; instructions 189/189; structural/operand (0, 43); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmLinkModules: keep each copied dispatch descriptor const within the name-resolution pass; source 4a3167bdf8c3; 98.677246%; instructions 189/189; structural/operand (0, 43); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmLinkModules: separate module traversal from the two scoped name-resolution iterators; source 4c8d4dcbf81f; 98.677246%; instructions 189/189; structural/operand (0, 43); exact 221; data 6904; regress []; restored.
|
||||
|
||||
DECLSEARCH AOSSApplyAuthOptions: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
DECLSEARCH AOSSApplyAuthOptions: | regress [].
|
||||
DECLSEARCH AOSSApplyAuthOptions: restored due to failure or exact-function regression.
|
||||
|
||||
DECLSEARCH AOSSDecryptMessage: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
DECLSEARCH AOSSDecryptMessage: | regress [].
|
||||
DECLSEARCH AOSSDecryptMessage: restored due to failure or exact-function regression.
|
||||
|
||||
DECLSEARCH AOSSXorBufferWithKey: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
DECLSEARCH AOSSXorBufferWithKey: | regress [].
|
||||
DECLSEARCH AOSSXorBufferWithKey: restored due to failure or exact-function regression.
|
||||
|
||||
DECLSEARCH AOSSApplyAuthOptions: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
|
||||
DECLSEARCH CHANSVmFormatString: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
DECLSEARCH AOSSApplyAuthOptions: declaration block: | u32 flags = 0; | const AOSSReplyOption* responseRecord; | AOSSConfigRecord* configRecord; | AOSSStoredConfig* wep40Config; | AOSSStoredConfig* wep104Config; | AOSSStoredConfig* tkipConfig; | AOSSStoredConfig* aesConfig; | u8* networkSettings; | const AOSSReplyOption* option; | u32 length; | s32 remainingLength = responseLength; | int result; | start (0, 22) | best (0, 22) after 177 builds; source restored; best order was: | u32 flags = 0; | const AOSSReplyOption* responseRecord; | AOSSConfigRecord* configRecord; | AOSSStoredConfig* wep40Config; | AOSSStoredConfig* wep104Config; | AOSSStoredConfig* tkipConfig; | AOSSStoredConfig* aesConfig; | u8* networkSettings; | const AOSSReplyOption* option; | u32 length; | s32 remainingLength = responseLength; | int result; | | regress [].
|
||||
|
||||
DECLSEARCH AOSSDecryptMessage: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
|
||||
Coverage exclusions: CHANSVmStep source 85374133139a had the wrong countdown tail and is excluded; CHANSVmAddExe source using header = mod->module reads a pointer member instead of deriving the adjacent payload and is excluded. Failed compilations never count as successful source attempts.
|
||||
Data proof: target BS2Mach .data contains seven pooled literal ranges at offsets 0, 0x22, 0x3c, 0x428, 0x452, 0x648, 0x669 and four relocated switch tables at 0x3f4, 0x590, 0xa4c, 0xaa8. Their table destinations belong to nonexact command/tick code. No named source object can justify a target symbol rename or extent correction; no config address/extent edits made.
|
||||
DECLSEARCH AOSSDecryptMessage: declaration block: | u32 checksum; | u8 manufacturerAddress[8]; | AOSSKeySchedule schedule; | AOSSEncryptedPayload* encrypted = &message->payload.encrypted; | u8* decryptedData; | u32 controlFlags; | u32 dataLength; | u32 i; | s32 crcIndex; | u32 firstIndex; | u32 secondIndex; | u32 firstValue; | u32 secondValue; | u32 stateIndex; | u32 crc; | const u8* inputCursor; | u8* state; | u8* outputCursor; | int result; | start (0, 87) | best (0, 87) after 300 builds; source restored; best order was: | u32 checksum; | u8 manufacturerAddress[8]; | AOSSKeySchedule schedule; | AOSSEncryptedPayload* encrypted = &message->payload.encrypted; | u8* decryptedData; | u32 controlFlags; | u32 dataLength; | u32 i; | s32 crcIndex; | u32 firstIndex; | u32 secondIndex; | u32 firstValue; | u32 secondValue; | u32 stateIndex; | u32 crc; | const u8* inputCursor; | u8* state; | u8* outputCursor; | int result; | | regress [].
|
||||
|
||||
DECLSEARCH AOSSXorBufferWithKey: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
DECLSEARCH AOSSXorBufferWithKey: declaration block: | u8* temporaryHalf; | s32 halfLength = length / 2; | u8* packetHalf; | s32 round; | u8* keyMask; | u8* temporary; | s32 keyIndex; | s32 index; | int result = -1; | u8* packetBytes; | start (0, 34) | best (0, 34) after 118 builds; source restored; best order was: | u8* temporaryHalf; | s32 halfLength = length / 2; | u8* packetHalf; | s32 round; | u8* keyMask; | u8* temporary; | s32 keyIndex; | s32 index; | int result = -1; | u8* packetBytes; | | regress [].
|
||||
DECLSEARCH CHANSVmFormatString: declaration block: | u8* fmtBuf; | wchar_t wideFmt[32]; | u32 halfMaxSize; | BOOL flag; | CHANSVmObjHdr* tempObj; | u32 argIdxCounter; | u32 totalLen; | u8* str; | u32 strLen; | u32 strPos; | u32 segStart; | u32 fmtBufPos; | u8* tmpBuf; | u32 maxSize; | u8* outputBuf; | u32 outputPos; | u32 maxLitLen; | u32 litLen; | u32 isEscaped; | CHANSVmObjHdr* cv; | CHANSVmPrivate* pVm; | CHANSVmObjHdr* argObj; | start (0, 13) | best (0, 13) after 300 builds; source restored; best order was: | u8* fmtBuf; | wchar_t wideFmt[32]; | u32 halfMaxSize; | BOOL flag; | CHANSVmObjHdr* tempObj; | u32 argIdxCounter; | u32 totalLen; | u8* str; | u32 strLen; | u32 strPos; | u32 segStart; | u32 fmtBufPos; | u8* tmpBuf; | u32 maxSize; | u8* outputBuf; | u32 outputPos; | u32 maxLitLen; | u32 litLen; | u32 isEscaped; | CHANSVmObjHdr* cv; | CHANSVmPrivate* pVm; | CHANSVmObjHdr* argObj; | | regress [].
|
||||
|
||||
DECLSEARCH VmWinEmuWrite: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
|
||||
## src/BS2/BS2Mach::BS2Tick
|
||||
Remote 29fe1efa, owned source UNCHANGED, local objdiff 98.6768%.
|
||||
Structural audit: instructions 1936/1940, structural/operand (119, 1702).
|
||||
Device-code access proof: private/os.h defines vu16 __OSDeviceCode with ADDRESS(OS_BASE_CACHED | OS_ADDR_DEVICE_CODE), 0x800030e6. Target case 5 uses an independent lis for each write; use the existing SDK object instead of a nonvolatile raw pointer.
|
||||
DECLSEARCH VmWinEmuWrite: declaration block: | CHANSVmObjHdr* strObj; | u32 offset; | u32 totalLength; | u8 buf[VM_STRING_SIZE]; | s32 outLen; | s32 inLen; | s32 result; | u32 remaining; | start (0, 5) | best (0, 5) after 71 builds; source restored; best order was: | CHANSVmObjHdr* strObj; | u32 offset; | u32 totalLength; | u8 buf[VM_STRING_SIZE]; | s32 outLen; | s32 inLen; | s32 result; | u32 remaining; | | regress [].
|
||||
- ATTEMPT BS2Tick: write the device code through its SDK-declared volatile low-memory object; source 91b01c705232; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
|
||||
DECLSEARCH CHANSVmAddExe: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
- ATTEMPT BS2Tick: make title-prefix fallthrough and unrestricted-prefix branches explicit; source f576609ce6f4; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: put the existing-partition transition before the missing-partition exit; source 24a8cfb915ec; 98.59278%; instructions 1937/1940; structural/operand (113, 1699); exact 24; data 155504; regress []; restored.
|
||||
DECLSEARCH CHANSVmAddExe: declaration block: | CHANSVmPrivate* pVm = (CHANSVmPrivate*)vm; | ModuleHeader* mod; | CHANSVmModule* header; | u32 maxEnd; | u32 size; | u32 cnt; | u32 ofs; | start (0, 16) | best (0, 16) after 52 builds; source restored; best order was: | CHANSVmPrivate* pVm = (CHANSVmPrivate*)vm; | ModuleHeader* mod; | CHANSVmModule* header; | u32 maxEnd; | u32 size; | u32 cnt; | u32 ofs; | | regress [].
|
||||
|
||||
DECLSEARCH CHANSVmLinkModules: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
DECLSEARCH CHANSVmLinkModules: declaration block: | CHANSVmPrivate* pVm = (CHANSVmPrivate*)vm; | CHANSVmModule* module; | u32 modIdx; | u32 i; | start (0, 43) | best (0, 43) after 13 builds; source restored; best order was: | CHANSVmPrivate* pVm = (CHANSVmPrivate*)vm; | CHANSVmModule* module; | u32 modIdx; | u32 i; | | regress [].
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmAddExe
|
||||
Remote 29fe1efa, owned source UNCHANGED, local objdiff 99.625984%.
|
||||
Structural audit: instructions 254/254, structural/operand (0, 16).
|
||||
- ATTEMPT CHANSVmAddExe: derive the adjacent payload before module validation without reading its fields early; source 4101ec2d810b; 98.31102%; instructions 254/254; structural/operand (28, 60); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::CheckBS2CommandStatus
|
||||
Remote 29fe1efa, owned source UNCHANGED, local objdiff 99.50739%.
|
||||
Structural audit: instructions 406/406, structural/operand (2, 2).
|
||||
- ATTEMPT CheckBS2CommandStatus: calculate partition cache extent through a const TOC inline helper; source 6fc3d898a116; 98.81527%; instructions 406/406; structural/operand (4, 12); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmConvertToFloatFromStr
|
||||
Remote 29fe1efa, owned source UNCHANGED, local objdiff 97.59036%.
|
||||
Structural audit: instructions 83/83, structural/operand (2, 2).
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: load the parse type after initializing the addressable end pointer; source 993ebfb33b38; 95.180725%; instructions 83/83; structural/operand (2, 3); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: save the string-type predicate before end-pointer initialization; source 2de2182cafda; 94.93976%; instructions 85/83; structural/operand (5, 74); exact 220; data 6904; regress ['VmBlobFill']; restored.
|
||||
|
||||
AOSSParseNetworkSettings is already 100.0% in objdiff and 0 structural/0 operand differences with declsearch disassembly. ctxdiff/gate odiff normalization reports five CR1 branch false differences: the first operand is cr1, not the branch destination, and the -56 difference equals the function start-offset shift. Per the already-matched-function rule it was not retuned. Acceptance tool left unchanged; its reported instruction-exact count remains 15/21.
|
||||
|
||||
Checkpoint: final retained AOSS_Init_old, UpdateThread and VmStringReplace improvements pass the four-unit quick gate. Full 43U build succeeds; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; zero regressions, forbidden additions and readability warnings. All instruction-exact/code/data counts remain unchanged. Evidence /tmp/big1.gate-second.txt.
|
||||
|
||||
## Final clean-build gate and coverage
|
||||
|
||||
Full non-quick gate: four owned units, GATE PASS. Full 43U build ok; DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d; pools IDENTICAL; regressions 0; forbidden additions 0; readability warnings 0. Raw gate evidence follows.
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/BS2/BS2Mach] pool: IDENTICAL
|
||||
[src/BS2/BS2Mach] objdiff: code 4940/16980 data 155504/158528 functions 24/29 fuzzy 98.3635 linked code 0
|
||||
[src/BS2/BS2Mach] instruction-exact functions: 24/29
|
||||
[src/BS2/BS2Mach] section .bss size 155232 match 100.0
|
||||
[src/BS2/BS2Mach] section .data size 3024 match None
|
||||
[src/BS2/BS2Mach] section .sbss size 240 match 100.0
|
||||
[src/BS2/BS2Mach] section .sdata size 32 match 100.0
|
||||
[src/BS2/BS2Mach] section .text size 16980 match 98.36349
|
||||
[src/BS2/BS2Mach] below 100: Run 16.744186
|
||||
[src/BS2/BS2Mach] below 100: BS2StartGame 98.72774
|
||||
[src/BS2/BS2Mach] below 100: BS2StartGCGame 99.5614
|
||||
[src/BS2/BS2Mach] below 100: CheckBS2CommandStatus 99.50739
|
||||
[src/BS2/BS2Mach] below 100: BS2Tick 98.6768
|
||||
[src/BS2/BS2Mach] baseline: code 4940/16980 data 155504 functions 24 fuzzy 98.1595
|
||||
[src/scene/setting/AOSS] pool: IDENTICAL
|
||||
[src/scene/setting/AOSS] objdiff: code 6436/16192 data 3928/3928 functions 16/21 fuzzy 97.0516 linked code 0
|
||||
[src/scene/setting/AOSS] instruction-exact functions: 15/21
|
||||
[src/scene/setting/AOSS] section .bss size 3496 match 100.0
|
||||
[src/scene/setting/AOSS] section .data size 368 match 100.0
|
||||
[src/scene/setting/AOSS] section .sbss size 32 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata size 24 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata2 size 8 match 100.0
|
||||
[src/scene/setting/AOSS] section .text size 16192 match 97.05163
|
||||
[src/scene/setting/AOSS] below 100: AOSS_Init_old 94.48674
|
||||
[src/scene/setting/AOSS] below 100: AOSSDecryptMessage 97.74143
|
||||
[src/scene/setting/AOSS] below 100: AOSSApplyAuthOptions 98.77193
|
||||
[src/scene/setting/AOSS] below 100: AOSSSendHelloRequest 92.190475
|
||||
[src/scene/setting/AOSS] below 100: AOSSXorBufferWithKey 98.605446
|
||||
[src/scene/setting/AOSS] baseline: code 6436/16192 data 3928 functions 16 fuzzy 96.7779
|
||||
[src/BS2/BS2Update] pool: IDENTICAL
|
||||
[src/BS2/BS2Update] objdiff: code 400/4052 data 10488/10488 functions 9/10 fuzzy 94.5064 linked code 0
|
||||
[src/BS2/BS2Update] instruction-exact functions: 9/10
|
||||
[src/BS2/BS2Update] section .bss size 9056 match 100.0
|
||||
[src/BS2/BS2Update] section .data size 1328 match 100.0
|
||||
[src/BS2/BS2Update] section .sbss size 80 match 100.0
|
||||
[src/BS2/BS2Update] section .sdata size 24 match 100.0
|
||||
[src/BS2/BS2Update] section .text size 4052 match 94.50642
|
||||
[src/BS2/BS2Update] below 100: UpdateThread 93.90471
|
||||
[src/BS2/BS2Update] baseline: code 400/4052 data 10488 functions 9 fuzzy 94.2300
|
||||
[src/channelScript/CHANSVm] pool: IDENTICAL
|
||||
[src/channelScript/CHANSVm] objdiff: code 37608/53564 data 6904/6904 functions 221/233 fuzzy 99.3655 linked code 0
|
||||
[src/channelScript/CHANSVm] instruction-exact functions: 221/233
|
||||
[src/channelScript/CHANSVm] section .data size 4672 match 100.0
|
||||
[src/channelScript/CHANSVm] section .rodata size 1432 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sbss size 16 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sdata size 600 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sdata2 size 184 match 100.0
|
||||
[src/channelScript/CHANSVm] section .text size 53564 match 99.36555
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmConvertToFloatFromStr 97.59036
|
||||
[src/channelScript/CHANSVm] below 100: VmDateDtor 94.96703
|
||||
[src/channelScript/CHANSVm] below 100: VmStringReplace 97.992424
|
||||
[src/channelScript/CHANSVm] below 100: VmStringSplit 98.04054
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmFormatString 99.84919
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobGetHexString 98.71951
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobPackCommon 97.949104
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobUnpack 98.452614
|
||||
[src/channelScript/CHANSVm] below 100: VmWinEmuWrite 99.62687
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmAddExe 99.625984
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmLinkModules 98.677246
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmStep 96.46608
|
||||
[src/channelScript/CHANSVm] baseline: code 37608/53564 data 6904 functions 221 fuzzy 99.3644
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 90.71801 -> 90.71801
|
||||
global fuzzy_match_percent: 99.57510 -> 99.57810
|
||||
global complete_code_percent: 71.01273 -> 71.01273
|
||||
global matched_data_percent: 99.36639 -> 99.36639
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
review note: src/BS2/BS2Update.c: volatile object declaration (orchestrator checks the target really re-reads it) (+1 net), e.g. static volatile u32 EntriesCount = 0;
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
Remaining source functions (every listed function has at least three distinct successful semantic trials; failed or invalid experiments excluded):
|
||||
|
||||
src/BS2/BS2Mach: instruction-exact 24; code 4940 -> 4940 / 16980; data 155504 -> 155504 / 158528.
|
||||
- Run 16.744186%; 11/43 instructions, structure/operands (40, 42); 3 successful distinct source attempts; ABI register clearing and stack/LR handoff require an assembly trampoline; new assembly is forbidden.
|
||||
- BS2StartGame 98.72774%; 393/393 instructions, structure/operands (4, 10); 3 successful distinct source attempts; instruction scheduling or control-flow shape differs.
|
||||
- BS2StartGCGame 99.5614%; 228/228 instructions, structure/operands (2, 7); 4 successful distinct source attempts; instruction scheduling or control-flow shape differs.
|
||||
- CheckBS2CommandStatus 99.50739%; 406/406 instructions, structure/operands (2, 2); 4 successful distinct source attempts; instruction scheduling or control-flow shape differs.
|
||||
- BS2Tick 98.6768%; 1936/1940 instructions, structure/operands (119, 1702); 12 successful distinct source attempts; four instructions short; low-memory base loads, branch shape and scheduling differ.
|
||||
|
||||
src/scene/setting/AOSS: instruction-exact 15; code 6436 -> 6436 / 16192; data 3928 -> 3928 / 3928.
|
||||
- AOSS_Init_old 94.48674%; 1570/1584 instructions, structure/operands (154, 1510); 8 successful distinct source attempts; stack/branch/control-flow differences remain; target r14 read before assignment is unresolved and uninitialized C is forbidden.
|
||||
- AOSSDecryptMessage 97.74143%; 321/321 instructions, structure/operands (0, 87); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- AOSSApplyAuthOptions 98.77193%; 114/114 instructions, structure/operands (0, 22); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- AOSSSendHelloRequest 92.190475%; 271/273 instructions, structure/operands (33, 254); 3 successful distinct source attempts; two instructions short; global-base grouping, checksum unrolling and cipher lifetimes differ.
|
||||
- AOSSXorBufferWithKey 98.605446%; 147/147 instructions, structure/operands (0, 34); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
|
||||
src/BS2/BS2Update: instruction-exact 9; code 400 -> 400 / 4052; data 10488 -> 10488 / 10488.
|
||||
- UpdateThread 93.90471%; 905/913 instructions, structure/operands (94, 747); 5 successful distinct source attempts; eight instructions short; loop and local lifetimes remain different after the proven volatile reload fix.
|
||||
|
||||
src/channelScript/CHANSVm: instruction-exact 221; code 37608 -> 37608 / 53564; data 6904 -> 6904 / 6904.
|
||||
- CHANSVmConvertToFloatFromStr 97.59036%; 83/83 instructions, structure/operands (2, 2); 6 successful distinct source attempts; instruction scheduling or control-flow shape differs.
|
||||
- VmDateDtor 94.96703%; 91/91 instructions, structure/operands (5, 7); 3 successful distinct source attempts; instruction scheduling or control-flow shape differs.
|
||||
- VmStringReplace 97.992424%; 132/132 instructions, structure/operands (0, 40); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- VmStringSplit 98.04054%; 222/222 instructions, structure/operands (0, 66); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- CHANSVmFormatString 99.84919%; 431/431 instructions, structure/operands (0, 13); 4 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- VmBlobGetHexString 98.71951%; 82/82 instructions, structure/operands (0, 14); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- VmBlobPackCommon 97.949104%; 668/668 instructions, structure/operands (0, 244); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- VmBlobUnpack 98.452614%; 517/517 instructions, structure/operands (0, 141); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- VmWinEmuWrite 99.62687%; 67/67 instructions, structure/operands (0, 5); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- CHANSVmAddExe 99.625984%; 254/254 instructions, structure/operands (0, 16); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- CHANSVmLinkModules 98.677246%; 189/189 instructions, structure/operands (0, 43); 3 successful distinct source attempts; register allocation and commutative operand selection; declaration/lifetime/const views did not make it exact.
|
||||
- CHANSVmStep 96.46608%; 1253/1253 instructions, structure/operands (65, 313); 4 successful distinct source attempts; opcode branch/local layout differs; pretested loop attempts lowered the data measure and were restored.
|
||||
|
||||
No exact-function gain in this round. Retained fuzzy improvements: BS2Tick 98.230415 -> 98.6768; AOSS_Init_old 93.78725 -> 94.48674; UpdateThread 93.59803 -> 93.90471; VmStringReplace 97.878784 -> 97.992424. Unit code/data match counts did not change. No configure/symbol extent edits, no new assembly, no push/PR or other worktree operations. All edits remain in the four owned C files and this log. The pre-existing fz18.attempts.md was preserved.
|
||||
|
||||
# MAX continuation from 84867e93
|
||||
Priority: BS2Tick, AOSS_Init_old, UpdateThread, VmStringReplace. No exact claims without gate evidence; structural blocks before declaration search.
|
||||
src/BS2/BS2Mach continuation pool: POOL IDENTICAL up to 91 (mine=91 base=91)
|
||||
src/scene/setting/AOSS continuation pool: POOL IDENTICAL up to 1 (mine=1 base=1)
|
||||
src/BS2/BS2Update continuation pool: POOL IDENTICAL up to 55 (mine=55 base=55)
|
||||
src/channelScript/CHANSVm continuation pool: POOL IDENTICAL up to 125 (mine=125 base=125)
|
||||
|
||||
## src/BS2/BS2Mach::BS2Tick
|
||||
Remote 29fe1efa, owned source UNCHANGED, local objdiff 98.6768%.
|
||||
Structural audit: instructions 1936/1940, structural/operand (119, 1702).
|
||||
Block audit MAX: frame 0x70 matches. First differences at instructions38-53 are progress/partition/cover stores and constant scheduling; no immediate reload proves additional volatility. Case5 is missing two independent low-memory base loads; case9 disc-title base is hoisted ahead of magic test; case0xb streaming load is scheduled after state store. Later two missing unconditional branches and loader output field-load order remain.
|
||||
- ATTEMPT BS2Tick: initialize progress through the freshly assigned progress pointer rather than a second absolute lvalue; source 869aad1e235f; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: initialize transfer flag before partition reset and cover state after disk-presence snapshot; source 47b9d7e2def3; 98.6299%; instructions 1936/1940; structural/operand (117, 1704); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: create the disc-title read-only view only inside the Revolution magic branch; source b0d211abd366; 98.66392%; instructions 1936/1940; structural/operand (114, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: load the streaming decision before clearing the audio-buffer state; source 145217e14adc; 98.671646%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: view the console hardware word as the existing OSBootInfo consoleType field; source ab02c01748ef; BUILD FAILED ibs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/BS2/BS2Mach.c -o build/43U/src/src/BS2 && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/BS2/BS2Mach.d build/43U/src/src/BS2/BS2Mach.d ### mwcceppc.exe Compiler: # File: src\BS2\BS2Mach.c # -------------------------- # 1392: if ((((const OSBootInfo *)0x80000000)->consoleType & 0xf0000000) == 0) # Error: ^ # (10115) ')' expected # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT BS2Tick: reset partition progress and cover through typed writable helper parameters; source 951fea4f79f5; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: put title-prefix acceptance and region dispatch in one read-only title helper; source 6da0db03d000; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: use the SDK console structure and SDK device-code object for both hardware accesses; source b5e249de0a3e; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: make the GameCube streaming header an immutable view; source e5b308c14018; 98.6768%; instructions 1936/1940; structural/operand (119, 1702); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSS_Init_old
|
||||
Remote 2d9e3ee1, owned source UNCHANGED, local objdiff 94.48674%.
|
||||
Structural audit: instructions 1570/1584, structural/operand (154, 1510).
|
||||
- ATTEMPT BS2Tick: express title-prefix acceptance as the two explicit accepting exits; source 9d5ea2e488cf; 98.547424%; instructions 1937/1940; structural/operand (115, 1699); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: publish the loader address before the loader length as in the target load order; source 715eaa5af0d3; 98.67783%; instructions 1936/1940; structural/operand (117, 1700); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: keep the initial progress address in its native pointer local until the reset store; source a35e1c93cd04; 98.67783%; instructions 1936/1940; structural/operand (117, 1700); exact 24; data 155504; regress []; restored.
|
||||
MAX block audit: frame/local offsets match. Target has an additional second zero-result test at0x6f0 and a full cleanup return before allocation at0x734; current if/else collapsed that block. Target manufacturer-length branch has explicit branch-around-copy. Three connect loops use a second status test before the config flag. Poll timeout shows duplicate division and an explicit 64-bit zero carry; remaining stack stores precede clock read in a different order. SDK cleanup calls target compare <0, source writes -1<result.
|
||||
- ATTEMPT AOSS_Init_old: restore the target second zero-result guard and independent cleanup before access-point allocation; source 9e90b4a698a7; 95.48232%; instructions 1587/1584; structural/operand (138, 1461); exact 15; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: use the transaction record field directly for rand and host-to-network conversion; source 7914992ed878; 95.655304%; instructions 1584/1584; structural/operand (130, 918); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: compare socket cleanup results directly against zero; source 546cd099ab1e; 95.65909%; instructions 1584/1584; structural/operand (128, 918); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: keep the final reconnect decrement in its explicit bounded-sleep branch form; source 338ebdc5a2ab; 95.91161%; instructions 1584/1584; structural/operand (123, 915); exact 16; data 3928; regress []; RETAINED.
|
||||
Checkpoint cbd9898a: BS2Tick target loader output loads address then length; publication order changed accordingly. Quick Mach gate PASS, regression0, pools identical. 1936/1940 remains, objdiff98.6768 ->98.67783. No new hardware volatile declarations or helpers retained.
|
||||
Retained setup guard proof: target0x6a0 compares NCD result once, branches0x6f0 on zero, then immediately branches0x734 on the same zero flag. Both intervening error paths free config/list and return-1. Source now preserves both guards and cleanup blocks; no dummy object or new call. Request field loads remove three extra instructions, yielding1584/1584. Raw gate16/21 includes already-objdiff100 ParseNetworkSettings now at its target offset; this is not a newly matched source function.
|
||||
- ATTEMPT AOSS_Init_old: give the send dispatch its own result lifetime ending before polling; source bf3e41e05d18; 95.91161%; instructions 1584/1584; structural/operand (123, 915); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: use unsigned host-state comparisons in both reconnect loops; source 23352e349173; 95.809975%; instructions 1584/1584; structural/operand (121, 914); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: use a direct nonnegative test for the final socket cleanup; source cb4fece669a6; 95.915405%; instructions 1584/1584; structural/operand (121, 913); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: assign the message opcode before the reserved byte to keep their distinct values live; source 1467c2b23c1d; 95.9173%; instructions 1584/1584; structural/operand (125, 913); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: widen the microsecond product before the tick right shift and carry addition; source 8bb2dd51b2bd; 95.9173%; instructions 1584/1584; structural/operand (125, 913); exact 16; data 3928; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Update::UpdateThread
|
||||
Remote 7851b2b2, owned source UNCHANGED, local objdiff 93.90471%.
|
||||
Structural audit: instructions 905/913, structural/operand (94, 747).
|
||||
MAX block audit UpdateThread: target913/source905, frame0xf0 matches. Four missing instructions are State=5 stores eliminated before final selected-count test; source has those writes, suggesting a selection-helper boundary. Seat-pointer arithmetic uses addis instead of target lis/add twice. Target reloads selected entry type between zero/type-one tests. Error logging derives base anew. Capacity/local declaration order is secondary to these differences.
|
||||
- ATTEMPT UpdateThread: separate entry selection into its typed inline return boundary before the worker import loop; source b3c58dd43faa; 93.95947%; instructions 905/913; structural/operand (94, 747); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: read the type-one discriminator through the published current entry; source a4fc190f5b59; BUILD FAILED EBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/BS2/BS2Update.c -o build/43U/src/src/BS2 && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/BS2/BS2Update.d build/43U/src/src/BS2/BS2Update.d Traceback (most recent call last): File "/mnt/drive2/projects/wii-ipl-workers/w0929-fix-board/tools/transform_dep.py", line 84, in <module> main() File "/mnt/drive2/projects/wii-ipl-workers/w0929-fix-board/tools/transform_dep.py", line 77, in main output = import_d_file(args.d_file) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/drive2/projects/wii-ipl-workers/w0929-fix-board/tools/transform_dep.py", line 31, in import_d_file with open(in_file) as file: ^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'build/43U/src/src/BS2/BS2Update.d' ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT UpdateThread: clear current-entry pointer before publishing completion progress; source d04823cb1529; 93.97043%; instructions 905/913; structural/operand (94, 747); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: recheck the published current-entry type after the zero-type branch; source 3cacd17bf8b9; 93.948524%; instructions 906/913; structural/operand (94, 747); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: give the worker import loop a const entry view after selecting writable entries; source 2c210a0ec798; 93.83899%; instructions 905/913; structural/operand (95, 747); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: derive the two seat-array cursors as separate base and entry-count steps; source bd0e352d40b9; 94.278206%; instructions 906/913; structural/operand (83, 746); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: reset cancellation before start while the selection helper initializes its counters; source 6800170e5598; 94.278206%; instructions 906/913; structural/operand (83, 746); exact 9; data 10488; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringReplace
|
||||
Remote 63f4c7ae, owned source UNCHANGED, local objdiff 97.992424%.
|
||||
Structural audit: instructions 132/132, structural/operand (0, 40).
|
||||
Checkpoint: continued AOSS setup now95.9173%, target-length1584insns; UpdateThread typed selection boundary and explicit seat cursors94.278206%,906/913insns. Four-unit quick gate PASS, regression0, forbidden0, readability0. Artifact /tmp/big1.max.checkpoint1.txt. All unit matched code/data bytes unchanged; AOSS raw instruction-exact16 is the known CR1-normalization artifact disappearing, not a new objdiff-exact source function.
|
||||
MAX structural audit VmStringReplace:132/132 instructions, frame0x40, branch topology and operand-independent sequence match. Remaining40 operand changes are VM/return/argument and payload/cursor register assignments. C89-correct payload const/lifetime trials precede first declaration search on the current source.
|
||||
- ATTEMPT VmStringReplace: cache the three actual payloads in const typed views declared at function entry; source d1c16fee5c88; 97.992424%; instructions 132/132; structural/operand (0, 45); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: end the converted-object lifetimes after capturing their payload fields; source f95c78ffa31b; 97.992424%; instructions 132/132; structural/operand (0, 40); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: limit the tail-segment length to the trailing-copy block; source 6dae86b9c20d; 97.992424%; instructions 132/132; structural/operand (0, 40); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: express the source and destination offset advances as assignments to their old values; source b87ac8404da8; 97.992424%; instructions 132/132; structural/operand (0, 40); exact 221; data 6904; regress []; restored.
|
||||
|
||||
DECLSEARCH VmStringReplace: source-level structure and const/lifetime trials exhausted; run declaration-order search, maximum 300 evaluations.
|
||||
Continuation data audit: AOSS .sdata2 bytes ffffffff00000000, sh_align8. Init relocations at0x24c/0x254 address target halfwords at+0/+2; real source s_defaultOptions currently size8 at+0 and both relocs use its base. This is a structural load-boundary difference despite already100% unit data. No metadata rename/extent is justified unless a candidate emits same bytes and independent real objects at+0/+2. Mach remaining3024 bytes are pooled literals and four jump tables, whose code relocation targets are still nonexact; all three other units already have100% data. No config edit made.
|
||||
- ATTEMPT AOSS_Init_old: audit real independent halfword default objects and their emitted offsets before any symbol rename; source 03ab1c03df1a; 96.28156%; instructions 1583/1584; structural/operand (112, 963); exact 15; data 3920; regress ['AOSSParseNetworkSettings']; restored.
|
||||
Independent defaults data audit: emitted .sdata2 ffff0000ffff, objects [('', 0, 0), ('s_defaultConnection', 0, 2), ('s_defaultResponse', 4, 2)]. Any unequal byte order or offset prevents a name-only correction; addresses are not to be moved.
|
||||
- ATTEMPT AOSS_Init_old: put the network-settings copy and overlong-manufacturer exit in a typed inline builder; source 87329728c23c; 94.3952%; instructions 1563/1584; structural/operand (145, 1526); exact 15; data 3928; regress ['AOSSParseNetworkSettings']; restored.
|
||||
- ATTEMPT AOSS_Init_old: derive the request record after rand has produced the transaction value; source 71aa914f1bb8; 95.96149%; instructions 1584/1584; structural/operand (124, 912); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: compute the subnet broadcast bound before the next-host candidate; source b5ef29f88a8e; 96.09154%; instructions 1584/1584; structural/operand (121, 911); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: snapshot disk presence before the volatile cover-state reset in the initialization block; source 3592347b5692; 98.77062%; instructions 1936/1940; structural/operand (115, 1701); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: combine both target conditional transition shapes rather than score either jump shift in isolation; source 31a2e79d4f84; 98.66289%; instructions 1938/1940; structural/operand (43, 1704); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: use one const boot-disc view across the magic and audio-buffer cases with title view scoped to the magic branch; source 6dc24f2d9e8a; BUILD FAILED libs/RVL_SDK/include -i libs/RevoEX/include -i libs/NW4R/include -i libs/RVLMiddleware/eZiText/include -i libs/RVLMiddleware/TMC_JPEG/include -i libs/RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -MMD -c src/BS2/BS2Mach.c -o build/43U/src/src/BS2 && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/BS2/BS2Mach.d build/43U/src/src/BS2/BS2Mach.d ### mwcceppc.exe Compiler: # File: src\BS2\BS2Mach.c # -------------------------- # 1458: u32 audioBufferSize; # Error: ^^^ # (10141) expression syntax error # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
Independent-default name audit is negative: two real u16[1] objects compile at source offsets0 and4, bytesffff0000ffff, size6; target halfwords are at0 and2 in8 bytes. This is not a name-only gap. No rename or extent correction retained. Source arrays restored. Prior AOSS trials that list ParseNetworkSettings as a regression reflect the previously established odiff CR1 rebasing artifact, not changed code.
|
||||
- ATTEMPT BS2Tick: hold the two proven target branch shapes for follow-up block alignment rather than register-score selection; source 31a2e79d4f84; 98.66289%; instructions 1938/1940; structural/operand (43, 1704); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: write the device code from read-only boot and drive-info inputs across a single typed inline boundary; source ac4fac6065fb; 98.66289%; instructions 1938/1940; structural/operand (43, 1704); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: give both disc cases one read-only boot view with C89 declaration order and branch-scoped title view; source 9020631e669d; 99.013916%; instructions 1938/1940; structural/operand (38, 1704); exact 24; data 155504; regress []; RETAINED.
|
||||
DECLSEARCH VmStringReplace: declaration block: | CHANSVmObjHdr* arg0; | CHANSVmObjHdr* arg1; | vmString parentStr; | vmString searchStr; | vmString replaceStr; | u32 parentLen; | u32 srcOffs; | u32 dstOffs; | u32 searchLen; | u32 replaceLen; | u32 dstBufLen; | vmString newStr; | u32 segLen; | start (0, 40) | improved (0, 39) | improved (0, 37) | improved (0, 35) | improved (0, 34) | improved (0, 28) | best (0, 28) after 285 builds; kept in source: | vmString replaceStr; | vmString searchStr; | vmString parentStr; | u32 parentLen; | u32 srcOffs; | u32 searchLen; | CHANSVmObjHdr* arg0; | u32 dstOffs; | CHANSVmObjHdr* arg1; | u32 replaceLen; | u32 dstBufLen; | vmString newStr; | u32 segLen; | | regress [].
|
||||
DECLSEARCH VmStringReplace: retained declaration order pending full gate; instruction-exact 221 -> 221.
|
||||
- ATTEMPT AOSS_Init_old: initialize the actual wait-interval aggregate locally instead of loading an artificial four-element default array; source 44412852d753; 96.36048%; instructions 1583/1584; structural/operand (108, 964); exact 16; data 3920; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: use the timer conversion with native unsigned-wide seconds and microseconds products; source 63db745418c9; 95.97096%; instructions 1586/1584; structural/operand (138, 1238); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: derive the microsecond remainder from a second quotient after setting the poll event; source 7ce9eece1186; 96.09154%; instructions 1584/1584; structural/operand (121, 911); exact 16; data 3928; regress []; restored.
|
||||
VmStringReplace declaration-order search:285 builds, 40 ->28 operand differences, structural0. Candidate objdiff 98.82576%, code 37608, data 6904; pending gate.
|
||||
VmStringReplace def-use audit after declaration search: target loads parent payload then search payload and parentLen before searchLen. Current source loads search payload then parent; register-blind structure0 obscures this semantic operand-order divergence. Restore parent-first field capture before more register tuning.
|
||||
- ATTEMPT VmStringReplace: load parent length before search length on the improved declaration order; source 62caace862eb; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: cache the parent-first immutable payloads before accessing the two lengths; source e9e0f446b0f7; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: carry the actual private VM view through argument and return-object calls; source 1b161afe60d4; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: use one converted-object definition for each argument with direct nested calls; source b68869ff4e67; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT BS2Tick: snapshot all loader outputs before publishing length then address then offset; source 96d0e4f4997b; 99.01134%; instructions 1938/1940; structural/operand (38, 1705); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: reset progress from the partition-reset expression through the typed progress pointer; source 87d17635de34; 99.013405%; instructions 1938/1940; structural/operand (41, 1704); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: dispatch the console class as a switch with independent SDK device-code branches; source 3e77d38da8c3; 99.03144%; instructions 1939/1940; structural/operand (39, 1696); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: snapshot the read-only streaming decision before clearing configuration state on the aligned branch layout; source 0b72694d4151; 98.97165%; instructions 1940/1940; structural/operand (33, 191); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: make both fully converted argument objects read-only views for all subsequent field loads; source aae0575dc38c; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: give the two-pass byte replacement a typed inline helper with read-only buffer inputs; source a4681b7b245b; 93.67424%; instructions 132/132; structural/operand (12, 74); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: capture each input string as its actual pointer-and-length pair; source b49d643b4456; 97.27273%; instructions 132/132; structural/operand (0, 52); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::BS2Tick
|
||||
Remote f05f7bbc, owned source UNCHANGED, local objdiff 99.03144%.
|
||||
Structural audit: instructions 1939/1940, structural/operand (39, 1696).
|
||||
- ATTEMPT BS2Tick: capture the native streaming byte before resetting audio configuration without boolean normalization; source 62e2b885dae7; 99.02629%; instructions 1939/1940; structural/operand (39, 1696); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: write both SDK device-code branches through a typed inline setter with ordinary if topology; source 4ff71a4e24c2; 99.013916%; instructions 1938/1940; structural/operand (38, 1704); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: capture only the loader address before publishing the volatile length and address; source 664260dcee6e; 99.03918%; instructions 1939/1940; structural/operand (39, 1696); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: use an immutable disc pointer definition in the audio case and a separate magic-check view; source fe5540942653; 98.81753%; instructions 1939/1940; structural/operand (42, 1696); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSS_Init_old
|
||||
Remote a8ab2099, owned source UNCHANGED, local objdiff 96.09154%.
|
||||
Structural audit: instructions 1584/1584, structural/operand (121, 911).
|
||||
- ATTEMPT BS2Tick: sequence the reset writes with their dependent status tests as native comma expressions; source 416d5f589a87; 99.03918%; instructions 1939/1940; structural/operand (39, 1696); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: publish the typed read-only data TOC view before loading its count for reporting; source e24edf585527; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; RETAINED.
|
||||
- ATTEMPT BS2Tick: keep the real partition reset and proven volatile region read across a typed inline boundary; source 035cc9f94dbe; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; restored.
|
||||
Checkpoint3: Mach quick GATE PASS, target DOL SHA1, regressions0, forbidden0, readability0. BS2Tick99.013916 ->99.106186: SDK console-class branch, native loader-address capture, and read-only data-TOC publication. /tmp/big1.max.checkpoint3.txt. No exact count or matched-byte increase.
|
||||
- ATTEMPT AOSS_Init_old: dispatch the bounded manufacturer copy as its actual zero-or-one case rather than a skip branch; source 7c3457cb28bc; 95.741165%; instructions 1591/1584; structural/operand (127, 1548); exact 16; data 3928; regress []; restored.
|
||||
Connect topology proof: target0x7f8 bne810 followed immediately by0x7fc bne8fc with the same cmpwi0 flags; reconnect repeats at0xd50/0xd54 and final-connect block. Testing the nested result guard restores the missing second condition without adding any data or undefined value.
|
||||
- ATTEMPT AOSS_Init_old: restore both result guards before the configuration flag in all three connect tests; source 5284e701f1db; 96.32513%; instructions 1587/1584; structural/operand (116, 1515); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: capture the actual request-array byte base before entering the three-record initialization loop; source 14b53b87c5be; 96.268936%; instructions 1586/1584; structural/operand (117, 1395); exact 16; data 3928; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Update::UpdateThread
|
||||
Remote 6b95233f, owned source UNCHANGED, local objdiff 94.278206%.
|
||||
Structural audit: instructions 906/913, structural/operand (83, 746).
|
||||
- ATTEMPT UpdateThread: define the typed selection helper after its call so file IPA supplies the inline boundary; source c01fc560098e; 94.278206%; instructions 906/913; structural/operand (83, 746); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: recheck the type-one case through the published entry on the explicit-seat-cursor layout; source 00b744a3eed3; 94.381165%; instructions 907/913; structural/operand (83, 745); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: return the protocol send result directly from a typed inline handshake dispatch; source d48ef9b99a91; BUILD FAILED s/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -O4,p -inline off -MMD -c src/scene/setting/AOSS.c -o build/43U/src/src/scene/setting && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/scene/setting/AOSS.d build/43U/src/src/scene/setting/AOSS.d ### mwcceppc.exe Compiler: # File: src\scene\setting\AOSS.c # --------------------------------- # 419: memcpy(messageIdentity,requestRecords->records[2],8); # Error: ^ # (10209) illegal implicit conversion from 'struct AOSSRequestRecord' to # 'const void *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT AOSS_Init_old: preserve the positive manufacturer-length branch followed by the common IP-setup continuation; source 453d818162df; 96.32513%; instructions 1587/1584; structural/operand (116, 1515); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: use native pointer-zero tests for both reconnect allocations; source 43454fbe3646; 96.49558%; instructions 1587/1584; structural/operand (114, 1515); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: give the import discriminator an explicit zero-type dispatch before the published type-one test; source b98142b126ed; 94.46988%; instructions 908/913; structural/operand (85, 746); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: load each import-error title through a const table-and-index inline helper; source 05215033703a; 94.282585%; instructions 908/913; structural/operand (87, 746); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: pass the selection status output through the typed inline boundary before publishing the count; source de6d3c74a49b; 94.46988%; instructions 908/913; structural/operand (85, 746); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: correct the typed send-dispatch helper with the actual address of the third request record; source 8048fbbe5b03; 90.522095%; instructions 1487/1584; structural/operand (198, 1493); exact 16; data 3928; regress []; restored.
|
||||
Checkpoint4: AOSS/Update quick GATE PASS, all pools identical, target DOL SHA1, regressions0, forbidden0, readability0. AOSS nested connection-result conditions match the three target double-bne blocks, pointer-null test restores cmpwi; Init96.09154 ->96.49558. Update rechecks published CurrentEntry and explicitly dispatches zero-type,94.278206 ->94.46988. No matched-byte or objdiff-exact gain. /tmp/big1.max.checkpoint4.txt.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringReplace
|
||||
Remote a2a04605, owned source UNCHANGED, local objdiff 98.82576%.
|
||||
Structural audit: instructions 132/132, structural/operand (0, 28).
|
||||
DECLSEARCH BS2Tick: block-by-block structural work complete through loader/TOC publication; search native secondary locals after the target stack aggregate (1289-1300), max300.
|
||||
- ATTEMPT VmStringReplace: carry the complete method through an inline helper with a formal const parent-object input; source a61f20789f6a; 96.666664%; instructions 132/132; structural/operand (0, 64); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: use the actual const byte-buffer types for all three replacement inputs; source 2aafce1f83f8; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: scope immutable converted-object pointer definitions to the input-capture block; source 487c8a8f31af; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::CheckBS2CommandStatus
|
||||
Remote ffeed96e, owned source UNCHANGED, local objdiff 99.50739%.
|
||||
Structural audit: instructions 406/406, structural/operand (2, 2).
|
||||
DECLSEARCH BS2Tick: declaration block: | DVDFileInfo bannerFile; | u32 discRegion; | s32 status; | u64 currentTime; | BOOL regionMatches; | char productRegion; | u32 iosHigh; | char *ticketByte; | u32 entryCount; | u32 readInterruptsEnabled; | u32 readAddress; | const DVDGameTOC *dataToc; | start (35, 1696) | best (35, 1696) after 177 builds; source restored; best order was: | DVDFileInfo bannerFile; | u32 discRegion; | s32 status; | u64 currentTime; | BOOL regionMatches; | char productRegion; | u32 iosHigh; | char *ticketByte; | u32 entryCount; | u32 readInterruptsEnabled; | u32 readAddress; | const DVDGameTOC *dataToc; | ; 99.106186%; regress[]; RETAINED.
|
||||
DECLSEARCH BS2Tick: block-by-block structural work complete through loader/TOC publication; search leading register locals before the target stack aggregate (1279-1283), max80.
|
||||
DECLSEARCH BS2Tick: declaration block: | u32 interruptsEnabled = OSDisableInterrupts(); | u32 titleCode; | const DVDDiskID *bootDisc; | s32 titlePrefix; | u8 titleCharacters[4]; | start (35, 1696) | best (35, 1696) after 23 builds; source restored; best order was: | u32 interruptsEnabled = OSDisableInterrupts(); | u32 titleCode; | const DVDDiskID *bootDisc; | s32 titlePrefix; | u8 titleCharacters[4]; | ; 99.106186%; regress[]; RETAINED.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmConvertToFloatFromStr
|
||||
Remote ffeed96e, owned source UNCHANGED, local objdiff 97.59036%.
|
||||
Structural audit: instructions 83/83, structural/operand (2, 2).
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: define the parse end pointer before the input type initializer at the inline helper entry; source 6e14bf12ffd3; 95.180725%; instructions 83/83; structural/operand (2, 3); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: declare the parse helper input as a formal pointer to const rather than casting a local view; source ebf2e0ddb903; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: give the parse output its immutable formal pointer definition; source e94e39411c2d; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 221; data 6904; regress []; restored.
|
||||
Additional volatile audit: target request record stores at0x9a4 and0x9b4 have clrlwi16 between the first store and SOHtoNs, not an immediate memory reload. No transactionId qualifier change is supported; no new volatile field was added.
|
||||
- ATTEMPT CheckBS2CommandStatus: declare the actual data TOC global as a pointer to its read-only input object; source 50723bf52f25; 99.50739%; instructions 406/406; structural/operand (2, 2); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT CheckBS2CommandStatus: declare the zero-or-one cache completion flag as its native BOOL type; source c874ab91a1d3; 99.50739%; instructions 406/406; structural/operand (2, 2); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT CheckBS2CommandStatus: compute the cache partition extent with its explicit 32-bit unsigned size operand; source 30e7aec0e44c; 99.50739%; instructions 406/406; structural/operand (2, 2); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::BS2StartGCGame
|
||||
Remote a9a3f36c, owned source UNCHANGED, local objdiff 99.5614%.
|
||||
Structural audit: instructions 228/228, structural/operand (2, 7).
|
||||
- ATTEMPT BS2StartGCGame: define one immutable cover-block address outside the volatile status polling loop; source 83b6e72ca5e4; 97.82895%; instructions 228/228; structural/operand (4, 9); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGCGame: poll cover status through a formal read-only command-block helper and precomputed address; source f0679e8dbefd; 97.82895%; instructions 228/228; structural/operand (4, 9); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2StartGCGame: keep the cover address before the explicit target polling label; source 20cf15703f86; 97.82895%; instructions 228/228; structural/operand (4, 9); exact 24; data 155504; regress []; restored.
|
||||
Definition-level volatile candidate proof (Mach): target BS2DVDCallback0x114 stw State then0x118 lwz State, repeated at0x14c/0x150,0x19c/0x1a0,0x1c0/0x1c4. This supports auditing State at its definition; retain only if all prior exact functions remain exact.
|
||||
- ATTEMPT BS2Tick: qualify the state object at its definition using four proven target store/reload pairs; source 832e7c9e8ddd; 98.93299%; instructions 1939/1940; structural/operand (39, 1698); exact 17; data 155504; regress ['BS2AbortStateMachine', 'BS2DVDCallback', 'BS2GetLockedTitles', 'BS2IsTitleAvailable', 'BS2NANDCallback', 'BS2StartLoadingTitle', 'CheckDVDCommandStatus']; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmStep
|
||||
Remote 8864436c, owned source UNCHANGED, local objdiff 96.46608%.
|
||||
Structural audit: instructions 1253/1253, structural/operand (65, 313).
|
||||
Definition-level volatile candidate proof (Step): target default inversion path0xc528 stw r29,0x18(r1), immediately0xc52c lwz r0,0x18(r1); this is the high half of the bit-not converted integer at stack18. Candidate qualifies only that actual local, never casts a use to volatile. Required disasm_fn dumps stop at paired-single saves; per-instruction target dump proves the pair.
|
||||
- ATTEMPT CHANSVmStep: qualify the target-proven inversion local and its parser output pointer at their definitions; source 95db9aea7828; 96.46608%; instructions 1253/1253; structural/operand (65, 313); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmStep: keep the target-proven inversion local volatile while parsing through a distinct native unsigned output; source b4ecc8559b01; 96.01596%; instructions 1258/1253; structural/operand (156, 901); exact 221; data 2232; regress []; restored.
|
||||
- ATTEMPT CHANSVmStep: give the signed float-conversion and bit-not local its native signed integer type; source ce1352fc7fea; 96.46608%; instructions 1253/1253; structural/operand (65, 313); exact 221; data 6904; regress []; restored.
|
||||
|
||||
## MAX continuation final audit
|
||||
Every remaining function has at least three distinct successful semantic source trials, excluding all failed compilations, invalid Step countdown source85374133139a and incorrect AddExe payload source2dd735c854a6. Coverage regenerated from current report; 23 open functions. Additional declaration searches: VmStringReplace285 builds kept40->28 operand differences; BS2Tick177+23 builds found no improvement. New proven volatile candidates (Mach State and Step inversion local) were tested and restored; only the earlier target-proven EntriesCount qualifier remains.
|
||||
Current continued-round fuzzy: BS2Tick98.6768 ->99.106186; AOSS_Init_old94.48674 ->96.49558; UpdateThread93.90471 ->94.46988; VmStringReplace97.992424 ->98.82576. Exact counts and matched code/data bytes unchanged. AOSS raw gate count is again15/21: sourceInit has three excess instructions, exposing the known CR1 branch-normalization offset artifact in already-objdiff100 ParseNetworkSettings. The transient16 count was never treated as a new source match.
|
||||
Source review: only four owned C files and this attempts log changed. No shared header, config address/extent, generated report, compiler flags, assembly, pinned labels, volatile casts, register declarations, dummy data, other worktree or remote writes. All unsuccessful trials restored. Pre-existing untracked fz18.attempts.md left untouched. Running final full non-quick gate over all four units.
|
||||
|
||||
## MAX final full gate and remaining-function coverage
|
||||
Full non-quick four-unit gate PASS. Raw clean-build evidence:
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/BS2/BS2Mach] pool: IDENTICAL
|
||||
[src/BS2/BS2Mach] objdiff: code 4940/16980 data 155504/158528 functions 24/29 fuzzy 98.5597 linked code 0
|
||||
[src/BS2/BS2Mach] instruction-exact functions: 24/29
|
||||
[src/BS2/BS2Mach] section .bss size 155232 match 100.0
|
||||
[src/BS2/BS2Mach] section .data size 3024 match None
|
||||
[src/BS2/BS2Mach] section .sbss size 240 match 100.0
|
||||
[src/BS2/BS2Mach] section .sdata size 32 match 100.0
|
||||
[src/BS2/BS2Mach] section .text size 16980 match 98.559715
|
||||
[src/BS2/BS2Mach] below 100: Run 16.744186
|
||||
[src/BS2/BS2Mach] below 100: BS2StartGame 98.72774
|
||||
[src/BS2/BS2Mach] below 100: BS2StartGCGame 99.5614
|
||||
[src/BS2/BS2Mach] below 100: CheckBS2CommandStatus 99.50739
|
||||
[src/BS2/BS2Mach] below 100: BS2Tick 99.106186
|
||||
[src/BS2/BS2Mach] baseline: code 4940/16980 data 155504 functions 24 fuzzy 98.1595
|
||||
[src/scene/setting/AOSS] pool: IDENTICAL
|
||||
[src/scene/setting/AOSS] objdiff: code 6436/16192 data 3928/3928 functions 16/21 fuzzy 97.8377 linked code 0
|
||||
[src/scene/setting/AOSS] instruction-exact functions: 15/21
|
||||
[src/scene/setting/AOSS] section .bss size 3496 match 100.0
|
||||
[src/scene/setting/AOSS] section .data size 368 match 100.0
|
||||
[src/scene/setting/AOSS] section .sbss size 32 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata size 24 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata2 size 8 match 100.0
|
||||
[src/scene/setting/AOSS] section .text size 16192 match 97.8377
|
||||
[src/scene/setting/AOSS] below 100: AOSS_Init_old 96.49558
|
||||
[src/scene/setting/AOSS] below 100: AOSSDecryptMessage 97.74143
|
||||
[src/scene/setting/AOSS] below 100: AOSSApplyAuthOptions 98.77193
|
||||
[src/scene/setting/AOSS] below 100: AOSSSendHelloRequest 92.190475
|
||||
[src/scene/setting/AOSS] below 100: AOSSXorBufferWithKey 98.605446
|
||||
[src/scene/setting/AOSS] baseline: code 6436/16192 data 3928 functions 16 fuzzy 96.7779
|
||||
[src/BS2/BS2Update] pool: IDENTICAL
|
||||
[src/BS2/BS2Update] objdiff: code 400/4052 data 10488/10488 functions 9/10 fuzzy 95.0158 linked code 0
|
||||
[src/BS2/BS2Update] instruction-exact functions: 9/10
|
||||
[src/BS2/BS2Update] section .bss size 9056 match 100.0
|
||||
[src/BS2/BS2Update] section .data size 1328 match 100.0
|
||||
[src/BS2/BS2Update] section .sbss size 80 match 100.0
|
||||
[src/BS2/BS2Update] section .sdata size 24 match 100.0
|
||||
[src/BS2/BS2Update] section .text size 4052 match 95.01579
|
||||
[src/BS2/BS2Update] below 100: UpdateThread 94.46988
|
||||
[src/BS2/BS2Update] baseline: code 400/4052 data 10488 functions 9 fuzzy 94.2300
|
||||
[src/channelScript/CHANSVm] pool: IDENTICAL
|
||||
[src/channelScript/CHANSVm] objdiff: code 37608/53564 data 6904/6904 functions 221/233 fuzzy 99.3738 linked code 0
|
||||
[src/channelScript/CHANSVm] instruction-exact functions: 221/233
|
||||
[src/channelScript/CHANSVm] section .data size 4672 match 100.0
|
||||
[src/channelScript/CHANSVm] section .rodata size 1432 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sbss size 16 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sdata size 600 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sdata2 size 184 match 100.0
|
||||
[src/channelScript/CHANSVm] section .text size 53564 match 99.37376
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmConvertToFloatFromStr 97.59036
|
||||
[src/channelScript/CHANSVm] below 100: VmDateDtor 94.96703
|
||||
[src/channelScript/CHANSVm] below 100: VmStringReplace 98.82576
|
||||
[src/channelScript/CHANSVm] below 100: VmStringSplit 98.04054
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmFormatString 99.84919
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobGetHexString 98.71951
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobPackCommon 97.949104
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobUnpack 98.452614
|
||||
[src/channelScript/CHANSVm] below 100: VmWinEmuWrite 99.62687
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmAddExe 99.625984
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmLinkModules 98.677246
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmStep 96.46608
|
||||
[src/channelScript/CHANSVm] baseline: code 37608/53564 data 6904 functions 221 fuzzy 99.3644
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 90.71801 -> 90.71801
|
||||
global fuzzy_match_percent: 99.57510 -> 99.58431
|
||||
global complete_code_percent: 71.01273 -> 71.01273
|
||||
global matched_data_percent: 99.36639 -> 99.36639
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
review note: src/BS2/BS2Update.c: volatile object declaration (orchestrator checks the target really re-reads it) (+1 net), e.g. static volatile u32 EntriesCount = 0;
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
|
||||
src/BS2/BS2Mach: exact-name objdiff functions 24/29; code 4940 -> 4940 / 16980; data 155504 -> 155504 / 158528.
|
||||
- Run 16.744186%; 11/43 instructions, structure/operands (40, 42); 3 distinct successful source trials; ABI register clearing and stack/LR handoff need an assembly trampoline; new assembly is forbidden.
|
||||
- BS2StartGame 98.72774%; 393/393 instructions, structure/operands (4, 10); 3 distinct successful source trials; initial low-memory publication scheduling and commutative integer/FP operand order remain.
|
||||
- BS2StartGCGame 99.5614%; 228/228 instructions, structure/operands (2, 7); 7 distinct successful source trials; target inlines and hoists cover-state polling; correcting that boundary changes initial scheduling and clock-product operand order.
|
||||
- CheckBS2CommandStatus 99.50739%; 406/406 instructions, structure/operands (2, 2); 7 distinct successful source trials; only the adjacent cache-completion store and partition-count shift are swapped; const input, flag type and unsigned-width trials did not change them.
|
||||
- BS2Tick 99.106186%; 1939/1940 instructions, structure/operands (35, 1696); 39 distinct successful source trials; two device-base materializations missing, one extra console switch jump; remaining global load/store scheduling and register choices differ.
|
||||
|
||||
src/scene/setting/AOSS: exact-name objdiff functions 16/21; code 6436 -> 6436 / 16192; data 3928 -> 3928 / 3928.
|
||||
- AOSS_Init_old 96.49558%; 1587/1584 instructions, structure/operands (114, 1515); 30 distinct successful source trials; manufacturer/connect/send/poll boundaries and constant hoisting differ; target r14 is read before assignment, while source keeps a defined initialization result.
|
||||
- AOSSDecryptMessage 97.74143%; 321/321 instructions, structure/operands (0, 87); 3 distinct successful source trials; register allocation and commutative operand selection; const/lifetime trials and 300 declaration evaluations did not improve.
|
||||
- AOSSApplyAuthOptions 98.77193%; 114/114 instructions, structure/operands (0, 22); 3 distinct successful source trials; register allocation and commutative operand selection; const/lifetime trials and 177 declaration evaluations did not improve.
|
||||
- AOSSSendHelloRequest 92.190475%; 271/273 instructions, structure/operands (33, 254); 3 distinct successful source trials; two instructions short; global-base grouping, checksum unrolling and cipher lifetimes differ.
|
||||
- AOSSXorBufferWithKey 98.605446%; 147/147 instructions, structure/operands (0, 34); 3 distinct successful source trials; register allocation and commutative operand selection; 118 declaration evaluations did not improve.
|
||||
|
||||
src/BS2/BS2Update: exact-name objdiff functions 9/10; code 400 -> 400 / 4052; data 10488 -> 10488 / 10488.
|
||||
- UpdateThread 94.46988%; 908/913 instructions, structure/operands (85, 746); 16 distinct successful source trials; selection error State stores are eliminated, logging bases reused; indexed type reload and zero-case dispatch differ. Frame remains0xf0.
|
||||
|
||||
src/channelScript/CHANSVm: exact-name objdiff functions 221/233; code 37608 -> 37608 / 53564; data 6904 -> 6904 / 6904.
|
||||
- CHANSVmConvertToFloatFromStr 97.59036%; 83/83 instructions, structure/operands (2, 2); 9 distinct successful source trials; only the adjacent end-pointer stack store and string-tag compare are swapped; formal const input and definition-order trials did not fix scheduling.
|
||||
- VmDateDtor 94.96703%; 91/91 instructions, structure/operands (5, 7); 3 distinct successful source trials; argument setup and call/return scheduling differ.
|
||||
- VmStringReplace 98.82576%; 132/132 instructions, structure/operands (0, 28); 17 distinct successful source trials; parent/search payload metadata load order and register allocation; frame/count/topology match. 285 declaration evaluations reduced40->28 operand differences.
|
||||
- VmStringSplit 98.04054%; 222/222 instructions, structure/operands (0, 66); 3 distinct successful source trials; register allocation and operand selection after matching frame/count/topology.
|
||||
- CHANSVmFormatString 99.84919%; 431/431 instructions, structure/operands (0, 13); 4 distinct successful source trials; register allocation; 300 declaration evaluations did not improve.
|
||||
- VmBlobGetHexString 98.71951%; 82/82 instructions, structure/operands (0, 14); 3 distinct successful source trials; register allocation and byte-result temporary lifetime.
|
||||
- VmBlobPackCommon 97.949104%; 668/668 instructions, structure/operands (0, 244); 3 distinct successful source trials; register allocation and commutative operand selection; loop/local/const trials did not fix.
|
||||
- VmBlobUnpack 98.452614%; 517/517 instructions, structure/operands (0, 141); 3 distinct successful source trials; register allocation and commutative operand selection; loop/local/const trials did not fix.
|
||||
- VmWinEmuWrite 99.62687%; 67/67 instructions, structure/operands (0, 5); 3 distinct successful source trials; register allocation; 71 declaration evaluations did not improve.
|
||||
- CHANSVmAddExe 99.625984%; 254/254 instructions, structure/operands (0, 16); 3 distinct successful source trials; register allocation; 52 declaration evaluations did not improve. Incorrect payload-member trial excluded.
|
||||
- CHANSVmLinkModules 98.677246%; 189/189 instructions, structure/operands (0, 43); 3 distinct successful source trials; register allocation; 13 declaration evaluations did not improve.
|
||||
- CHANSVmStep 96.46608%; 1253/1253 instructions, structure/operands (65, 313); 7 distinct successful source trials; opcode countdown/branch/local layout differs; target-proven volatile inversion-local trials were identical or regressed. Invalid countdown trial excluded.
|
||||
|
||||
Final interpretation: zero new exact functions and unchanged matched code/data bytes. Continued-round gains are fuzzy, recorded above and committed only after GATE PASS. Raw instruction counts remain Mach24/29, AOSS15/21, Update9/10, Vm221/233. AOSSParseNetworkSettings is still exact in objdiff/proper disassembly; raw count15 reflects the existing CR1-normalization offset artifact. Data audit found no eligible name/extent correction. AOSS r14 read-before-assignment remains uncertain; no uninitialized source was introduced.
|
||||
Changed files: src/BS2/BS2Mach.c, src/scene/setting/AOSS.c, src/BS2/BS2Update.c, src/channelScript/CHANSVm.c, tools/decomp-assist/big1.attempts.md. Continued source checkpoints: cbd9898a,746ce740,f4721a92,2e016fe1,2738dcf4,c4f1e876. Final log-only validation commit follows; no source change after the final full gate.
|
||||
|
||||
# MAX continuation 2 at 6778cff9
|
||||
Continuation priorities: BS2Tick, AOSS_Init_old, UpdateThread, VmStringReplace; preserve existing exact functions and full data. Fresh baseline saved in /tmp/big1.max2-before.json.
|
||||
Initial pools: BS2Mach 91/91, AOSS 1/1, BS2Update 55/55, CHANSVm 125/125, all identical.
|
||||
|
||||
## src/BS2/BS2Mach::BS2Tick
|
||||
Remote e3457d11, owned source UNCHANGED, local objdiff 99.106186%.
|
||||
Structural audit: instructions 1939/1940, structural/operand (35, 1696).
|
||||
MAX2 block audit: first divergence remains case-0 materialization/store order (38-53); case-5 uses an extra switch branch and lacks two low-memory LIS instructions. Target frame and all stack locals remain matched. No new global qualifier proof exists except State, already audited; use typed source boundaries before register search.
|
||||
- ATTEMPT BS2Tick: return the disk-presence snapshot from the typed reset helper after the actual volatile cover write; source 8b1dd7868930; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: separate read-only console-class lookup from the two SDK device-code stores; source ca0be2a204de; 99.08866%; instructions 1938/1940; structural/operand (34, 1706); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: keep the next-state store at each real device-code branch exit rather than after switch dispatch; source d241bbcb5d28; 98.91083%; instructions 1940/1940; structural/operand (22, 78); exact 24; data 158528; regress []; restored.
|
||||
- ATTEMPT BS2Tick: hold target-aligned duplicated next-state branch exits for block audit; restores full jump-table data pairing; source d241bbcb5d28; 98.91083%; instructions 1940/1940; structural/operand (22, 78); exact 24; data 158528; regress []; RETAINED.
|
||||
|
||||
## src/scene/setting/AOSS::AOSS_Init_old
|
||||
Remote 26d7e1e0, owned source UNCHANGED, local objdiff 96.49558%.
|
||||
Structural audit: instructions 1587/1584, structural/operand (114, 1515).
|
||||
- ATTEMPT BS2Tick: give the audio reset a formal const disc input and actual mutable flag output across an inline boundary; source 51706ca013a6; 98.91083%; instructions 1940/1940; structural/operand (22, 78); exact 24; data 158528; regress []; restored.
|
||||
- ATTEMPT BS2Tick: read the signed native console-class word before the device branches; source 3dd5f3192552; 98.91083%; instructions 1940/1940; structural/operand (22, 78); exact 24; data 158528; regress []; restored.
|
||||
- ATTEMPT BS2Tick: keep device publication and next-state publication in one typed inline writer at both exits; source 96cba28ffab6; 98.91083%; instructions 1940/1940; structural/operand (22, 78); exact 24; data 158528; regress []; restored.
|
||||
MAX2 AOSS audit: first genuine missing instruction is the manufacturer-copy branch-around; default constants still have a section-base load (data already exact). At dispatch compare0x135c target defers protocolState publication to0x1818; source publishes before branch, producing an extra MR and a different backedge. The changed non-2 state must still resume immediately, while unchanged state performs the retry wait; preserve that behavior.
|
||||
- ATTEMPT AOSS_Init_old: express the bounded manufacturer copy as the single-iteration pretested block seen in target; source d0e4d1c40623; 96.33207%; instructions 1589/1584; structural/operand (118, 1553); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: defer changed protocol-state publication to its real common resume label after the reconnect path; source ddefbc8ec565; 96.59344%; instructions 1586/1584; structural/operand (110, 1516); exact 16; data 3928; regress []; RETAINED.
|
||||
- ATTEMPT AOSS_Init_old: keep all immutable initialization input fields behind one const view while status writes use the output object; source 7ba2671cb31d; BUILD FAILED RVLFaceLib/include -i libs/EGG/include -i libs/OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -O4,p -inline off -MMD -c src/scene/setting/AOSS.c -o build/43U/src/src/scene/setting && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/scene/setting/AOSS.d build/43U/src/src/scene/setting/AOSS.d ### mwcceppc.exe Compiler: # File: src\scene\setting\AOSS.c # --------------------------------- # 473: s_runtime.config = readInput->ssid; # Error: ^ # (10209) illegal implicit conversion from 'const unsigned char[256]' to # 'void *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT AOSS_Init_old: read only the scalar options and request identity through the const input view; retain mutable buffers on the output view; source 6a0e00ed01c3; 96.59344%; instructions 1586/1584; structural/operand (110, 1516); exact 16; data 3928; regress []; restored.
|
||||
MAX2 device-branch hold rejected for promotion: data158528/158528 is caused by matching downstream label offsets, but source has duplicate State8 stores where target has one; fuzzy98.91083 falls below99.106186. Restore shared-store baseline and pursue actual control/materialization differences, rather than retain incidental alignment.
|
||||
MAX2 checkpoint: AOSS quick GATE PASS (/tmp/big1.max2.gate-aoss1.txt), full build/DOL SHA1 exact, regressions0, forbidden0, readability0. Delayed protocol publication removes one extra MR: Init96.49558 ->96.59344,1587 ->1586 instructions; existing instruction-exact count unchanged. Mach incidental-alignment hold is restored.
|
||||
|
||||
## src/BS2/BS2Update::UpdateThread
|
||||
Remote 26d7e1e0, owned source UNCHANGED, local objdiff 94.46988%.
|
||||
Structural audit: instructions 908/913, structural/operand (85, 746).
|
||||
MAX2 Update audit: first divergence is selection/start-reset scheduling. Frame0xf0 and scratch offsets match. Four State5 instructions are optimized away across the inline selection boundary; no immediate State store/reload or SDK qualifier proof authorizes volatility. The import zero-type switch has one extra jump; target reloads the indexed type again for case1. Test actual const access boundaries and natural if shape before register allocation.
|
||||
- ATTEMPT UpdateThread: use the natural zero-type exit followed by an independent read-only indexed type view; source 1cd852a33e72; 94.70427%; instructions 907/913; structural/operand (82, 745); exact 9; data 10488; regress []; RETAINED.
|
||||
- ATTEMPT UpdateThread: keep the second discriminator at a const table-and-index inline boundary after the natural zero-type exit; source 0aac9ab02e4d; 94.70427%; instructions 907/913; structural/operand (82, 745); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: use a read-only view for the complete import phase after the natural zero-type exit; source 7abc6f85a058; 94.480835%; instructions 906/913; structural/operand (84, 746); exact 9; data 10488; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringReplace
|
||||
Remote 26d7e1e0, owned source UNCHANGED, local objdiff 98.82576%.
|
||||
Structural audit: instructions 132/132, structural/operand (0, 28).
|
||||
- ATTEMPT UpdateThread: derive import fields directly from the actual fixed entry table instead of retaining a mutable cursor; source 53077a1455ef; 92.79737%; instructions 906/913; structural/operand (98, 746); exact 9; data 10488; regress []; restored.
|
||||
MAX2 checkpoint: Update quick GATE PASS, full build and target DOL SHA1, regressions0/forbidden0/readability0. Natural zero-type exit plus separate const indexed test:94.46988 ->94.70427,908 ->907/913 instructions, structure85 ->82, same9 exact and10488 data. No State qualifier introduced.
|
||||
MAX2 Replace block audit: frame0x40,132 instructions and both replacement passes exactly shaped. Target parent-payload metadata loads precede search; source reverses them. Target VM/result use r27/r28, three buffers r31/r30/r29; source VM/result r30/r31 and buffers r26/r27/r28. Try formal/local ownership and const input boundaries, then declaration-order search on changed graphs only.
|
||||
- ATTEMPT VmStringReplace: give execution, parent and result views actual local definitions separate from incoming parameters; source 2d0015e17a39; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: carry the VM and destination as the two fields of the execution view used by conversion and allocation; source 78eda6b2bebf; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: keep the actual parent metadata reads behind an independently declared const object view; source c8737f3f6078; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: give the three native byte strings their read-only char pointer definitions without payload intermediates; source 0faf43351030; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: read the UTF16 payload through its actual wide-string union view while retaining byte offsets for copies; source 932669fa8ba1; 98.82576%; instructions 132/132; structural/operand (0, 28); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: read parent-first string metadata through const formal object parameters in small inline accessors; source b5aa06d9aebe; 98.068184%; instructions 132/132; structural/operand (0, 38); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: define immutable parent-first payload metadata at the start of the validated replacement block; source a557f3f0ea3d; 97.083336%; instructions 132/132; structural/operand (0, 54); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: hold const-formal metadata accessors for declaration-order search on the new read-only graph; source b5aa06d9aebe; 98.068184%; instructions 132/132; structural/operand (0, 38); exact 221; data 6904; regress []; RETAINED.
|
||||
MAX2 DECLSEARCH Replace const-accessor graph: frame/count/branches already exact; maximum400 declaration evaluations after the metadata-boundary trials.
|
||||
MAX2 DECLSEARCH const-accessor result: declaration block: | vmString replaceStr; | vmString searchStr; | vmString parentStr; | u32 parentLen; | u32 srcOffs; | u32 searchLen; | CHANSVmObjHdr* arg0; | u32 dstOffs; | CHANSVmObjHdr* arg1; | u32 replaceLen; | u32 dstBufLen; | vmString newStr; | u32 segLen; | start (0, 38) | improved (0, 36) | improved (0, 33) | improved (0, 31) | best (0, 31) after 326 builds; kept in source: | u32 searchLen; | vmString searchStr; | u32 parentLen; | u32 srcOffs; | vmString replaceStr; | CHANSVmObjHdr* arg0; | u32 dstOffs; | CHANSVmObjHdr* arg1; | u32 replaceLen; | u32 dstBufLen; | vmString parentStr; | vmString newStr; | u32 segLen; | .
|
||||
MAX2 DECLSEARCH accessor graph final (0, 31), fuzzy98.75; restored original28-operand state.
|
||||
- ATTEMPT VmStringReplace: hold the complete formal-const parent helper for declaration search after its frame and control flow passed; source a61f20789f6a; 96.666664%; instructions 132/132; structural/operand (0, 64); exact 221; data 6904; regress []; RETAINED.
|
||||
MAX2 DECLSEARCH Replace formal-const parent helper: matched frame/count/branch topology, maximum400 evaluations of the real helper locals, wrapper signature unchanged.
|
||||
MAX2 DECLSEARCH parent-helper result: declaration block: | vmString replaceStr; | vmString searchStr; | vmString parentStr; | u32 parentLen; | u32 srcOffs; | u32 searchLen; | CHANSVmObjHdr* arg0; | u32 dstOffs; | CHANSVmObjHdr* arg1; | u32 replaceLen; | u32 dstBufLen; | vmString newStr; | u32 segLen; | start (0, 64) | improved (0, 62) | improved (0, 61) | improved (0, 38) | improved (0, 37) | improved (0, 32) | improved (0, 23) | improved (0, 21) | improved (0, 16) | improved (0, 6) | best (0, 6) after 400 builds; kept in source: | CHANSVmObjHdr* arg0; | vmString replaceStr; | vmString searchStr; | vmString parentStr; | vmString newStr; | u32 dstBufLen; | u32 replaceLen; | u32 dstOffs; | CHANSVmObjHdr* arg1; | u32 searchLen; | u32 srcOffs; | u32 parentLen; | u32 segLen; | .
|
||||
MAX2 DECLSEARCH parent-helper final (0, 6), fuzzy99.77273; retained pending gate.
|
||||
MAX2 native type audit: AudioBufferUnconfigured, LoadingTitle, PartitionOpen and RestartRequested are only assigned0/1; use real BOOL definitions as an alternative alias/type graph. DvdProgress is only cleared or tested as a signed word. No volatile qualification or dummy store is involved.
|
||||
- ATTEMPT BS2Tick: declare the audio configuration flag with its actual BOOL value domain; source a8faa86d122a; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: declare restart, partition and title-loading state flags with their native BOOL type; source 6edf878867ab; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: give the cleared and signed-tested progress word its signed native pointer type; source c6561d62de5e; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: carry system-clock instants in the SDK OSTime type used by all signed deadline comparisons; source 1e679def56c9; 99.106186%; instructions 1939/1940; structural/operand (35, 1696); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::VmStringReplace
|
||||
Remote 2d3bc63c, owned source UNCHANGED, local objdiff 99.77273%.
|
||||
Structural audit: instructions 132/132, structural/operand (0, 6).
|
||||
MAX2 Replace final six operands: formal-const parent helper now matches every register assignment and control-flow instruction; only parent/search metadata load ordering differs. Re-test source order on this new graph before another declaration search.
|
||||
- ATTEMPT VmStringReplace: read parent length before search length on the matched const-parent helper graph; source 746260e487a0; 99.77273%; instructions 132/132; structural/operand (0, 6); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: read complete parent metadata before the search payload on the const-parent graph; source 909649390f5a; 99.77273%; instructions 132/132; structural/operand (0, 6); exact 221; data 6904; regress []; restored.
|
||||
- ATTEMPT VmStringReplace: retain actual const parent and search payload views before extracting their lengths and buffers; source a53b6dcac429; 100.0%; instructions 132/132; structural/operand (0, 0); exact 222; data 6904; regress []; RETAINED.
|
||||
MAX2 EXACT VmStringReplace: formal-const parent helper plus explicit const payload views resolves both inline-boundary register allocation and metadata scheduling. objdiff100.0,132/132 instructions,ctxdiff0,pool125/125 identical; unit222/233 raw exact,38136/53564 matched code,6904/6904 data. All-unit quick gate /tmp/big1.max2.gate-replace1.txt: GATE PASS, full43U build/targetDOL SHA1, regression0/forbidden0/readability0. Public method symbol and VM callback signature remain unchanged.
|
||||
|
||||
## src/scene/setting/AOSS::AOSS_Init_old
|
||||
Remote 449529d9, owned source UNCHANGED, local objdiff 96.59344%.
|
||||
Structural audit: instructions 1586/1584, structural/operand (110, 1516).
|
||||
MAX2 AOSS continuation: first copy guard is target BLE-copy then unconditional skip; source BGT-skip. Scalar const locals did not change aliasing; test actual switch shape and formal const scalar-input boundary, with writable ssid/status supplied separately.
|
||||
- ATTEMPT AOSS_Init_old: use the boolean manufacturer-copy dispatch with one genuine copy case and a default exit; source 314d0c31b90b; 96.11301%; instructions 1593/1584; structural/operand (116, 1561); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: supply initialization scalars through a formal const input while the real status and ssid output use their writable view; source 8ba94f246fff; BUILD FAILED OperaWWW/include -ir libs/RVL_SDK/include/private/bte -i build/43U/include -DBUILD_VERSION=0 -DVERSION_43U -i libs/RVL_SDK/include/private/bte -DNDEBUG=1 -DTARGET_RVL -W nomissingreturn -ipa file -gccinc -fp_contract off -O4,s -enc SJIS -lang=c -O4,p -inline off -MMD -c src/scene/setting/AOSS.c -o build/43U/src/src/scene/setting && "/usr/bin/python3" tools/transform_dep.py build/43U/src/src/scene/setting/AOSS.d build/43U/src/src/scene/setting/AOSS.d ### mwcceppc.exe Compiler: # File: src\scene\setting\AOSS.c # --------------------------------- # 1404: protocolResult = AOSSValidateInitConfig(input); # Error: ^ # (10209) illegal implicit conversion from 'const struct AOSSInitInput *' to # 'struct AOSSInitInput *' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed. ; restored.
|
||||
- ATTEMPT AOSS_Init_old: retain the immutable authentication request record across its identity-copy boundary; source 45d38dad82d3; 96.58586%; instructions 1586/1584; structural/operand (112, 1516); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: dispatch all supported native manufacturer lengths directly, avoiding boolean materialization; source 896c92d95c18; 96.486115%; instructions 1589/1584; structural/operand (112, 1539); exact 16; data 3928; regress []; restored.
|
||||
- ATTEMPT AOSS_Init_old: read the existing default halfwords through their native wait-settings union rather than array element addressing; source 674300c90fc5; 96.59344%; instructions 1586/1584; structural/operand (110, 1516); exact 16; data 3928; regress []; restored.
|
||||
|
||||
## src/channelScript/CHANSVm::CHANSVmConvertToFloatFromStr
|
||||
Remote 449529d9, owned source UNCHANGED, local objdiff 97.59036%.
|
||||
Structural audit: instructions 83/83, structural/operand (2, 2).
|
||||
MAX2 Float audit:83/83 instructions,frame0x70,end pointer8 and text buffer12 match; only initial type comparison and end-pointer zero store are swapped. No immediate store/reload proves volatility. Test caller return shape and real parse scratch aggregate before register search.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: return failed parses directly while the allocated result has one immutable local definition; source 0a880fd10234; 95.481926%; instructions 84/83; structural/operand (6, 12); exact 221; data 6904; regress ['VmBlobFill']; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: keep the end pointer and converted text in the native parser scratch record; source aeebfa0fe322; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 222; data 6904; regress []; restored.
|
||||
- ATTEMPT CHANSVmConvertToFloatFromStr: carry the complete string conversion through a formal const input boundary while preserving the public callback signature; source 9e89a701c621; 97.59036%; instructions 83/83; structural/operand (2, 2); exact 222; data 6904; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Update::UpdateThread
|
||||
Remote 449529d9, owned source UNCHANGED, local objdiff 94.70427%.
|
||||
Structural audit: instructions 907/913, structural/operand (82, 745).
|
||||
MAX2 Update continuation: early State5 stores are removed across the count-return boundary, even though final volatile EntriesCount store/reload matches. Test genuine selection output parameters; no State volatility is proven.
|
||||
- ATTEMPT UpdateThread: write the actual selection phase through a typed output parameter across the selection boundary; source 636b9e8d9fe3; 94.70427%; instructions 907/913; structural/operand (82, 745); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: publish the selected count through its proven volatile destination at the selection boundary before the worker tests it; source b13425bc38d9; 94.70427%; instructions 907/913; structural/operand (82, 745); exact 9; data 10488; regress []; restored.
|
||||
- ATTEMPT UpdateThread: return directly from the two actual selection failures that target publishes before leaving selection; source 3da6da199fa1; 94.70427%; instructions 907/913; structural/operand (82, 745); exact 9; data 10488; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSSendHelloRequest
|
||||
Remote 449529d9, owned source UNCHANGED, local objdiff 92.190475%.
|
||||
Structural audit: instructions 271/273, structural/operand (33, 254).
|
||||
MAX2 Hello audit:frame/count271/273 and checksum/cipher traversal retain structural differences; packet request is read-only for its entire lifetime, but only a const local view was tested previously. Test the formal read-only contract without changing writable payload/schedule.
|
||||
- ATTEMPT AOSSSendHelloRequest: declare the whole hello-request input formally const and keep the writable response separate; source 1d377c6e2603; 92.190475%; instructions 271/273; structural/operand (33, 254); exact 16; data 3928; regress []; restored.
|
||||
|
||||
## src/scene/setting/AOSS::AOSSXorBufferWithKey
|
||||
Remote 449529d9, owned source UNCHANGED, local objdiff 98.605446%.
|
||||
Structural audit: instructions 147/147, structural/operand (0, 34).
|
||||
MAX2 XOR audit:147/147 instructions,frame0x40 and register-blind structure0; surviving34 operands allocate packet/key/temp counters differently. The key is read-only throughout; test its formal const contract before further declaration-order work.
|
||||
- ATTEMPT AOSSXorBufferWithKey: declare the actual encryption key as a formal read-only byte-string input; source 527206155ae8; 95.17007%; instructions 146/147; structural/operand (12, 108); exact 16; data 3928; regress []; restored.
|
||||
|
||||
## src/BS2/BS2Mach::BS2Tick
|
||||
Remote 449529d9, owned source UNCHANGED, local objdiff 99.106186%.
|
||||
Structural audit: instructions 1939/1940, structural/operand (35, 1696).
|
||||
MAX2 Tick final structural trials: the current source is one instruction short; case5 has an extra switch jump and reuses the low-memory base. Target audio loads the streaming byte before publishing the clear flag. Test actual constant lifetimes and native branch publication, retaining no duplicated state store merely for table alignment.
|
||||
- ATTEMPT BS2Tick: define the actual initialization audio-state value before resetting partition progress; source 83b5d8bd66f5; 99.0366%; instructions 1939/1940; structural/operand (35, 1709); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: publish audio configuration state at both actual streaming-configuration paths after reading the immutable header; source d872644b8b0b; 98.89742%; instructions 1941/1940; structural/operand (48, 1701); exact 24; data 155504; regress []; restored.
|
||||
- ATTEMPT BS2Tick: compute the native drive device code before publishing it once through the SDK hardware object; source d43d983f8935; 98.957214%; instructions 1938/1940; structural/operand (37, 1703); exact 24; data 155504; regress []; restored.
|
||||
|
||||
## MAX2 final coverage before clean full gate
|
||||
src/BS2/BS2Mach: objdiff exact functions 24 -> 24 / 29; code 4940 -> 4940 / 16980; data 155504 -> 155504 / 158528.
|
||||
- COVERED Run 16.744186%; valid distinct source attempts 3.
|
||||
- COVERED BS2StartGame 98.72774%; valid distinct source attempts 3.
|
||||
- COVERED BS2StartGCGame 99.5614%; valid distinct source attempts 7.
|
||||
- COVERED CheckBS2CommandStatus 99.50739%; valid distinct source attempts 7.
|
||||
- COVERED BS2Tick 99.106186%; valid distinct source attempts 52.
|
||||
src/scene/setting/AOSS: objdiff exact functions 16 -> 16 / 21; code 6436 -> 6436 / 16192; data 3928 -> 3928 / 3928.
|
||||
- COVERED AOSS_Init_old 96.59344%; valid distinct source attempts 37.
|
||||
- COVERED AOSSDecryptMessage 97.74143%; valid distinct source attempts 3.
|
||||
- COVERED AOSSApplyAuthOptions 98.77193%; valid distinct source attempts 3.
|
||||
- COVERED AOSSSendHelloRequest 92.190475%; valid distinct source attempts 4.
|
||||
- COVERED AOSSXorBufferWithKey 98.605446%; valid distinct source attempts 4.
|
||||
src/BS2/BS2Update: objdiff exact functions 9 -> 9 / 10; code 400 -> 400 / 4052; data 10488 -> 10488 / 10488.
|
||||
- COVERED UpdateThread 94.70427%; valid distinct source attempts 23.
|
||||
src/channelScript/CHANSVm: objdiff exact functions 221 -> 222 / 233; code 37608 -> 38136 / 53564; data 6904 -> 6904 / 6904.
|
||||
- COVERED CHANSVmConvertToFloatFromStr 97.59036%; valid distinct source attempts 12.
|
||||
- COVERED VmDateDtor 94.96703%; valid distinct source attempts 3.
|
||||
- COVERED VmStringSplit 98.04054%; valid distinct source attempts 3.
|
||||
- COVERED CHANSVmFormatString 99.84919%; valid distinct source attempts 4.
|
||||
- COVERED VmBlobGetHexString 98.71951%; valid distinct source attempts 3.
|
||||
- COVERED VmBlobPackCommon 97.949104%; valid distinct source attempts 3.
|
||||
- COVERED VmBlobUnpack 98.452614%; valid distinct source attempts 3.
|
||||
- COVERED VmWinEmuWrite 99.62687%; valid distinct source attempts 3.
|
||||
- COVERED CHANSVmAddExe 99.625984%; valid distinct source attempts 3.
|
||||
- COVERED CHANSVmLinkModules 98.677246%; valid distinct source attempts 3.
|
||||
- COVERED CHANSVmStep 96.46608%; valid distinct source attempts 7.
|
||||
All22 remaining functions have3+ distinct successful source-level attempts; failed compilations and invalid prior Step/AddExe substitutions excluded. VmStringReplace is now instruction-exact; untouched open functions retain earlier validated attempts. No source changes remain uncommitted.
|
||||
Final remote audit 449529d9: owned source paths unchanged from merge base; no duplicate remote match.
|
||||
|
||||
## MAX2 final clean full gate and handoff
|
||||
Full non-quick gate over all four owned units. Raw evidence:
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/BS2/BS2Mach] pool: IDENTICAL
|
||||
[src/BS2/BS2Mach] objdiff: code 4940/16980 data 155504/158528 functions 24/29 fuzzy 98.5597 linked code 0
|
||||
[src/BS2/BS2Mach] instruction-exact functions: 24/29
|
||||
[src/BS2/BS2Mach] section .bss size 155232 match 100.0
|
||||
[src/BS2/BS2Mach] section .data size 3024 match None
|
||||
[src/BS2/BS2Mach] section .sbss size 240 match 100.0
|
||||
[src/BS2/BS2Mach] section .sdata size 32 match 100.0
|
||||
[src/BS2/BS2Mach] section .text size 16980 match 98.559715
|
||||
[src/BS2/BS2Mach] below 100: Run 16.744186
|
||||
[src/BS2/BS2Mach] below 100: BS2StartGame 98.72774
|
||||
[src/BS2/BS2Mach] below 100: BS2StartGCGame 99.5614
|
||||
[src/BS2/BS2Mach] below 100: CheckBS2CommandStatus 99.50739
|
||||
[src/BS2/BS2Mach] below 100: BS2Tick 99.106186
|
||||
[src/BS2/BS2Mach] baseline: code 4940/16980 data 155504 functions 24 fuzzy 98.1595
|
||||
[src/scene/setting/AOSS] pool: IDENTICAL
|
||||
[src/scene/setting/AOSS] objdiff: code 6436/16192 data 3928/3928 functions 16/21 fuzzy 97.8760 linked code 0
|
||||
[src/scene/setting/AOSS] instruction-exact functions: 15/21
|
||||
[src/scene/setting/AOSS] section .bss size 3496 match 100.0
|
||||
[src/scene/setting/AOSS] section .data size 368 match 100.0
|
||||
[src/scene/setting/AOSS] section .sbss size 32 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata size 24 match 100.0
|
||||
[src/scene/setting/AOSS] section .sdata2 size 8 match 100.0
|
||||
[src/scene/setting/AOSS] section .text size 16192 match 97.87599
|
||||
[src/scene/setting/AOSS] below 100: AOSS_Init_old 96.59344
|
||||
[src/scene/setting/AOSS] below 100: AOSSDecryptMessage 97.74143
|
||||
[src/scene/setting/AOSS] below 100: AOSSApplyAuthOptions 98.77193
|
||||
[src/scene/setting/AOSS] below 100: AOSSSendHelloRequest 92.190475
|
||||
[src/scene/setting/AOSS] below 100: AOSSXorBufferWithKey 98.605446
|
||||
[src/scene/setting/AOSS] baseline: code 6436/16192 data 3928 functions 16 fuzzy 96.7779
|
||||
[src/BS2/BS2Update] pool: IDENTICAL
|
||||
[src/BS2/BS2Update] objdiff: code 400/4052 data 10488/10488 functions 9/10 fuzzy 95.2271 linked code 0
|
||||
[src/BS2/BS2Update] instruction-exact functions: 9/10
|
||||
[src/BS2/BS2Update] section .bss size 9056 match 100.0
|
||||
[src/BS2/BS2Update] section .data size 1328 match 100.0
|
||||
[src/BS2/BS2Update] section .sbss size 80 match 100.0
|
||||
[src/BS2/BS2Update] section .sdata size 24 match 100.0
|
||||
[src/BS2/BS2Update] section .text size 4052 match 95.22705
|
||||
[src/BS2/BS2Update] below 100: UpdateThread 94.70427
|
||||
[src/BS2/BS2Update] baseline: code 400/4052 data 10488 functions 9 fuzzy 94.2300
|
||||
[src/channelScript/CHANSVm] pool: IDENTICAL
|
||||
[src/channelScript/CHANSVm] objdiff: code 38136/53564 data 6904/6904 functions 222/233 fuzzy 99.3853 linked code 0
|
||||
[src/channelScript/CHANSVm] instruction-exact functions: 222/233
|
||||
[src/channelScript/CHANSVm] section .data size 4672 match 100.0
|
||||
[src/channelScript/CHANSVm] section .rodata size 1432 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sbss size 16 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sdata size 600 match 100.0
|
||||
[src/channelScript/CHANSVm] section .sdata2 size 184 match 100.0
|
||||
[src/channelScript/CHANSVm] section .text size 53564 match 99.38533
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmConvertToFloatFromStr 97.59036
|
||||
[src/channelScript/CHANSVm] below 100: VmDateDtor 94.96703
|
||||
[src/channelScript/CHANSVm] below 100: VmStringSplit 98.04054
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmFormatString 99.84919
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobGetHexString 98.71951
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobPackCommon 97.949104
|
||||
[src/channelScript/CHANSVm] below 100: VmBlobUnpack 98.452614
|
||||
[src/channelScript/CHANSVm] below 100: VmWinEmuWrite 99.62687
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmAddExe 99.625984
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmLinkModules 98.677246
|
||||
[src/channelScript/CHANSVm] below 100: CHANSVmStep 96.46608
|
||||
[src/channelScript/CHANSVm] baseline: code 37608/53564 data 6904 functions 221 fuzzy 99.3644
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 90.71801 -> 90.73564
|
||||
global fuzzy_match_percent: 99.57510 -> 99.58501
|
||||
global complete_code_percent: 71.01273 -> 71.01273
|
||||
global matched_data_percent: 99.36639 -> 99.36639
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
review note: src/BS2/BS2Update.c: volatile object declaration (orchestrator checks the target really re-reads it) (+1 net), e.g. static volatile u32 EntriesCount = 0;
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
|
||||
src/BS2/BS2Mach: objdiff exact functions 24 -> 24 / 29; code 4940 -> 4940 / 16980; data 155504 -> 155504 / 158528.
|
||||
- Run 16.744186%; 11/43 instructions, structure/operands (40, 42); 3 distinct successful source trials; ABI register clearing and stack/LR handoff need an assembly trampoline; new assembly is forbidden.
|
||||
- BS2StartGame 98.72774%; 393/393 instructions, structure/operands (4, 10); 3 distinct successful source trials; initial low-memory publication scheduling and commutative integer/FP operand order remain.
|
||||
- BS2StartGCGame 99.5614%; 228/228 instructions, structure/operands (2, 7); 7 distinct successful source trials; target inlines and hoists cover-state polling; correcting that boundary changes initial scheduling and clock-product operand order.
|
||||
- CheckBS2CommandStatus 99.50739%; 406/406 instructions, structure/operands (2, 2); 7 distinct successful source trials; only the adjacent cache-completion store and partition-count shift are swapped; const input, flag type and unsigned-width trials did not change them.
|
||||
- BS2Tick 99.106186%; 1939/1940 instructions, structure/operands (35, 1696); 52 distinct successful source trials; two device-base materializations missing, one extra console switch jump; remaining global load/store scheduling and register choices differ.
|
||||
|
||||
src/scene/setting/AOSS: objdiff exact functions 16 -> 16 / 21; code 6436 -> 6436 / 16192; data 3928 -> 3928 / 3928.
|
||||
- AOSS_Init_old 96.59344%; 1586/1584 instructions, structure/operands (110, 1516); 37 distinct successful source trials; default-halfword base, manufacturer skip branch, send-result/poll temporaries and scheduling differ. Protocol-state resume publication now matches. Target r14 read-before-definition remains uncertain; no uninitialized source introduced.
|
||||
- AOSSDecryptMessage 97.74143%; 321/321 instructions, structure/operands (0, 87); 3 distinct successful source trials; register allocation and commutative operand selection; const/lifetime trials and 300 declaration evaluations did not improve.
|
||||
- AOSSApplyAuthOptions 98.77193%; 114/114 instructions, structure/operands (0, 22); 3 distinct successful source trials; register allocation and commutative operand selection; const/lifetime trials and 177 declaration evaluations did not improve.
|
||||
- AOSSSendHelloRequest 92.190475%; 271/273 instructions, structure/operands (33, 254); 4 distinct successful source trials; two instructions short; global-base grouping, checksum unrolling and cipher lifetimes differ. Formal const request did not change the discrepancy.
|
||||
- AOSSXorBufferWithKey 98.605446%; 147/147 instructions, structure/operands (0, 34); 4 distinct successful source trials; register allocation and commutative operand selection; const-key formal removes a real target mask store and regresses, so mutable-key baseline retained.
|
||||
|
||||
src/BS2/BS2Update: objdiff exact functions 9 -> 9 / 10; code 400 -> 400 / 4052; data 10488 -> 10488 / 10488.
|
||||
- UpdateThread 94.70427%; 907/913 instructions, structure/operands (82, 745); 23 distinct successful source trials; six instructions short: two early selection State5 stores are optimized away and error logging reuses a table base; selection output/return boundary trials unchanged. Frame0xf0 and native zero-type exit/indexed const test now closer.
|
||||
|
||||
src/channelScript/CHANSVm: objdiff exact functions 221 -> 222 / 233; code 37608 -> 38136 / 53564; data 6904 -> 6904 / 6904.
|
||||
- CHANSVmConvertToFloatFromStr 97.59036%; 83/83 instructions, structure/operands (2, 2); 12 distinct successful source trials; only adjacent end-pointer zero store and string-tag compare differ. Formal const whole-conversion boundary and real scratch-record trials unchanged; direct-return trial regresses and was restored.
|
||||
- VmDateDtor 94.96703%; 91/91 instructions, structure/operands (5, 7); 3 distinct successful source trials; argument setup and call/return scheduling differ.
|
||||
- VmStringSplit 98.04054%; 222/222 instructions, structure/operands (0, 66); 3 distinct successful source trials; register allocation and operand selection after matching frame/count/topology.
|
||||
- CHANSVmFormatString 99.84919%; 431/431 instructions, structure/operands (0, 13); 4 distinct successful source trials; register allocation; 300 declaration evaluations did not improve.
|
||||
- VmBlobGetHexString 98.71951%; 82/82 instructions, structure/operands (0, 14); 3 distinct successful source trials; register allocation and byte-result temporary lifetime.
|
||||
- VmBlobPackCommon 97.949104%; 668/668 instructions, structure/operands (0, 244); 3 distinct successful source trials; register allocation and commutative operand selection; loop/local/const trials did not fix.
|
||||
- VmBlobUnpack 98.452614%; 517/517 instructions, structure/operands (0, 141); 3 distinct successful source trials; register allocation and commutative operand selection; loop/local/const trials did not fix.
|
||||
- VmWinEmuWrite 99.62687%; 67/67 instructions, structure/operands (0, 5); 3 distinct successful source trials; register allocation; 71 declaration evaluations did not improve.
|
||||
- CHANSVmAddExe 99.625984%; 254/254 instructions, structure/operands (0, 16); 3 distinct successful source trials; register allocation; 52 declaration evaluations did not improve. Incorrect payload-member trial excluded.
|
||||
- CHANSVmLinkModules 98.677246%; 189/189 instructions, structure/operands (0, 43); 3 distinct successful source trials; register allocation; 13 declaration evaluations did not improve.
|
||||
- CHANSVmStep 96.46608%; 1253/1253 instructions, structure/operands (65, 313); 7 distinct successful source trials; opcode countdown/branch/local layout differs; target-proven volatile inversion-local trials were identical or regressed. Invalid countdown trial excluded.
|
||||
|
||||
VmStringReplace after the clean build: objdiff100.0,132/132 identical instructions,ctxdiff0. Natural formal const parent view plus const payload views and real local declaration order; public symbol/callback preserved. Code +528 bytes; no data metadata correction needed.
|
||||
This round from6778cff9: instruction-exact counts Mach24 ->24/29, AOSS15 ->15/21, Update9 ->9/10, Vm221 ->222/233. Objdiff AOSS16/21 already includes ParseNetworkSettings; raw15 is the unchanged previously audited CR1-normalization offset artifact, not a loss or new match. Aggregate objdiff code49384 ->49912/90788; data176824 ->176824/179848.
|
||||
Big-function scores this round: BS2Tick99.106186 ->99.106186; AOSS_Init_old96.49558 ->96.59344; UpdateThread94.46988 ->94.70427; VmStringReplace98.82576 ->100.0. Other open functions retain their measured baselines.
|
||||
Final data ownership audit: pools identical for all four units; AOSS/Update/Vm data100. Mach literals have identical bytes/offsets, while unresolved .data differences are jump-table relocations inside nonexact code and extracted trailing alignment. No eligible name-only object or proven extent correction found; no symbol/address/section total changed. Weak/inline duplicate objects left alone.
|
||||
Uncertainty: AOSS target tests saved r14 at0xa20 before any definition in this function. Defined source initialization remains; reproducing undefined input is forbidden. Complete-unit100% not claimed. All22 residual functions have3+ valid trials, with failed compilations/invalid prior substitutions excluded.
|
||||
Source checkpoint commits this round:85515018 (AOSS),c924d33e (Update),df894b4e (exact Replace). Changed paths:src/scene/setting/AOSS.c,src/BS2/BS2Update.c,src/channelScript/CHANSVm.c,tools/decomp-assist/big1.attempts.md. Final log-only commit follows; no source change after full gate. Untracked fz18.attempts.md pre-existed and is untouched.
|
||||
77
tools/decomp-assist/bs2-presence-lifetime-20261003.md
Normal file
77
tools/decomp-assist/bs2-presence-lifetime-20261003.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# BS2Tick disk-presence read lifetime, 2026-10-03
|
||||
|
||||
Base: `84d0c74f0ae814354a805907299bb7ff79243ece`, 43U only.
|
||||
The only source change is in `src/BS2/BS2Mach.c`, case 0 of `BS2Tick`.
|
||||
|
||||
## Source evidence
|
||||
|
||||
The original function begins at `0x8137D3B8`. Its case-zero initialization
|
||||
reads `BS2NoDisk` at `+0xC8`, stores `AudioBufferUnconfigured` at `+0xCC`,
|
||||
compares the captured disk flag at `+0xD0`, and clears `CoverBlock.state` at
|
||||
`+0xD4`. The baseline clears the cover state before reading the disk flag.
|
||||
The extracted object's relocations and all 29 instructions in this
|
||||
initialization slice agree with the original linked DOL.
|
||||
|
||||
Capture `BS2NoDisk` in the existing `s32 status` before the audio and cover
|
||||
resets, then test that captured value. `BS2NoDisk` is already declared
|
||||
`vBOOL`; `CoverBlock.state` is already volatile in this translation unit.
|
||||
Their distinct addresses are `0x816989E4` and `0x8108BF6C`. No qualifier,
|
||||
storage, callback, initialization, or shared-header change is needed.
|
||||
|
||||
The assigned status is genuinely consumed by the zero/nonzero branch.
|
||||
Case 0 always exits the switch, so it cannot carry this value into another
|
||||
case. All later status consumers have their own preceding assignment;
|
||||
the declaration and all their statements are unchanged. The function enters
|
||||
with interrupts disabled. This reconstructs the target's access order; it
|
||||
does not claim an observed runtime failure or asynchronous pointer replacement.
|
||||
|
||||
Historical lead: `big1.attempts.md:509` records the same disk-presence
|
||||
snapshot within an earlier compound candidate, with a partial improvement
|
||||
from 98.67783% to 98.77062% and no exact/code/data regression. That compound
|
||||
was not present in this baseline. Its larger 99.106186% score includes other
|
||||
changes and is not attributed to this isolated edit. No prior source artifact
|
||||
was imported; the target instructions independently support this change.
|
||||
|
||||
## Single measured trial
|
||||
|
||||
| Measure | Baseline | Candidate |
|
||||
| --- | ---: | ---: |
|
||||
| BS2Tick fuzzy | 98.639175% | 98.73196% |
|
||||
| BS2Tick instructions / original | 1937 / 1940 | 1937 / 1940 |
|
||||
| Unit fuzzy | 99.09658% | 99.138985% |
|
||||
| Exact functions | 25 / 29 | 25 / 29 |
|
||||
| Matched code bytes | 5112 / 16980 | 5112 / 16980 |
|
||||
| Matched data bytes | 155504 / 158528 | 155504 / 158528 |
|
||||
|
||||
The compiler changes eleven instructions, all between function offsets
|
||||
`+0x9C` and `+0xD4`. Three relocation positions move inside the slice;
|
||||
all 1461 relocation identities, their count, and every relocation elsewhere
|
||||
are preserved. All text outside BS2Tick and every allocated nontext byte
|
||||
remain identical. Each of the 25 exact functions remains instruction-exact.
|
||||
All other 1026 unit reports are unchanged.
|
||||
|
||||
## Validation
|
||||
|
||||
- A bounded interpreter executes the actual baseline, candidate, and original
|
||||
initialization slices for 10036 flag combinations, including signed/unsigned
|
||||
boundaries, both zero/nonzero classes, and deterministic 32-bit samples.
|
||||
It reaches every one of the 29 instructions in each slice. Final memory
|
||||
and next-state choices agree; candidate disk/audio/cover/state access order
|
||||
agrees with the original. A wrong signed test is detected.
|
||||
- The predicate is exactly word equality to zero, so its two equivalence
|
||||
classes cover the full 32-bit flag domain; this is not a claim of exhaustive
|
||||
execution of all 2^64 input pairs or the complete Wii runtime.
|
||||
- All 201 original direct-call targets agree with raw DOL addresses. Candidate
|
||||
and baseline call sites and destinations are unchanged, including callbacks.
|
||||
- `pool_diff.py`: 91/91 identical strings.
|
||||
- Literal audit: 97 arguments across 28 functions, no candidates/errors;
|
||||
BS2Tick remains the existing unequal-extent skip.
|
||||
- Full `all_source`, fresh report, and `build/43U/ok` pass.
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
- `git diff --check` passes. No linking/configuration or assembly changes.
|
||||
|
||||
Private local validation: `validation/bs2-presence-lifetime-20261003/check.py`
|
||||
and `check.json` under the shared workspace. Baseline/candidate objects,
|
||||
reports, and build/pool/literal/ctxdiff logs are retained in
|
||||
`/tmp/bs2-presence-lifetime/`. Original binary/instruction material is not
|
||||
included in this commit.
|
||||
96
tools/decomp-assist/bs2-update-publication-20261002.md
Normal file
96
tools/decomp-assist/bs2-update-publication-20261002.md
Normal file
@@ -0,0 +1,96 @@
|
||||
# BS2 update-thread publication recovery, 2026-10-02
|
||||
|
||||
Baseline b26e248b. Source-only candidate in src/BS2/BS2Update.c.
|
||||
The assignment's .cpp spelling was checked; this unit is C.
|
||||
|
||||
## Retained target-proven declarations
|
||||
|
||||
- EntriesCount: original UpdateThread object offsets 0xC2C/0xC30 store the
|
||||
selected count then immediately reload it, with no intervening call or store.
|
||||
The old source tests the still-live local count and omits that reload.
|
||||
Definition-level volatile restores the published global read.
|
||||
- State: target writes the failure state at 0x4F4 and 0xB4C before joining
|
||||
selection completion. The zero-selection exit writes State=5 again at 0xC44.
|
||||
The old source loses the first two store sequences because MWCC sees a later
|
||||
overwrite without an intervening function call. Definition-level volatile
|
||||
restores both observable failure-state publications. State is also exposed
|
||||
through BS2UpdateState for polling by the boot state machine.
|
||||
|
||||
These are real existing state objects. No use-site qualifier casts, added
|
||||
storage, fabricated barriers, assembly, metadata, or linking changes.
|
||||
|
||||
## Measurements
|
||||
|
||||
| Source form | UpdateThread fuzzy | Instructions |
|
||||
| --- | ---: | ---: |
|
||||
| Baseline | 93.59803% | 904/913 |
|
||||
| EntriesCount publication reread | 93.90471% | 905/913 |
|
||||
| Also preserve State publications | 94.5575% | 909/913 |
|
||||
|
||||
Unit fuzzy improves 94.23001% -> 95.094765%. Exact code remains 400/4052,
|
||||
exact functions 9/10, data 10488/10488. This is partial source reconstruction,
|
||||
not an exact function or linking candidate.
|
||||
|
||||
Rejected independent source-structure experiments, based on the count-reread
|
||||
candidate: explicit selected-entry byte progression (93.73275%, 905/913),
|
||||
seatholder byte progression (93.47755%, 905/913), and separate disc-base
|
||||
expressions in error logging (93.56955%, 905/913). All were restored. The
|
||||
remaining four missing target instructions are a repeated entry.type read and
|
||||
three address-materialization differences. Register allocation and scheduling
|
||||
also differ. The type declaration requires separate shared-header review.
|
||||
|
||||
## Fresh verification
|
||||
|
||||
- Configured only 43U with ../toolchain/wibo-build/wibo
|
||||
- WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja all_source build/43U/report.json build/43U/ok
|
||||
- Pool: 55/55 identical
|
||||
- Exact-name report and fresh ctxdiff preserve all nine exact functions
|
||||
- Literal audit: 5 arguments across 9 exact functions, no skips/candidates/errors
|
||||
- Every other unit's complete report unchanged; no per-function regression
|
||||
- All four data sections still report 100%
|
||||
- git diff --check passes
|
||||
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
|
||||
GATE: source-only nonregression/build/pool/DOL checks pass. Awaiting independent
|
||||
parent review; no complete decompilation, matching, or linking claim.
|
||||
|
||||
## Separate shared entry-type declaration
|
||||
|
||||
Parent authorized a separate experiment on the actual shared type declaration,
|
||||
without a translation-unit-specific qualifier. Changed BS2UpdateEntry.type to
|
||||
vu32 in include/BS2/BS2Update.h for every consumer.
|
||||
|
||||
Original UpdateThread offsets 0xCE8 and 0xD00 read the same entry.type field.
|
||||
Between them are only the type-zero branch and its skipped increment/continue
|
||||
path: the nonzero path has no call or write that could require a normal reload.
|
||||
The shared declaration restores that second observable read. No new guard or
|
||||
use-site qualifier cast was introduced.
|
||||
|
||||
- UpdateThread: 94.5575% -> 94.66265%, 909 -> 910/913 instructions
|
||||
- Overall from initial baseline: 93.59803% -> 94.66265%, 904 -> 910/913
|
||||
- Unit fuzzy: 94.23001% -> 95.18954%
|
||||
- Exact functions remain 9/10 and code remains 400/4052
|
||||
- Data remains 10488/10488, with every allocated non-text byte unchanged
|
||||
|
||||
All generated source objects were deleted and rebuilt with the configured 43U
|
||||
all_source/report/ok targets. The prior cache had 1028 objects, including an
|
||||
obsolete keyboard/tiManager.o absent from build.ninja, objdiff.json, and
|
||||
configure.py. The current build graph cleanly rebuilt all 1027 configured
|
||||
objects. Hash comparison of those objects against the source-only checkpoint
|
||||
found only BS2Update.o changed. All 1026 other unit reports are identical.
|
||||
This includes every shared-header consumer; none needed source adjustment.
|
||||
|
||||
Fresh final pool: 55/55 identical. Literal audit: 5 arguments across 9 exact
|
||||
functions, no skips/candidates/errors. Fresh ctxdiff preserves all 9 exact
|
||||
functions. DOL SHA1 remains 26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes.
|
||||
|
||||
The final three missing target instructions are address materializations:
|
||||
seatholder table construction uses separate load/add in the target, and both
|
||||
error-log calls materialize their own disc-table base. These are not omitted
|
||||
source operations; register and scheduling differences remain as well. No
|
||||
register sweep or artificial materialization was retained.
|
||||
|
||||
GATE: clean all-source build, cross-unit/object nonregression, complete data,
|
||||
pool, exact-function preservation, and DOL checks pass. Leaf frozen for
|
||||
independent parent review. Both commits are partial reconstruction gains.
|
||||
103
tools/decomp-assist/call_target_diff.md
Normal file
103
tools/decomp-assist/call_target_diff.md
Normal file
@@ -0,0 +1,103 @@
|
||||
# Direct-call destination advisory
|
||||
|
||||
`call_target_diff.py` checks the callees of functions reported as objdiff100.
|
||||
A 100% instruction score can still conceal a different relocation target. This
|
||||
tool compares resolved destination addresses with branches decoded independently
|
||||
from the original 43U DOL. It does not change source, build outputs, configuration,
|
||||
CI, or the completion policy.
|
||||
|
||||
Requires Python and pyelftools, as do the neighboring ELF tools. Run from the
|
||||
repository root after preparing the normal 43U objects and report:
|
||||
|
||||
```sh
|
||||
python tools/decomp-assist/call_target_diff.py --output /tmp/call-targets.json
|
||||
python tools/decomp-assist/call_target_diff.py src/scene/setting/iplSetting
|
||||
python tools/decomp-assist/call_target_diff.py UNIT --function EXACT_SYMBOL
|
||||
python -m unittest discover -s tools/decomp-assist -p test_call_target_diff.py
|
||||
```
|
||||
|
||||
With no unit arguments, it scans the report. Unit names omit the `main/` prefix
|
||||
and `.o` suffix. `--function` requires exactly one unit and still requires that
|
||||
function to be reported100. JSON goes to stdout unless `--output` is supplied.
|
||||
The output path cannot overwrite an input.
|
||||
|
||||
`--root` selects another prepared repository. `--report` and `--dol` override
|
||||
input paths; otherwise they are `ROOT/build/43U/report.json` and
|
||||
`ROOT/orig/43U/00000008.app`. Relative overrides are relative to the current
|
||||
working directory. The DOL must match the known 43U SHA1 by default; `--dol-sha1`
|
||||
accepts an explicitly verified alternative hash, including authored test inputs.
|
||||
The configuration remains 43U.
|
||||
|
||||
## What it checks
|
||||
|
||||
Only exact-name functions with equal source/reference extents and
|
||||
`fuzzy_match_percent == 100` are compared. Missing/ambiguous functions and
|
||||
unequal extents are reported as skips. Direct unconditional PPC `bl` instructions
|
||||
are decoded whether they have explicit `R_PPC_REL24`/`R_PPC_ADDR24` relocations or
|
||||
already contain resolved branch displacements. Signed relative and absolute
|
||||
encodings are supported.
|
||||
|
||||
Section-relative relocation targets and raw local branches resolve through
|
||||
actual function extents. Aliases sharing one function start are retained;
|
||||
overlapping distinct function starts remain unresolved. A matching reference
|
||||
symbol or an unambiguous configured address maps the source callee into the
|
||||
original address space. The original DOL supplies the reference call destination,
|
||||
and reference-object disagreement is an input error. Symbol spelling alone is
|
||||
not accepted as proof that two distinct callees are equivalent.
|
||||
|
||||
Rows classify:
|
||||
|
||||
- `different_destination`: source resolves to a different original address
|
||||
- `unresolved_destination`: source has no unique original-address mapping
|
||||
- `same_address_alias`: different names resolve to the same original address
|
||||
- `call_shape_difference`: only one object has a direct call at that offset
|
||||
|
||||
Rows are candidates for inspection, not automatic bug reports. Different
|
||||
constructor addresses can have identical bodies; a generated assignment or
|
||||
anonymous wrapper can implement the same operation under another name. Optional
|
||||
`alias_hint` evidence identifies identical original leaf bodies or a local
|
||||
relocation-free body identical to the original callee. Hints require compatible
|
||||
extents, equal bytes, and conservative branch checks; they do not suppress rows
|
||||
or establish general semantic equivalence. Helpers containing relocations may
|
||||
remain unresolved even when manual review can establish equivalence. No symbol
|
||||
name, constructor prefix, or wrapper prefix is silently excluded.
|
||||
|
||||
An unresolved symbol is not necessarily a missing implementation: it may be a
|
||||
renamed helper, external symbol, or ambiguous map entry. Check source definitions,
|
||||
linker aliases, receiver types, and the actual callee before proposing a fix.
|
||||
|
||||
## Provenance and exits
|
||||
|
||||
JSON includes both observed Git heads, the original-DOL SHA1, and SHA-256 hashes
|
||||
of the exact report, symbol/split maps, object files, tool, and shared ELF helper
|
||||
read by the scan. Inputs are fingerprinted again at the end. A changed head or
|
||||
input produces an error rather than a clean result. No binary or assembly bytes
|
||||
are written into the report.
|
||||
|
||||
These fingerprints identify what was inspected. They do not prove that cached
|
||||
objects were rebuilt from the stated source commit or that the report is fresh.
|
||||
For a serious candidate, preserve its inputs and independently rebuild/verify
|
||||
that specific commit before changing source.
|
||||
|
||||
Exit statuses are advisory:
|
||||
|
||||
- 0: no review rows, skips, or input errors in the selected scope
|
||||
- 1: rows or skipped functions require review
|
||||
- 2: invalid, missing, inconsistent, or changing input
|
||||
|
||||
An empty or entirely nonexact selection can check zero calls. Always inspect the
|
||||
counts. A clean result does not establish completion, whole-program equivalence,
|
||||
or correct callee bodies. Indirect calls, tail calls, conditional branch-and-link,
|
||||
nonexact callers, and unequal extents are outside this pass. Runtime behavior,
|
||||
callback effects, and floating-point evaluation order still require focused
|
||||
review.
|
||||
|
||||
## Tests
|
||||
|
||||
Tests build small ELF32/PPC objects and DOL containers from authored instruction
|
||||
words and metadata in temporary directories. They cover an incorrect relocation
|
||||
destination despite identical instruction bytes, raw local branches, shifted
|
||||
function locations, interior targets, address/constructor/wrapper aliases,
|
||||
undefined destinations, malformed references, original-DOL disagreement,
|
||||
selection skips, input changes, and JSON exit behavior. No original executable
|
||||
bytes or assembly are embedded in the tool, documentation, or tests.
|
||||
383
tools/decomp-assist/call_target_diff.py
Normal file
383
tools/decomp-assist/call_target_diff.py
Normal file
@@ -0,0 +1,383 @@
|
||||
"""Advisory direct-call destination audit for objdiff100, equal-size functions.
|
||||
|
||||
Run from the repository root: python tools/decomp-assist/call_target_diff.py [unit ...]
|
||||
Checks REL24/ADDR24 relocations and raw PPC direct BL against the original DOL.
|
||||
Exit 0: no review rows or skips; 1: review needed; 2: invalid/changing input.
|
||||
This is not a completion gate or a proof of callee behavior. See call_target_diff.md.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from collections import Counter, defaultdict
|
||||
from dataclasses import dataclass
|
||||
import hashlib
|
||||
import io
|
||||
import json
|
||||
from pathlib import Path
|
||||
import re
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from elftools.common.exceptions import ELFError
|
||||
from elftools.elf.elffile import ELFFile
|
||||
|
||||
import jump_table_diff as elf
|
||||
|
||||
DOL_SHA1 = "26116613f624061ba99c8d1a299aaa6efa85670d"
|
||||
|
||||
|
||||
def signed(value, bits):
|
||||
return value - (1 << bits) if value & (1 << (bits - 1)) else value
|
||||
|
||||
|
||||
def branch_target(word, address):
|
||||
"""Return a PPC I-form direct BL destination, or None for other instructions."""
|
||||
if word >> 26 != 18 or not word & 1:
|
||||
return None
|
||||
displacement = signed(word & 0x03FFFFFC, 26)
|
||||
return (displacement if word & 2 else address + displacement) & 0xFFFFFFFF
|
||||
|
||||
|
||||
class Inputs:
|
||||
"""Fingerprint exact bytes read; detect changes before presenting a result."""
|
||||
|
||||
def __init__(self):
|
||||
self.hashes = {}
|
||||
|
||||
def read(self, path):
|
||||
path = Path(path)
|
||||
raw = path.read_bytes()
|
||||
digest = hashlib.sha256(raw).hexdigest()
|
||||
previous = self.hashes.setdefault(str(path), digest)
|
||||
if previous != digest:
|
||||
raise ValueError("input changed while reading: " + str(path))
|
||||
return raw
|
||||
|
||||
def changed(self):
|
||||
return [path for path, digest in self.hashes.items()
|
||||
if not Path(path).is_file()
|
||||
or hashlib.sha256(Path(path).read_bytes()).hexdigest() != digest]
|
||||
|
||||
|
||||
@dataclass
|
||||
class CallObject:
|
||||
info: elf.ObjectInfo
|
||||
data: dict
|
||||
|
||||
def function(self, name):
|
||||
symbol = self.info.symbol(name)
|
||||
if symbol.kind != "STT_FUNC" or symbol.value % 4 or symbol.size % 4:
|
||||
raise ValueError("expected an aligned function: " + name)
|
||||
return symbol
|
||||
|
||||
def location(self, section, offset, mechanism):
|
||||
functions = [s for s in self.info.symbols if s.section == section
|
||||
and s.kind == "STT_FUNC" and s.value <= offset < s.value + s.size]
|
||||
# Multiple names at one start are aliases; overlapping starts are ambiguous.
|
||||
starts = {s.value for s in functions}
|
||||
start = next(iter(starts)) if len(starts) == 1 else None
|
||||
names = sorted({s.name for s in functions}) if start is not None else []
|
||||
return {"mechanism": mechanism, "names": names,
|
||||
"addend": offset - start if start is not None else 0,
|
||||
"section": self.info.sections[section][0], "offset": offset}
|
||||
|
||||
def call(self, function, offset):
|
||||
at = function.value + offset
|
||||
word = int.from_bytes(self.data[function.section][at:at + 4], "big")
|
||||
raw_target = branch_target(word, at)
|
||||
if raw_target is None:
|
||||
return None
|
||||
relocation = self.info.relocs(function.section).get(at)
|
||||
if relocation is not None:
|
||||
expected = 2 if word & 2 else 10 # R_PPC_ADDR24 / R_PPC_REL24
|
||||
if relocation.kind != expected:
|
||||
raise ValueError("direct BL has an unsupported relocation kind")
|
||||
location = self.info.location(relocation)
|
||||
if location is not None:
|
||||
section, value = location
|
||||
if section not in self.data or value % 4 or not 0 <= value < len(self.data[section]):
|
||||
raise ValueError("call relocation is outside an allocated section")
|
||||
return self.location(section, value, "relocation")
|
||||
symbol = self.info.symbols[relocation.symbol]
|
||||
return {"mechanism": "relocation", "names": [symbol.name],
|
||||
"addend": relocation.addend}
|
||||
if word & 2:
|
||||
return {"mechanism": "raw_absolute", "names": [], "addend": 0,
|
||||
"address": raw_target}
|
||||
return self.location(function.section, raw_target, "raw_relative")
|
||||
|
||||
|
||||
def read_object(path, inputs):
|
||||
raw = inputs.read(path)
|
||||
info = elf.read_object(path)
|
||||
inputs.read(path) # Shared ELF helper reads the path; reject a concurrent change.
|
||||
parsed = ELFFile(io.BytesIO(raw))
|
||||
data = {i: section.data() for i, section in enumerate(parsed.iter_sections())
|
||||
if section["sh_type"] == "SHT_PROGBITS" and section["sh_flags"] & 2}
|
||||
return CallObject(info, data)
|
||||
|
||||
|
||||
class Dol:
|
||||
def __init__(self, raw, expected_sha1):
|
||||
self.sha1 = hashlib.sha1(raw).hexdigest()
|
||||
if self.sha1 != expected_sha1:
|
||||
raise ValueError("original DOL SHA1 does not match --dol-sha1")
|
||||
if len(raw) < 256:
|
||||
raise ValueError("truncated DOL header")
|
||||
self.raw = raw
|
||||
header = struct.unpack(">64I", raw[:256])
|
||||
self.spans = []
|
||||
for index in range(18):
|
||||
offset, address, size = header[index], header[18 + index], header[36 + index]
|
||||
if size:
|
||||
if offset < 256 or offset + size > len(raw) or address + size > 0x100000000:
|
||||
raise ValueError("DOL section is outside its file/address space")
|
||||
if any(max(address, a) < min(address + size, a + n) for a, n, _ in self.spans):
|
||||
raise ValueError("overlapping DOL address sections")
|
||||
self.spans.append((address, size, offset))
|
||||
|
||||
def read(self, address, size):
|
||||
matches = [self.raw[offset + address - start:offset + address - start + size]
|
||||
for start, length, offset in self.spans
|
||||
if start <= address and address + size <= start + length]
|
||||
if size <= 0 or len(matches) != 1:
|
||||
raise ValueError("address is not in one DOL section: 0x%X" % address)
|
||||
return matches[0]
|
||||
|
||||
def call(self, address):
|
||||
return branch_target(int.from_bytes(self.read(address, 4), "big"), address)
|
||||
|
||||
|
||||
def read_maps(symbol_text, split_text):
|
||||
names, sizes, splits = defaultdict(set), defaultdict(set), {}
|
||||
for line in symbol_text.splitlines():
|
||||
match = re.match(r"(.*?) = (\S+):0x([0-9a-fA-F]+);(.*)", line)
|
||||
if not match or not re.search(r"type:(function|label)\b", match[4]):
|
||||
continue
|
||||
address = int(match[3], 16)
|
||||
names[match[1]].add(address)
|
||||
size = re.search(r"size:(0x[0-9a-fA-F]+|\d+)\b", match[4])
|
||||
if "type:function" in match[4] and size:
|
||||
sizes[address].add(int(size[1], 0))
|
||||
unit = None
|
||||
for line in split_text.splitlines():
|
||||
if line and not line[0].isspace() and line.endswith(":") and line != "Sections:":
|
||||
unit = line[:-1]
|
||||
splits[unit] = {}
|
||||
match = re.match(r"\s+(\S+)\s+start:0x([0-9a-fA-F]+)", line)
|
||||
if match and unit:
|
||||
splits[unit][match[1]] = int(match[2], 16)
|
||||
return names, sizes, splits
|
||||
|
||||
|
||||
def addresses(destination, reference, bases, names):
|
||||
if destination is None:
|
||||
return set()
|
||||
if "address" in destination:
|
||||
return {destination["address"]}
|
||||
result = set()
|
||||
for name in destination["names"]:
|
||||
local = [s for s in reference.info.symbols if s.name == name
|
||||
and s.kind == "STT_FUNC" and isinstance(s.section, int)]
|
||||
if local:
|
||||
for symbol in local:
|
||||
section = reference.info.sections[symbol.section][0]
|
||||
if section in bases:
|
||||
result.add(bases[section] + symbol.value + destination["addend"])
|
||||
elif len(names.get(name, ())) == 1:
|
||||
result.update(address + destination["addend"] for address in names[name])
|
||||
return result
|
||||
|
||||
|
||||
def position_independent_leaf(raw):
|
||||
"""Conservative filter for body-alias hints, never an equivalence proof."""
|
||||
for offset in range(0, len(raw), 4):
|
||||
word = int.from_bytes(raw[offset:offset + 4], "big")
|
||||
op = word >> 26
|
||||
branch_op = (word >> 1) & 1023
|
||||
if op == 19 and branch_op in (16, 528) and (word & 1 or branch_op == 528):
|
||||
return False # Indirect call or tail transfer.
|
||||
if op in (16, 18):
|
||||
displacement = signed(word & (0x03FFFFFC if op == 18 else 0xFFFC),
|
||||
26 if op == 18 else 16)
|
||||
if word & 3 or not 0 <= offset + displacement < len(raw):
|
||||
return False # Link/absolute branches or transfers outside the body.
|
||||
return bool(raw) and len(raw) % 4 == 0
|
||||
|
||||
|
||||
def alias_hint(source, destination, source_addresses, target_address, dol, sizes):
|
||||
if destination is None or target_address is None or len(sizes.get(target_address, ())) != 1:
|
||||
return None
|
||||
size = next(iter(sizes[target_address]))
|
||||
target_body = dol.read(target_address, size)
|
||||
if not position_independent_leaf(target_body):
|
||||
return None
|
||||
# Different known addresses can share a retail body (e.g. folded constructors).
|
||||
if len(source_addresses) == 1:
|
||||
address = next(iter(source_addresses))
|
||||
if sizes.get(address) == {size} and dol.read(address, size) == target_body:
|
||||
return "identical_original_leaf_bodies; current callee implementation not proved"
|
||||
# Renamed local helpers need no guessed symbol pairing or name allowlist.
|
||||
for name in destination["names"]:
|
||||
try:
|
||||
function = source.function(name)
|
||||
except ValueError:
|
||||
continue
|
||||
if destination["addend"] or function.size != size:
|
||||
continue
|
||||
relocations = source.info.relocs(function.section)
|
||||
if any(function.value <= at < function.value + size for at in relocations):
|
||||
continue
|
||||
body = source.data[function.section][function.value:function.value + size]
|
||||
if body == target_body:
|
||||
return "identical_relocation_free_local_body; alias requires review"
|
||||
return None
|
||||
|
||||
|
||||
def compare_function(source, reference, name, bases, names, sizes, dol):
|
||||
src, ref = source.function(name), reference.function(name)
|
||||
if src.size != ref.size:
|
||||
raise ValueError("function extents differ")
|
||||
section = reference.info.sections[ref.section][0]
|
||||
if section not in bases:
|
||||
raise ValueError("no original section base for " + section)
|
||||
caller = bases[section] + ref.value
|
||||
counts, rows = Counter(), []
|
||||
for offset in range(0, ref.size, 4):
|
||||
left, right = source.call(src, offset), reference.call(ref, offset)
|
||||
expected = dol.call(caller + offset)
|
||||
if left is None and right is None and expected is None:
|
||||
continue
|
||||
counts["calls"] += 1
|
||||
for prefix, destination in (("source_", left), ("reference_", right)):
|
||||
if destination:
|
||||
counts[prefix + destination["mechanism"]] += 1
|
||||
actual = addresses(left, reference, bases, names)
|
||||
target = addresses(right, reference, bases, names)
|
||||
if right and right.get("section") in bases:
|
||||
target = {bases[right["section"]] + right["offset"]}
|
||||
if bool(right) != (expected is not None) or (target and target != {expected}):
|
||||
raise ValueError("reference ELF/DOL disagreement at +0x%X" % offset)
|
||||
if left and right and expected is not None and actual == {expected}:
|
||||
counts["same_destination"] += 1
|
||||
if set(left["names"]) == set(right["names"]):
|
||||
continue
|
||||
classification = "same_address_alias"
|
||||
elif not left or not right:
|
||||
classification = "call_shape_difference"
|
||||
elif len(actual) != 1:
|
||||
classification = "unresolved_destination"
|
||||
else:
|
||||
classification = "different_destination"
|
||||
hint = alias_hint(source, left, actual, expected, dol, sizes)
|
||||
rows.append({"function": name, "offset": offset, "caller_address": caller,
|
||||
"classification": classification, "source": left, "reference": right,
|
||||
"source_addresses": sorted(actual), "reference_addresses": sorted(target),
|
||||
"dol_destination": expected, "alias_hint": hint})
|
||||
counts[classification] += 1
|
||||
return counts, rows
|
||||
|
||||
|
||||
def git_head(root):
|
||||
result = subprocess.run(["git", "-C", str(root), "rev-parse", "HEAD"],
|
||||
capture_output=True, text=True)
|
||||
return result.stdout.strip() if result.returncode == 0 else None
|
||||
|
||||
|
||||
def audit(root, report_path, dol_path, expected_sha1, units=(), function=None):
|
||||
inputs = Inputs()
|
||||
inputs.read(Path(__file__))
|
||||
inputs.read(Path(elf.__file__))
|
||||
before = git_head(root)
|
||||
report = json.loads(inputs.read(report_path))
|
||||
names, sizes, splits = read_maps(
|
||||
inputs.read(root / "config/43U/symbols.txt").decode(),
|
||||
inputs.read(root / "config/43U/splits.txt").decode())
|
||||
dol = Dol(inputs.read(dol_path), expected_sha1)
|
||||
counts, rows, skipped, errors = Counter(), [], [], []
|
||||
selected = set(units)
|
||||
found = set()
|
||||
for unit in report["units"]:
|
||||
key = unit["name"].removeprefix("main/")
|
||||
if selected and key not in selected:
|
||||
continue
|
||||
found.add(key)
|
||||
functions = [f for f in unit.get("functions", [])
|
||||
if f.get("fuzzy_match_percent") == 100
|
||||
and (function is None or function == f["name"])]
|
||||
if not functions:
|
||||
if function:
|
||||
skipped.append({"unit": key, "function": function,
|
||||
"reason": "function absent or not objdiff100"})
|
||||
continue
|
||||
try:
|
||||
source = read_object(root / "build/43U/src" / (key + ".o"), inputs)
|
||||
reference = read_object(root / "build/43U/obj" / (key + ".o"), inputs)
|
||||
except (OSError, ValueError, ELFError) as error:
|
||||
errors.append({"unit": key, "reason": str(error)})
|
||||
continue
|
||||
bases = splits.get(unit.get("metadata", {}).get("source_path"), {})
|
||||
counts["units"] += 1
|
||||
for entry in functions:
|
||||
try:
|
||||
src, ref = source.function(entry["name"]), reference.function(entry["name"])
|
||||
if src.size != ref.size:
|
||||
raise ValueError("function extents differ")
|
||||
except ValueError as error:
|
||||
skipped.append({"unit": key, "function": entry["name"], "reason": str(error)})
|
||||
continue
|
||||
try:
|
||||
measured, result = compare_function(source, reference, entry["name"],
|
||||
bases, names, sizes, dol)
|
||||
except (ValueError, KeyError) as error:
|
||||
errors.append({"unit": key, "function": entry["name"], "reason": str(error)})
|
||||
continue
|
||||
counts.update(measured)
|
||||
counts["functions"] += 1
|
||||
rows.extend(dict(row, unit=key) for row in result)
|
||||
for missing in sorted(selected - found):
|
||||
errors.append({"unit": missing, "reason": "unit absent from report"})
|
||||
after = git_head(root)
|
||||
changed = inputs.changed()
|
||||
if before != after or changed:
|
||||
errors.append({"reason": "inputs changed during audit", "paths": changed})
|
||||
result = {"advisory": True, "counts": dict(counts), "rows": rows,
|
||||
"skipped_functions": skipped, "errors": errors,
|
||||
"provenance": {"head_before": before, "head_after": after,
|
||||
"dol_sha1": dol.sha1, "sha256": inputs.hashes},
|
||||
"limits": "Direct BL, objdiff100 and equal extents only. Alias hints require review; "
|
||||
"no callee-behavior, build-freshness or completion proof."}
|
||||
return result, 2 if errors else 1 if rows or skipped else 0
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("units", nargs="*")
|
||||
parser.add_argument("--root", type=Path, default=Path("."))
|
||||
parser.add_argument("--report", type=Path, help="default: ROOT/build/43U/report.json")
|
||||
parser.add_argument("--dol", type=Path, help="default: ROOT/orig/43U/00000008.app")
|
||||
parser.add_argument("--dol-sha1", default=DOL_SHA1)
|
||||
parser.add_argument("--function", help="one exact-name objdiff100 function; requires one unit")
|
||||
parser.add_argument("--output", type=Path, help="write JSON here instead of stdout")
|
||||
args = parser.parse_args(argv)
|
||||
if args.function and len(args.units) != 1:
|
||||
parser.error("--function requires exactly one unit")
|
||||
try:
|
||||
result, status = audit(args.root, args.report or args.root / "build/43U/report.json",
|
||||
args.dol or args.root / "orig/43U/00000008.app",
|
||||
args.dol_sha1, args.units, args.function)
|
||||
output = json.dumps(result, indent=2) + "\n"
|
||||
if args.output:
|
||||
if args.output.resolve() in {Path(p).resolve() for p in result["provenance"]["sha256"]}:
|
||||
raise ValueError("output must not overwrite an audit input")
|
||||
args.output.write_text(output)
|
||||
else:
|
||||
print(output, end="")
|
||||
return status
|
||||
except (OSError, ValueError, KeyError, ELFError) as error:
|
||||
print("ERROR: " + str(error), file=sys.stderr)
|
||||
return 2
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
77
tools/decomp-assist/card-icon-reconstruction-attempts.md
Normal file
77
tools/decomp-assist/card-icon-reconstruction-attempts.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# Card icon and move/copy reconstruction
|
||||
|
||||
Base: `13881c99`; branch `agent/bittle/card-icon-reconstruction`.
|
||||
Owned source: `src/scene/cardSequence/iplCardSequence.cpp` only.
|
||||
No headers, linking configuration, assembly, forced registers, volatile casts,
|
||||
undefined values, or dummy storage were introduced.
|
||||
|
||||
## Retained: reset the temporary name on every move rename attempt
|
||||
|
||||
The target's rename-collision loop returns to the filename clearing call before
|
||||
formatting the next temporary name. The reconstruction returned directly to the
|
||||
formatting call, clearing the filename only on the first attempt.
|
||||
|
||||
Moved the existing filename `memset` into the `do` loop. This changes exactly one
|
||||
compiled branch instruction word; every other allocated byte in the object is
|
||||
unchanged from the baseline. It restores the target's per-attempt reset boundary.
|
||||
It is not a claim that ordinary fixed-width temporary names previously produced
|
||||
incorrect filenames; the SDK status routine also normalizes trailing name bytes.
|
||||
|
||||
- `runCardMoveOrCopy`: 97.804276 -> 97.8125 fuzzy
|
||||
- Instructions: 608/608; ctxdiff differences: 186 -> 185
|
||||
- Unit fuzzy: 97.198944 -> 97.20097
|
||||
- Exact functions remain 27/30; matched code remains 4168/9852 bytes
|
||||
- All 30 function scores preserved or improved
|
||||
- All 27 exact functions checked individually: objdiff 100, ctxdiff zero
|
||||
- Data remains 1496/1496 bytes exact
|
||||
|
||||
## Validation
|
||||
|
||||
- Full 43U build: PASS
|
||||
- Pool before and after: identical, 43 strings
|
||||
- Literal-reference advisory: 45 arguments in 29 functions; no candidates or
|
||||
errors. The unequal-sized icon loader was skipped; it was not changed
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- Base-relative `git diff --check 13881c99`: PASS
|
||||
|
||||
A focused compiled-PPC loop audit passed 192 cases covering both slots, file
|
||||
numbers 0/63/126, collision counts 0/1/2/7/63/126/127/128, and final results
|
||||
0/-3/-7/-10. Candidate instruction execution produced the target's memory state
|
||||
and call trace in every case. The baseline omitted the repeated clear in 174
|
||||
cases. `memset`, `sprintf`, and status results were modeled, so this is bounded
|
||||
loop evidence, not execution of the complete copy/move operation or Wii runtime.
|
||||
|
||||
## Icon-loader audit and deferred boundary
|
||||
|
||||
The loader was inspected against the target and tested with a bounded integer
|
||||
PPC interpreter using modeled CARD, memory-copy and cache-store calls.
|
||||
|
||||
- 841 valid-format, bounds and error cases agreed on return values, modeled
|
||||
call traces and non-stack memory, including guard regions
|
||||
- Both slots and file-table endpoints, banner modes, icon formats 0/1/2,
|
||||
animation speeds, sector errors, image/comment read failures, close failures,
|
||||
and offset boundaries were exercised
|
||||
- Valid-case instruction coverage was 506/508 source and 511/512 target; this is
|
||||
instruction-address coverage, not exhaustive inputs or paths
|
||||
- All interpreted calls checked SP, LR and nonvolatile GPR restoration
|
||||
|
||||
Six reserved-format examples exposed a separate difference: after a preceding
|
||||
valid icon, format 3 retains the preceding icon's byte size in the target, while
|
||||
the current source resets it to zero. This affects later offsets and modeled
|
||||
image-read lengths. Format 3 is not among the SDK's supported icon formats.
|
||||
When the first icon has format 3, the target has no uniquely established initial
|
||||
size; that unspecified boundary must not be reconstructed with an invented
|
||||
initial value or an uninitialized C local.
|
||||
|
||||
An explicitly initialized carry trial agreed with the six later-format-3 cases
|
||||
and all 841 earlier cases, but reduced loader fuzzy from 90.34375 to 90.14844.
|
||||
It was restored. Its patch and bounded evidence are preserved privately for
|
||||
possible later review. The retained source does not claim to correct this
|
||||
reserved-input boundary or to establish general runtime correctness.
|
||||
|
||||
## Existing external branch
|
||||
|
||||
Read-only inspection of the already fetched `origin/agent/w1008/card2` at
|
||||
`14b921b3` found a restructuring of the image-read success/error join. It has the
|
||||
same effective error propagation as the current source. It was not copied,
|
||||
merged, or used as a replacement implementation; no remote action was taken.
|
||||
69
tools/decomp-assist/card-permission-lifetime-20261003.md
Normal file
69
tools/decomp-assist/card-permission-lifetime-20261003.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Card move/copy permission result lifetime
|
||||
|
||||
Base: `57ccda3883537a308568c03924af2cebf2d8a789`.
|
||||
Owned source: `src/scene/cardSequence/iplCardSequence.cpp` only.
|
||||
|
||||
## Retained reconstruction
|
||||
|
||||
Give the permission-check stage of `runCardMoveOrCopy` its own initialized
|
||||
`permissionResult`, scoped around the existing status query, command permission
|
||||
checks and error gate. The later transfer result remains separate. There is no
|
||||
copy back, added operation, dummy local or initializer-order search.
|
||||
|
||||
Original `runCardMoveOrCopy` begins at `0x813D3D14`. Its permission stage
|
||||
`+0xC8..+0x148` initializes r16 to zero at `+0xD4`, sets -10 for denied copy/move
|
||||
permissions, or takes `CARDGetResultCode` after a failed status query. The error
|
||||
report consumes that value at `+0x140/+0x144`, and failure branches to the final
|
||||
return. Success reaches a new status query at `+0x158`; the old permission value
|
||||
is dead, and r16 is reused for `createSize` at `+0x170`.
|
||||
|
||||
The current source previously reused `result` across the permission and transfer
|
||||
stages. Narrowing the permission result follows the original lifetime without
|
||||
changing control or output ownership: failed permission goes to `finish`, whose
|
||||
only operation is return; successful permission is followed by a new assignment
|
||||
to `result` from `__CARDGetStatusEx`. No cleanup path reads the scoped value.
|
||||
|
||||
This recovers a natural partial previously restored under exact-only acceptance.
|
||||
`gk3.attempts.md` lines 108/240 recorded 185 -> 176 instruction differences,
|
||||
identical pool and no exact regressions, but no isolated fuzzy score. The older
|
||||
`iplCardSequence.attempts.md` also restored this result scope for its focused
|
||||
exact-function diff. The fresh score below was measured directly.
|
||||
|
||||
## Results
|
||||
|
||||
- `runCardMoveOrCopy`: 97.8125% -> 97.88651%
|
||||
- Instructions: unchanged 608/608; ctxdiff differences: 185 -> 176
|
||||
- Unit fuzzy: 97.20097% -> 97.219246%
|
||||
- Exact functions: unchanged 27/30; matched code: unchanged 4168/9852 bytes
|
||||
- All 27 exact functions individually checked: zero ctxdiff differences
|
||||
- Matched data: unchanged 1496/1496 bytes
|
||||
- All allocated non-text bytes, sizes and alignments unchanged
|
||||
- Every other unit's complete report unchanged; no function regression across
|
||||
the 1027-unit report
|
||||
- Pool: 43/43 identical before and after
|
||||
- Literal audit: 45 arguments across 29 functions; no candidates/errors. The
|
||||
unchanged unequal-extent icon loader is the only skip
|
||||
- Full 43U all_source/report/DOL gates: pass
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- `git diff --check`: pass
|
||||
|
||||
## Focused original-machine validation
|
||||
|
||||
A bounded integer-PPC interpreter executes the actual baseline, candidate and
|
||||
original instruction prefixes. It models the CARD calls and records fixed-ABI
|
||||
arguments and error reports through either permission failure return or the next
|
||||
status query beginning transfer. No arbitrary register renaming is assumed.
|
||||
|
||||
All 17,328 cases agree, including both slots, file numbers 0/63/126, all 256
|
||||
permission bytes, copy/move/other command values and signed boundaries, negative
|
||||
status results, and negative/nonnegative `CARDGetResultCode` results. In
|
||||
particular, the retail continuation when that latter result is nonnegative is
|
||||
preserved. Outcomes: 12,912 transfer entries and 4,416 early returns. Each version
|
||||
covers 79 prefix instructions, and early returns preserve SP and nonvolatile
|
||||
GPRs. An in-memory wrong-permission-mask mutation is detected.
|
||||
|
||||
The whole original function's 513 nonrelocated instruction words and all 79
|
||||
call destinations agree with raw DOL bytes. Baseline, candidate and original
|
||||
retain the same ordered call identities. This is bounded permission-stage
|
||||
proof, not a full copy/move or Wii runtime test. The function remains nonexact;
|
||||
no linking or full decompilation claim is made.
|
||||
74
tools/decomp-assist/card-thread-entry-contract-20261003.md
Normal file
74
tools/decomp-assist/card-thread-entry-contract-20261003.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# Card thread entry contract
|
||||
|
||||
Base: `be7ded2fdc4ebba0b87695a132905e38e7f984df`.
|
||||
Owned source: `src/scene/cardSequence/iplCardSequence.cpp` only.
|
||||
|
||||
## Retained source correction
|
||||
|
||||
Give `cardThreadMain` its unused `void*` entry parameter in both its declaration
|
||||
and definition, and remove the function-pointer cast at `OSCreateThread`.
|
||||
The unnamed parameter follows the existing unused-parameter style in this unit.
|
||||
The function body and registration arguments are unchanged.
|
||||
|
||||
`OSCreateThread` declares its entry as `void* (*)(void*)`. The previous C++
|
||||
`void* cardThreadMain()` declaration describes a different function type;
|
||||
its explicit cast hid that mismatch. A C++98 direct-binding compile check rejects
|
||||
the previous declaration and accepts the corrected declaration. This is a source
|
||||
interface correction. No runtime sanitizer diagnosis or fuzzy improvement is
|
||||
claimed: the SDK launches the entry by restoring a machine context.
|
||||
|
||||
## Original-machine contract
|
||||
|
||||
- The original `initCardThread` is at `0x813D2660`, 668 bytes. Its call to
|
||||
`OSCreateThread` at `0x813D28B0` passes entry `0x813D2C8C` in r4 and null in r5.
|
||||
- Original `OSCreateThread` at `0x81534548` preserves the parameter from r5 in
|
||||
r26, calls `OSInitContext` at `+0x88`, then stores r26 at context `+0x0C`
|
||||
(`gpr[3]`) at `+0xA4`.
|
||||
- Original `OSInitContext` at `0x8152E18C` stores entry r4 at context `+0x198`
|
||||
(`srr0`). `OSLoadContext` at `0x8152E028` restores r3 from context `+0x0C`
|
||||
at `+0xD0`, immediately before its `rfi`.
|
||||
- Original `cardThreadMain` is 1204 bytes. The entry prologue calls
|
||||
`_savegpr_19` at `+0x10`; that helper only stores r19 through r31 and returns.
|
||||
The body overwrites r3 from `sThread` at `+0x14` before consuming it.
|
||||
The extra formal is genuinely unused, with no dummy read or receiver.
|
||||
- The existing null return in r3 remains unchanged. `OSCreateThread` sets the
|
||||
saved LR to `OSExitThread`, whose original entry preserves returned r3.
|
||||
- Both original and source retain the existing global C symbol binding. There
|
||||
is no linkage or callback-address change.
|
||||
|
||||
A read-only original-object/DOL audit checked six entry/caller/SDK functions:
|
||||
656 nonrelocated instruction words and 73 direct calls agree with the original
|
||||
DOL. The registration's raw address construction was independently decoded;
|
||||
the evidence does not rely only on objdiff relocation matching.
|
||||
|
||||
## Measurements and gates
|
||||
|
||||
The baseline and candidate were both explicitly rebuilt with the same 43U
|
||||
configuration and compiler. No header, build setting, or other source changed.
|
||||
|
||||
- `cardThreadMain`: unchanged 97.9402%, 301/301 instructions
|
||||
- Unit: unchanged 97.20097%, 27/30 exact functions, 4168/9852 matched code bytes
|
||||
- All 27 exact functions: individually checked, zero instruction differences
|
||||
- Matched data: unchanged 1496/1496 bytes
|
||||
- All five allocated sections: byte-identical, including extents and attributes
|
||||
- All 522 relocation records and all symbol-table records: byte-identical
|
||||
- The only ELF section difference is `.strtab`: 46 compiler-generated anonymous
|
||||
`@number` labels are renumbered; each retains its section, value, size and binding
|
||||
- Full 1027-unit report: byte-identical to baseline
|
||||
- String pool: 43/43 identical, checked before and after
|
||||
- Literal-reference check: 45 arguments across 29 functions; no candidates or
|
||||
errors. The unchanged unequal-extent `loadCardFileIcons` is the only skip
|
||||
- Full 43U `all_source`, report and DOL gates: pass
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- `git diff --check`: pass
|
||||
|
||||
Object SHA256 values:
|
||||
|
||||
- Baseline: `071b634c812dca8dc853fb57562509e1de1c927d8619aba34f34694ec0e3bf93`
|
||||
- Candidate: `5bbe85c6a9d2e7aa8559f9b75024cb841bcb76a4273ad9e4dbe8fae23ec6963b`
|
||||
|
||||
The prior CardSequence attempts, card-icon reconstruction record, scene-call
|
||||
contract audit, and current report were inspected first. Earlier trials covered
|
||||
message packing, local lifetimes, icon parsing and copy/move branches; they did
|
||||
not correct this callback declaration. No prior register-allocation trial was
|
||||
repeated. This correction leaves the nonexact scene routines unresolved.
|
||||
671
tools/decomp-assist/gk1.attempts.md
Normal file
671
tools/decomp-assist/gk1.attempts.md
Normal file
@@ -0,0 +1,671 @@
|
||||
# gk1 iplSetting max round
|
||||
|
||||
Owned unit: src/scene/setting/iplSetting. Data naming and extents first; convertRevIP then scanAP.
|
||||
Baseline HEAD 20ba34a80f9d0a09c4a8fad51352f0dd97d84be0; fetched origin/main 20ba34a80f9d0a09c4a8fad51352f0dd97d84be0.
|
||||
Initial worktree has an unrelated untracked perm4.attempts.md; left untouched.
|
||||
Prior-art index has no iplSetting, scanAP or convertRevIP entry.
|
||||
Baseline report measures {"fuzzy_match_percent": 99.85767, "total_code": "37884", "matched_code": "36504", "matched_code_percent": 96.35731, "total_data": "5696", "matched_data": "1680", "matched_data_percent": 29.49438, "total_functions": 112, "matched_functions": 110, "matched_functions_percent": 98.21429, "total_units": 1}.
|
||||
|
||||
## Data audit
|
||||
|
||||
POOL IDENTICAL, 108/108 strings, identical offsets. No missing string or table literals.
|
||||
All named objects already pair: scAnmTable, sSettingAPButtonNames, sSettingArrowNames, sSettingAPTextNames, sSettingAPNumberNames, sSettingAPPaneNames, sSettingAPAnimations, m_AOSSConfig, m_RakuConfig, mem1Buffer_, mem2Buffer_, browserScrollDirection, scNumber, scNumber2, APEvent/Setting vtables. Each has identical symbol extent and section-relative address in both ELFs. No permitted lbl-to-real-name rename remains.
|
||||
.data raw nonrelocated bytes are identical, 4016/4016. The only relocation differences are the scanAP switch table at .data+0xc7c, target @27409/source @27430, size 0x28. Its entries at 0xc7c/0xc98/0xc9c/0xca0 point into scanAP at target offsets 1068/872/940/956 vs source 1044/864/924/940. Therefore the 4016-byte data gap is caused by scanAP code offsets, not missing data or names. No symbols changed.
|
||||
.rodata is byte-identical; renamed compiler-generated @188xx references point to identical version-suffix literals. .sdata and .sdata2 have only final 4-byte unowned alignment absent in the source ELF. Weak extra vtables are ignored.
|
||||
|
||||
## Function baseline
|
||||
|
||||
Fetched origin/main before inspecting functions; its iplSetting.cpp and header are identical to HEAD. Current report has convertRevIP 98.69863 and scanAP 95.39338; no newer exact match exists in origin/main.
|
||||
convertRevIP has 73/73 instructions and a 0x40 frame. Structural instruction shapes agree; 16 register/allocation and initialization-order differences remain.
|
||||
scanAP has 266/272 instructions and a 0x10 frame. Three isPlaying negations are branch-folded in ours, while target materializes the bool with addi/cntlzw/rlwinm. Cases 7 and 9 also differ in load/store scheduling. Fix structure before allocation.
|
||||
|
||||
convertRevIP attempt 1: leading-local declaration order search, after confirming identical structural instruction shapes.
|
||||
declaration block:
|
||||
char ascii[20];
|
||||
int count = 0;
|
||||
int index;
|
||||
start (0, 16)
|
||||
best (0, 16) after 6 builds; source restored; best order was:
|
||||
char ascii[20];
|
||||
int count = 0;
|
||||
int index;
|
||||
|
||||
|
||||
convertRevIP | output-before-component-start | {"insns": [73, 73], "structural": 0, "diffs": 16, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | index-initialized-before-component | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | leading-component-declaration | {"insns": [73, 73], "structural": 0, "diffs": 16, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | leading-output-declaration | {"insns": [73, 73], "structural": 0, "diffs": 16, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | count-after-conversion | {"insns": [73, 73], "structural": 2, "diffs": 21, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
Named data object pairing proof, all extents retained:
|
||||
- scAnmTable__Q23ipl5scene .rodata+0x0 size 0xe8; common code users create__Q33ipl5scene7SettingFv; pointers none.
|
||||
- scNumber__Q23ipl5scene .rodata+0x258 size 0x14; common code users none; pointers none.
|
||||
- scNumber2__Q23ipl5scene .rodata+0x26c size 0x14; common code users none; pointers none.
|
||||
- m_AOSSConfig__Q23ipl5scene .bss+0x0 size 0x158; common code users AOSSProcess__Q33ipl5scene7SettingFv; pointers none.
|
||||
- m_RakuConfig__Q23ipl5scene .bss+0x158 size 0x70; common code users RakuProcess__Q33ipl5scene7SettingFv; pointers none.
|
||||
- sSettingAPButtonNames__Q23ipl5scene .data+0x0 size 0x10; common code users get_ap_no__Q33ipl5scene7SettingFPCc; pointers @16789, @16790, @16791, @16792.
|
||||
- sSettingAPTextNames__Q23ipl5scene .data+0x10 size 0x18; common code users setAPDraw__Q33ipl5scene7SettingFv; pointers @16795, @16796, @16797, @16798, @16799.
|
||||
- sSettingAPNumberNames__Q23ipl5scene .data+0x28 size 0x18; common code users initScroll__Q33ipl5scene7SettingFv; pointers @16801, @16802, @16803, @16804, @16805.
|
||||
- sSettingAPPaneNames__Q23ipl5scene .data+0x90 size 0x68; common code users none; pointers @16807, @16808, @16809, @16810, @16811.
|
||||
- sSettingAPAnimations__Q23ipl5scene .data+0x284 size 0x4c; common code users none; pointers @16833, @16834, @16835, @16836, @16837.
|
||||
- __vt__Q33ipl5scene7APEvent .data+0xe9c size 0x18; common code users create__Q33ipl5scene7SettingFv; pointers onEvent__Q33ipl5scene7APEventFUlUlPv, setManager__Q23gui12EventHandlerFPQ23gui7Manager, setLatestEventCtrlNo__Q23gui12EventHandlerFi, getLatestEventCtrlNo__Q23gui12EventHandlerFv.
|
||||
- __vt__Q33ipl5scene7Setting .data+0xeb4 size 0x68; common code users __ct__Q33ipl5scene7SettingFPQ23EGG4Heapi, __dt__Q33ipl5scene7SettingFv; pointers __dt__Q33ipl5scene7SettingFv, getParent__Q33ipl5scene4BaseFv, getChild__Q33ipl5scene4BaseFv, getNext__Q33ipl5scene4BaseFv, getPrev__Q33ipl5scene4BaseFv.
|
||||
- sSettingArrowNames__Q23ipl5scene .sdata+0x28 size 0x8; common code users create__Q33ipl5scene7SettingFv, get_arw_no__Q33ipl5scene7SettingFPCc, initScroll__Q33ipl5scene7SettingFv; pointers @16793, @16794.
|
||||
- mem1Buffer___Q33ipl5scene7Setting .sbss+0x0 size 0x4; common code users __dt__Q33ipl5scene7SettingFv, createBrowser__Q33ipl5scene7SettingFv; pointers none.
|
||||
- mem2Buffer___Q33ipl5scene7Setting .sbss+0x4 size 0x4; common code users __dt__Q33ipl5scene7SettingFv, createBrowser__Q33ipl5scene7SettingFv; pointers none.
|
||||
- browserScrollDirection__Q23ipl5scene .sbss+0x8 size 0x4; common code users draw__Q33ipl5scene7SettingFv; pointers none.
|
||||
|
||||
Before scanAP experiments, fetched origin/main again; owned source equals initial source: True.
|
||||
|
||||
scanAP | isPlaying-equals-false | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | isPlaying-equals-FALSE | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | isPlaying-not-true | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | isPlaying-materialized-int | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | isPlaying-materialized-bool | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-scan | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | leading-counter-and-pointer-declarations | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | loop-index-declared-at-initialization | {"insns": [73, 73], "structural": 0, "diffs": 20, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | unsigned-parsed-count | {"insns": [73, 73], "structural": 1, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | byte-conversion-buffer | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | signed-char-conversion-buffer | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | count-before-output-advance | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | output-advance-before-count | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | parse-value-declared-before-loop | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | loop-char-declared-before-loop | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-convert-round2 | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-BOOL | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-ternary-bool | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-ternary-BOOL | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-explicit-result | {"insns": [266, 272], "structural": 54, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-explicit-BOOL | {"insns": [266, 272], "structural": 54, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-early-return | {"insns": [266, 272], "structural": 54, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-reverse-compare | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-playing-negated-difference | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-scoped-playing | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | static-inline-playing-helper | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | static-BOOL-playing-helper | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | static-bool-complete-helper | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-free-helper | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP tested existing Object::isPlaying(int) const as a unit-scoped inline definition. All List_GetNth relocations in both objects use const List*; this does not distinguish the original inline accessor. That existing method remained an out-of-line call and gave 257/272 instructions, so restored its original declaration.
|
||||
|
||||
scanAP | inline-existing-const-Object-isPlaying | {"insns": [257, 272], "structural": 36, "diffs": 165, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-return-compare-one | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-return-compare-TRUE | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-return-less-than-one | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-return-complement-low-bit | {"insns": [278, 272], "structural": 59, "diffs": 163, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-return-xor-true | {"insns": [278, 272], "structural": 59, "diffs": 163, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-return-compare-one | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-return-complement-low-bit | {"insns": [278, 272], "structural": 59, "diffs": 163, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-predicate-combinations | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | inline-clamp-component-helper | {"insns": [67, 73], "structural": 11, "diffs": 50, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | inline-shift-component-helper | {"insns": [69, 73], "structural": 18, "diffs": 50, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | inline-clamp-and-shift-helpers | {"insns": [63, 73], "structural": 23, "diffs": 51, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | clamp-using-min-ternary | {"insns": [75, 73], "structural": 11, "diffs": 52, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | decimal-value-signed-view | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-component-helpers | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | playing-explicit-inline-in-class | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | playing-outside-class-inline | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | playing-outside-class-BOOL | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | playing-byte-return | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-inline-boundaries | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | wide-playing-low-bit-is-zero | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | wide-playing-bit-inverted | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | wide-playing-unsigned-zero | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | wide-playing-bool-cast | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | wide-playing-equal-boolean-false | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | wide-playing-zero-ternary | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-integer-local-return | {"insns": [266, 272], "structural": 54, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-bool-cast-after-int | {"insns": [266, 272], "structural": 54, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-playing-shapes | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | readonly-output-parameter | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | readonly-address-parameter | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | array-output-parameter | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | array-address-parameter | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | output-cursor-before-memset | {"insns": [73, 73], "structural": 2, "diffs": 19, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | output-cursor-before-count | {"insns": [73, 73], "structural": 2, "diffs": 26, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | output-cursor-before-buffer | {"insns": [73, 73], "structural": 2, "diffs": 26, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | scan-counters-at-function-entry | {"insns": [73, 73], "structural": 4, "diffs": 35, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | component-start-at-function-entry | {"insns": [73, 73], "structural": 2, "diffs": 35, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | conversion-address-local-view | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | loop-count-negative-form | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | next-output-pointer-assignment | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | read-only-existing-address-view | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-lifetimes | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | cursor-advanced-with-first-store | {"insns": [73, 73], "structural": 3, "diffs": 22, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | count-postincrement-in-first-test | {"insns": [73, 73], "structural": 4, "diffs": 22, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | count-incremented-in-both-branches | {"insns": [74, 73], "structural": 10, "diffs": 49, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | cursor-incremented-in-both-branches | {"insns": [74, 73], "structural": 8, "diffs": 49, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | index-and-component-joint-init | {"insns": [73, 73], "structural": 0, "diffs": 16, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | loop-index-and-start-joint-init | {"insns": [73, 73], "structural": 0, "diffs": 16, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | parse-array-index-address | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | write-byte-by-cursor-subscript | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | loop-with-explicit-bottom-step | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | typed-zero-byte | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | ascii-buffer-initialized-at-definition | {"insns": [75, 73], "structural": 12, "diffs": 69, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-flow | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-nonpositive | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-less-than-TRUE | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-byte-mask-zero | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-full-mask-zero | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-left-shift-zero | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-unsigned-mask-zero | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-boolean-cast-false | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-zero-first-comparison | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-negative-zero-comparison | {"insns": [272, 272], "structural": 12, "diffs": 15, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-test-double-negation | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-mask-TRUE-zero | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-playing-zero-conditional | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-nonpositive | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-less-than-TRUE | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-byte-mask-zero | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-full-mask-zero | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-left-shift-zero | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-unsigned-mask-zero | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-boolean-cast-false | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-zero-first-comparison | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-negative-zero-comparison | {"insns": [272, 272], "structural": 12, "diffs": 15, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-test-double-negation | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-mask-TRUE-zero | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-playing-zero-conditional | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-expression-search | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | late-bool-playing-helper | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | late-BOOL-playing-helper | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | late-FrameController-playing-definition | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-late-helpers | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | inspect-wide-playing-nonpositive | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-output-all | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-output-read-only | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-output-decimal-only | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-output-scan-only | {"insns": [73, 73], "structural": 0, "diffs": 20, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-output-all | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-output-read-only | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-output-decimal-only | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-output-scan-only | {"insns": [73, 73], "structural": 0, "diffs": 20, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-index-all | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-index-read-only | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-index-decimal-only | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-after-index-scan-only | {"insns": [73, 73], "structural": 0, "diffs": 20, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-memset-all | {"insns": [71, 73], "structural": 12, "diffs": 63, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-memset-read-only | {"insns": [71, 73], "structural": 12, "diffs": 63, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-memset-decimal-only | {"insns": [71, 73], "structural": 12, "diffs": 63, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | explicit-buffer-pointer-before-memset-scan-only | {"insns": [73, 73], "structural": 5, "diffs": 27, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-explicit-buffer-pointer | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-local-playing <= 0 | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-local-playing == 0 | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-local-!playing | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-accumulate-|= | {"insns": [272, 272], "structural": 6, "diffs": 9, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | int-accumulate-+= | {"insns": [272, 272], "structural": 6, "diffs": 9, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-local-playing <= 0 | {"insns": [272, 272], "structural": 9, "diffs": 12, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-local-playing == 0 | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-local-!playing | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-accumulate-|= | {"insns": [272, 272], "structural": 6, "diffs": 9, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-accumulate-+= | {"insns": [272, 272], "structural": 6, "diffs": 9, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-local-playing <= 0 | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-local-playing == 0 | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-local-!playing | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-accumulate-|= | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-accumulate-+= | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-local-status | {"insns": [272, 272], "structural": 6, "diffs": 9, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-status-switch-zero | {"insns": [275, 272], "structural": 54, "diffs": 157, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | bool-status-switch-one | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-status-switch-zero | {"insns": [275, 272], "structural": 54, "diffs": 157, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | BOOL-status-switch-one | {"insns": [275, 272], "structural": 56, "diffs": 158, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-status-switch | {"insns": [266, 272], "structural": 53, "diffs": 160, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | capture-index-in-both-remaining-cases | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | capture-index-only-in-case7 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-state-scheduling | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-unsigned-index | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-narrow-index-local | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-explicit-index-narrowing | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-unsigned-argument-view | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-readonly-index-local | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-animator-local | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-readonly-animator-local | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-layout-local-after-index | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-playing-declaration-before-index | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-case9-scheduling | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-index-const-reference | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-index-reference | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-index-const-pointer | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-const-setting-view | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-layout-reference | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-readonly-case9-views | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | lookup-index-first-case9 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | lookup-index-first-all-cases | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | lookup-layout-first-case9 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | lookup-layout-first-all-cases | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-inline-lookup | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-sdk-index | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-sdk-playing | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-sdk-index-and-playing | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-initialized-playing-after-index | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | common-playing-mask | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-add-result | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-zero-integer-initializer | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-condition-equals-FALSE | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-case9-final-forms | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-int-index-int-start-s32 | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-int-index-s32-start-int | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-int-index-s32-start-s32 | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-s32-index-int-start-int | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-s32-index-int-start-s32 | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-s32-index-s32-start-int | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | sdk-count-s32-index-s32-start-s32 | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | moving-output-parameter | {"insns": [73, 73], "structural": 0, "diffs": 24, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | moving-parameter-with-base-before-calls | {"insns": [73, 73], "structural": 2, "diffs": 29, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | reuse-address-parameter-for-converted-text | {"insns": [71, 73], "structural": 9, "diffs": 56, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | unsigned-int-value-type | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-parameter-role-types | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-readonly-layout-query | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-readonly-layout-first | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | case9-const-reference-layout-query | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-const-layout-lookup | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | leading-all-parser-locals | {"insns": [73, 73], "structural": 0, "diffs": 14, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
## Structural result
|
||||
|
||||
Integer animation status accumulation preserves the target addi/cntlzw/rlwinm normalization without masks, shifts, volatile, assembly, or unused values. Capturing the animation index before the busy flag store in state 7 restores its target loads. scanAP reaches 272/272 instructions, leaving only the four load/scheduling differences in state 9; all scanAP switch-table relocations now have the correct offsets, making all 5696/5696 data bytes match. The accumulator representation is inferred from the compilation experiment.
|
||||
convertRevIP initialization order reduces the register-only diff from 16 to 14 while preserving 73/73 instructions and the 0x40 frame. Neither function is claimed exact yet.
|
||||
Both target extents meet their next function exactly: convertRevIP 0x813f5e1c+0x124=adjustSecA 0x813f5f40; scanAP 0x813f6858+0x440=initScroll 0x813f6c98. No extents changed.
|
||||
|
||||
convertRevIP | full-local declaration permutation search |
|
||||
declaration block:
|
||||
char ascii[20];
|
||||
int count = 0;
|
||||
int index;
|
||||
int componentStart;
|
||||
u8* output;
|
||||
u32 value;
|
||||
u8 character;
|
||||
start (0, 14)
|
||||
improved (0, 8)
|
||||
best (0, 8) after 60 builds; kept in source:
|
||||
char ascii[20];
|
||||
u8* output;
|
||||
int index;
|
||||
int componentStart;
|
||||
int count = 0;
|
||||
u32 value;
|
||||
u8 character;
|
||||
|
||||
|
||||
convertRevIP | all-parser-declaration-search-result | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-after-all-declarations | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | sdk-field-unk_0x918-s32 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | sdk-field-unk_0x918-u32 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | sdk-field-unk_0xB9C-s32 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | sdk-field-unk_0xB9C-u32 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-field-types | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | existing-character-clears-delimiter | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | character-assignment-clears-delimiter | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | existing-parsed-value-clears-delimiter | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | typed-null-literal | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | byte-null-cast | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | character-local-loop-scope | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | decimal-value-local-delimiter-scope | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | named-null-terminator-before-output | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | named-null-terminator-after-index | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | named-null-terminator-before-loop | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-null-character-lifetimes | {"insns": [73, 73], "structural": 0, "diffs": 8, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | first-component-indexed-by-count | {"insns": [73, 73], "structural": 0, "diffs": 0, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
convertRevIP | restore-best-count-derived-cursor | {"insns": [73, 73], "structural": 0, "diffs": 0, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | single-integer-animation-status | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-getAnim-index-u16 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-getAnim-index-unsigned int | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-getAnim-index-u32 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | scoped-getAnim-index-s32 | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
scanAP | restore-best-lookup-argument-type | {"insns": [272, 272], "structural": 3, "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)"}
|
||||
|
||||
## Exact convertRevIP
|
||||
|
||||
The target output cursor is a compiler-generated induction variable, not an explicit source pointer. Using destination[count] for the first-component store lets MWCC perform its own strength reduction. Combined with the logged local order and index-before-componentStart initialization, this gives 73/73 instructions, ctxdiff diffs 0, objdiff 100.0%, matched code 36504 -> 36796, exact functions 110 -> 111. The store is equivalent because this branch executes only when count == 0. No manual cursor, assembly, uninitialized read, symbol change, or artificial data is used.
|
||||
scanAP uses one BOOL status initialized FALSE and ORs the current animation query in states 6/7/9; state 7 captures the animation index before setting the busy flag. Every data section matches 100%; state 9 still has four load/operand scheduling differences. All experimental shared-header edits were restored.
|
||||
|
||||
## Plateau audit
|
||||
|
||||
{'convertRevIP': 83, 'scanAP': 123} distinct compiled source trials, plus 6-build initial and 60-build full declaration searches. Only scanAP remains open; more than three distinct successful trials are logged. Its remaining four differences are the state-9 animation-index/layout-pointer load order and the two subsequent argument instructions. None change switch destinations. No hard-case function is left untried.
|
||||
|
||||
## Quick gate before commit
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/setting/iplSetting] pool: IDENTICAL
|
||||
[src/scene/setting/iplSetting] objdiff: code 36796/37884 data 5696/5696 functions 111/112 fuzzy 99.9771 linked code 0
|
||||
[src/scene/setting/iplSetting] instruction-exact functions: 110/112
|
||||
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
|
||||
[src/scene/setting/iplSetting] section .data size 4016 match 100.0
|
||||
[src/scene/setting/iplSetting] section .rodata size 640 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
|
||||
[src/scene/setting/iplSetting] section .text size 37884 match 99.97709
|
||||
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 99.20221
|
||||
[src/scene/setting/iplSetting] baseline: code 36504/37884 data 1680 functions 110 fuzzy 99.8577
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.53532 -> 91.54507
|
||||
global fuzzy_match_percent: 99.69871 -> 99.70022
|
||||
global complete_code_percent: 74.74593 -> 74.74593
|
||||
global matched_data_percent: 99.55890 -> 99.77803
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
## Instruction-exact baseline clarification
|
||||
|
||||
Independently rebuilt the initial source in this same worktree, then restored and rebuilt the committed candidate. The baseline has 109/112 raw instruction-exact functions, despite objdiff reporting 110/112. Candidate has 110/112 raw instruction-exact functions and 111/112 in objdiff. The pre-existing discrepancy is not introduced by this diff. Baseline raw nonexact list: convertRevIP__Q33ipl5scene7SettingFPUcPCc, scanAP__Q33ipl5scene7SettingFv, setUpdate_NoUpdateDialog___Q33ipl5scene7SettingFv.
|
||||
|
||||
The pre-existing raw-count discrepancy is a gate-tool normalization bug: odiff.dis treats operand 0 of blt cr1 as an immediate branch target. That operand is the CR register, while operand 1 is the target. Therefore source/target section offsets enter the comparison. setUpdate_NoUpdateDialog_ has identical 120-byte instruction bytes and correct last-operand normalization gives structural 0, exact 0; objdiff is correctly 100%. Gate still prints 110/112 after versus 109/112 before; actual instruction matches are 111/112 after and 110/112 before. No gate or helper was edited.
|
||||
|
||||
## Final clean full gate
|
||||
|
||||
Command: python3 /mnt/drive2/projects/wii-ipl-workers/_restore0928-tools/gate.py src/scene/setting/iplSetting (no --quick). Exit status 0.
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/setting/iplSetting] pool: IDENTICAL
|
||||
[src/scene/setting/iplSetting] objdiff: code 36796/37884 data 5696/5696 functions 111/112 fuzzy 99.9771 linked code 0
|
||||
[src/scene/setting/iplSetting] instruction-exact functions: 110/112
|
||||
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
|
||||
[src/scene/setting/iplSetting] section .data size 4016 match 100.0
|
||||
[src/scene/setting/iplSetting] section .rodata size 640 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
|
||||
[src/scene/setting/iplSetting] section .text size 37884 match 99.97709
|
||||
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 99.20221
|
||||
[src/scene/setting/iplSetting] baseline: code 36504/37884 data 1680 functions 110 fuzzy 99.8577
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.53532 -> 91.54507
|
||||
global fuzzy_match_percent: 99.69871 -> 99.70022
|
||||
global complete_code_percent: 74.74593 -> 74.74593
|
||||
global matched_data_percent: 99.55890 -> 99.77803
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
After the full gate, regenerated the live report. pool_diff: IDENTICAL, 108/108. convertRevIP: objdiff 100.0%, ctxdiff diffs 0, instructions 73/73. scanAP: objdiff 99.20221%, ctxdiff diffs 4, instructions 272/272. All owned data sections are 100%. No literal is missing, and no symbol rename or extent adjustment was required. The only open function is scanAP; its 123 distinct compiled trials and declaration searches exceed the three-attempt handoff requirement.
|
||||
|
||||
## Host-restart recovery 2026-10-03T03:50:28.907285+00:00
|
||||
|
||||
Preserved commits 349be634 and f4797373 and unrelated untracked perm4.attempts.md. No tracked uncommitted source edits remained. Fetched fork origin under /tmp/wii-git.lock; origin/main is a791e598a154e105d9ca81087d8d5912e222636a. Owned source and headers have no changes in the new origin/main commits. No rebase or branch changes.
|
||||
Fresh object build: no work to do. Corrected pool_diff argument from unit path to explicit source/target object paths: POOL IDENTICAL, 108/108. convertRevIP: 73/73 instructions, diffs 0. scanAP: 272/272 instructions, diffs 4 at 239-242, only state-9 lookup loads/argument ordering. Previous 123 scanAP trials retained and not repeated.
|
||||
One initial skill announcement was emitted before reading silent_mode_first, as required by the session skill instructions. Subsequent worker communication is tool calls only.
|
||||
|
||||
scanAP | recovery-common-int-animation-index | {"insns": [272, 272], "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)", "ctxdiff": "src 0x440 base 0x440 insns 272/272\ndiffs 4: [239, 240, 241, 242]\n 239 M lwz r3, 0xc4(r3)\n B lwz r0, 0x918(r3)\n 240 M lwz r0, 0x918(r31)\n B lwz r3, 0xc4(r3)\n 241 M addi r3, r3, 0x28c\n B clrlwi r4, r0, 0x10\n 242 M clrlwi r4, r0, 0x10\n B addi r3, r3, 0x28c"}
|
||||
|
||||
scanAP | recovery-common-u16-animation-index | {"insns": [272, 272], "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)", "ctxdiff": "src 0x440 base 0x440 insns 272/272\ndiffs 4: [239, 240, 241, 242]\n 239 M lwz r3, 0xc4(r3)\n B lwz r0, 0x918(r3)\n 240 M lwz r0, 0x918(r31)\n B lwz r3, 0xc4(r3)\n 241 M addi r3, r3, 0x28c\n B clrlwi r4, r0, 0x10\n 242 M clrlwi r4, r0, 0x10\n B addi r3, r3, 0x28c"}
|
||||
|
||||
scanAP | recovery-common-animator-result | {"insns": [272, 272], "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)", "ctxdiff": "src 0x440 base 0x440 insns 272/272\ndiffs 4: [239, 240, 241, 242]\n 239 M lwz r3, 0xc4(r3)\n B lwz r0, 0x918(r3)\n 240 M lwz r0, 0x918(r31)\n B lwz r3, 0xc4(r3)\n 241 M addi r3, r3, 0x28c\n B clrlwi r4, r0, 0x10\n 242 M clrlwi r4, r0, 0x10\n B addi r3, r3, 0x28c"}
|
||||
|
||||
scanAP | recovery-final-preserved-source | {"insns": [272, 272], "diffs": 4, "pool": "POOL IDENTICAL up to 108 (mine=108 base=108)", "ctxdiff": "src 0x440 base 0x440 insns 272/272\ndiffs 4: [239, 240, 241, 242]\n 239 M lwz r3, 0xc4(r3)\n B lwz r0, 0x918(r3)\n 240 M lwz r0, 0x918(r31)\n B lwz r3, 0xc4(r3)\n 241 M addi r3, r3, 0x28c\n B clrlwi r4, r0, 0x10\n 242 M clrlwi r4, r0, 0x10\n B addi r3, r3, 0x28c"}
|
||||
|
||||
## Recovery final clean full gate 2026-10-03T03:54:55.458102+00:00
|
||||
|
||||
Three new common-local scanAP trials were compiled: int animation index, u16 animation index, and Animator result pointer. All stayed 272/272 instructions with the same four differences and identical 108-string pools. Restored the prior gate-passing committed source byte for byte. No previous source trial was repeated.
|
||||
|
||||
Command: python3 /mnt/drive2/projects/wii-ipl-workers/_restore0928-tools/gate.py src/scene/setting/iplSetting, without --quick. Exit status 0.
|
||||
|
||||
```
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/setting/iplSetting] pool: IDENTICAL
|
||||
[src/scene/setting/iplSetting] objdiff: code 36796/37884 data 5696/5696 functions 111/112 fuzzy 99.9771 linked code 0
|
||||
[src/scene/setting/iplSetting] instruction-exact functions: 110/112
|
||||
[src/scene/setting/iplSetting] section .bss size 456 match 100.0
|
||||
[src/scene/setting/iplSetting] section .data size 4016 match 100.0
|
||||
[src/scene/setting/iplSetting] section .rodata size 640 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sbss size 16 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sdata size 504 match 100.0
|
||||
[src/scene/setting/iplSetting] section .sdata2 size 64 match 100.0
|
||||
[src/scene/setting/iplSetting] section .text size 37884 match 99.97709
|
||||
[src/scene/setting/iplSetting] below 100: scanAP__Q33ipl5scene7SettingFv 99.20221
|
||||
[src/scene/setting/iplSetting] baseline: code 36504/37884 data 1680 functions 110 fuzzy 99.8577
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.53532 -> 91.54507
|
||||
global fuzzy_match_percent: 99.69871 -> 99.70022
|
||||
global complete_code_percent: 74.74593 -> 74.74593
|
||||
global matched_data_percent: 99.55890 -> 99.77803
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
Regenerated build/43U/report.json with ninja progress build/43U/report.json. Open functions: scanAP__Q33ipl5scene7SettingFv, 99.20221%, four differences at instructions 239-242. All 126 distinct source-level scanAP trials are logged, exceeding the three-attempt plateau handoff contract. convertRevIP is still 100.0%, 73/73 instructions, diffs 0. Data stays 5696/5696 and all six owned data sections are 100%.
|
||||
|
||||
Fresh raw-byte verification of the existing gate discrepancy: setUpdate_NoUpdateDialog___Q33ipl5scene7SettingFv source and target instruction bytes are identical, 120 bytes, SHA1 1d64ee400d91a5c2583db97e3334c3805da18006. Live objdiff correctly gives it 100.0%. Gate still reports 110/112 raw instruction-exact functions; actual exact count is 111/112. Earlier independently measured raw baseline 109/112 -> candidate 110/112 is preserved; corrected actual count is 110/112 -> 111/112. No helper or gate edits.
|
||||
244
tools/decomp-assist/gk3.attempts.md
Normal file
244
tools/decomp-assist/gk3.attempts.md
Normal file
@@ -0,0 +1,244 @@
|
||||
# gk3 MAX structural and sibling-idiom round
|
||||
|
||||
2026-10-03T02:41:57.184346+00:00
|
||||
|
||||
HEAD 20ba34a80f9d0a09c4a8fad51352f0dd97d84be0; origin/main 20ba34a80f9d0a09c4a8fad51352f0dd97d84be0.
|
||||
|
||||
Owned sources: src/scene/address/iplAddress.cpp, src/scene/address/iplAddressEdit.cpp, src/scene/cardSequence/iplCardSequence.cpp; config/43U/symbols.txt only if proven metadata correction is needed. Matching only; no configure.py or linking changes.
|
||||
|
||||
Acceptance: pool preserved, exact-name objdiff and instruction-exact gains, no regressions/forbidden or readability patterns, full non-quick gate across all three units, correct DOL SHA1; commit every passing improvement. All remaining functions require three distinct source-level attempts with matched sibling references first.
|
||||
|
||||
Baseline objdiff exact functions/code/data: Address 98/101, 21856/23988, 1964/1964; AddressEdit 91/94, 23344/27112, 2560/2560; CardSequence 27/30, 4168/9852, 1496/1496. All assigned data already 100%; no missing-name or extent correction indicated. Reference index has no entries for the assigned units. All three pools identical.
|
||||
|
||||
## Address::start_drag_event
|
||||
Fresh origin fetch: assigned source unchanged. Target and ours both 223 instructions/frame 0x40, only seven icon/pane register differences. Matched sibling AddressEdit::nigaoe_create_callback_edit uses a named Pane and a texture accessor; Address::MiiObj::create_callback uses a typed MiiObj receiver and getIconTexture. Using those idioms before declaration search; reference index has no hit. No overlap in symbol extent.
|
||||
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | read-only nigaoe pointer for const texture/image accessors: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | typed MiiObj reference shared by texture access and reset: 223/223 instructions; structural/exact (4, 50); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | explicit root pane lookup used by exact movePane_onDrag: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | named const texture reference following matched callback accessor idiom: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | named image pointer for memcpy using matched pointer-local idiom: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | pane lookup through named layout reference: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | named root pane boundary mirroring exact scene construction: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | named material receiver mirroring matched MiiObj callback: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | explicit root with const texture reference boundary: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | single-use inline texture installation with const object reference: BUILD FAILED, reverted. ive2\projects\wii-ipl-workers\data- # d4\src\scene\address\iplAddress.cpp:6) ### mwcceppc.exe Compiler: # File: src\scene\address\iplAddress.cpp # ----------------------------------------- # 1174: nw4r::lyt::Pane* miiPane = address.mpLayout->FindPaneByName("mii_move"); # Error: ^^ # (10412) illegal access from 'ipl::scene::Address' to protected/private # member 'ipl::scene::Address::mpLayout' # Too many errors printed, aborting program User break, cancelled... ninja: build stopped: subcommand failed.
|
||||
|
||||
## Address::onEventDerived
|
||||
Fetched origin; source unchanged there. Both 270 instructions, frame 0x30; remaining differences are saved register assignments. Matched sibling AddressAddSel::onEventDerived and MailAddressSelect::onEventDerived split PaneComponent from name lookup; matched AddressEdit::onEventDerived also names manager and pane. Branch structure and string order already correct; no extent overlap/reference-index hit.
|
||||
|
||||
- onEventDerived__Q33ipl5scene7AddressFUlUlPCQ33ipl10controller9Interface | matched sibling PaneComponent local boundary: 270/270 instructions; structural/exact (0, 81); pool identical; exact regressions []; reverted.
|
||||
- onEventDerived__Q33ipl5scene7AddressFUlUlPCQ33ipl10controller9Interface | matched AddressEdit manager/component/pane lookup boundaries: 270/270 instructions; structural/exact (0, 81); pool identical; exact regressions []; reverted.
|
||||
- onEventDerived__Q33ipl5scene7AddressFUlUlPCQ33ipl10controller9Interface | named animator reuse and initFrame/restart used by exact AddressEdit states: 270/270 instructions; structural/exact (0, 81); pool identical; exact regressions []; reverted.
|
||||
|
||||
Address::onEventDerived register-only last: official declsearch --score-only structural 0 exact 81. No independent leading declaration block to permute safely. Restored baseline after three sibling-based attempts.
|
||||
|
||||
## FriendListCache::update
|
||||
Fresh origin fetch; source unchanged. Target 40 instructions/0x20 frame, ours 39/0x20. Target recomputes mInfos[index] after wcsncpy; ours retains a record pointer in r31. Exact sibling FriendListCache::add recalculates direct mInfos[index] for writeFriendInfo after memcpy. No pool/data issue or extent overlap/reference-index hit.
|
||||
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx | direct member-array access matching exact FriendListCache::add: 38/40 instructions; structural/exact (7, 33); pool identical; exact regressions []; reverted.
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx | read-only cache view for name and update-info accessors: 39/40 instructions; structural/exact (2, 11); pool identical; exact regressions []; reverted.
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx | named manager followed by const record accessor as in cache init: 39/40 instructions; structural/exact (2, 11); pool identical; exact regressions []; reverted.
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx | const accessor for name but direct member address for update, matching add: 39/40 instructions; structural/exact (4, 19); pool identical; exact regressions []; reverted.
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx | direct writable name with const accessor only for final update: 39/40 instructions; structural/exact (10, 32); pool identical; exact regressions []; reverted.
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx | explicit signed friend index in final member lookup: 40/40 instructions; structural/exact (0, 0); pool identical; exact regressions []; retained for gate.
|
||||
|
||||
## AddressEdit::create
|
||||
Fresh origin fetch, source unchanged. Target 820 instructions versus ours 818, frame 0x50. Constant text-pool base and board file use swapped saved registers; tail has argument-load order and two lost conditional margin loads because source creates margin locals before new. Exact sibling Address::create and AddressAddSel::create use getSceneHeap and natural constructor arguments; exact AddressEdit::stt_wait_decide_anm names animator/text receivers. TextBalloon construction idiom from siblings will be compared. No pool/extent/reference-index issue.
|
||||
|
||||
- create__Q33ipl5scene11AddressEditFv | literal margins in new constructor, matching target conditional argument evaluation: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | literal margins plus direct getSceneHeap used by exact sibling create: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | named board receiver before layout file accessor, sibling scene idiom: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
|
||||
FriendListCache::update exact result: final signed native mInfos subscript prevents MWCC retaining the earlier const accessor result across wcsncpy, matching the target repeated 0x140 multiply. Uses the same member array as exact add, with signed indexing consistent with getInfo(int). 40/40 instructions, ctxdiff diffs 0. Quick three-unit gate PASS, zero regressions/forbidden/readability warnings; data remains exact.
|
||||
Baseline instruction-exact counts freshly measured: Address 97/101, AddressEdit 91/94, CardSequence 27/30. Address objdiff count is 98, one existing objdiff-exact stream is not instruction-exact.
|
||||
AddressEdit::create note correction: frame is 0x60, not 0x50; direct literal margins dropped saved floats and grew the structural mismatch. Exact SDButton::create confirms the direct-literal idiom but our target retains saved margins across the position constructor.
|
||||
|
||||
Full non-quick three-unit gate 1: GATE PASS; DOL 26116613f624061ba99c8d1a299aaa6efa85670d; zero regressions/forbidden/readability warnings; Address code 22016/23988, objdiff 99/101, instruction-exact 98/101, data 1964/1964. Other owned units unchanged. Gate log /tmp/gk3.gate2.log.
|
||||
The baseline objdiff/instruction count discrepancy is AddressEvent::onEvent: odiff interprets the first condition-register operand of two beq instructions as a branch immediate, yielding source-offset-dependent false instruction differences. Objdiff remains 100%; no source change warranted.
|
||||
- create__Q33ipl5scene11AddressEditFv | TextBalloon default margin arguments before VEC3 evaluation: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | default margin constructor plus exact sibling getSceneHeap spelling: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | default margins with heap-before-manager creation arguments as target loads: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
|
||||
## AddressEdit::get_friendinfo
|
||||
Fresh origin fetch; assigned source unchanged. Target 84/ours 82 instructions, both frame 0x420. Target holds name/display-text member addresses across FindPaneByName virtual calls, ours computes them after. Matched local idiom is AddressEdit::create mode 0 and exact stt_add_name_fadein/stt_wait_decide_anm, which bind text and Pane before set_textbox. Matching add_friendinfo also binds typed source/destination. No pool/extent/reference-index issue.
|
||||
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | name/display pointer lifetimes across pane lookup matching scene text idiom: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | typed record-copy input and destination boundaries with named text pointers: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | named friend index and cache before copy, keeping text accessor lifetimes: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
|
||||
## AddressEdit::update_friendinfo
|
||||
Fresh origin fetch, assigned source unchanged. 38/38 instructions and 0x10 frame, only wcsncpy source/destination address instruction order differs. Exact add_friendinfo creates const name and writable storedName locals in that order. Porting that source-evaluation idiom; no pool/data/extent/reference-index issue.
|
||||
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | named source and destination matching exact add_friendinfo: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | read-only String view for source alias and load ordering: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | typed global friend-info reference plus const name pointer: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
|
||||
Accessor-boundary reconstruction: trying guarded read-only String getName/getDisplayText helpers, matching existing getDispCodeLong and Address::getInfo getter style. Header guard affects only AddressEdit CPP. Pure member-address temporaries alone were sunk after virtual calls; inline accessor return lifetimes may recover the two target saved addresses.
|
||||
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | const inline String accessor return across pane lookup: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | mutable inline String receiver with const returned text: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | const inline name getter in wcsncpy argument, matching accessor evaluation idiom: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | explicit first element address for stored UTF16 name: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | explicit source first element address in wcsncpy: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | ordinary wide pointer cast spelling as in matching FriendListCache update: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
|
||||
## cardThreadMain
|
||||
Fresh origin fetch; owned source unchanged. Target/ours 301 instructions, frame 0x130. Structural mismatch is validity response packing order plus many register assignments. Exact matched siblings probeCard and sendCardSlotState use OSMessage, typed slot/command extraction, queue locals and a union packet; clearAllCardFileEntries uses a signed do/while index. Matched index checked: all are 100. No pool/data/extent/reference-index issue.
|
||||
|
||||
- cardThreadMain | native OSMessage receive/storage matching exact probeCard: 301/301 instructions; structural/exact (2, 78); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | queue local before union field assembly matching exact sendCardSlotState: 301/301 instructions; structural/exact (2, 78); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | signed do/while mounted-file scan following exact clearAllCardFileEntries: 301/301 instructions; structural/exact (2, 78); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | union packet-return helper evaluated in message argument, exact sendCardSlotState idiom: 301/301 instructions; structural/exact (2, 78); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | const by-value packet parameters for read-only response view: 301/301 instructions; structural/exact (2, 78); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | explicit low-byte command mask before validity bitfield insertion: 301/301 instructions; structural/exact (2, 78); pool identical; exact regressions []; reverted.
|
||||
|
||||
## loadCardFileIcons
|
||||
Fresh origin fetch; source unchanged. Target 512 instructions/frame 0x60, ours 508/frame 0x60. Structural differences include image/comment error joins, signed icon-array indexing and saved-register allocation. Exact matched refreshCardSlotInfo uses native u32 sector-size locals, checkCardFileDuplicate uses typed CARDDir and signed file loops, clearAllCardFileEntries uses signed do/while. Matched MemoryCardManager icon_set uses a const IconState* read-only view. Target keeps the previous palette byte count for reserved format 3; first-format-3 appears to read an unspecified incoming register. No uninitialized C local will be introduced. All 1496 data bytes exact; pool/extent/reference-index checks clean.
|
||||
|
||||
- loadCardFileIcons | const CARDDir input matching read-only icon metadata view: 505/512 instructions; structural/exact (103, 431); pool identical; exact regressions []; reverted.
|
||||
- loadCardFileIcons | native unsigned sector size outputs matching exact refreshCardSlotInfo: 508/512 instructions; structural/exact (66, 436); pool identical; exact regressions []; reverted.
|
||||
- loadCardFileIcons | signed do/while animation speed scan matching clearAllCardFileEntries: 509/512 instructions; structural/exact (71, 423); pool identical; exact regressions []; reverted.
|
||||
|
||||
## runCardMoveOrCopy
|
||||
Fresh origin fetch; owned source unchanged. 608/608 instructions, frame 0x1E0. Structural diffs are permission/metadata error joins and scheduling; most of 185 instruction differences are saved-register assignments. Closest exact sibling checkCardFileDuplicate uses scoped native result/status values and signed do/while scan; handleCardMountResult uses helper error returns; sendCardSlotState packs explicit byte masks. Applying helper and typed-local idioms before declaration search. No pool/data/extent/reference-index issue.
|
||||
loadCardFileIcons sibling-reference correction: MemoryCardManager::_create_icon uses a mutable typed IconState*, not a const pointer; the const CARDDir experiment tests the proven read-only-input lever. The exact typed return view is getIconComment.
|
||||
|
||||
- runCardMoveOrCopy | inline common-sector helper with reference outputs and exact sibling error returns: 608/608 instructions; structural/exact (12, 185); pool identical; exact regressions []; reverted.
|
||||
- runCardMoveOrCopy | scoped permission result matching exact status-helper local lifetime: 608/608 instructions; structural/exact (12, 176); pool identical; exact regressions []; reverted.
|
||||
- runCardMoveOrCopy | explicit block count guard following exact sibling native loop locals: 609/608 instructions; structural/exact (24, 498); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | explicit signed friend index for const cache getter: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | const reference receiver for initial friend cache read: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | unsigned getter index view guarded to the owning AddressEdit translation unit: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | const margin locals matching read-only constructor settings: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | double literal conversion in direct constructor defaults: 808/820 instructions; structural/exact (37, 803); pool identical; exact regressions []; reverted.
|
||||
- create__Q33ipl5scene11AddressEditFv | const reference margin locals retaining setting view through vector constructor: 818/820 instructions; structural/exact (23, 331); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | real inline UTF16 name-copy helper with const String input: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | mutable String helper receiver with const wcsncpy input: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | inline name accessor/copy boundary retaining the original clear call: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | layout FindPaneByName wrapper used by exact Address text methods: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | direct layout root accessor boundary before virtual lookup: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv | named read-only text plus layout wrapper boundary: 82/84 instructions; structural/exact (10, 68); pool identical; exact regressions []; reverted.
|
||||
|
||||
Address::start_drag_event member-helper attempt: correct the earlier free-helper access error with a private real inline member guarded to IPL_ADDRESS_MATCHING. This ports the matched MiiObj::create_callback texture-installation boundary without changing another translation unit.
|
||||
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | real inline Address member for const icon installation: 224/223 instructions; structural/exact (8, 109); pool DIVERGES; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | read-only pointer parameter for inline member texture installation: 224/223 instructions; structural/exact (8, 109); pool DIVERGES; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | inline const icon member with matched callback root-pane lookup: 224/223 instructions; structural/exact (8, 109); pool DIVERGES; exact regressions []; reverted.
|
||||
- loadCardFileIcons | explicit image result join matching target helper success/error returns: 507/512 instructions; structural/exact (65, 431); pool identical; exact regressions []; reverted.
|
||||
- loadCardFileIcons | named image status before joined success/error path: 507/512 instructions; structural/exact (65, 431); pool identical; exact regressions []; reverted.
|
||||
- loadCardFileIcons | separate comment base lifetime matching target inlined read regions: 507/512 instructions; structural/exact (65, 431); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | typed picture receiver for texture installation, matching NW4R picture role: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | typed picture with read-only icon object accessor: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | pane reference receiver for matched callback texture idiom: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
|
||||
Register allocation last: update_friendinfo official declsearch over two independent name-pointer initializers after the clear, following three structural/sibling attempts. declaration block: | const wchar_t* name = mString.mName; | wchar_t* storedName = reinterpret_cast<wchar_t*>(ipl::scene::sFriendInfo.attr.name); | start (2, 2) | best (2, 2) after 2 builds; source restored; best order was: | const wchar_t* name = mString.mName; | wchar_t* storedName = reinterpret_cast<wchar_t*>(ipl::scene::sFriendInfo.attr.name); |
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv | official declsearch final name argument scheduling check: 38/38 instructions; structural/exact (2, 2); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | explicit unsigned valid MiiObj index, matching stored friend-index view: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | unsigned MiiObj indexing with exact callback root lookup: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface | native unsigned friend-index local for both icon access and reset: 223/223 instructions; structural/exact (0, 7); pool identical; exact regressions []; reverted.
|
||||
|
||||
Register allocation last for cardThreadMain: after six structural/sibling/helper attempts, official declsearch over its independent scalar locals, max 120 evaluations. The packet insertion scheduling is the only remaining normalized structure difference; no added storage or undefined values.
|
||||
|
||||
declaration block: | BOOL brokenFile; | BOOL exitThread = FALSE; | u32 validState = TRUE; | u32 command; | s16 fileNo; | u8 slot; | s32 result; | s32 file; | u32 listingFile; | s32 outerSlot; | s32 freeFile; | s32 freeBlocks; | start (2, 78) | improved (2, 73) | improved (2, 58) | improved (2, 54) | improved (2, 50) | improved (2, 41) | improved (2, 39) | best (2, 39) after 120 builds; kept in source: | s32 freeBlocks; | s32 outerSlot; | s32 freeFile; | u32 command; | u32 validState = TRUE; | u8 slot; | s32 result; | s32 file; | BOOL brokenFile; | BOOL exitThread = FALSE; | u32 listingFile; | s16 fileNo; |
|
||||
- cardThreadMain | final official scalar-declaration search check: 301/301 instructions; structural/exact (2, 39); pool identical; exact regressions []; reverted.
|
||||
|
||||
Decoder discrepancy confirmed from raw ELF bytes: AddressEvent::onEvent instruction 32 is 418601ec and instruction 37 is 41860020 in both baseline and target. Capstone yields beq cr1, immediate; odiff incorrectly reads operand 0 (the condition-register identifier 13) instead of the last immediate. The gate instruction-exact count excludes this existing byte-identical function. Gate scripts remain untouched.
|
||||
|
||||
Card thread last-register continuation: first declsearch improved 78 -> 39 instruction differences, preserving 301 instructions and every exact function/pool. It was restored while preparing a bounded continuation from that real scalar order. Continue official search for 240 evaluations; source trials have already covered native packet, helper, and loop idioms.
|
||||
declaration block: | s32 freeBlocks; | s32 outerSlot; | s32 freeFile; | u32 command; | u32 validState = TRUE; | u8 slot; | s32 result; | s32 file; | BOOL brokenFile; | BOOL exitThread = FALSE; | u32 listingFile; | s16 fileNo; | start (2, 39) | improved (2, 35) | best (2, 35) after 240 builds; kept in source: | s16 fileNo; | s32 freeBlocks; | s32 outerSlot; | s32 freeFile; | u32 command; | u32 validState = TRUE; | u8 slot; | s32 result; | s32 file; | BOOL brokenFile; | BOOL exitThread = FALSE; | u32 listingFile; |
|
||||
- cardThreadMain | continued official scalar allocation search: 301/301 instructions; structural/exact (2, 35); pool identical; exact regressions []; reverted.
|
||||
|
||||
Card thread final structural packing trials start from the real scalar order found by declsearch. Test exact sibling byte-mask and typed wire-field idioms; preserve initialized packet storage and command bits. Nonexact results are restored.
|
||||
|
||||
- cardThreadMain | explicit masked validity byte merge matching exact sendCardSlotState masks: 301/301 instructions; structural/exact (2, 34); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | byte-typed validity parameter matching packed response field: 301/301 instructions; structural/exact (2, 35); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | aggregate initialized response union with named native message result: 301/301 instructions; structural/exact (2, 35); pool identical; exact regressions []; reverted.
|
||||
- cardThreadMain | byte-field native packet matching exact response wire layout: 302/301 instructions; structural/exact (45, 263); pool identical; exact regressions []; reverted.
|
||||
|
||||
## Final completeness audit
|
||||
|
||||
Fresh origin/main 885cdfeee63a4b681bb5242e198dd7220834eb43. Owned sources/headers unchanged since the starting main.
|
||||
|
||||
- start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface: 18 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- onEventDerived__Q33ipl5scene7AddressFUlUlPCQ33ipl10controller9Interface: 3 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- update__Q33ipl5scene15FriendListCacheFUlPCwUx: 6 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- create__Q33ipl5scene11AddressEditFv: 9 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- get_friendinfo__Q33ipl5scene11AddressEditFv: 11 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- update_friendinfo__Q33ipl5scene11AddressEditFv: 10 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- cardThreadMain: 10 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- loadCardFileIcons: 6 compiled distinct source/helper/type/loop trials before final gate.
|
||||
- runCardMoveOrCopy: 3 compiled distinct source/helper/type/loop trials before final gate.
|
||||
|
||||
All experimental header and nonexact source changes restored. Retained code: only the gate-passing signed FriendListCache member subscript. Owned pools/data require no symbol rename or extent correction. Final non-quick three-unit gate follows.
|
||||
|
||||
## Final full gate and open-function audit
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[src/scene/address/iplAddress] pool: IDENTICAL
|
||||
[src/scene/address/iplAddress] objdiff: code 22016/23988 data 1964/1964 functions 99/101 fuzzy 99.9233 linked code 0
|
||||
[src/scene/address/iplAddress] instruction-exact functions: 98/101
|
||||
[src/scene/address/iplAddress] section .ctors size 4 match 100.0
|
||||
[src/scene/address/iplAddress] section .data size 1880 match 100.0
|
||||
[src/scene/address/iplAddress] section .rodata size 24 match 100.0
|
||||
[src/scene/address/iplAddress] section .sbss size 8 match 100.0
|
||||
[src/scene/address/iplAddress] section .sdata size 16 match 100.0
|
||||
[src/scene/address/iplAddress] section .sdata2 size 32 match 100.0
|
||||
[src/scene/address/iplAddress] section .text size 23988 match 99.923294
|
||||
[src/scene/address/iplAddress] below 100: start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface 99.84305
|
||||
[src/scene/address/iplAddress] below 100: onEventDerived__Q33ipl5scene7AddressFUlUlPCQ33ipl10controller9Interface 98.42593
|
||||
[src/scene/address/iplAddress] baseline: code 21856/23988 data 1964 functions 98 fuzzy 99.8933
|
||||
[src/scene/address/iplAddressEdit] pool: IDENTICAL
|
||||
[src/scene/address/iplAddressEdit] objdiff: code 23344/27112 data 2560/2560 functions 91/94 fuzzy 99.5528 linked code 0
|
||||
[src/scene/address/iplAddressEdit] instruction-exact functions: 91/94
|
||||
[src/scene/address/iplAddressEdit] section .bss size 320 match 100.0
|
||||
[src/scene/address/iplAddressEdit] section .data size 2152 match 100.0
|
||||
[src/scene/address/iplAddressEdit] section .rodata size 40 match 100.0
|
||||
[src/scene/address/iplAddressEdit] section .sdata size 24 match 100.0
|
||||
[src/scene/address/iplAddressEdit] section .sdata2 size 24 match 100.0
|
||||
[src/scene/address/iplAddressEdit] section .text size 27112 match 99.55282
|
||||
[src/scene/address/iplAddressEdit] below 100: create__Q33ipl5scene11AddressEditFv 97.5561
|
||||
[src/scene/address/iplAddressEdit] below 100: get_friendinfo__Q33ipl5scene11AddressEditFv 88.03571
|
||||
[src/scene/address/iplAddressEdit] below 100: update_friendinfo__Q33ipl5scene11AddressEditFv 99.42105
|
||||
[src/scene/address/iplAddressEdit] baseline: code 23344/27112 data 2560 functions 91 fuzzy 99.5528
|
||||
[src/scene/cardSequence/iplCardSequence] pool: IDENTICAL
|
||||
[src/scene/cardSequence/iplCardSequence] objdiff: code 4168/9852 data 1496/1496 functions 27/30 fuzzy 97.2010 linked code 0
|
||||
[src/scene/cardSequence/iplCardSequence] instruction-exact functions: 27/30
|
||||
[src/scene/cardSequence/iplCardSequence] section .bss size 16 match 100.0
|
||||
[src/scene/cardSequence/iplCardSequence] section .data size 1464 match 100.0
|
||||
[src/scene/cardSequence/iplCardSequence] section .sbss size 8 match 100.0
|
||||
[src/scene/cardSequence/iplCardSequence] section .sdata size 8 match 100.0
|
||||
[src/scene/cardSequence/iplCardSequence] section .text size 9852 match 97.20097
|
||||
[src/scene/cardSequence/iplCardSequence] below 100: cardThreadMain 97.9402
|
||||
[src/scene/cardSequence/iplCardSequence] below 100: loadCardFileIcons 90.34375
|
||||
[src/scene/cardSequence/iplCardSequence] below 100: runCardMoveOrCopy 97.8125
|
||||
[src/scene/cardSequence/iplCardSequence] baseline: code 4168/9852 data 1496 functions 27 fuzzy 97.2010
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.53532 -> 91.54067
|
||||
global fuzzy_match_percent: 99.69871 -> 99.69896
|
||||
global complete_code_percent: 74.74593 -> 74.74593
|
||||
global matched_data_percent: 99.55890 -> 99.55890
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
Fresh objdiff report regenerated after the full clean build. build/43U/ok up to date; FriendListCache::update objdiff 100.0, ctxdiff 40/40 instructions and diffs 0. All three owned pools identical and all owned data sections 100.0.
|
||||
|
||||
- src/scene/address/iplAddress: objdiff exact functions 98/101 -> 99/101; matched code bytes 21856 -> 22016/23988; data bytes 1964 -> 1964/1964.
|
||||
- OPEN start_drag_event__Q33ipl5scene7AddressFPCcPCQ33ipl10controller9Interface: 99.84305%; 18 distinct compiled source attempts. 223/223 instructions, seven saved icon/pane register differences; sibling accessor/root/picture trials unchanged.
|
||||
- OPEN onEventDerived__Q33ipl5scene7AddressFUlUlPCQ33ipl10controller9Interface: 98.42593%; 3 distinct compiled source attempts. 270/270 instructions, normalized structure exact; 81 saved-register differences after sibling lookup/animator boundaries.
|
||||
- src/scene/address/iplAddressEdit: objdiff exact functions 91/94 -> 91/94; matched code bytes 23344 -> 23344/27112; data bytes 2560 -> 2560/2560.
|
||||
- OPEN create__Q33ipl5scene11AddressEditFv: 97.5561%; 9 distinct compiled source attempts. 818/820 instructions; conditional margin loads, saved pool/file registers, argument scheduling; literal/default/const margins did not recover target.
|
||||
- OPEN get_friendinfo__Q33ipl5scene11AddressEditFv: 88.03571%; 11 distinct compiled source attempts. 82/84 instructions; target preserves text addresses across virtual pane lookup, ours rematerializes them; accessor/helper/const-view trials unchanged.
|
||||
- OPEN update_friendinfo__Q33ipl5scene11AddressEditFv: 99.42105%; 10 distinct compiled source attempts. 38/38 instructions; wcsncpy source/destination address setup order swapped; typed const views/accessors/name-copy helper and final declsearch unchanged.
|
||||
- src/scene/cardSequence/iplCardSequence: objdiff exact functions 27/30 -> 27/30; matched code bytes 4168 -> 4168/9852; data bytes 1496 -> 1496/1496.
|
||||
- OPEN cardThreadMain: 97.9402%; 10 distinct compiled source attempts. 301/301 instructions; validity-byte merge scheduling and saved-register lifetimes; 360 official declaration evaluations reduced a reverted candidate to 35 differences, byte-mask variant 34 but no exact gain.
|
||||
- OPEN loadCardFileIcons: 90.34375%; 6 distinct compiled source attempts. 508/512 instructions; image/comment error joins, indexing and palette lifetime for reserved format 3. No undefined-value reconstruction introduced.
|
||||
- OPEN runCardMoveOrCopy: 97.8125%; 3 distinct compiled source attempts. 608/608 instructions; permission/metadata joins and saved-register allocation. Scoped result variant reduced 185 to 176 differences but was restored.
|
||||
|
||||
Instruction-exact gate counts before -> after: Address 97/101 -> 98/101; AddressEdit 91/94 -> 91/94; CardSequence 27/30 -> 27/30. AddressEvent::onEvent remains objdiff 100.0 and byte-identical; the existing condition-register branch decoder discrepancy explains the one-count difference.
|
||||
Only code delta: signed direct member indexing in FriendListCache::update, committed as fd527e4a. No other CPP/header/config edit retained. No upstream writes, pushes, PRs, workers or linking changes.
|
||||
Unresolved source inference: loadCardFileIcons reserved initial palette format 3; target appears to carry an incoming register, so no uninitialized local was substituted. All reverted helper/register candidates remain documented above.
|
||||
87
tools/decomp-assist/nwc24-download-retry-mask-20261003.md
Normal file
87
tools/decomp-assist/nwc24-download-retry-mask-20261003.md
Normal file
@@ -0,0 +1,87 @@
|
||||
# NWC24Download source and retry-mask audit, 2026-10-03
|
||||
|
||||
Baseline: 1fa33882. Read AGENTS, CONTRIBUTING, NWC24Download, pk2, fz10,
|
||||
and structural round 10/12 attempt records. PR #954 is already present.
|
||||
Only libs/RevoEX/src/nwc24/NWC24Download.c changes, plus this evidence file.
|
||||
|
||||
## Retained correction
|
||||
|
||||
CheckDlTaskRetry accepts retry counts 0 through 31 and reads a u32 mask.
|
||||
The reconstructed `1 << retryCount` has undefined signed-left-shift behavior
|
||||
at count 31. Use `1U << retryCount` to express the target's 32-bit mask.
|
||||
The target checks the upper bound before shifting; that order stays intact.
|
||||
|
||||
The full compiled object is byte-identical to the baseline, SHA256:
|
||||
85cc303983a219bdb34b3765ecc3a352fade4238e1ce911a7cba8078e3e9b42a
|
||||
This is a source-definedness correction, not a fuzzy or exact-match gain.
|
||||
|
||||
## Semantic coverage and remaining differences
|
||||
|
||||
- NWC24InitDlTask: all 144 instructions have the same operations, constants,
|
||||
branch destinations and relocation targets after register normalization.
|
||||
Home-path parsing, identifier halves, byte/halfword task stores, default
|
||||
intervals, content filename, and permission-result propagation agree.
|
||||
- NWC24iCheckDlHeaderConsistency: 212/212 instructions; its only differences
|
||||
are scheduling three entry instructions. Repair dispatch, signed subtask
|
||||
halfword test, read/delete contracts and error branches agree.
|
||||
- NWC24UpdateDlTask: reviewed both permission checks, time retrieval and signed
|
||||
64-bit division by 60, task/header validation, reset stores, retry error
|
||||
constants, mask handling and StoreDlTask arguments. The target's repeated
|
||||
work/header reads and retry-field accesses are present. Remaining shape
|
||||
differences concern saved lifetimes/frame and equivalent retry branches.
|
||||
- AddTaskInternal: reviewed URL validation, update path, free-slot bounds and
|
||||
16-byte entry addressing, task-ID halfword stores, purge error propagation,
|
||||
and repeated lookup/update control flow. No omitted call, wrong field
|
||||
offset, or different error constant was found.
|
||||
- The task record is 0x200 bytes; retry count/enabled/mask offsets are
|
||||
0x24/0x25/0x28. The list has a 0x80-byte prefix and 120 0x10-byte entries,
|
||||
matching its 0x800-byte read/write contract.
|
||||
|
||||
## Rejected investigations
|
||||
|
||||
All are restored; none is part of the retained source diff.
|
||||
|
||||
- Widening AddTaskInternal/FindFreeDlTask bounds to u32 while retaining the
|
||||
halfword loop cursor: Add 97.7182% -> 97.14464%.
|
||||
- Reusing the existing CheckDlUrlString helper in ValidateDlTaskUrl:
|
||||
Add 97.7182% -> 96.38404%. The shared helper did not recover the original
|
||||
inlined error boundary.
|
||||
- Shared group permission helper taking a const task and an explicit nested
|
||||
boolean: Update 95.00395% -> 98.81423%, Init -> 99.02778%, but five exact
|
||||
sibling functions regressed and Add fell to 97.58105%. No special-purpose
|
||||
update-only copy was introduced to isolate allocation effects.
|
||||
- Wide bounds with a wide search cursor initially narrowed to NWC24DlId:
|
||||
Add -> 98.0424%. This did not establish the original bounds contract or
|
||||
recover the complete loop form, so the existing types were preserved.
|
||||
|
||||
Prior logs already contain stronger but discarded Update helper-boundary
|
||||
scores, including 99.48617%. Those are historical results, not new gains.
|
||||
No register/declaration sweep, qualifier trick, dummy storage, new assembly,
|
||||
header change, or linking change was used.
|
||||
|
||||
## Verification
|
||||
|
||||
- Configured only 43U with ../toolchain/wibo-build/wibo
|
||||
- WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja all_source build/43U/report.json build/43U/ok
|
||||
- Complete object and complete project report identical to the fresh baseline
|
||||
- All 26 exact functions compared with relocation-aware ctxdiff: zero differences
|
||||
- Pool: identical, 3/3 strings
|
||||
- Literal audit: 4 arguments, 26 functions, no skips/candidates/errors
|
||||
- Exact code 8456/12496, exact functions 26/30, data 80/80 and fuzzy 99.169655%, unchanged
|
||||
- DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
A native C11 harness extracts the actual helper, task layout and error enum,
|
||||
with a validation-result stub. GCC -O2 -Wall -Wextra -Werror and UBSan checks
|
||||
270336 combinations: every u8 count, 66 zero/all/one-hot/complement masks,
|
||||
four enabled values and four validation outcomes. It uses an independent
|
||||
right-shift predicate as its expected mask result. All retained-helper cases
|
||||
and layout assertions pass. The otherwise identical baseline harness fails
|
||||
at count 31: signed left shift cannot be represented in int.
|
||||
|
||||
Local harness: /tmp/nwc24-retry-mask-test.c (executable without .c).
|
||||
Baseline reproducer: /tmp/nwc24-retry-mask-baseline-test.c.
|
||||
These test the local retry predicate, not filesystem or network integration.
|
||||
|
||||
GATE: byte preservation, exact-function/data preservation, complete-report
|
||||
nonregression, pool, literals, native UBSan and full 43U/DOL checks pass.
|
||||
1190
tools/decomp-assist/perm2.attempts.md
Normal file
1190
tools/decomp-assist/perm2.attempts.md
Normal file
File diff suppressed because it is too large
Load Diff
1904
tools/decomp-assist/perm7.attempts.md
Normal file
1904
tools/decomp-assist/perm7.attempts.md
Normal file
File diff suppressed because it is too large
Load Diff
312
tools/decomp-assist/perm8.attempts.md
Normal file
312
tools/decomp-assist/perm8.attempts.md
Normal file
@@ -0,0 +1,312 @@
|
||||
# perm8 C permuter lane
|
||||
|
||||
Baseline: `255f3e05305939d73df73fcf9c4cd9044be9fa91`. Worktree: `sol-high`, branch `agent/w1002/sol-perm8-max`.
|
||||
|
||||
All three units had identical pools before source experiments. Only Wii Menu 4.3U was built. Compile scripts use the GC/3.0a5.2 MWCC command and flags from `ninja -t commands`, including `-O4,p`, `-ipa file`, `-fp_contract off`, and `-lang=c`; dependency-file generation is omitted for temporary objects. Original extracted objects supply the targets. The scorer selects the exact function name and includes stack differences. The aligned partition buffer remains aligned to 32 bytes in the preprocessed context.
|
||||
|
||||
Per-function contexts and compile scripts are under `/tmp/perm-<function>`. Compiler dependencies are in `/tmp/perm8-venv`. Searches used at most two permutation jobs in this lane: one job per concurrent function, then two jobs for the final partition search after the other searches finished. Each stalled search was stopped after about 45 minutes without a better score. Searches stopped earlier when a readable exact reconstruction was found or when a better readable seed replaced the old seed.
|
||||
|
||||
## Exact source changes
|
||||
|
||||
- `NWC24ReadMsgSubjectPublic`: baseline 100/104 instructions. At offsets 0xa0..0xb8 and 0xe0..0xf8, the target compares status with 0 and -8. The four missing instructions are unconditional switch exits, including unreachable default exits; there are no additional length-check comparisons. A single success-case switch whose default marks overflow and breaks, then returns other errors directly, produces 104/104 instructions and zero differences.
|
||||
- `NWC24ReadMsgTextPublic`: the same status dispatch at 0xa8..0xc0 needs two unconditional exits. The same readable switch/default/early-return form produces 70/70 instructions and zero differences.
|
||||
- `NWC24SetMsgSubjectAndTextPublic`: the score-40 permutation suggested staging the computed text capacity. The readable reconstruction stores that value in `textCapacity`, copies it to the mutable `textWorkSize`, and declares `subjectWork` before `subjectWorkSize`. This produces 190/190 instructions and zero differences. No unused pointer assignment, identity inline wrapper, or multiplication noise from the generated candidate remains.
|
||||
|
||||
Reader changes were committed as `1bb68c6f`. Their clean full gate reported 11/12 exact functions, code 4592/5352, data 232/232, identical pools, zero regressions, zero forbidden patterns/readability warnings, and the correct DOL SHA1.
|
||||
|
||||
The setter was committed as `30744387`. Its clean full gate reported 12/12 exact functions, code 5352/5352, data 232/232, every owned section at 100%, identical pools, zero regressions, zero forbidden patterns/readability warnings, and the correct DOL SHA1.
|
||||
|
||||
## Reader source attempts
|
||||
|
||||
Both reader functions were tried with at least these distinct changes:
|
||||
|
||||
1. Explicit OK/OVERFLOW/default switches: correct instruction counts, but 10 subject differences and five text differences from range dispatch.
|
||||
2. A success/default switch with an overflow `if` ending in `break`: still 100/104 and 68/70 instructions because the exits disappeared.
|
||||
3. Nested overflow switches and reordered case labels: no exact result; extra dispatch tests or missing exits remained.
|
||||
4. Explicit rejected error cases: 110/104 and 73/70 instructions; discarded.
|
||||
5. Early `return result` for rejected statuses instead of `goto done`: both functions became exact. Existing buffer bounds and truncation behavior are preserved.
|
||||
|
||||
## NWC24SetMsgSubjectAndTextPublic attempts
|
||||
|
||||
1. Split the text-capacity ratio into numerator and division statements; reorder size and work-pointer setup; retain a charset-name pointer: still non-exact.
|
||||
2. Use meaningful text/subject charset temporaries and separate encoding variables: 65 register differences, or shorter non-matching instruction streams; discarded.
|
||||
3. Name the text buffer separately: 65 differences; discarded.
|
||||
4. Reconstruct the staged text capacity with a real `textCapacity` variable: eight remaining differences, solely swapping `subjectWork` and `subjectWorkSize` registers.
|
||||
5. Reorder those two declarations while retaining the capacity staging: zero differences and 100% exact-name objdiff. No helper or redundant temporary was needed.
|
||||
|
||||
Generated score-150 candidates assigned to unused charset temporaries; discarded. Score-300 output read `subjectWorkSize` before initialization; discarded. Score-125 output added a pointer-to-pointer alias of `work`; discarded. The useful score-40 capacity hint was translated into the minimal readable source above.
|
||||
|
||||
## ConvertDateToDays attempts
|
||||
|
||||
1. Compute annual days before the century quotient, or decrement the year offset later: 16 differences remained.
|
||||
2. Split common-leap quotients and try a single total expression: 16-18 differences.
|
||||
3. Enumerate natural groupings of annual, century, and ordinary leap days, with real scalar temporaries: best six differences, at instructions 98..103. This seed keeps 113/113 instructions but changes scheduling and registers in the final arithmetic.
|
||||
4. Put the century and ordinary leap calculations in readable inline helpers, and vary their source expressions: best still six differences.
|
||||
5. Permute both the original and refined seeds: no exact result. The original source was restored; no fuzzy-only change is retained.
|
||||
|
||||
## ConvertDaysToDate attempts
|
||||
|
||||
1. Initialize the month at its declaration or use a word-sized month: 26 differences.
|
||||
2. Invert the monthly leap branch: 12 differences. Nest the February check: 107/103 instructions; discarded.
|
||||
3. Initialize the saved day count at its declaration, change the leap-result scalar type, or qualify the month alias: six differences remained.
|
||||
4. Reorder the monthly declarations: six differences remained at 55, 57, 60, 83, 84, and 88, swapping the month byte and leap flag between r0 and r12.
|
||||
5. Permute the complete function, then restrict randomization to the monthly loop: no improvement over score 30. Original source restored.
|
||||
|
||||
## pdm_part_is_master_boot_sector attempts
|
||||
|
||||
1. Grouped little-endian inline helpers, separate even/odd groups, byte locals, and sequential accumulators: no exact result.
|
||||
2. Enumerate direct little-endian macro expression trees: the best readable seed has 84/84 instructions and 33 differences. It removes the two extra baseline instructions but still differs in allocation and scheduling.
|
||||
3. Cache each real start-sector input byte before or after clearing the destination, using byte and word temporaries: 33-35 differences; discarded.
|
||||
4. Run whole-function randomization: best score 820, with no exact candidate. A valid score-820 hint caches buffer byte 456; readable reconstructions did not match.
|
||||
|
||||
The tied score-820 candidate using `(454 & 0xFF) + 3` reads byte 201 instead of byte 457. It is semantically wrong and was rejected. Earlier score-950 candidates combined the two cursor pointers into an array; those were also discarded. Original source is retained.
|
||||
|
||||
## pdm_part_get_start_sector attempts
|
||||
|
||||
1. Grouped endian inline helpers, word macros, byte locals, pointer views, and expression-tree permutations: the best initial readable seed had 45 differences with 276/276 instructions.
|
||||
2. Reconstruct the valid permutation declaration-order hint: 39 differences. Permute the four real loop-variable declarations: best eleven differences, all in the two extended-entry byte decoding blocks, at 175..181, 208..209, and 213..214.
|
||||
3. Relative-sector helpers, explicit grouping of base and decoded word, and named even/odd byte groups: 26-38 differences, or no exact build; discarded.
|
||||
4. Meaningful byte-array views of the partition start/count fields: eleven differences remained.
|
||||
5. Cache actual offset bytes with byte/word scalar types at different declaration positions: 11-41 differences. Every value was initialized and actually used; no exact result.
|
||||
6. Run a second search from the eleven-difference seed, restricted to the two byte-decoding blocks, with two jobs. Generated score-107 and score-85 hints introduced unused pointer/scalar assignments. The natural byte-view and cached-byte reconstructions did not match and are not retained.
|
||||
|
||||
Before starting each function, origin was fetched under `/tmp/wii-git.lock` and checked for existing exact work. Origin's partition source changed during the run in `230c3af2`, adding a typed endian helper. Compiling that updated source separately proved both requested functions remained non-exact (86/84 instructions for the master-sector function, 276/276 and 147 positional differences for the start-sector function). The start-sector search was resumed after a fresh fetch; the source was unchanged at that second check. No remote changes, branch operations, or rebases were performed in this worktree.
|
||||
|
||||
## Search measurements and final gate
|
||||
|
||||
The final measurements and the final clean gate are appended after every search exits. Permuter scores are search penalties, not objdiff percentages. Only readable source with exact-name objdiff 100% and zero instruction differences counts as a result.
|
||||
|
||||
| Function | Permutations | Best score | Result |
|
||||
| --- | ---: | ---: | --- |
|
||||
| NWC24ReadMsgSubjectPublic | 1455 | 400 | Exact structural source rewrite; search stopped |
|
||||
| NWC24ReadMsgTextPublic | 4496 | 200 | Exact structural source rewrite after stalled search |
|
||||
| NWC24SetMsgSubjectAndTextPublic | 2498 | 40 | Readable reconstruction reached exact match; search stopped |
|
||||
| ConvertDateToDays | 1336 + 3721 | 355 then 235 | No exact result |
|
||||
| ConvertDaysToDate | 1826 + 1814 | 30 in both phases | No exact result |
|
||||
| pdm_part_is_master_boot_sector | 4950 | 820 | No exact result |
|
||||
| pdm_part_get_start_sector | 2317 + 15888 | 418 then 85 | No readable exact result |
|
||||
|
||||
The final partition phase ran 4133 seconds with two jobs, ending after about 45 minutes without a lower score. The score-85 candidate still requires an unused byte assignment. Forty-eight readable cached-byte variants and the entry-view variants failed exact comparison. The best readable partition seed stayed eleven differences and was not retained. Every search exited, with no permutation process left running. Full raw source-attempt details are preserved in `/tmp/perm8-raw-attempts.md`; all generated inputs and candidates remain outside the repository.
|
||||
|
||||
| Unit | Instruction-exact functions before -> after | Exact code bytes before -> after | Exact data bytes before -> after |
|
||||
| --- | --- | --- | --- |
|
||||
| NWC24MsgSubject | 9/12 -> 12/12 | 3896/5352 -> 5352/5352 | 232/232 -> 232/232 |
|
||||
| NWC24DateParser | 6/8 -> 6/8 | 1508/2372 -> 1508/2372 | 40/40 -> 40/40 |
|
||||
| pdm_partition | 18/20 -> 18/20 | 2276/3716 -> 2276/3716 | No data sections |
|
||||
|
||||
Final open-function audit:
|
||||
|
||||
- `ConvertDateToDays`: 96.92921%; 73 logged source attempts in the raw record, with at least three distinct readable changes documented above.
|
||||
- `ConvertDaysToDate`: 99.70874%; 42 logged source attempts in the raw record, with at least three distinct readable changes documented above.
|
||||
- `pdm_part_is_master_boot_sector`: 86.5%; 36 logged source attempts in the raw record, with at least three distinct readable changes documented above.
|
||||
- `pdm_part_get_start_sector`: 82.56159%; 87 logged source attempts in the raw record, with at least three distinct readable changes documented above.
|
||||
|
||||
The final full gate uses a clean 4.3U rebuild and all three assigned units. Source remained unchanged after it; only this attempt record was consolidated. No configure.py linking flags, shared headers, symbols, retail assembly, or other units changed. Remaining compiler choices are unresolved; no fuzzy-only source is retained.
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] objdiff: code 5352/5352 data 232/232 functions 12/12 fuzzy 100.0000 linked code 0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] instruction-exact functions: 12/12
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .data size 184 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .sdata size 48 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .text size 5352 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] baseline: code 3896/5352 data 232 functions 9 fuzzy 99.3012
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] objdiff: code 1508/2372 data 40/40 functions 6/8 fuzzy 99.3642 linked code 0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] instruction-exact functions: 6/8
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .rodata size 40 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .text size 2372 match 99.36425
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] below 100: ConvertDateToDays 96.92921
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] below 100: ConvertDaysToDate 99.70874
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] baseline: code 1508/2372 data 40 functions 6 fuzzy 99.3642
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 93.5985 linked code 0
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.598495
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2276/3716 data None functions 18 fuzzy 93.5985
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.16326 -> 91.21187
|
||||
global fuzzy_match_percent: 99.60110 -> 99.60236
|
||||
global complete_code_percent: 74.56724 -> 74.56724
|
||||
global matched_data_percent: 99.55890 -> 99.55890
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
|
||||
|
||||
## Continuation 2026-10-03
|
||||
|
||||
Started at `b9bda11d` on `agent/w1002/sol-perm8b-max`. The subject/text setter was already merged and 12/12 exact, so it was skipped after a fresh origin check. Each open function was checked against freshly fetched `origin/main` before its search. All three units had identical pools before experiments.
|
||||
|
||||
Compile scripts and targets were refreshed in the existing `/tmp/perm-<function>` directories. Flags match this worktree's `ninja -t commands`; only temporary dependency-file generation is omitted. Contexts contain the requested C function and its real dependencies, with the partition buffer's 32-byte alignment preserved. Stack and branch-target differences are scored. This lane used at most two permutation jobs. Dummy, padding, mask-noise, self-assignment, and external-type mutation passes are disabled; every generated hint still receives semantic and readability review.
|
||||
|
||||
### Exact calendar conversion
|
||||
|
||||
The monthly-loop score-16 hint initially matched with a pointer alias of `days`; that generated form was rejected. The readable reconstruction needs a signed `calendarYear` temporary in the real leap-year helper and a direct `*parsedMonth` February test. The cached month remains the month-table index. No pointer alias, unused variable, artificial helper, assembly, volatile cast, or register keyword is retained.
|
||||
|
||||
`ConvertDaysToDate` is 100.0% by exact-name objdiff and 103/103 instructions with zero ctxdiff differences. The six previously exact DateParser functions remain exact. The focused source change and its first clean full gate were committed as `1cc1ddd4`; evidence is `/tmp/perm8r-month-full-gate.log`.
|
||||
|
||||
### Readable attempts for remaining functions
|
||||
|
||||
- `ConvertDateToDays`: tried partial Gregorian quotient expressions and equivalent year inputs; separate annual/century/ordinary-leap accumulations with meaningful scalar temporaries; live-variable declaration orders; natural 32-bit scalar types and dependency-correct const scopes. Best readable seed: 113/113 instructions, six scheduling/register differences. The whole-function phase was narrowed to the arithmetic tail, then stopped after 45 minutes without improvement. No non-exact source is retained.
|
||||
- `pdm_part_is_master_boot_sector`: tried little-endian inline helpers and expression trees; independent cursor/index declarations, initialization and increment order; byte-promotion types and real even/odd accumulators; meaningful offset staging. Best readable seed: 84/84 instructions, 23 differences, improving the prior 33-difference seed. Score 795 overwrites the real sector bound and is rejected. Score 660 introduces unrelated staged constants; its natural reconstructions remain non-exact. The resumed seed stalled for 45 minutes and was stopped. Original source is retained.
|
||||
- `pdm_part_get_start_sector`: tried typed MBR record fields; separately accumulated even/odd relative-sector bytes with block/function scopes; real entry-byte views and cached bytes; inline byte loops and sequential/pair decoders. Best readable seed: 276/276 instructions, eleven differences. Scores 213 and 114 contain dead scalar/pointer assignments. Natural byte-cache and pointer-view reconstructions remain non-exact. The search was stopped after about 45 minutes with no readable improvement. Original source is retained.
|
||||
|
||||
One temporary const-scope experiment moved a declaration before its dependency was initialized. It was rejected, excluded from valid readable attempts, and rerun with dependency-correct declarations. No such source was applied or committed.
|
||||
|
||||
Each remaining function has at least three distinct readable source attempts documented above. Full raw records are preserved at `/tmp/perm8r-final-raw-attempts.md`; trial sources, compiler output and instruction diffs remain under `/tmp/perm8-resume-trials`. Permutation inputs and outputs remain outside the repository.
|
||||
|
||||
### Resumed search measurements
|
||||
|
||||
Permuter scores are search penalties, not objdiff percentages. Current continuation phases are listed separately from the earlier round above.
|
||||
|
||||
| Function | Iterations | Best score | Seconds | Result |
|
||||
| --- | ---: | ---: | ---: | --- |
|
||||
| pdm_part_is_master_boot_sector | 2224 | 795 | 921 | Reseeded from a better readable form; unsafe hint rejected |
|
||||
| ConvertDaysToDate | 4078 | 16 | 1571 | Readable exact reconstruction committed |
|
||||
| ConvertDateToDays | 1107 | 252 | 573 | Reseeded to focus on arithmetic tail |
|
||||
| pdm_part_is_master_boot_sector | 6239 | 660 | 2756 | Stopped after 45 minutes without improvement |
|
||||
| ConvertDateToDays | 6425 | 252 | 2715 | Stopped after 45 minutes without improvement |
|
||||
| pdm_part_get_start_sector | 5594 | 114 | 2714 | Dead-variable hints rejected; no readable improvement |
|
||||
|
||||
The first two phases were reattached to their existing processes after restarting the supervisor; their exit codes are unavailable, while their elapsed time, iteration count and scores were preserved. Remaining owned phases exited normally. All searches stopped; the directories are ready to resume.
|
||||
|
||||
### Final full gate
|
||||
|
||||
| Unit | Instruction-exact before -> after | Exact code bytes before -> after | Exact data bytes before -> after |
|
||||
| --- | --- | --- | --- |
|
||||
| NWC24MsgSubject | 12/12 -> 12/12 | 5352/5352 -> 5352/5352 | 232/232 -> 232/232 |
|
||||
| NWC24DateParser | 6/8 -> 7/8 | 1508/2372 -> 1920/2372 | 40/40 -> 40/40 |
|
||||
| pdm_partition | 18/20 -> 18/20 | 2276/3716 -> 2276/3716 | No data sections |
|
||||
|
||||
The final gate is a clean, non-quick rebuild of all three assigned units. Pools are identical, the DOL SHA1 is correct, and regression, forbidden-pattern and readability counts are zero. Source stayed unchanged afterward. No configure.py linking flags, shared headers, symbols, retail assembly or other units changed. The unrelated untracked pk4/pk6 records remain untouched.
|
||||
|
||||
Remaining open functions: `ConvertDateToDays` 96.92921% (113/113, arithmetic scheduling/register allocation); `pdm_part_is_master_boot_sector` 86.5% (86/84 in retained source, byte assembly and registers); `pdm_part_get_start_sector` 84.51811% (276/276, byte-assembly scheduling/registers). All non-exact experimental source was discarded.
|
||||
|
||||
Gate evidence: `/tmp/perm8r-final-full-gate.log`.
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] objdiff: code 5352/5352 data 232/232 functions 12/12 fuzzy 100.0000 linked code 0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] instruction-exact functions: 12/12
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .data size 184 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .sdata size 48 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .text size 5352 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] baseline: code 5352/5352 data 232 functions 12 fuzzy 100.0000
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] objdiff: code 1920/2372 data 40/40 functions 7/8 fuzzy 99.4148 linked code 0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] instruction-exact functions: 7/8
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .rodata size 40 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .text size 2372 match 99.41484
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] below 100: ConvertDateToDays 96.92921
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] baseline: code 1508/2372 data 40 functions 6 fuzzy 99.3642
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 94.1798 linked code 0
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 94.17976
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 84.51811
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2276/3716 data None functions 18 fuzzy 94.1798
|
||||
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
|
||||
```
|
||||
|
||||
## perm8c restart continuation 2026-10-03
|
||||
|
||||
Initial status: `agent/w1002/sol-perm8c-max`, HEAD `7654dc33e1f98d0fcf7c8361acc522ec02068b57`; no tracked diff and no commits ahead of origin/main. Unrelated pk4/pk6 untracked logs are untouched. ConvertDaysToDate was already merged in #1033 and remains exact; it is skipped. Source in all assigned units is identical to the freshly fetched origin/main. Existing /tmp search outputs and readable seeds were retained; no old supervisor or permuter process was alive. Previous failed variants were read before selecting new combined experiments.
|
||||
|
||||
Fresh object builds needed no work. pool_diff.py reports identical pools for all three units. Baseline exact counts: NWC24MsgSubject 12/12, NWC24DateParser 7/8, pdm_partition 18/20. The three open functions remain non-exact. Raw new trials will be recorded in `/tmp/perm8c-raw-attempts.jsonl`; compile flags come directly from this worktree ninja commands, with only temporary dependency generation omitted.
|
||||
- ConvertDateToDays checked origin/main a791e598 before experiments; instruction score 16.
|
||||
- ConvertDateToDays new continuation classes: in-place annual accumulation with direct common-leap returns, signed quotient expression types, and a real signed calendar-year copy combined with the refined tail. 147 new compiled forms; best instruction penalty 6.
|
||||
- pdm_part_is_master_boot_sector checked origin/main a791e598 before experiments; instruction score 2082.
|
||||
- Temporary master batch stopped after source generation dropped a required offset declaration from an old saved hint. Those compile failures are excluded from valid attempts. Rebuilt the seed from the retained direct-expression permuter input and added replacement assertions. No repository source was affected. Initial date search setup also stopped before launch because the system Python lacks toml; use the existing permuter virtualenv.
|
||||
- pdm_part_is_master_boot_sector checked origin/main 333eea81 before experiments; instruction score 2082.
|
||||
- ConvertDateToDays new search reseeded from the minimal three-scalar annual-return form. Randomization now joins day-of-year accumulation with the Gregorian tail, instead of replaying the earlier tail-only plateau. Inline-wrapper mutations are disabled. Score is measured with stack and branch-target differences.
|
||||
- ConvertDateToDays perm8c best score 252 after 5 seconds.
|
||||
- Additional calendar continuation tried range-valid u16 year offsets with signed prior-year arithmetic, real signed counter lifetimes, and an elapsed-calendar-days helper with a live day-of-year argument. 39 forms; best instruction penalty 6.
|
||||
- Checkpoint: {"ConvertDateToDays": 176, "pdm_part_is_master_boot_sector": 3986} valid temporary object comparisons. Calendar best remains 113/113 with six scheduling/register differences. The combined master extent batch has not improved the prior 84/84, 23-difference seed. Source remains unchanged in the worktree; active searches compile only under /tmp.
|
||||
- Stopped the combined master declaration/decoder batch after 4134 valid comparisons with no improvement over 23 differences. Additional array ordering permutations recycle the same code generation; move to the distinct typed-field and signed-extent staging experiments. Failed scaffold compiles are excluded from this count.
|
||||
- Master-sector new continuation classes additionally tried signed low-byte extent staging with real decoded start/count scalars, and typed byte fields for the on-disk MBR entries, including addition/multiplication decoders. 112 forms; best instruction penalty 23.
|
||||
- pdm_part_get_start_sector checked origin/main 74dcb16a before experiments; instruction score 147.
|
||||
- Start-sector multiplication decoder improved the readable seed from eleven to nine positional differences, keeping 276/276 instructions. Pause the broader five-operand tree batch to test shift/multiply hybrids around this concrete hint. The nine-difference source remains only in /tmp.
|
||||
- Start-sector hybrid relative-byte decoder branch 1 complete; best instruction penalty 4, branch exact True.
|
||||
- Readable exact candidate for pdm_part_get_start_sector: /tmp/perm8c-trials/pdm_part_get_start_sector-hybrid-relative-byte-decoder-2-shift-int-shift-int-shift-int-linear-5ab787fc.c.
|
||||
- Readable exact candidate for pdm_part_get_start_sector: /tmp/perm8c-trials/pdm_part_get_start_sector-exact-reconstruction-formatted-direct-word-reading-ccae1132.c.
|
||||
- Readable exact candidate for pdm_part_get_start_sector: /tmp/perm8c-trials/pdm_part_get_start_sector-exact-reconstruction-relative-start-return-long-3c43d9aa.c.
|
||||
- Readable exact candidate for pdm_part_get_start_sector: /tmp/perm8c-trials/pdm_part_get_start_sector-exact-reconstruction-macro-return-int-663cd65f.c.
|
||||
- Calendar shared-predicate continuation replaced one or both duplicated leap tests with the existing private helper, including signed scalar types and an early-return predicate. 9 forms; best instruction penalty 6. No unrelated helper changes retained.
|
||||
- pdm_part_get_start_sector checked origin/main fdd68ddd before experiments; instruction score 147.
|
||||
- Exact start-sector reconstruction: use unsigned int byte arithmetic for the relative LBA offset, with the real base sector included in read_relative_start_sector. This differs from SDK pf_u32, which is unsigned long, only in compiler expression typing. All shifts operate on initialized real buffer bytes and unsigned 32-bit values. The relative-start helper is a meaningful operation, not an identity wrapper. The bulk MBR-word macro remains unsigned long and is formatted over three lines. Reordered the existing real loop declarations as suggested by the earlier eleven-difference seed. Temporary object comparison is 276/276 with zero differences; copied the readable form to the owned source for object/objdiff/full-gate verification.
|
||||
- Start-sector exact-name objdiff is 100.0%; the worktree object has 276/276 instructions and ctxdiff reports diffs 0. Full non-quick three-unit gate is GATE PASS: pdm_partition 18/20 -> 19/20, matched code 2276/3716 -> 3380/3716; pools identical, all regression/style/forbidden counts zero, DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d. DateParser stays 7/8 and MsgSubject stays 12/12. Evidence: `/tmp/perm8c-getstart-full-gate.log`.
|
||||
- The broad base-inclusive start-sector tree batch was superseded by the concrete nine-difference multiplication hint and the shift/type hybrid reconstruction. No dead assignment, pointer alias, identity helper, mask noise or unused value appears in the retained source.
|
||||
- pdm_part_is_master_boot_sector checked origin/main be7ded2f before experiments; instruction score 2082.
|
||||
- Master-sector continuation after the relative-sector win: native unsigned-int byte operands, meaningful accumulation into the zero-initialized start value, direct byte grouping shapes and cursor/summand order. 481 forms; best instruction penalty 23.
|
||||
- Calendar numerator promotions after the native-int sector result: real signed-int annual/century/common-leap numerators in mixed long/int sums, with direct return or named common-leap counts. 112 new forms; best instruction penalty 6.
|
||||
- Master-sector also reused the proven relative-start decoder for absolute MBR starts with base zero or the already zero-initialized destination, keeping the count decoder separate. 24 forms; best instruction penalty 23.
|
||||
|
||||
### perm8c source-attempt audit
|
||||
|
||||
- ConvertDateToDays: distinct new classes covered annual accumulation/direct common-leap returns; signed quotient and numerator typing; valid-width calendar-year lifetimes; real Gregorian-day helper arguments; and reuse of the existing leap-year predicate. 297 valid temporary object comparisons, best 113/113 with six differences. Every new source experiment stayed in /tmp. Original source is retained.
|
||||
- pdm_part_is_master_boot_sector: distinct new classes covered combined real cursor/array declarations and endian grouping; signed low-byte decoded extent staging; typed on-disk byte fields; native unsigned-int decoding and initialization/accumulation; and reuse of the relative reader for an absolute start. 4752 valid comparisons, best 84/84 with 23 differences. The retained function remains unchanged. No further master permuter restart was warranted after these forms failed to improve the readable seed.
|
||||
- pdm_part_get_start_sector: signed low-byte staging, multiplication-based decoding, base-inclusive expression trees and shift/type hybrids were tried. 705 valid comparisons. Native unsigned-int offset arithmetic removed the final eleven differences. The minimal readable relative-start helper also stays 276/276 with zero differences; a decoder that returns only the unsigned-int word did not remain exact and was discarded.
|
||||
- Commit `8bf45d51a2bfc4d153d3b50e43a7aad25a9d583b` preserves the independently rebuilt, objdiff-100% start-sector result and its clean full gate. The unused pk4/pk6 attempt records are untouched. Remaining compiler choices are unresolved; no non-exact experimental source is retained.
|
||||
- Completed perm8c search: {"function": "ConvertDateToDays", "best": 252, "elapsed": 2708, "iterations": 6698, "returncode": 0, "reason": "45 minutes without score improvement", "log": "/tmp/perm8c-search-ConvertDateToDays.log", "running": false}.
|
||||
|
||||
### perm8c permutation phase complete
|
||||
|
||||
- ConvertDateToDays new joined day-of-year/tail permutation phase ended normally after 2708 seconds and 6698 iterations. Best search penalty 252, no score improvement for about 45 minutes. No readable exact result. Stack and branch-target differences were included; one permutation job ran. The earlier master/start-sector plateaus were not replayed because the new manual forms and the already exact start-sector reconstruction supplied the useful results.
|
||||
- All owned searches have exited. Inputs, candidates, raw valid-trial counts and search logs remain under /tmp. The only source change retained is the objdiff-100% start-sector reconstruction. Final validation below is another non-quick three-unit build after every search stopped.
|
||||
|
||||
### perm8c final full gate
|
||||
|
||||
| Unit | Instruction-exact before -> after | Matched code bytes before -> after | Matched data bytes before -> after |
|
||||
| --- | --- | --- | --- |
|
||||
| NWC24MsgSubject | 12/12 -> 12/12 | 5352/5352 -> 5352/5352 | 232/232 -> 232/232 |
|
||||
| NWC24DateParser | 7/8 -> 7/8 | 1920/2372 -> 1920/2372 | 40/40 -> 40/40 |
|
||||
| pdm_partition | 18/20 -> 19/20 | 2276/3716 -> 3380/3716 | No data sections |
|
||||
|
||||
Exact-name pdm_part_get_start_sector is 100.0%, 276/276 instructions, diffs 0 after the final clean build. ConvertDateToDays stays open at 96.92921%, 113/113 with 16 retained-source differences; best readable temporary seed has six. pdm_part_is_master_boot_sector stays open at 86.5%, 86/84; best temporary seed has 84/84 with 23 differences. Both open functions have more than three distinct valid source-attempt classes above. No untracked pk4/pk6 file, shared header, symbol, configure flag, retail assembly or other translation unit changed.
|
||||
|
||||
Final full gate evidence: `/tmp/perm8c-final-full-gate.log`. Final instruction diffs are `/tmp/perm8c-final-<function>.ctxdiff`. Raw temporary comparisons are `/tmp/perm8c-raw-attempts.jsonl`. All owned searches stopped before this non-quick gate.
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] objdiff: code 5352/5352 data 232/232 functions 12/12 fuzzy 100.0000 linked code 5352
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] instruction-exact functions: 12/12
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .data size 184 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .sdata size 48 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] section .text size 5352 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24MsgSubject] baseline: code 5352/5352 data 232 functions 12 fuzzy 100.0000
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] objdiff: code 1920/2372 data 40/40 functions 7/8 fuzzy 99.4148 linked code 0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] instruction-exact functions: 7/8
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .rodata size 40 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .text size 2372 match 99.41484
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] below 100: ConvertDateToDays 96.92921
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] baseline: code 1920/2372 data 40 functions 7 fuzzy 99.4148
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 3380/3716 data None/None functions 19/20 fuzzy 98.7793 linked code 0
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 19/20
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 98.779335
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2276/3716 data None functions 18 fuzzy 94.1798
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.56577 -> 91.60263
|
||||
global fuzzy_match_percent: 99.69885 -> 99.70456
|
||||
global complete_code_percent: 74.74593 -> 74.74593
|
||||
global matched_data_percent: 99.55890 -> 99.55890
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
78
tools/decomp-assist/perm8d.attempts.md
Normal file
78
tools/decomp-assist/perm8d.attempts.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# perm8d ultra continuation
|
||||
|
||||
Worktree sol-high, branch agent/w1003/sol-perm8d-ultra, initial HEAD 98d8a522. Initial full quick gate passes. DateParser 7/8 instruction-exact, code 1920/2372, data 40/40. Partition 19/20 instruction-exact, code 3380/3716, no data. Both pools are identical. Unrelated untracked pk4/pk6 logs are untouched.
|
||||
|
||||
Read perm8, NWC24DateParser, relevant fz7 and sol-high-four attempts, effort-policy, and prior orch progress history before trials. The prior-art index has no reference for either open function. Origin was fetched under the shared git lock; both functions remain non-exact on origin/main 409ef82d.
|
||||
|
||||
ConvertDateToDays target CFG: validate year/month; February Gregorian leap predicate and leap-day bound; ordinary day bound; month-prefix/day addition; March-or-later leap-day adjustment; signed year offset; annual and Gregorian quotient accumulation; return. No calls, frame, or immediate stack-store/reload. The first 92 instructions match; the final arithmetic differs in quotient scheduling and scalar allocation. No volatile is justified. DateParser .rodata is already 40/40 and both table objects are paired correctly.
|
||||
|
||||
pdm_part_is_master_boot_sector target CFG: clear output; validate 55/AA signature; four-entry decode loop with start/count nonzero test and first-entry output update; four-entry extent-bound loop; early return 2 or success 0. No calls. Target frame 0x30 saves r30/r31; current 0x40 also saves r29. Byte-pair arithmetic should combine high/low even and odd byte groups. Both original arrays occupy 16 bytes; start is at stack 0x18 and count at 0x08. First loop uses start/count/index r6/r7/r8; second loop reverses the cursor allocation. Partition owns only .text, so no data rename or extent change applies.
|
||||
|
||||
All experimental files are in /tmp/perm8d and compiled with this worktree's exact ninja flags, omitting only dependency generation. Raw instruction comparisons are /tmp/perm8d/trials.jsonl. No source experiment will be kept without exact matching and a passing full gate.
|
||||
- Master attempt 1: direct array indexing in one or both loops, or fresh second-loop cursor lifetimes, combined with the existing helper, MBR_WORD and explicit byte-pair decoding. Valid comparisons 25; best penalty 24.
|
||||
- Master attempt 2: a meaningful destination-writing MBR decoder, using direct, summed or bytewise accumulation, mutable/const byte views and native int/SDK long arithmetic. Tested both pointer and indexed traversals. Valid comparisons 224; best penalty 24.
|
||||
- Date attempt 1: reuse the actual annual/century subtotal or prior-year offset as the final accumulator, including a real in-place decrement and separately staged century numerator. Signed long/native int result lifetimes and final operand order were varied. Valid comparisons 309; best penalty 1.
|
||||
- Exact temporary candidate ConvertDateToDays /tmp/perm8d/ConvertDateToDays-a28442585b5f.c.
|
||||
- ConvertDateToDays exact reconstruction: accumulate ordinary annual days first, form the real day-plus-century subtotal in centuryLeapDays, then return that subtotal plus the common-leap correction. No new locals or helpers. Correct subtotal operand order removes the last instruction difference. 113/113 instructions, zero differences in the temporary full unit.
|
||||
- Exact temporary candidate ConvertDateToDays /tmp/perm8d/ConvertDateToDays-7ac42db86e86.c.
|
||||
- Readable retained local name is totalDays, since it contains the day-of-year, ordinary-year days and century correction. The rename preserves the zero-difference result. Fresh origin check still has the original open function.
|
||||
|
||||
## Calendar acceptance
|
||||
|
||||
ConvertDateToDays worktree build is 113/113 instructions with ctxdiff diffs 0, exact-name objdiff 100.0%. The first clean full two-unit gate is GATE PASS, DateParser 7/8 -> 8/8, code 1920/2372 -> 2372/2372, data 40/40 unchanged. Every owned DateParser section is 100%. Pools identical, regressions 0, forbidden patterns 0, readability warnings 0. Full build passes, DOL SHA1 is 26116613f624061ba99c8d1a299aaa6efa85670d. Evidence /tmp/perm8d/date-full-gate.log. The focused source diff changes only the final arithmetic accumulator and its meaningful local name; no helper, unused local, symbol, header or link flag changes.
|
||||
- Master attempt 3: direct shift/multiply hybrids for each actual little-endian byte, with unsigned native-int and SDK-long promotion, even/odd pair trees and a separate indexed second loop. Valid comparisons 768; best penalty 20.
|
||||
- Master attempt 4: actual MBR byte views using const-qualified input pointers, with declaration/loop scopes, signed or unsigned low-byte promotion and separate second-loop traversal lifetimes. Valid comparisons 81; best penalty 20.
|
||||
- Master attempt 6: cache one actual start/count input byte using byte, halfword or unsigned-word scalar types, before/after the initial clear and at function/loop scope. Every cache is initialized and used. Valid comparisons 128; best penalty 19.
|
||||
- Master attempt 5: the start and length fields use independent little-endian trees and promotions, preserving the improved traversal while testing direct assignment versus meaningful accumulation into the cleared start. Valid comparisons 1022; best penalty 19.
|
||||
- Master attempt 8: real named even/odd endian sums, separate high-byte staging or all four decoded byte contributions. Tested direct/native word arithmetic, clear placement and independent count decoding. Valid comparisons 168; best penalty 19.
|
||||
|
||||
## Partition continuation
|
||||
|
||||
The input, traversal and byte-pair work produced temporary 84/84-instruction forms with 19 positional differences, improved from the previous readable 23-difference seed. These differences still include byte-load scheduling and sum grouping inside the decoder. No fuzzy-only partition change is retained. All target calls, branch exits, stack frame, output behavior and array extents were reviewed before tuning; the target does not justify a volatile declaration.
|
||||
- Master attempt 7: cache meaningful pairs or full sets of MBR input bytes in target load order and other dependency-safe orders, with byte/word scalar types and function/loop scopes. Every cached input is used in its original field. Valid comparisons 960; best penalty 19.
|
||||
- Master attempt 9: swap the real even/odd limb operands independently in both decoded fields and test meaningful shift/multiply byte forms. Valid comparisons 752; best penalty 19.
|
||||
|
||||
## Final open-function audit
|
||||
|
||||
- ConvertDateToDays is exact in the retained source. 313 valid temporary comparisons this round. No other DateParser function or data regressed.
|
||||
- pdm_part_is_master_boot_sector remains open at retained objdiff 86.5%, 86/84 instructions. 4128 valid temporary comparisons this round, covering nine distinct source-level classes below. Best temporary form is 84/84 with 19 instruction differences; byte-load scheduling and sum/register choices remain unresolved. All partition source experiments were discarded.
|
||||
- array-access: 24 valid comparisons, best penalty 24.
|
||||
- destination-inline-decoder: 224 valid comparisons, best penalty 24.
|
||||
- direct-shift-multiply-hybrid: 768 valid comparisons, best penalty 20.
|
||||
- read-only-entry-view: 81 valid comparisons, best penalty 20.
|
||||
- independent-MBR-start-count-expressions: 1022 valid comparisons, best penalty 19.
|
||||
- cache-real-field-byte-: 128 valid comparisons, best penalty 19.
|
||||
- cache-real-field-byte-set: 960 valid comparisons, best penalty 19.
|
||||
- semantic-byte-pairs: 168 valid comparisons, best penalty 21.
|
||||
- independent-even-odd-operand-orders: 752 valid comparisons, best penalty 19.
|
||||
- All temporary compiles succeeded. No own trial/search process remains active. No symbols, shared headers, configure flags, other units, upstream or other worktrees were changed. The latest fetched origin a3e3725c still has both functions open.
|
||||
- Communication audit: one initial commentary before the worker prompt was read; no further conversational text during matching.
|
||||
|
||||
## Final full gate
|
||||
|
||||
Clean non-quick two-unit gate after every experiment stopped. ConvertDateToDays is exact-name objdiff 100.0% and ctxdiff 113/113, diffs 0. All eight DateParser functions and all 40 data bytes are exact. Partition source remains unchanged. Exact objdiff JSON is /tmp/perm8d/final-report.json. The auxiliary JSON assertion initially compared string byte counts with integers; normalizing with int confirms the same gate measurements.
|
||||
|
||||
```text
|
||||
full build: ok
|
||||
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] pool: IDENTICAL
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] objdiff: code 2372/2372 data 40/40 functions 8/8 fuzzy 100.0000 linked code 0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] instruction-exact functions: 8/8
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .rodata size 40 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] section .text size 2372 match 100.0
|
||||
[libs/RevoEX/src/nwc24/NWC24DateParser] baseline: code 1920/2372 data 40 functions 7 fuzzy 99.4148
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 3380/3716 data None/None functions 19/20 fuzzy 98.7793 linked code 0
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 19/20
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 98.779335
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5
|
||||
[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 3380/3716 data None functions 19 fuzzy 98.7793
|
||||
regressions vs baseline: 0
|
||||
global matched_code_percent: 91.81992 -> 91.83501
|
||||
global fuzzy_match_percent: 99.71336 -> 99.71384
|
||||
global complete_code_percent: 74.76262 -> 74.76262
|
||||
global matched_data_percent: 99.77803 -> 99.77803
|
||||
forbidden patterns added (net, per file): 0
|
||||
readability warnings (net, per file; must be 0 in the final result): 0
|
||||
GATE PASS
|
||||
```
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user