Compare commits
42 Commits
setting-cl
...
agent/w092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bb48720876 | ||
|
|
b9bda11dea | ||
|
|
7b8dbf2c96 | ||
|
|
b7a4105bd6 | ||
|
|
bc2b18090b | ||
|
|
674722c158 | ||
|
|
e81aed2882 | ||
|
|
7d6057adf6 | ||
|
|
16a170f944 | ||
|
|
0904bf9161 | ||
|
|
e5987de5ad | ||
|
|
11bd51b3a9 | ||
|
|
e4a9449256 | ||
|
|
b940710632 | ||
|
|
1fa33882ae | ||
|
|
aba50ea278 | ||
|
|
14a8b23adb | ||
|
|
b8931fae6f | ||
|
|
bcac23375a | ||
|
|
ed49ada973 | ||
|
|
fa0cb9b7b4 | ||
|
|
8ffaa9d25a | ||
|
|
cc812ad30e | ||
|
|
3d3448e3a8 | ||
|
|
654c65dd27 | ||
|
|
bb93684b95 | ||
|
|
39648c8aa6 | ||
|
|
230c3af28f | ||
|
|
13881c99fb | ||
|
|
b26e248bb0 | ||
|
|
8350f2b4df | ||
|
|
3851d2cc74 | ||
|
|
7bdf4629fd | ||
|
|
5a222cdec4 | ||
|
|
ac8d46d231 | ||
|
|
813660b96e | ||
|
|
e82417345a | ||
|
|
230c2f8d34 | ||
|
|
524350ed8f | ||
|
|
c62453dac9 | ||
|
|
6b17698b84 | ||
|
|
f9358f6e46 |
20
.github/workflows/readme-progress.yml
vendored
20
.github/workflows/readme-progress.yml
vendored
@@ -2,8 +2,8 @@ name: README progress
|
||||
|
||||
# runs on the self-hosted runner on cole's server so it doesn't use hosted minutes.
|
||||
# only push/schedule/manual triggers, never pull_request, so fork PRs can't reach this machine.
|
||||
# README progress is written inside each landing commit by the orchestrator, so this job never commits;
|
||||
# it only rebuilds and publishes the current numbers to the job summary.
|
||||
# it never commits to main: it rebuilds, publishes the numbers to the job summary, and force-pushes
|
||||
# the README badge JSON as a single commit on the orphan progress-data branch.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
@@ -17,7 +17,7 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
progress:
|
||||
@@ -55,3 +55,17 @@ jobs:
|
||||
python3 tools/update_readme_progress.py build/43U/report.json README.md "$GITHUB_SHA"
|
||||
sed -n '/progress:start/,/progress:end/p' README.md >> "$GITHUB_STEP_SUMMARY"
|
||||
git checkout -- README.md
|
||||
|
||||
- name: Publish badges
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
out="$RUNNER_TEMP/progress-data"
|
||||
rm -rf "$out"
|
||||
python3 tools/progress_badges.py build/43U/report.json "$out"
|
||||
cd "$out"
|
||||
git init -q -b progress-data
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git add .
|
||||
git commit -q -m "progress for $GITHUB_SHA"
|
||||
git push -q -f "https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY.git" HEAD:refs/heads/progress-data
|
||||
|
||||
37
README.md
37
README.md
@@ -7,23 +7,23 @@
|
||||
|
||||
<!--- Github Actions Badge -->
|
||||
|
||||
[Build Status]: https://github.com/coah80/wii-ipl/actions/workflows/build.yml/badge.svg
|
||||
[actions]: https://github.com/coah80/wii-ipl/actions/workflows/build.yml
|
||||
[Build Status]: https://github.com/coah80/wii-ipl/actions/workflows/readme-progress.yml/badge.svg?branch=main
|
||||
[actions]: https://github.com/coah80/wii-ipl/actions/workflows/readme-progress.yml
|
||||
|
||||
<!--- Discord Badge -->
|
||||
|
||||
[Discord Badge]: https://img.shields.io/discord/727908905392275526?color=%237289DA&logo=discord&logoColor=%23FFFFFF
|
||||
[discord]: https://discord.gg/hKx3FJJgrV
|
||||
|
||||
<!-- Progress links -->
|
||||
<!-- Progress badges: JSON on the progress-data branch, refreshed by the README progress workflow on every push to main -->
|
||||
|
||||
[V43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U
|
||||
|
||||
<!--- Version 4.3U progress Badge -->
|
||||
|
||||
[DecompBadgeV43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U.svg?&measure=code&label=Decompiled&mode=shield&labelColor=%237c7c7c&color=%2333b8ff&style=plastic
|
||||
[LinkBadgeV43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U.svg?&measure=complete_code&label=Linked&mode=shield&labelColor=%237c7c7c&color=%2333b8ff&style=plastic
|
||||
[FuncBadgeV43U]: https://decomp.dev/koopthekoopa/wii-ipl/43U.svg?&measure=functions&label=Functions&mode=shield&labelColor=%237c7c7c&color=%2333b8ff&style=plastic
|
||||
[progress]: https://github.com/coah80/wii-ipl/actions/workflows/readme-progress.yml
|
||||
[DecompiledBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Fdecompiled.json
|
||||
[MatchedBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Fmatched.json
|
||||
[LinkedBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Flinked.json
|
||||
[DataBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Fdata.json
|
||||
[FunctionsBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Ffunctions.json
|
||||
[UnitsBadge]: https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fcoah80%2Fwii-ipl%2Fprogress-data%2Funits.json
|
||||
|
||||
<!--- Header -->
|
||||
|
||||
@@ -43,28 +43,17 @@ Live decomp status
|
||||
|
||||
[![Build status]][actions]
|
||||
|
||||
Open the latest successful [Build workflow run][actions] and check its summary for the current objdiff metrics. It includes perfect-match/decompiled, fuzzy-match, fully linked, data, function, unit, and category breakdowns. The run also publishes the 43U report artifact and generated decomp-status report.
|
||||
Every push to `main` rebuilds 4.3U, checks the DOL hash, and refreshes the progress badges below. Open the latest [README progress run][actions] for the full objdiff summary.
|
||||
|
||||
Supported versions:
|
||||
- `43U` - Version **4.3U** (USA)
|
||||
|
||||
Progress
|
||||
========
|
||||
<!-- progress:start -->
|
||||
| Decompiled | Matched | Linked | Data |
|
||||
|:---:|:---:|:---:|:---:|
|
||||
| 99.59% | 91.16% | 74.57% | 99.56% |
|
||||
|
||||
units 964/1027 complete, functions 12378/12563 matched.
|
||||
[![DecompiledBadge]][progress] [![MatchedBadge]][progress] [![LinkedBadge]][progress] [![DataBadge]][progress]
|
||||
[![FunctionsBadge]][progress] [![UnitsBadge]][progress]
|
||||
|
||||
decompiled = code with a C/C++ implementation (objdiff fuzzy), matched = byte-exact code, linked = code actually linked into the DOL, data = byte-exact data
|
||||
<!-- progress:end -->
|
||||
|
||||
| Version | Progress |
|
||||
|-----------------------|------------------------------------------------------------------------------|
|
||||
| [Wii Menu 4.3U][V43U] | [![FuncBadgeV43U]][V43U] [![DecompBadgeV43U]][V43U] [![LinkBadgeV43U]][V43U] |
|
||||
|
||||
> You can see the full progress and its history by clicking on one of the versions in the table.
|
||||
|
||||
Dependencies
|
||||
============
|
||||
|
||||
@@ -37,6 +37,9 @@ force_active:
|
||||
|
||||
# textinput::toolbar::csPaneToAnimation points one past the end of csAninationFile.
|
||||
block_relocations:
|
||||
# Run establishes a fixed stack at 0x81600000, not __pformatter + 0x280.
|
||||
- source: .text:0x8137B468
|
||||
- source: .text:0x8137B46C
|
||||
- source: .data:0x8165E15C
|
||||
- source: .data:0x8165E19C
|
||||
|
||||
|
||||
@@ -1081,7 +1081,7 @@ 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/NWC24FriendList.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;
|
||||
|
||||
@@ -92,18 +92,20 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
dst[0] = val;
|
||||
} else {
|
||||
s32 oddLowSum;
|
||||
s32 oddLowDifference;
|
||||
s32 oddHighSum;
|
||||
s32 oddHighDifference;
|
||||
s32 dcValue;
|
||||
|
||||
t = b2 - b6;
|
||||
oddLowSum = b5 + b3;
|
||||
b5 = b5 - b3;
|
||||
oddLowDifference = b5 - b3;
|
||||
oddHighSum = b1 + b7;
|
||||
b1 = b1 - b7;
|
||||
oddHighDifference = b1 - b7;
|
||||
u = b6 + b2;
|
||||
t = t * 0xB5 >> 8;
|
||||
x_factor = oddHighSum - oddLowSum;
|
||||
z_factor = b5 + b1;
|
||||
z_factor = oddLowDifference + oddHighDifference;
|
||||
dcValue = block[0];
|
||||
a = dcValue - b4;
|
||||
x = x_factor * 0xB5 >> 8;
|
||||
@@ -113,14 +115,14 @@ void TMCJPEGDEC_IdctBlock_Lumi(s32* block, u8* conv_row_ptr, u16 pitch, s32 zigz
|
||||
z = z_factor * 0x62 >> 8;
|
||||
w = d + u;
|
||||
y = d - u;
|
||||
m_part = b1 * 0x14E >> 8;
|
||||
m_part = oddHighDifference * 0x14E >> 8;
|
||||
e = a - t;
|
||||
m = m_part - z;
|
||||
oddLowSum += m;
|
||||
n = oddHighSum + oddLowSum;
|
||||
o = x + m;
|
||||
dst[0] = w + n;
|
||||
p_part = b5 * 0x8B;
|
||||
p_part = oddLowDifference * 0x8B;
|
||||
dst[7] = w - n;
|
||||
p_part >>= 8;
|
||||
dst[1] = v + o;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <tmc_jpeg_internal.h>
|
||||
|
||||
static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData* pInfo);
|
||||
static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder, const u8* entry);
|
||||
static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder, u8* entry);
|
||||
static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder, const u8* entry);
|
||||
static s32 TMCJPEGDEC_ThumbnailCheck(TMCCJPEGDecInitParam* param, TMCCJPEGDecExifInfo* info, u32 totalSize);
|
||||
|
||||
@@ -280,7 +280,7 @@ static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData*
|
||||
return -161;
|
||||
}
|
||||
for (index = 0; index < count; index++) {
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, entries);
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, (u8*)entries);
|
||||
entries += 12;
|
||||
}
|
||||
remaining -= entriesSize;
|
||||
@@ -331,19 +331,19 @@ static s32 TMCJPEGDEC_exif_parse(const u8* data, u32 size, TMCCJPEGDecExifData*
|
||||
return -161;
|
||||
}
|
||||
for (index = 0; index < count; index++) {
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, entries);
|
||||
TMCJPEGDEC_IFD0_tag_parse(pInfo, byteOrder, (u8*)entries);
|
||||
entries += 12;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder, const u8* entry) {
|
||||
static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder, u8* entry) {
|
||||
s32 tag;
|
||||
u16 type;
|
||||
u32 type;
|
||||
|
||||
tag = readU16(entry, byteOrder);
|
||||
type = readU16(entry + 2, byteOrder);
|
||||
tag = readExifU16(entry, byteOrder);
|
||||
type = readExifU16(entry + 2, byteOrder);
|
||||
|
||||
switch (tag) {
|
||||
case 0x0103:
|
||||
@@ -366,7 +366,7 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
return;
|
||||
}
|
||||
pInfo->xResNum = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
p = pInfo->thumbnailData + (offset + 4);
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
@@ -386,7 +386,7 @@ static void TMCJPEGDEC_IFD0_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
return;
|
||||
}
|
||||
pInfo->yResNum = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
p = pInfo->thumbnailData + (offset + 4);
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
@@ -501,6 +501,10 @@ static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
case 0x8769:
|
||||
case 0x9000:
|
||||
case 0x9101:
|
||||
case 0x011C:
|
||||
case 0xA000:
|
||||
case 0xA001:
|
||||
case 0xA002:
|
||||
case 0xA003: {
|
||||
break;
|
||||
}
|
||||
@@ -516,7 +520,7 @@ static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
return;
|
||||
}
|
||||
pInfo->xResNumIfd1 = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
p = pInfo->thumbnailData + (offset + 4);
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
@@ -538,7 +542,7 @@ static void TMCJPEGDEC_IFD1_tag_parse(TMCCJPEGDecExifData* pInfo, u16 byteOrder,
|
||||
return;
|
||||
}
|
||||
pInfo->planarConfigIfd1 = readU32(p, byteOrder);
|
||||
p = (const u8*)(pInfo->thumbnailData + offset + 4);
|
||||
p = pInfo->thumbnailData + (offset + 4);
|
||||
if (pInfo->thumbnailData > p) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -816,7 +816,6 @@ static void TMCJPEGDEC_converterYUV444toRGB565(TMCCJPEGDecWork* work, s32 x, s32
|
||||
u8* luminance;
|
||||
u8* cb;
|
||||
u8* cr;
|
||||
s32 value;
|
||||
s32 column;
|
||||
s32 xEnd;
|
||||
s32 cbValue;
|
||||
@@ -844,17 +843,17 @@ static void TMCJPEGDEC_converterYUV444toRGB565(TMCCJPEGDecWork* work, s32 x, s32
|
||||
for (column = x; column < xEnd; column++) {
|
||||
cbValue = (s8)*cb++;
|
||||
crValue = (s8)*cr++;
|
||||
value = *luminance++;
|
||||
green = value + (-(cbValue * 88 + crValue * 183) >> 8);
|
||||
red = value + ((crValue * 359) >> 8);
|
||||
blue = value + ((cbValue * 454) >> 8);
|
||||
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;
|
||||
}
|
||||
output[(column & 3) + (((column >> 2) + tileRow) << 4)] =
|
||||
((blue & 0xF8) >> 3) + ((red & 0xF8) << 8) + ((green & 0xFC) << 3);
|
||||
((blue & 0xF8) >> 3) + (((red & 0xF8) << 8) + ((green & 0xFC) << 3));
|
||||
}
|
||||
luminance += rowSkip;
|
||||
cb += rowSkip;
|
||||
|
||||
@@ -656,10 +656,10 @@ static void TMCJPEGDEC_converterYUV420toRGBA8edge(TMCCJPEGDecWork* work, s32 x,
|
||||
blueOffset = (cbValue * 454) >> 8;
|
||||
}
|
||||
{
|
||||
s32 value = *luminance++;
|
||||
s32 green = value + greenOffset;
|
||||
s32 red = value + redOffset;
|
||||
s32 blue = value + blueOffset;
|
||||
s32 red = *luminance++;
|
||||
s32 green = red + greenOffset;
|
||||
s32 blue = red + blueOffset;
|
||||
red = red + redOffset;
|
||||
if ((green | red | blue) >> 8) {
|
||||
blue = blue > 255 ? 255 : blue < 0 ? 0 : blue;
|
||||
green = green > 255 ? 255 : green < 0 ? 0 : green;
|
||||
|
||||
@@ -311,21 +311,21 @@ Zi8UInt Zi8SpellingPY(ziU16 *output,Zi8UInt key,ziU8 includeTone)
|
||||
return length;
|
||||
}
|
||||
|
||||
ziU8 Zi8IsMatch1Key(ziU16 *input,Zi8UInt inputLength,Zi8UInt key,ziU8 requireFull,ziU8 usePinyin,ziU8 tone)
|
||||
ziU8 Zi8IsMatch1Key(ziU16 *input,Zi8UInt inputLength,ziU16 key,ziU8 requireFull,ziU8 usePinyin,ziU8 tone)
|
||||
{
|
||||
ziU16 spelling[16];
|
||||
Zi8UInt spellingLength;
|
||||
|
||||
if ((key & 0xffff) == 0) {
|
||||
if (key == 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((inputLength & 0xff) == 0) {
|
||||
return 1;
|
||||
}
|
||||
if (usePinyin != 0) {
|
||||
spellingLength = Zi8SpellingPY(spelling,key & 0xffff,tone & 0xff);
|
||||
spellingLength = Zi8SpellingPY(spelling,key,tone & 0xff);
|
||||
} else {
|
||||
spellingLength = Zi8SpellingZY(spelling,key & 0xffff,tone & 0xff);
|
||||
spellingLength = Zi8SpellingZY(spelling,key,tone & 0xff);
|
||||
}
|
||||
if ((requireFull != 0) && ((inputLength & 0xff) != (spellingLength & 0xff))) {
|
||||
return 0;
|
||||
@@ -1327,7 +1327,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
}
|
||||
if (elementIndex == 0) continue;
|
||||
if (!emitWords) {
|
||||
if (trackDuplicates && Zi8SetFindCand(params->scratch,candidateOrdinal,work) != 0) continue;
|
||||
if (trackDuplicates && (ziU8)Zi8SetFindCand(params->scratch,candidateOrdinal,work) != 0) continue;
|
||||
for (index = 0; index < candidateCount; index++) {
|
||||
if (candidateCharacter == output[index]) break;
|
||||
}
|
||||
@@ -1396,7 +1396,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
}
|
||||
if (elementIndex == 0) continue;
|
||||
if (!emitWords) {
|
||||
if (trackDuplicates && Zi8SetFindCand(params->scratch,candidateOrdinal,work) != 0) continue;
|
||||
if (trackDuplicates && (ziU8)Zi8SetFindCand(params->scratch,candidateOrdinal,work) != 0) continue;
|
||||
for (index = 0; index < candidateCount; index++) {
|
||||
if (candidateCharacter == output[index]) break;
|
||||
}
|
||||
@@ -1519,7 +1519,7 @@ int Zi8Get1KeyPressCandidates(Zi8OneKeyParam *params,Zi8OneKeyOptions *options,Z
|
||||
}
|
||||
if (elementIndex == 0) goto nextPhrase;
|
||||
if (!emitWords) {
|
||||
if (trackDuplicates && Zi8SetFindCand(params->scratch,phraseCharacter,work) != 0) goto nextPhrase;
|
||||
if (trackDuplicates && (ziU8)Zi8SetFindCand(params->scratch,phraseCharacter,work) != 0) goto nextPhrase;
|
||||
for (index = 0; index < candidateCount; index++) {
|
||||
if (firstOrdinal == output[index]) goto nextPhrase;
|
||||
}
|
||||
@@ -1601,7 +1601,7 @@ finishPhrases:
|
||||
}
|
||||
if (elementIndex == 0) goto nextSortedOrdinal;
|
||||
if (!emitWords) {
|
||||
if (trackDuplicates && Zi8SetFindCand(params->scratch,ordinal,work) != 0) goto nextSortedOrdinal;
|
||||
if (trackDuplicates && (ziU8)Zi8SetFindCand(params->scratch,ordinal,work) != 0) goto nextSortedOrdinal;
|
||||
ordinal = Zi8Ord2Uni(ordinal,work);
|
||||
for (index = 0; index < candidateCount; index++) {
|
||||
if (ordinal == output[index]) break;
|
||||
@@ -1629,11 +1629,11 @@ nextSortedOrdinal:
|
||||
;
|
||||
}
|
||||
}
|
||||
if ((options->countOnly == '\0') && Zi8GetZHuwdPtr(&userEntries,&userCount,work) != 0)
|
||||
if ((options->countOnly == '\0') && (ziU8)Zi8GetZHuwdPtr(&userEntries,&userCount,work) != 0)
|
||||
{
|
||||
for (phraseOrdinal = 0; phraseOrdinal < userCount;) {
|
||||
if ((params->elementCount == '\0') || ((userEntries[1] & 0x80) != 0)) {
|
||||
userOrdinal = (userEntries[1] & 0x7f) << 8 | (ziU16)userEntries[2];
|
||||
userOrdinal = (ziU16)(userEntries[1] & 0x7f) << 8 | (ziU16)userEntries[2];
|
||||
phraseTable = syllableTable + (Zi8UInt)userOrdinal * 0xc;
|
||||
if (((*phraseTable & languageMask) != 0) &&
|
||||
((characterSetTable == 0 || ((characterSet & characterSetTable[(Zi8UInt)userOrdinal]) != 0)))) {
|
||||
@@ -1654,7 +1654,7 @@ nextSortedOrdinal:
|
||||
}
|
||||
if (elementIndex == 0) goto nextUserOrdinal;
|
||||
if (!emitWords) {
|
||||
if (trackDuplicates && Zi8SetFindCand(params->scratch,userOrdinal,work) != 0) goto nextUserOrdinal;
|
||||
if (trackDuplicates && (ziU8)Zi8SetFindCand(params->scratch,userOrdinal,work) != 0) goto nextUserOrdinal;
|
||||
userCharacter = Zi8Ord2Uni(userOrdinal,work);
|
||||
for (duplicateIndex = 0; duplicateIndex < candidateCount; duplicateIndex++) {
|
||||
if (userCharacter == output[duplicateIndex]) break;
|
||||
@@ -1710,7 +1710,7 @@ nextUserOrdinal:
|
||||
if (unicodeCharacter == previousCharacter) goto nextOrdinal;
|
||||
previousCharacter = unicodeCharacter;
|
||||
if (!emitWords) {
|
||||
if (trackDuplicates && Zi8SetFindCand(params->scratch,ordinal,work) != 0) goto nextOrdinal;
|
||||
if (trackDuplicates && (ziU8)Zi8SetFindCand(params->scratch,ordinal,work) != 0) goto nextOrdinal;
|
||||
for (index = 0; index < candidateCount; index++) {
|
||||
if (unicodeCharacter == output[index]) break;
|
||||
}
|
||||
@@ -1738,8 +1738,7 @@ nextOrdinal:
|
||||
}
|
||||
finishCandidates:
|
||||
if ((emitWords) && (outputIndex != 0)) {
|
||||
output[outputIndex] = 0;
|
||||
outputIndex++;
|
||||
output[outputIndex++] = 0;
|
||||
}
|
||||
params->count = candidateCount;
|
||||
Zi8LogError(100,work);
|
||||
|
||||
@@ -920,8 +920,7 @@ selectDictionary:
|
||||
if ((((wordLength == 0) && (*punctuationCursor != 0)) && (dictionaryExact != 0)) &&
|
||||
((((ZiAlphaWork*)workData)->singleCharacter != 0 && (parameters->elementCount == 2)))) {
|
||||
*wordCursor = ((ZiAlphaWork*)workData)->singleCharacter;
|
||||
wordCursor[1] = *punctuationCursor;
|
||||
punctuationCursor = punctuationCursor + 1;
|
||||
wordCursor[1] = *punctuationCursor++;
|
||||
wordCursor[2] = 0;
|
||||
wordLength = 2;
|
||||
}
|
||||
@@ -1139,7 +1138,7 @@ prepareCandidate:
|
||||
Zi8ChangeWordCase(wordCursor - prefixCount,language,workData);
|
||||
}
|
||||
if ((((ZiAlphaOptions*)optionData)->suffixOnly != '\0') &&
|
||||
((int)((ZiAlphaOptions*)optionData)->maxWordLength < (int)(wordLength + prefixCount))) {
|
||||
((wordLength + prefixCount) > ((ZiAlphaOptions*)optionData)->maxWordLength)) {
|
||||
wordLength = ((ZiAlphaOptions*)optionData)->maxWordLength - prefixCount;
|
||||
wordCursor[wordLength] = 0;
|
||||
}
|
||||
@@ -1208,16 +1207,14 @@ emitCandidate:
|
||||
if (((ZiAlphaOptions*)optionData)->maxResults <= candidateCount) goto finishCandidates;
|
||||
} else {
|
||||
if (((ZiAlphaOptions*)optionData)->lookupMode != '\0') {
|
||||
for (index = 0;
|
||||
(index <= (int)wordLength &&
|
||||
(wordCursor[index] == ((ZiAlphaOptions*)optionData)->dictionary[index]));
|
||||
index = index + 1) {
|
||||
for (index = 0; index <= wordLength; index++) {
|
||||
if (wordCursor[index] != ((ZiAlphaOptions*)optionData)->dictionary[index]) break;
|
||||
}
|
||||
if ((((((ZiAlphaWork*)workData)->operation != '\0') || ((int)wordLength <= index))
|
||||
if ((((((ZiAlphaWork*)workData)->operation != '\0') || (index >= wordLength))
|
||||
&& ((((ZiAlphaWork*)workData)->operation == '\0' ||
|
||||
((exactLengthOnly == 0 ||
|
||||
((int)(ziU16)Zi8WCharCount(((ZiAlphaOptions*)optionData)->dictionary,workData) <= index)))))) &&
|
||||
((exactLengthOnly != 0 || ((int)wordLength <= index)))) {
|
||||
(index >= (int)(ziU16)Zi8WCharCount(((ZiAlphaOptions*)optionData)->dictionary,workData))))))) &&
|
||||
((exactLengthOnly != 0 || (index >= wordLength)))) {
|
||||
candidateCount = 1;
|
||||
goto finishCandidates;
|
||||
}
|
||||
@@ -1376,27 +1373,23 @@ finishDictionaryPass:;
|
||||
(((parameters->elementCount == 1 &&
|
||||
(((Zi8GetTableCount(parameters->language,0x1f,workData)) & 0x40) == 0)) &&
|
||||
(*parameters->elements >= 0xeff1)))))) &&
|
||||
((*parameters->elements < 0xf011 &&
|
||||
((*parameters->elements <= 0xf010 &&
|
||||
((Zi8getKeyLayout(parameters->language,*parameters->elements,&punctuationBuffer[0],1,workData)) != '\0')))) {
|
||||
punctuationCandidate = ZI8_TRUE;
|
||||
}
|
||||
if (((candidateCount == 0) && (punctuationCandidate)) && (firstCandidate == 0)) {
|
||||
candidateCount = 1;
|
||||
if ((((ZiAlphaOptions*)optionData)->countOnly == '\0') && ((parameters->getOptions & 0xfd) != 0x81)) {
|
||||
*encodedOutput = 0x3e;
|
||||
encodedOutput[2] = 0;
|
||||
encodedOutput[1] = 0;
|
||||
}
|
||||
else {
|
||||
if (((ZiAlphaOptions*)optionData)->countOnly != 0 || (parameters->getOptions & 0xFD) == 0x81) {
|
||||
if (parameters->getMode == 1) {
|
||||
*wordCursor = *elements;
|
||||
} else {
|
||||
*wordCursor = 0x3E;
|
||||
}
|
||||
else {
|
||||
*wordCursor = 0x3e;
|
||||
}
|
||||
wordCursor[2] = 0;
|
||||
wordCursor[1] = 0;
|
||||
wordCursor = wordCursor + 2;
|
||||
wordCursor[1] = wordCursor[2] = 0;
|
||||
wordCursor += 2;
|
||||
} else {
|
||||
*encodedOutput = 0x3E;
|
||||
encodedOutput[1] = encodedOutput[2] = 0;
|
||||
}
|
||||
if (((ZiAlphaOptions*)optionData)->lookupMode == '\0') {
|
||||
((ZiAlphaWork*)workData)->singleCharacter = 0;
|
||||
@@ -1576,17 +1569,17 @@ checkPrefixFields:
|
||||
|
||||
finishCandidates:
|
||||
((ZiAlphaWork*)workData)->usePrefixAsElements = 0;
|
||||
if (((ZiAlphaOptions*)optionData)->countOnly == '\0') {
|
||||
parameters->letters = candidateCount;
|
||||
if (((ZiAlphaOptions*)optionData)->countOnly != '\0') {
|
||||
parameters->letters = 0;
|
||||
}
|
||||
else {
|
||||
parameters->letters = 0;
|
||||
parameters->letters = candidateCount;
|
||||
}
|
||||
wordCursor[-prefixCount] = 0;
|
||||
if (((((ZiAlphaOptions*)optionData)->countOnly == '\0') && (((ZiAlphaOptions*)optionData)->lookupMode == '\0')) && (parameters->elementCount != 0)) {
|
||||
elementIndex = parameters->elementCount - 1;
|
||||
if (((primaryVowelRestriction) || (secondaryVowelRestriction)) &&
|
||||
((((ZiAlphaWork*)workData)->prefixEnabled < 2 ||
|
||||
((((ZiAlphaWork*)workData)->prefixEnabled <= 1 ||
|
||||
(parameters->elements[elementIndex] == 0xEFF1)))) {
|
||||
index = 0;
|
||||
while (elementIndex >= 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,
|
||||
@@ -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) {
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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;
|
||||
@@ -743,9 +743,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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -749,7 +749,8 @@ s32 pfd_sddrv_get_total_sectors(u32* sectors, u16* bytes_per_sector) {
|
||||
minimum_multiplier = multiplier >= 9 ? multiplier : 9;
|
||||
max_multiplier = minimum_multiplier <= 11 ? minimum_multiplier : 11;
|
||||
multiplier_factor = 1;
|
||||
multiplier_factor <<= (u16)(max_multiplier - 9);
|
||||
max_multiplier = (u16)(max_multiplier - 9);
|
||||
multiplier_factor = (u16)(multiplier_factor << max_multiplier);
|
||||
*sectors = cluster_blocks * multiplier_factor;
|
||||
} else {
|
||||
*sectors = ((csd[1] >> 8 & 0x3fffff) + 1) * 0x400;
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#include <private/fa/pdm.h>
|
||||
#include <revolution/types.h>
|
||||
#define MBR_WORD(buf, offset) (((pf_u32)(buf)[(offset) + 3] << 24) + ((pf_u32)(buf)[(offset) + 2] << 16) + ((pf_u32)(buf)[(offset) + 1] << 8) + (buf)[offset])
|
||||
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]);
|
||||
}
|
||||
|
||||
static inline pf_u32 read_partition_u32(const pf_u8* buf, pf_u32 offset) {
|
||||
return (((pf_u32)buf[offset + 2] << 16) + buf[offset]) +
|
||||
(((pf_u32)buf[offset + 3] << 24) + ((pf_u32)buf[offset + 1] << 8));
|
||||
}
|
||||
|
||||
pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mbr) {
|
||||
pf_s16 index;
|
||||
pf_u32 start[4];
|
||||
@@ -18,8 +22,8 @@ pf_s32 pdm_part_is_master_boot_sector(pf_u8* buf, pf_u32 total, pf_bool* p_is_mb
|
||||
p_count = count;
|
||||
for (index = 0; index < 4; index++) {
|
||||
*p_start = 0;
|
||||
*p_start = (((pf_u32)buf[456] << 16) + buf[454]) + (((pf_u32)buf[457] << 24) + ((pf_u32)buf[455] << 8));
|
||||
*p_count = (((pf_u32)buf[460] << 16) + buf[458]) + (((pf_u32)buf[461] << 24) + ((pf_u32)buf[459] << 8));
|
||||
*p_start = read_partition_u32(buf, 454);
|
||||
*p_count = read_partition_u32(buf, 458);
|
||||
if (*p_start != 0 && *p_count != 0) {
|
||||
if (index == 0) { *p_is_mbr = 1; }
|
||||
} else {
|
||||
@@ -91,14 +95,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] = 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);
|
||||
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);
|
||||
part_index = 0;
|
||||
for (index = 0; index < 4; index++) {
|
||||
sector = start[index];
|
||||
@@ -112,15 +116,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 + MBR_WORD(buf, 454);
|
||||
length = MBR_WORD(buf, 458);
|
||||
sector = sector + read_partition_u32(buf, 454);
|
||||
length = read_partition_u32(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 + MBR_WORD(buf, 470);
|
||||
length = MBR_WORD(buf, 474);
|
||||
sector = base + read_partition_u32(buf, 470);
|
||||
length = read_partition_u32(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; }
|
||||
|
||||
@@ -557,15 +557,11 @@ static void kbdSendKey(KBDKeyEventData* event) {
|
||||
}
|
||||
}
|
||||
|
||||
static inline u32 kbdChannelFlags(u32 channel) {
|
||||
return kbdData[channel].flags;
|
||||
}
|
||||
|
||||
static void kbd_led_handler(BOOL success, void* callbackArg) {
|
||||
const KBDLEDCallbackData* callback;
|
||||
u32 index;
|
||||
s32 index;
|
||||
u32 err;
|
||||
index = (u32)callbackArg;
|
||||
index = (s32)callbackArg;
|
||||
callback = &kbdLCBuf[index];
|
||||
kbdCmdBuf[index].device = 0;
|
||||
if (callback->callbackAddress == (USBKBDCmdLEDCallback)(u32)kbdCmdBuf[index].device) {
|
||||
@@ -579,12 +575,11 @@ static void kbd_led_handler(BOOL success, void* callbackArg) {
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
kbdLCBuf[index].callbackAddress(err, kbdLCBuf[index].callbackArg);
|
||||
kbdLCBuf[(u32)callbackArg].callbackAddress(err, kbdLCBuf[(u32)callbackArg].callbackArg);
|
||||
}
|
||||
|
||||
USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback, void* callbackArg) {
|
||||
s32 index;
|
||||
u32 ofs;
|
||||
u32 index;
|
||||
u8 ledBits;
|
||||
BOOL interrupts;
|
||||
USBKBDErr result;
|
||||
@@ -594,14 +589,18 @@ USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback,
|
||||
if (channel >= 4) {
|
||||
return 4;
|
||||
}
|
||||
if ((s32)kbdChannelFlags(channel) == 1 || (s32)kbdChannelFlags(channel) == 4) {
|
||||
return 5;
|
||||
{
|
||||
KBDChannel* data = &kbdData[(s32)channel];
|
||||
if ((s32)data->flags == 1 || (s32)data->flags == 4) {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
ledBits = leds;
|
||||
interrupts = OSDisableInterrupts();
|
||||
for (index = 0, ofs = 0; index < 12; index++, ofs += sizeof(KBDLEDCommand)) {
|
||||
if (*(u32*)&((u8*)kbdCmdBuf)[ofs] == 0) {
|
||||
*(u32*)&((u8*)kbdCmdBuf)[ofs] = (u32)kbdData[channel].device;
|
||||
for (index = 0; index < 12; index++) {
|
||||
if (kbdCmdBuf[(s32)index].device == 0) {
|
||||
KBDChannel* data = &kbdData[channel];
|
||||
kbdCmdBuf[(s32)index].device = (u32)data->device;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -609,11 +608,14 @@ USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback,
|
||||
if (index == 12) {
|
||||
return 7;
|
||||
}
|
||||
kbdLCBuf[index].callbackAddress = callback;
|
||||
kbdLCBuf[index].callbackArg = callbackArg;
|
||||
result = USBKBDSetLEDAsync((u32)kbdData[channel].device, ledBits,
|
||||
(USBKBDCmdLEDAsync*)&kbdCmdBuf[index],
|
||||
kbd_led_handler, (void*)index);
|
||||
{
|
||||
KBDChannel* data = &kbdData[channel];
|
||||
kbdLCBuf[index].callbackAddress = callback;
|
||||
kbdLCBuf[index].callbackArg = callbackArg;
|
||||
result = USBKBDSetLEDAsync((u32)data->device, ledBits,
|
||||
(USBKBDCmdLEDAsync*)&kbdCmdBuf[index],
|
||||
kbd_led_handler, (void*)index);
|
||||
}
|
||||
switch (result) {
|
||||
default:
|
||||
return 7;
|
||||
@@ -624,7 +626,6 @@ USBKBDErr KBDSetLedsAsync(u32 channel, u32 leds, USBKBDCmdLEDCallback callback,
|
||||
|
||||
USBKBDErr KBDSetLeds(u32 channel, u32 leds) {
|
||||
u32 index;
|
||||
KBDLEDCommand* command;
|
||||
BOOL interrupts;
|
||||
USBKBDErr result;
|
||||
u8 ledBits;
|
||||
@@ -634,20 +635,16 @@ USBKBDErr KBDSetLeds(u32 channel, u32 leds) {
|
||||
if (channel >= 4) {
|
||||
return 4;
|
||||
}
|
||||
if ((s32)kbdChannelFlags(channel) == 1 || (s32)kbdChannelFlags(channel) == 4) {
|
||||
if ((s32)kbdData[(s32)channel].flags == 1 || (s32)kbdData[(s32)channel].flags == 4) {
|
||||
return 5;
|
||||
}
|
||||
ledBits = leds & 0xff;
|
||||
interrupts = OSDisableInterrupts();
|
||||
index = 0;
|
||||
command = kbdCmdBuf;
|
||||
while (index < 12) {
|
||||
if (command->device == 0) {
|
||||
command->device = (u32)kbdData[channel].device;
|
||||
for (index = 0; index < 12; index++) {
|
||||
if (kbdCmdBuf[(s32)index].device == 0) {
|
||||
kbdCmdBuf[(s32)index].device = (u32)kbdData[channel].device;
|
||||
break;
|
||||
}
|
||||
index++;
|
||||
command++;
|
||||
}
|
||||
OSRestoreInterrupts(interrupts);
|
||||
if (index == 12) {
|
||||
@@ -655,7 +652,7 @@ USBKBDErr KBDSetLeds(u32 channel, u32 leds) {
|
||||
}
|
||||
result = USBKBDSetLED((u32)kbdData[channel].device, ledBits,
|
||||
(USBKBDCmdLED*)&kbdCmdBuf[index]);
|
||||
kbdCmdBuf[index].device = 0;
|
||||
kbdCmdBuf[(s32)index].device = 0;
|
||||
switch (result) {
|
||||
default:
|
||||
return 7;
|
||||
|
||||
@@ -939,15 +939,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 +963,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) {
|
||||
|
||||
@@ -169,11 +169,11 @@ static const u32 AESiDecryptTable[] = {
|
||||
};
|
||||
|
||||
#define ROTATE(x,n) (((x) << (n)) | ((x) >> (32 - (n))))
|
||||
#define ENCRYPT(a,b,c,d) (ROTATE(AESiEncryptTable[(a)>>24],24) ^ ROTATE(AESiEncryptTable[((b)>>16)&255],16) ^ ROTATE(AESiEncryptTable[((c)>>8)&255],8) ^ AESiEncryptTable[(d)&255])
|
||||
#define DECRYPT(a,b,c,d) (ROTATE(AESiDecryptTable[(a)>>24],24) ^ ROTATE(AESiDecryptTable[((b)>>16)&255],16) ^ ROTATE(AESiDecryptTable[((c)>>8)&255],8) ^ AESiDecryptTable[(d)&255])
|
||||
#define SUBSTITUTE(table,a,b,c,d) (((u32)table[(a)>>24]<<24) | ((u32)table[((b)>>16)&255]<<16) | ((u32)table[((c)>>8)&255]<<8) | table[(d)&255])
|
||||
#define ENCRYPT(a,b,c,d) (((ROTATE(AESiEncryptTable[((b)>>16)&255],16) ^ ROTATE(AESiEncryptTable[(a)>>24],24)) ^ AESiEncryptTable[(d)&255]) ^ ROTATE(AESiEncryptTable[((c)>>8)&255],8))
|
||||
#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) ^ ((u32)table[((b)>>16)&255]<<16) ^ ((u32)table[((c)>>8)&255]<<8) ^ table[(d)&255])
|
||||
#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))
|
||||
|
||||
void AESiEncryptBlock(AESContext* context, u32* output, const u32* input) {
|
||||
u32 rounds = context->rounds;
|
||||
@@ -210,9 +210,9 @@ void AESiDecryptBlock(AESContext* context, u32* output, const u32* input) {
|
||||
u32 twice=DOUBLE_BYTES(value);
|
||||
u32 four=DOUBLE_BYTES(twice);
|
||||
u32 eight=DOUBLE_BYTES(four)^value;
|
||||
u32 mixed=eight ^ (four ^ ROTATE(eight,8));
|
||||
mixed ^= twice ^ ROTATE(mixed,8);
|
||||
mixed ^= value ^ ROTATE(mixed,8);
|
||||
u32 mixed=(ROTATE(eight,8) ^ (eight ^ four));
|
||||
mixed=(ROTATE(mixed,8) ^ (mixed ^ twice));
|
||||
mixed=(ROTATE(mixed,8) ^ (mixed ^ value));
|
||||
keys[word]=mixed;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
u8 rawLeft;
|
||||
while (LowerCase((s8)(rawLeft = *(const u8*)left)) == LowerCase(*right)) {
|
||||
if ((s8)rawLeft == 0 || (s8)rawLeft == ' ') {
|
||||
return 0;
|
||||
}
|
||||
++left;
|
||||
++right;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -161,13 +161,16 @@ s32 NHTTPi_Base64Encode(char* destination, const char* source) {
|
||||
static char alphabet[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
const char* table=alphabet;
|
||||
char* output=destination;
|
||||
u32 length=strlen(source);
|
||||
s32 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];
|
||||
for(; consumed<length; consumed+=3) {
|
||||
s8 first = source[0];
|
||||
s8 second = source[1];
|
||||
s8 third = source[2];
|
||||
output[0]=table[first>>2];
|
||||
output[1]=table[(second>>4)+((first&3)<<4)];
|
||||
output[2]=table[(third>>6)+((second&15)<<2)];
|
||||
output[3]=table[third&63];
|
||||
source+=3; output+=4;
|
||||
}
|
||||
if(consumed==length+1) output[-1]='=';
|
||||
|
||||
@@ -715,7 +715,7 @@ static inline NWC24Err CheckDlTaskRetry(NWC24DlTask* dlTask, u8 retryCount) {
|
||||
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; }
|
||||
if ((retryMask & (1U << retryCount)) == 0) { return NWC24_ERR_DISABLED; }
|
||||
return NWC24_OK;
|
||||
}
|
||||
static inline NWC24Err UpdateDlTaskAccessTime(NWC24DlTask* dlTask) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -242,14 +242,63 @@ BOOL BS2IsDiagDisc() { return (u8)(*(u8 *)OSPhysicalToCached(OS_ADDR_BOOT_INFO)
|
||||
extern vu32 BS2VideoMode;
|
||||
extern vu32 __DVDLayoutFormat;
|
||||
|
||||
void Run(u32 entryPoint, void *start, u32 blockCount, u32 argument) {
|
||||
u8 *block = start;
|
||||
for (; blockCount != 0; --blockCount) {
|
||||
__dcbz(block, 0);
|
||||
__dcbf(block, 0);
|
||||
block += 32;
|
||||
}
|
||||
((void (*)(u32))entryPoint)(argument);
|
||||
asm void Run(u32 entryPoint, void *start, u32 blockCount, u32 argument) {
|
||||
// clang-format off
|
||||
#ifdef __MWERKS__
|
||||
nofralloc
|
||||
|
||||
mtctr r5
|
||||
mtlr r3
|
||||
|
||||
li r0, 0
|
||||
li r2, 0
|
||||
li r3, 0
|
||||
li r5, 0
|
||||
li r7, 0
|
||||
li r8, 0
|
||||
li r9, 0
|
||||
li r10, 0
|
||||
li r11, 0
|
||||
li r12, 0
|
||||
li r13, 0
|
||||
li r14, 0
|
||||
li r15, 0
|
||||
li r16, 0
|
||||
li r17, 0
|
||||
li r18, 0
|
||||
li r19, 0
|
||||
li r20, 0
|
||||
li r21, 0
|
||||
li r22, 0
|
||||
li r23, 0
|
||||
li r24, 0
|
||||
li r25, 0
|
||||
li r26, 0
|
||||
li r27, 0
|
||||
li r28, 0
|
||||
li r29, 0
|
||||
li r30, 0
|
||||
li r31, 0
|
||||
|
||||
// The application stack is fixed; it is unrelated to the formatter.
|
||||
lis r1, 0x8160
|
||||
ori r1, r1, 0
|
||||
li r6, 0
|
||||
|
||||
b Run_loop_entry
|
||||
Run_loop:
|
||||
dcbz r4, r0
|
||||
dcbf r4, r0
|
||||
addi r4, r4, 0x20
|
||||
bdnz Run_loop
|
||||
b Run_done
|
||||
Run_done:
|
||||
li r4, 0
|
||||
blr
|
||||
Run_loop_entry:
|
||||
b Run_loop
|
||||
#endif
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
BOOL BS2GetLockedTitles(ESTitleId *pTitleIds, u32 *count) {
|
||||
@@ -803,7 +852,7 @@ void BS2StartGCGame() {
|
||||
OSTime time;
|
||||
|
||||
StartingGame = TRUE;
|
||||
while (DVDGetCommandBlockStatus(&CoverBlock) != DVD_STATE_IDLE) {
|
||||
while (CoverBlock.state != DVD_STATE_IDLE) {
|
||||
}
|
||||
|
||||
soundMode = SCGetSoundMode();
|
||||
@@ -1796,21 +1845,24 @@ invalidRvlRegion:
|
||||
State = BS2_STT_RESET_SYSTEM;
|
||||
break;
|
||||
}
|
||||
if (GamePartition == 0) {
|
||||
if (GamePartition != 0) {
|
||||
State = BS2_STT_37;
|
||||
} else {
|
||||
State = BS2_STT_54;
|
||||
break;
|
||||
}
|
||||
State = BS2_STT_37;
|
||||
case 0x25:
|
||||
case 0x25: {
|
||||
u32 partitionOffset = (u32)((DVDPartitionInfo *)GamePartition)->partition;
|
||||
if (BS2BootFromCache != 0) {
|
||||
BS2Report("Open partition from cache.dat\n");
|
||||
NandPending = 1;
|
||||
BS2NANDDivideReadAsync(&BS2CacheFileInfo, &PartitionParams.tmd, 0x4a00, BS2NANDCallback, &BS2NandBlock);
|
||||
} else
|
||||
DVDOpenPartitionAsync(&Block, &PartitionParams.tmd, (u32)((DVDPartitionInfo *)GamePartition)->partition, BS2DVDCallback);
|
||||
DVDOpenPartitionAsync(&Block, &PartitionParams.tmd, partitionOffset, BS2DVDCallback);
|
||||
PartitionOpen = 1;
|
||||
State = BS2_STT_38;
|
||||
break;
|
||||
}
|
||||
case 0x26: {
|
||||
status = CheckBS2CommandStatus();
|
||||
if (status == 0)
|
||||
@@ -1837,13 +1889,16 @@ invalidRvlRegion:
|
||||
titlePrefix = titleCode >> 0x18;
|
||||
titleCharacters[3] = (u8)titleCode;
|
||||
titleCharacters[0] = (char)(titleCode >> 0x18);
|
||||
if (titlePrefix < 'R') {
|
||||
if (titlePrefix == 'D')
|
||||
goto check_title_region;
|
||||
} else if (titlePrefix < 'U')
|
||||
switch (titlePrefix) {
|
||||
case 'D':
|
||||
case 'R':
|
||||
case 'S':
|
||||
case 'T':
|
||||
goto check_title_region;
|
||||
regionMatches = TRUE;
|
||||
goto title_region_checked;
|
||||
default:
|
||||
regionMatches = TRUE;
|
||||
goto title_region_checked;
|
||||
}
|
||||
{
|
||||
check_title_region:
|
||||
if (titleCharacters[3] == 0x41) {
|
||||
@@ -2001,8 +2056,8 @@ invalidRvlRegion:
|
||||
if (status == 0)
|
||||
OSPanic("BS2Mach.c", 0x12c8, "BS2 ERROR >>> Cannnot alloc 0x%08x from MEMAllocator", bannerFile.length);
|
||||
BannerLength = bannerFile.length;
|
||||
BannerBuffer = OSRoundDown32B(BannerAllocation) + 32;
|
||||
BS2Report("BannerBufferAddr : %08X\n");
|
||||
BannerBuffer = BannerAllocation + 32 - BannerAllocation % 32;
|
||||
BS2Report("BannerBufferAddr : %08X\n", BannerBuffer);
|
||||
} else {
|
||||
if ((BannerBuffer != 0) && (BannerLength != 0)) {
|
||||
if (BannerLength < ((bannerFile.length + 0x1fU) & 0xffffffe0))
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -3070,20 +3070,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 +3100,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 +3173,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;
|
||||
@@ -7207,7 +7215,7 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
u32 cmpLow;
|
||||
struct {
|
||||
CHANSVmObjType operandTypes[2];
|
||||
u64 floatBits;
|
||||
double floatLiteral;
|
||||
CHANSVmObjHdr copies[2];
|
||||
CHANSVmObjHdr load;
|
||||
CHANSVmObjHdr operand;
|
||||
@@ -7291,8 +7299,8 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
case CHANS_VM_OP_LOAD_FLOAT: {
|
||||
opSize = 9;
|
||||
operandBuf = VmGetOperand(vm, 1, 9);
|
||||
memcpy(&scratch.floatBits, operandBuf, 8);
|
||||
result = CHANSVmSetFloat(vm, &pVm->accumulator, *(double*)&scratch.floatBits);
|
||||
memcpy(&scratch.floatLiteral, operandBuf, 8);
|
||||
result = CHANSVmSetFloat(vm, &pVm->accumulator, scratch.floatLiteral);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -7769,8 +7777,8 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
arrayIdx = (u32)stackPtr->value.int_v;
|
||||
goto set_index_ok;
|
||||
case CHANS_VM_OBJ_TYPE_FLOAT: {
|
||||
double stackFloat = *(double*)stackPtr;
|
||||
if (stackFloat <= 4294967294.0 && 0.0 <= stackFloat) {
|
||||
double stackFloat = stackPtr->value.float_v;
|
||||
if (stackFloat >= 0.0 && stackFloat <= 4294967294.0) {
|
||||
arrayIdx = (u32)stackFloat;
|
||||
goto set_index_ok;
|
||||
}
|
||||
@@ -8004,34 +8012,27 @@ CHANSVmErr CHANSVmStep(CHANSVm* vm, int stepCount) {
|
||||
if (pVm->pActiveCtx->stackDepth != 0 && pVm->pObjStackTopBuf + sizeof(CHANSVmObjHdr) <= pVm->pHeapEnd) {
|
||||
CHANSVmObjHdr* stackTop = (CHANSVmObjHdr*)pVm->pObjStackTopBuf;
|
||||
isTypeMatch = 0;
|
||||
if (pVm->accumulator.type == stackTop->type) {
|
||||
if (stackTop->type == pVm->accumulator.type) {
|
||||
switch (stackTop->type) {
|
||||
case CHANS_VM_OBJ_TYPE_INTEGER: {
|
||||
u32 low1 = *(u32*)stackTop;
|
||||
u32 low2 = *(u32*)&pVm->accumulator;
|
||||
u32 high1 = *((u32*)stackTop + 1);
|
||||
u32 high2 = *((u32*)&pVm->accumulator + 1);
|
||||
u32 xor1 = low1 ^ low2;
|
||||
u32 xor2 = high1 ^ high2;
|
||||
isTypeMatch = !(xor1 | xor2);
|
||||
isTypeMatch = stackTop->value.int_v == pVm->accumulator.value.int_v;
|
||||
goto end_branch_check;
|
||||
}
|
||||
case CHANS_VM_OBJ_TYPE_FLOAT: {
|
||||
double stackFloat = stackTop->value.float_v;
|
||||
double accFloat = pVm->accumulator.value.float_v;
|
||||
isTypeMatch = stackFloat == accFloat ? 1 : 0;
|
||||
isTypeMatch = stackTop->value.float_v == pVm->accumulator.value.float_v;
|
||||
goto end_branch_check;
|
||||
}
|
||||
case CHANS_VM_OBJ_TYPE_STRING: {
|
||||
u32 len1, len2;
|
||||
CHANSVmObjHdr* stackObj = (CHANSVmObjHdr*)pVm->pObjStackTopBuf;
|
||||
const vmWStringObjVal* accumulatorString = pVm->accumulator.value.wstring_v;
|
||||
const vmWStringObjVal* stackString = stackTop->value.wstring_v;
|
||||
u32 strEqual;
|
||||
isTypeMatch = 0;
|
||||
len1 = stackObj->value.wstring_v->len;
|
||||
len2 = pVm->accumulator.value.wstring_v->len;
|
||||
len1 = stackString->len;
|
||||
len2 = accumulatorString->len;
|
||||
if (len1 == len2) {
|
||||
strEqual = 0;
|
||||
if (len1 == 0 || memcmp(stackObj->value.wstring_v->spData, pVm->accumulator.value.wstring_v->spData, len1) == 0) {
|
||||
if (len1 == 0 || memcmp(stackString->spData, accumulatorString->spData, len1) == 0) {
|
||||
strEqual = 1;
|
||||
}
|
||||
if (strEqual) {
|
||||
|
||||
@@ -433,16 +433,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 (u16 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 +1084,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 +1685,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));
|
||||
|
||||
@@ -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);
|
||||
@@ -3177,7 +3177,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 +3186,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 +3207,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -1198,8 +1198,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) {
|
||||
|
||||
@@ -2719,14 +2719,10 @@ namespace ipl {
|
||||
|
||||
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;
|
||||
|
||||
@@ -617,6 +617,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 +738,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 +811,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 +900,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 +952,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 +1040,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 +1112,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 +1250,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 +1308,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 +1339,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 +1366,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 {
|
||||
|
||||
@@ -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;
|
||||
@@ -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) {
|
||||
|
||||
@@ -1379,30 +1379,34 @@ namespace ipl {
|
||||
return;
|
||||
}
|
||||
|
||||
ext_ead::www::BrowserThread* browser = surface->GetBrowserThread();
|
||||
if (browser == NULL) {
|
||||
// One pointer, overwritten by the standard-buffer fetch, so the
|
||||
// browser `this` and standardBuffer share a callee-saved reg.
|
||||
void* held = surface->GetBrowserThread();
|
||||
if (held == NULL) {
|
||||
return;
|
||||
}
|
||||
if (browser->GetTextureBuffer(0, NULL) == NULL) {
|
||||
if (static_cast<ext_ead::www::BrowserThread*>(held)->GetTextureBuffer(0, NULL) == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
ext_ead::www::BrowserWindow* browserWindow =
|
||||
static_cast<ext_ead::www::BrowserWindow*>(browser->mpBrowserWindows[0]);
|
||||
if ((browserWindow != NULL ? browserWindow->unk_0x2C4[3] : 0) != 0) {
|
||||
static_cast<ext_ead::www::BrowserWindow*>(static_cast<ext_ead::www::BrowserThread*>(held)->mpBrowserWindows[0]);
|
||||
if ((browserWindow == NULL ? 0 : browserWindow->unk_0x2C4[3]) != 0) {
|
||||
unk_0x91C[2] = 1;
|
||||
mState = 0;
|
||||
browserWindow = static_cast<ext_ead::www::BrowserWindow*>(browser->mpBrowserWindows[0]);
|
||||
browserWindow = static_cast<ext_ead::www::BrowserWindow*>(static_cast<ext_ead::www::BrowserThread*>(held)->mpBrowserWindows[0]);
|
||||
if (browserWindow != NULL) {
|
||||
browserWindow->unk_0x2C4[3] = 0;
|
||||
}
|
||||
www::trasition::ScrollState scrollState = www::trasition::GetScrollState();
|
||||
browserScrollDirection = scrollState == www::trasition::SCROLL_LEFT
|
||||
? 1
|
||||
: (scrollState == www::trasition::SCROLL_RIGHT ? -1 : 0);
|
||||
if (scrollState == www::trasition::SCROLL_LEFT) {
|
||||
browserScrollDirection = 1;
|
||||
} else {
|
||||
browserScrollDirection = scrollState == www::trasition::SCROLL_RIGHT ? -1 : 0;
|
||||
}
|
||||
www::trasition::ResetScrollState();
|
||||
void* changedWideBuffer = browser->GetTextureBuffer(1, NULL);
|
||||
void* changedStandardBuffer = browser->GetTextureBuffer(0, NULL);
|
||||
void* changedWideBuffer = static_cast<ext_ead::www::BrowserThread*>(held)->GetTextureBuffer(1, NULL);
|
||||
void* changedStandardBuffer = static_cast<ext_ead::www::BrowserThread*>(held)->GetTextureBuffer(0, NULL);
|
||||
OSReport("changed %p %p\n", changedStandardBuffer, changedWideBuffer);
|
||||
ext_ead::www::Heap::reportLeaHeap();
|
||||
}
|
||||
@@ -1415,8 +1419,9 @@ namespace ipl {
|
||||
|
||||
WWWRect* standardRect;
|
||||
WWWRect* wideRect;
|
||||
void* wideBuffer = browser->GetTextureBuffer(1, &wideRect);
|
||||
void* standardBuffer = browser->GetTextureBuffer(0, &standardRect);
|
||||
void* wideBuffer = static_cast<ext_ead::www::BrowserThread*>(held)->GetTextureBuffer(1, &wideRect);
|
||||
held = static_cast<ext_ead::www::BrowserThread*>(held)->GetTextureBuffer(0, &standardRect);
|
||||
void* standardBuffer = held;
|
||||
nw4r::ut::Rect projection4x3;
|
||||
System::getProjectionRect4x3(&projection4x3);
|
||||
int screenWidth = abs(static_cast<int>(projection4x3.GetWidth()));
|
||||
@@ -1443,33 +1448,33 @@ namespace ipl {
|
||||
int wideWidth = abs(static_cast<int>(projection16x9.GetWidth()));
|
||||
int wideHeight = abs(static_cast<int>(projection16x9.GetHeight()));
|
||||
f32 wideLeft = -wideWidth / 2;
|
||||
f32 wideTop = wideHeight / 2;
|
||||
f32 wideTopL = wideHeight / 2;
|
||||
f32 wideRight = wideWidth / 2;
|
||||
nw4r::ut::Rect leftSide(wideLeft, wideTop,
|
||||
f32 wideTopR = wideHeight / 2;
|
||||
nw4r::ut::Rect leftSide(wideLeft, wideTopL,
|
||||
wideLeft + sideDescriptor->textureHeader->width,
|
||||
wideTop - sideDescriptor->textureHeader->height);
|
||||
wideTopL - sideDescriptor->textureHeader->height);
|
||||
nw4r::ut::Rect rightSide(wideRight - sideDescriptor->textureHeader->width,
|
||||
wideTop, wideRight, wideTop - sideDescriptor->textureHeader->height);
|
||||
|
||||
wideTopR, wideRight, wideTopR - sideDescriptor->textureHeader->height);
|
||||
if (browserScrollDirection != 0) {
|
||||
nw4r::lyt::Material* wideMaterial =
|
||||
void* wideMaterial =
|
||||
mpChangeLayout->FindPaneByName("N_Tra0")->FindMaterialByName("Tex0");
|
||||
nw4r::lyt::Material* firstStandardMaterial =
|
||||
mpChangeLayout->FindPaneByName("N_Tra0")->FindMaterialByName("Tex1");
|
||||
nw4r::lyt::Material* secondStandardMaterial =
|
||||
mpChangeLayout->FindPaneByName("N_Tra0")->FindMaterialByName("Tex2");
|
||||
wideMaterial->SetTexture(0, wideTexture);
|
||||
static_cast<nw4r::lyt::Material*>(wideMaterial)->SetTexture(0, wideTexture);
|
||||
firstStandardMaterial->SetTexture(0, standardTexture);
|
||||
secondStandardMaterial->SetTexture(0, standardTexture);
|
||||
mpChangeLayout->FindPaneByName("N_Tra0")->SetVisible(true);
|
||||
if (browserScrollDirection == 1) {
|
||||
utility::FrameController* animation = mpSecondAnimation;
|
||||
animation->initFrame();
|
||||
animation->restart();
|
||||
wideMaterial = mpSecondAnimation;
|
||||
static_cast<utility::FrameController*>(wideMaterial)->initFrame();
|
||||
static_cast<utility::FrameController*>(wideMaterial)->restart();
|
||||
} else {
|
||||
utility::FrameController* animation = mpFirstAnimation;
|
||||
animation->initFrame();
|
||||
animation->restart();
|
||||
wideMaterial = mpFirstAnimation;
|
||||
static_cast<utility::FrameController*>(wideMaterial)->initFrame();
|
||||
static_cast<utility::FrameController*>(wideMaterial)->restart();
|
||||
}
|
||||
mpChangeLayout->calc();
|
||||
browserScrollDirection = 0;
|
||||
@@ -1509,13 +1514,44 @@ namespace ipl {
|
||||
}
|
||||
|
||||
if (mpWiiSettingFlag->smthMsgData >= 2 && mpWiiSettingFlag->smthMsgData <= 7) {
|
||||
GXRenderModeObj renderMode = *System::getRenderModeObj();
|
||||
GXRenderModeObj* pRmode = System::getRenderModeObj();
|
||||
GXRenderModeObj renderMode;
|
||||
volatile GXRenderModeObj* srcMode = pRmode;
|
||||
volatile GXRenderModeObj* dstMode = &renderMode;
|
||||
int n = 12;
|
||||
u8* src;
|
||||
u8* dst = &renderMode.aa;
|
||||
src = &pRmode->aa;
|
||||
dstMode->viTVmode = srcMode->viTVmode;
|
||||
dstMode->fbWidth = srcMode->fbWidth;
|
||||
dstMode->efbHeight = srcMode->efbHeight;
|
||||
dstMode->xfbHeight = srcMode->xfbHeight;
|
||||
dstMode->viXOrigin = srcMode->viXOrigin;
|
||||
dstMode->viYOrigin = srcMode->viYOrigin;
|
||||
dstMode->viWidth = srcMode->viWidth;
|
||||
dstMode->viHeight = srcMode->viHeight;
|
||||
dstMode->xFBmode = srcMode->xFBmode;
|
||||
dstMode->field_rendering = srcMode->field_rendering;
|
||||
dstMode->aa = srcMode->aa;
|
||||
for (; n != 0; n--) {
|
||||
dst[1] = src[1];
|
||||
dst[2] = src[2];
|
||||
src += 2;
|
||||
dst += 2;
|
||||
}
|
||||
dstMode->vfilter[0] = srcMode->vfilter[0];
|
||||
dstMode->vfilter[1] = srcMode->vfilter[1];
|
||||
dstMode->vfilter[2] = srcMode->vfilter[2];
|
||||
dstMode->vfilter[3] = srcMode->vfilter[3];
|
||||
dstMode->vfilter[4] = srcMode->vfilter[4];
|
||||
dstMode->vfilter[5] = srcMode->vfilter[5];
|
||||
dstMode->vfilter[6] = srcMode->vfilter[6];
|
||||
u32 left;
|
||||
u32 top;
|
||||
u32 width;
|
||||
u32 height;
|
||||
GXGetScissor(&left, &top, &width, &height);
|
||||
GXSetScissor(0, renderMode.efbHeight / 2 - 0xA4, renderMode.fbWidth, 0x132);
|
||||
GXSetScissor(0, dstMode->efbHeight / 2 - 0xA4, dstMode->fbWidth, 0x132);
|
||||
mpMainLayout->draw();
|
||||
GXSetScissor(left, top, width, height);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -931,17 +931,15 @@ void CArGBAOdh::cdj_c_makeHeader(SArCDJ_OdhMaster* master, u32 size) {
|
||||
}
|
||||
|
||||
s32 CArGBAOdh::cdj_c_colorConv(SArCDJ_OdhMaster* master, u8* sourceData, int format) {
|
||||
u32 paddedWidth;
|
||||
u16 width;
|
||||
u16 height;
|
||||
u8* workPlane;
|
||||
int sourceStride;
|
||||
u8* crPlane;
|
||||
u8* cbPlane;
|
||||
u8* crPlane;
|
||||
u16* dimensions;
|
||||
int rowIndex;
|
||||
int sourceStride;
|
||||
int i;
|
||||
u16 dimension;
|
||||
u16 paddedDimensions[2];
|
||||
|
||||
dimensions = &master->width;
|
||||
@@ -952,11 +950,11 @@ s32 CArGBAOdh::cdj_c_colorConv(SArCDJ_OdhMaster* master, u8* sourceData, int for
|
||||
height = dimensions[1];
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
dimension = dimensions[i];
|
||||
if ((dimension & 7) != 0) {
|
||||
paddedDimensions[i] = (dimension + 8) - (dimension & 7);
|
||||
u16 remainder = dimensions[i] & 7;
|
||||
if (remainder != 0) {
|
||||
paddedDimensions[i] = (dimensions[i] + 8) - remainder;
|
||||
} else {
|
||||
paddedDimensions[i] = dimension;
|
||||
paddedDimensions[i] = dimensions[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -972,13 +970,12 @@ s32 CArGBAOdh::cdj_c_colorConv(SArCDJ_OdhMaster* master, u8* sourceData, int for
|
||||
}
|
||||
}
|
||||
|
||||
paddedWidth = paddedDimensions[0];
|
||||
for (rowIndex = 0; rowIndex < (s32)height; rowIndex++) {
|
||||
LineConv11(sourceData + (rowIndex & 3) * 8 + rowIndex / 4 * sourceStride, workPlane, cbPlane, crPlane,
|
||||
dimensions[0], dimensions[1], (const long*)gArConvPlttTbl, format);
|
||||
workPlane += paddedWidth;
|
||||
cbPlane += paddedWidth;
|
||||
crPlane += paddedWidth;
|
||||
workPlane += paddedDimensions[0];
|
||||
cbPlane += paddedDimensions[0];
|
||||
crPlane += paddedDimensions[0];
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -978,33 +978,37 @@ namespace ipl {
|
||||
ESMisc::ChangeUid(SYSMENU_TITLE_ID);
|
||||
}
|
||||
|
||||
static inline void DeleteTicketsForce(EGG::Heap* heap, ESTitleId titleId, u8* ticketViews, u32* ticketViewCount) {
|
||||
static inline s32 DeleteTicketsForce(EGG::Heap* heap, ESTitleId titleId, u8* ticketViews, u32* ticketViewCount) {
|
||||
ESTicketView* ticketViewList = NULL;
|
||||
s32 ret;
|
||||
memset(ticketViews, 0, OSRoundUp32B(sizeof(ESTicketView)));
|
||||
ret = ES_GetTicketViews(titleId, NULL, ticketViewCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
} else if (*ticketViewCount != 0) {
|
||||
ticketViewList = (ESTicketView*)heap->alloc(*ticketViewCount * OSRoundUp32B(sizeof(ESTicketView)), -DEFAULT_ALIGN);
|
||||
ret = ES_GetTicketViews(titleId, ticketViewList, ticketViewCount);
|
||||
goto cleanup;
|
||||
}
|
||||
if (*ticketViewCount == 0) {
|
||||
return ret;
|
||||
}
|
||||
ticketViewList = (ESTicketView*)heap->alloc(*ticketViewCount * OSRoundUp32B(sizeof(ESTicketView)), -DEFAULT_ALIGN);
|
||||
ret = ES_GetTicketViews(titleId, ticketViewList, ticketViewCount);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
goto cleanup;
|
||||
}
|
||||
for (u32 j = 0; j < *ticketViewCount; j++) {
|
||||
memcpy(ticketViews, (u8*)ticketViewList + j * sizeof(ESTicketView), sizeof(ESTicketView));
|
||||
ret = ES_DeleteTicket((ESTicketView*)ticketViews);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_GetTicketViews failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret, titleId);
|
||||
} else {
|
||||
for (u32 j = 0; j < *ticketViewCount; j++) {
|
||||
memcpy(ticketViews, (u8*)ticketViewList + j * sizeof(ESTicketView), sizeof(ESTicketView));
|
||||
ret = ES_DeleteTicket((ESTicketView*)ticketViews);
|
||||
if (ret != ES_ERR_OK) {
|
||||
OSReport("%s::%s: ES_DeleteTicket failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret,
|
||||
((ESTicketView*)ticketViews)->ticketId);
|
||||
}
|
||||
}
|
||||
OSReport("%s::%s: ES_DeleteTicket failed: %d for %016llx\n", __FILE__, __FUNCTION__, ret,
|
||||
((ESTicketView*)ticketViews)->ticketId);
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (ticketViewList != NULL) {
|
||||
heap->free(ticketViewList);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline s32 InitSavedata(EGG::Heap* heap) {
|
||||
@@ -1032,20 +1036,23 @@ namespace ipl {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < titleCount; i++) {
|
||||
if ((titleIds[i] & 0xFFFFFFFFFFFFFF00ULL) == 0x00010000525A4400ULL) {
|
||||
verifySavedataZD(heap, titleIds[i], &fileInfo);
|
||||
continue;
|
||||
}
|
||||
switch (titleIds[i]) {
|
||||
case 0x0001000844495343ULL:
|
||||
case 0x000100014A4F4449ULL:
|
||||
case 0x0001000148415858ULL:
|
||||
case 0x0001000844564458ULL:
|
||||
case 0x000100084449534BULL:
|
||||
ES_DeleteTitle(titleIds[i]);
|
||||
DeleteTicketsForce(heap, titleIds[i], ticketViews, &ticketViewCount);
|
||||
break;
|
||||
{
|
||||
u8* ticketScratch = ticketViews;
|
||||
for (u32 i = 0; i < titleCount; i++) {
|
||||
if ((titleIds[i] & 0xFFFFFFFFFFFFFF00ULL) == 0x00010000525A4400ULL) {
|
||||
verifySavedataZD(heap, titleIds[i], &fileInfo);
|
||||
continue;
|
||||
}
|
||||
switch (titleIds[i]) {
|
||||
case 0x0001000844495343ULL:
|
||||
case 0x000100014A4F4449ULL:
|
||||
case 0x0001000148415858ULL:
|
||||
case 0x0001000844564458ULL:
|
||||
case 0x000100084449534BULL:
|
||||
ES_DeleteTitle(titleIds[i]);
|
||||
DeleteTicketsForce(heap, titleIds[i], ticketScratch, &ticketViewCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# CHANSVm typed comparison reconstruction
|
||||
|
||||
Baseline: ec75ddb0. This candidate is separate from the accepted load-string and opcode-error-path work. Those commits and their logs are unchanged. Only CHANSVm.c and this log changed; no headers, linking classifications, metadata, or original assets changed.
|
||||
|
||||
## Retained reconstruction
|
||||
|
||||
- LOAD_FLOAT copies the eight-byte literal into a double scratch member and passes that value directly. This replaces a u64 temporary followed by a double-pointer reinterpretation. Scratch alignment, member offsets, and emitted code are unchanged.
|
||||
- SET_INDEX reads the floating operand through its union member and checks its lower bound before its upper bound, matching the target's comparison order. The accepted interval remains [0, 4294967294], with NaN and infinities rejected.
|
||||
- Strict integer equality uses the declared 64-bit integer values rather than four offset-based u32 loads and manual XOR/OR expressions.
|
||||
- Strict floating equality uses the declared floating values directly.
|
||||
- Strict string equality uses named, read-only payload pointers rather than recreating a header pointer. The stack operand is consistently first in the outer type comparison, following the target.
|
||||
|
||||
This is structural/type reconstruction, not a newly discovered behavior fix. No register forcing, declaration sweep, or alignment padding was introduced.
|
||||
|
||||
## Target evidence
|
||||
|
||||
After rebuilding, the integer-comparison block (Step instructions 1093-1102), floating-comparison block (1103-1108), string-comparison block (1109-1128), and floating-index block (703-712) have the same instructions, control flow, constants, and memory offsets as the target after register names are normalized. This comparison is advisory: register differences remain, and Step is not exact.
|
||||
|
||||
The floating range's instruction forms now use the target's lower-bound-first order. Integer equality emits the same target ten-instruction two-word equality sequence naturally from the 64-bit value comparison. LOAD_FLOAT retains its original eight-byte copy and call sequence without a pointer reinterpretation.
|
||||
|
||||
## Measurements
|
||||
|
||||
- Instruction-exact functions: 221/233 -> 221/233; no previously exact function regressed.
|
||||
- Unit Decompiled/fuzzy: 99.406320% -> 99.413185%.
|
||||
- Step: 96.913800% -> 96.987230%; 1253/1253 instructions; differing positions 285 -> 276.
|
||||
- Exact code: unchanged at 37608/53564 bytes (70.211334%).
|
||||
- Exact data: unchanged at 6904/6904 bytes (100%).
|
||||
- Per-function score regressions: zero.
|
||||
- Unit remains NonMatching/unlinked, with twelve non-exact functions.
|
||||
|
||||
## Attempts
|
||||
|
||||
- Direct 64-bit equality alone: Step 96.933760%, data 100%; retained for combination.
|
||||
- Typed integer/float/string comparison paths: 96.971270%, data 100%; retained.
|
||||
- Those typed paths plus a separate strict-comparison local error result: 1254 instructions, table relocations moved; rejected.
|
||||
- Floating index member access alone preserves the typed-comparison score. Lower-bound-first range checking raises it to 96.983240%, data 100%; retained.
|
||||
- A union literal temporary produced the same code; simplified to a direct double member instead, also with identical code.
|
||||
- Stack-first type comparison raises Step to 96.987230% with unchanged data; retained.
|
||||
|
||||
## Verification
|
||||
|
||||
- Full 43U build passed with the assigned wrapper and WIBO_SJIS_MISSING_IMPORTS=1.
|
||||
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
- pool_diff: all 125 strings identical.
|
||||
- .data: 4672/4672 raw bytes and 352/352 canonical relocations identical.
|
||||
- .rodata: 1432/1432 raw bytes and 258/258 canonical relocations identical.
|
||||
- All 233 functions checked with ctxdiff/odiff: 221 instruction-exact; no falsely exact objdiff functions.
|
||||
- Literal-reference audit: 233 functions analyzed, 40 resolvable call-string arguments checked, no candidates/errors/skips.
|
||||
- Source-extracted host C harnesses passed 20 strict-comparison cases, nine floating-index-bound cases, and eight floating-literal bit patterns. Coverage includes signed integer extremes, differing high words, signed zero, NaN, infinities, strings, references, deletion errors, and literal payload preservation. They stub surrounding dependencies and do not constitute Wii runtime execution.
|
||||
- git diff --check passed.
|
||||
|
||||
Source is paused for independent parent verification.
|
||||
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.
|
||||
83
tools/decomp-assist/allhands-aes-finalround.attempts.md
Normal file
83
tools/decomp-assist/allhands-aes-finalround.attempts.md
Normal file
@@ -0,0 +1,83 @@
|
||||
# AES final-round word reconstruction, 2026-10-02
|
||||
|
||||
Base: `813660b9` plus local cherry-pick `97035641` of the parent's already queued
|
||||
`fce31442`. The imported candidate and its log are unchanged. This follow-on
|
||||
changes only two final-round expression lines in `libs/RevoEX/src/net/aes.c`
|
||||
and this new log. 43U only; no configuration, metadata, headers or linking edits.
|
||||
|
||||
## Retained reconstruction
|
||||
|
||||
The last cipher round substitutes four bytes, places them in distinct unsigned
|
||||
word lanes, and combines them before AddRoundKey. Encryption combines the high
|
||||
and low lanes, combines the two middle lanes, then ORs those pieces. Decryption
|
||||
combines high/low first, then the lower-middle and upper-middle lanes by XOR.
|
||||
These expressions preserve byte indices, shifts, S-box identity, key traversal,
|
||||
output order and all input/state reads. The four lane contributions are disjoint;
|
||||
all operands are unsigned and have no side effects. No value, algorithmic path,
|
||||
or table is newly invented. This is arithmetic-dependency reconstruction rather
|
||||
than a new implementation or an exact-match claim.
|
||||
|
||||
The target evidence is the original split object's final substitution and
|
||||
packing regions in `AESiEncryptBlock` and `AESiDecryptBlock`. Those regions
|
||||
contain the same sixteen byte loads and word-lane insertion/XOR operations.
|
||||
The retained grouping improves the whole-function instruction similarity at
|
||||
the target's existing body sizes. It does not reproduce every target dependency
|
||||
or register assignment: exact matching remains open, and positional ctxdiff
|
||||
counts are slightly worse despite the improved aligned objdiff scores.
|
||||
|
||||
## Explored alternatives
|
||||
|
||||
- MD5 third-round Boolean grouping and four typed step helpers were tested.
|
||||
The best small Boolean change only reached 94.37255% from 94.30719%; a larger
|
||||
helper reached 94.43791%. Both were discarded as too little benefit for the
|
||||
added change. MD5 source is byte-for-byte unchanged.
|
||||
- Typed inverse-key word, round and complete-schedule helper scopes were tested.
|
||||
A round helper reached 69.72908% decrypt similarity, but interacted poorly
|
||||
with the better final-round grouping. No helper is retained.
|
||||
- Fusing AddRoundKey into each intermediate column regressed both directions.
|
||||
- Typed final-substitution helpers, packed-byte intermediates, and explicit
|
||||
T-table column helpers were evaluated. Their source complexity was unnecessary
|
||||
or they scored below the two retained macro changes.
|
||||
- Twelve unsigned lane-combination expressions were checked for each final-round
|
||||
macro. Two independently improving forms are retained. No register/declaration
|
||||
sweep, assembly, volatile qualifier, undefined value, padding or compiler-option
|
||||
change was used.
|
||||
|
||||
## Verification
|
||||
|
||||
Before -> after:
|
||||
- AESiEncryptBlock: 62.58228 -> 65.81013% fuzzy; 158/158 instructions unchanged;
|
||||
final ctxdiff 137 positional differences (baseline 133).
|
||||
- AESiDecryptBlock: 67.64143 -> 69.69323% fuzzy; 251/251 instructions unchanged;
|
||||
final ctxdiff 227 positional differences (baseline 224).
|
||||
- AES unit: 79.601746 -> 81.09157% fuzzy; exact functions 7/9 and exact code
|
||||
1116/2752 bytes unchanged. Data 2800/2800 (100%) and linking unchanged.
|
||||
- All seven exact AES APIs/CBC functions retain objdiff 100% and ctxdiff diffs 0:
|
||||
NETAESCreateEx 108/108, NETAESCreate 2/2, NETAESDelete 1/1, NETAESEncrypt 46/46,
|
||||
NETAESDecrypt 46/46, NETiAESEncryptoBlock 39/39, NETiAESDecryptoBlock 37/37.
|
||||
- AES pool: all four strings identical. .rodata 2592 bytes and .sdata2 8 bytes
|
||||
identical. .data has the same 197-byte prefix of the 200-byte target, retaining
|
||||
the existing three-byte target alignment extent; no padding was introduced.
|
||||
- MD5 remains unit 96.179825%, ProcessBlock 94.30719% (306/306 instructions),
|
||||
exact functions 3/4, exact code 600/1824, data 456/456. Its three exact APIs
|
||||
retain ctxdiff diffs 0. All 448 .data bytes are identical; .sdata retains its
|
||||
existing one-byte source/seven-byte target-alignment extent difference.
|
||||
- Full 1027-unit report: no exact-function, exact-code, data or fuzzy regression
|
||||
versus the locally imported parent candidate.
|
||||
- Full 43U build and build/43U/ok passed. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Host tests compile production source unchanged with private copies of the existing
|
||||
PPC type/intrinsic shims. Both final AES and the imported parent baseline passed
|
||||
all 2,406 AES-128/192/256 known-answer and seeded randomized CBC checks, including
|
||||
separate/in-place buffers and single/incremental calls. Unchanged MD5 passed all
|
||||
3,088 known-answer/random/chunking checks. The MD5 test supplies RFC1321 padding
|
||||
externally; GetDigest's target-endian length stores remain outside host coverage.
|
||||
|
||||
Private local evidence: `/tmp/crypto-reconstruction-next/` contains baseline/final
|
||||
reports, pool/section/ctxdiff results, full-build.log, host validation scripts and
|
||||
results, and the rejected experiments. No retail assembly or binary is committed
|
||||
or uploaded. Prior worker logs under `/tmp/crypto-remainder/` are untouched.
|
||||
|
||||
GATE: validated partial arithmetic reconstruction with no report regressions.
|
||||
Exact matching and linking remain open. Candidate frozen for parent validation.
|
||||
71
tools/decomp-assist/allhands-aes-rounds.attempts.md
Normal file
71
tools/decomp-assist/allhands-aes-rounds.attempts.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# AES round-expression reconstruction, 2026-10-02
|
||||
|
||||
Separate follow-on to AES key-cursor candidate `2a537c14`. Frozen MD5 candidate
|
||||
`8a6461f9` and prior logs are untouched. This commit changes five expression
|
||||
lines in `libs/RevoEX/src/net/aes.c`, plus this log. 43U only; no linking changes.
|
||||
|
||||
## Evidence and reconstruction
|
||||
|
||||
Target evidence remains the original split `aes.o`, AESiEncryptBlock and
|
||||
AESiDecryptBlock. Both round bodies use four cyclic T-table columns: rotations
|
||||
of 24, 16 and 8 bits plus the unrotated low-byte column. Their XOR dependencies
|
||||
and the inverse-key transform's successive rotate/XOR dependencies lower in a
|
||||
different order from the previous source. The retained expressions associate
|
||||
these same unsigned contributions so compiler scheduling moves closer to the
|
||||
target. Byte indices, rotation counts, table identity, key traversal, row order,
|
||||
loop conditions and final substitution are unchanged.
|
||||
|
||||
The inverse-key transform still computes doubled/four-times/eight-times byte
|
||||
values in the same GF(2^8) representation. Each subsequent stage combines its
|
||||
old mixed value, its 8-bit rotation and the same added contribution. Explicit
|
||||
XOR assignment replaces the compound assignment; all RHS values are evaluated
|
||||
before the assignment, with no side effects or undefined evaluation order.
|
||||
|
||||
No source body or algorithm was missing. This is further instruction-shape
|
||||
reconstruction, not a new functional path or an exact-match claim.
|
||||
|
||||
## Attempts
|
||||
|
||||
- Eight staged column/round helpers and six explicit table-load stages did not
|
||||
improve both functions; reverted.
|
||||
- Tested 120 associative/permutation forms of four T-table contributions,
|
||||
retaining the independent improving expression for each cipher direction.
|
||||
- Tested twelve uniform inverse-key XOR forms plus per-stage refinements. The
|
||||
retained rotate-first XOR form improves all three stages without new helpers.
|
||||
- Array/struct state views, a 15-by-4 round-key view, initial-key cursor forms,
|
||||
and typed table helpers were evaluated. Small gains that required larger
|
||||
changes were rejected, along with all regressions.
|
||||
- No register declaration sweep, inline assembly, volatile qualifier, padding,
|
||||
undefined input, compiler-option change or table change was used.
|
||||
|
||||
## Verification
|
||||
|
||||
Before -> after:
|
||||
- AESiEncryptBlock fuzzy 60.348103 -> 62.58228%; 158/158 instructions unchanged;
|
||||
final ctxdiff has 133 positional differences.
|
||||
- AESiDecryptBlock fuzzy 63.836655 -> 67.64143%; 251/251 instructions unchanged;
|
||||
final ctxdiff has 224 positional differences.
|
||||
- Unit fuzzy 77.700584 -> 79.601746%.
|
||||
- Exact functions 7/9, exact code 1116/2752 bytes, data 2800/2800 (100%), and
|
||||
linked status are unchanged. All seven exact functions retain ctxdiff diffs 0.
|
||||
- All four pool strings match. Table and data source is unchanged.
|
||||
- Frozen MD5 source/metrics are unchanged: unit96.179825%, ProcessBlock94.30719%.
|
||||
- The full 1027-unit report has zero exact-function/code/data/fuzzy regressions
|
||||
against the immediately preceding frozen MD5/AES source report.
|
||||
- Full 43U build and build/43U/ok passed. DOL SHA1 remains
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
`python3 /tmp/crypto-remainder/validate_aes.py` passed all 2,406 production-source
|
||||
known-answer/randomized AES-128/192/256 CBC checks, including in-place buffers
|
||||
and incremental calls. The frozen AES parent source independently passed the
|
||||
same coverage in the same run. Input/key/IV words carry their PPC big-endian
|
||||
numeric values in the native host harness; production source is unmodified.
|
||||
|
||||
Local evidence, not committed or uploaded: `/tmp/crypto-remainder/` contains
|
||||
`aes.xor-results.json`, `aes.invmix-results.json`, `aes-rounds-final.json`,
|
||||
`aes-rounds-AESiEncryptBlock.ctx`, `aes-rounds-AESiDecryptBlock.ctx`,
|
||||
`aes-rounds-vectors.log`, `aes-rounds-full-build.log`, and `validate_aes.py`.
|
||||
No original retail assembly or binary is included in this commit.
|
||||
|
||||
GATE: validated partial arithmetic/data-flow candidate; no regressions. Exact
|
||||
matching and linking remain open.
|
||||
62
tools/decomp-assist/allhands-bs2-tick.attempts.md
Normal file
62
tools/decomp-assist/allhands-bs2-tick.attempts.md
Normal file
@@ -0,0 +1,62 @@
|
||||
# BS2Tick control-flow reconstruction, 2026-10-02
|
||||
|
||||
Baseline BS2Mach source is 449529d9. This candidate changes only BS2Tick in
|
||||
src/BS2/BS2Mach.c. Existing ESMisc and AOSSLink commits remain separate.
|
||||
|
||||
Initial pool_diff: 91/91 strings identical. Read the BS2 round-two/round-three
|
||||
and fz1 attempt records, and compared the current five open functions with
|
||||
fresh target objects. The Run hardware-handoff deficit is separate and is not
|
||||
changed or represented as complete here.
|
||||
|
||||
## Retained source reconstruction
|
||||
|
||||
1. Express the title-family dispatch as the actual sparse set D/R/S/T.
|
||||
The target compares D below R, then dispatches the contiguous R-through-T
|
||||
group using an upper boundary U. The switch restores its branch pair and
|
||||
makes the family set explicit. Exhaustively checked all 256 prefix values.
|
||||
2. Restore the positive game-partition state transition and capture the
|
||||
partition offset at entry to state 0x25, before either cache or disc path.
|
||||
The target loads the partition member before choosing the cache branch;
|
||||
the old source only read it on the disc path. The incoming partition
|
||||
existence check and the state-37 fallthrough remain explicit.
|
||||
3. Restore the banner address diagnostic's missing variadic argument.
|
||||
Target BS2Tick object offsets 0x39B4–0x39D8 compute the aligned banner
|
||||
pointer in r4, store it as BannerBuffer and pass it to BS2Report. The old
|
||||
source supplied the %08X format with no argument on the allocation path.
|
||||
4. Express the same next-cache-line calculation as allocation + 32 minus its
|
||||
remainder modulo 32. This retains the target's strictly-next-line behavior,
|
||||
including when the allocation is already aligned. It does not add padding
|
||||
storage. Checked 196608 address samples including all low 16-bit values at
|
||||
zero, 0x80000000 and near u32 wrap.
|
||||
|
||||
Measured attempts, all retained and individually nonregressing:
|
||||
|
||||
| Attempt | BS2Tick fuzzy | Unit fuzzy |
|
||||
| --- | ---: | ---: |
|
||||
| Baseline | 98.230415% | 98.159485% |
|
||||
| Actual title-family switch | 98.35567% | 98.21673% |
|
||||
| Partition entry and typed member snapshot | 98.58763% | 98.32273% |
|
||||
| Banner diagnostic argument | 98.59278% | 98.32509% |
|
||||
| Explicit next-cache-line remainder | 98.639175% | 98.34629% |
|
||||
|
||||
BS2Tick grows from 1934 to 1937 instructions; target is 1940. The remaining
|
||||
three missing instructions are address-materialization differences, with
|
||||
additional register and instruction-scheduling differences. This is partial
|
||||
reconstruction/matching progress, not an exact function.
|
||||
|
||||
## Verification
|
||||
|
||||
- Full all_source / fresh report / build/43U/ok requested after focused build
|
||||
- DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- Exact functions unchanged: 24/29; exact code unchanged: 4940/16980
|
||||
- Data unchanged: 155504/158528 (98.092445%)
|
||||
- Every other unit's report unchanged
|
||||
- The 91-string pool is identical; literal reference audit checks 37 arguments
|
||||
across 24 exact functions with no candidates or errors
|
||||
- Compared all 1027 source objects with the initial snapshot: only previously
|
||||
committed ESMisc and this BS2Mach object differ. BS2Mach .text 16828 -> 16840
|
||||
bytes, 1306 relocations on both sides; .data stays 3020 bytes and 155 jump-table
|
||||
relocations; all other allocated sections/objects are unchanged
|
||||
- git diff --check passes
|
||||
|
||||
No BS2Update, shared-header, metadata, link-flag or assembly change is included.
|
||||
@@ -0,0 +1,99 @@
|
||||
# Alpha comparison and output boundary follow-on, 2026-10-02
|
||||
|
||||
Base: 813660b9 plus unchanged one-key candidate 2ec4a57e, locally fe647fe4.
|
||||
Changed source: libs/RVLMiddleware/eZiText/src/clib/zi8alpha.c only.
|
||||
No ABI, shared header, linking flag or other source change is included.
|
||||
|
||||
## Retained target source structure
|
||||
|
||||
- At function +0x25A8, the suffix truncation condition compares the combined
|
||||
word/prefix length first and branches on less-or-equal. Recovered that
|
||||
operand order. The separate bound check at +0x25E0 has the opposite operand
|
||||
order and is deliberately preserved.
|
||||
- The dictionary lookup comparisons at +0x2948, +0x2978 and +0x2990 compare
|
||||
the dictionary scan index first against word length or the halfword-narrowed
|
||||
dictionary count. Recovered those three relational expressions without
|
||||
changing the count helper's declaration or its halfword conversion.
|
||||
- The punctuation fallback at +0x30F8 compares against 0xF010 and uses a
|
||||
strict greater-than failure branch. Replaced the equivalent < 0xF011 test
|
||||
with <= 0xF010.
|
||||
- The output-count branch at +0x3B08 falls through to clear letters when
|
||||
countOnly is true, and branches to the actual-count store otherwise.
|
||||
Restored that original arm order.
|
||||
- Prefix selection at +0x3B84 compares against 1 and uses less-or-equal.
|
||||
Recovered <= 1 instead of the equivalent < 2.
|
||||
|
||||
These are demonstrated control-flow and expression reconstructions, not
|
||||
register/declaration permutations. No new volatile, assembly, forced register,
|
||||
padding, artificial storage, or undefined value is introduced.
|
||||
|
||||
## Isolated trials and rejected work
|
||||
|
||||
Trials used the live 43U Ninja compiler command, separate source/objects and
|
||||
reports under /tmp/ezi-next, without changing the worktree before selection.
|
||||
Columns: unit fuzzy / matched data bytes / exact functions.
|
||||
|
||||
- Output-count arm order: 96.47729 / 516 / 11
|
||||
- Both inclusive boundary expressions: 96.3798 / 516 / 11
|
||||
- Both maximum-length comparison orders: 96.38128 / 516 / 11
|
||||
- Dictionary comparison order: 96.38405 / 516 / 11
|
||||
- Initial four-group combination: 96.48966 / 516 / 11
|
||||
- Final reviewed combination, preserving the second length comparison's
|
||||
original operand order: 96.52474 / 516 / 11
|
||||
|
||||
Further target-evidenced trials were rejected rather than committed:
|
||||
|
||||
- Safe temporary plus postfix prefix append: 94.71085 / 336 / 11
|
||||
- Safe temporary plus postfix highlighted append: 94.60377 / 336 / 11
|
||||
- Dictionary-kind switches: 96.364845 / 408 / 11
|
||||
- Early candidate skip: 96.451996 / 408 / 11
|
||||
- Combined candidate-count limits: 96.402695 / 408 / 11
|
||||
- Full dictionary source structure plus initial boundary combination:
|
||||
96.78767 / 408 / 11; function extent 0x3DB8 versus 0x3DA8
|
||||
- Explicit prefix-mode byte: 96.40805 / 408 / 11
|
||||
- Explicit element-count byte: 96.3582 / 408 / 11
|
||||
- Skip/count/byte combinations retained extent mismatches and were rejected.
|
||||
|
||||
One-key spelling compound count assignment was codegen-neutral. Prefix
|
||||
increment removed the redundant byte narrowing but worsened allocation:
|
||||
unit 98.23523 -> 97.36198. Neither trial is retained.
|
||||
|
||||
Chinese explicit halfword casts at the two paired phonetic comparisons and
|
||||
an alternative proper halfword return declaration with redundant casts removed
|
||||
both reproduce the previously parked result: unit 96.848755, matched data
|
||||
144 -> 72. Adding the demonstrated component-cursor reload gives 96.489876
|
||||
with the same loss. All remain scratch experiments, with no Chinese edit or
|
||||
neutral PUD ABI commit included.
|
||||
|
||||
## Validation
|
||||
|
||||
Fresh full report: /tmp/ezi-next-alpha-full-report.json.
|
||||
Full-build log: /tmp/ezi-next-alpha-full-build.log.
|
||||
Baseline report: /tmp/ezi-next-baseline.json.
|
||||
|
||||
Zi8AlphaGetCandidates: 95.02813% -> 95.23011%.
|
||||
Unit fuzzy: 96.37759% -> 96.52474%, about 31.88 weighted bytes gained.
|
||||
Exact functions remain 11/12; exact code remains 5880/21664;
|
||||
matched data remains 516/564. No complete unit or new exact function claimed.
|
||||
All 1027 units were compared for fuzzy, matched-code, matched-data and exact
|
||||
function measures: the alpha fuzzy improvement is the sole changed measure,
|
||||
with no regressions.
|
||||
|
||||
Pool checked first: identical and empty. Main function stays 3946/3946
|
||||
instructions and 0x3DA8 bytes, with the same 0x2B0 frame. Strict ctxdiff is
|
||||
nonzero (3738 differences); existing scalar-stack displacement and register
|
||||
allocation remain. Each of the 11 existing exact functions retains identical
|
||||
instruction counts and ctxdiff diffs 0.
|
||||
|
||||
Baseline/candidate .rodata, .data, extab and extabindex have identical payloads
|
||||
and canonical relocations. Relative to the target, extab and extabindex remain
|
||||
byte-identical; the unchanged generated switch relocations remain unmatched.
|
||||
The source rodata's pre-existing 330-byte size versus target 336 is unchanged;
|
||||
objdiff still reports 100% for that section and the same exact-data accounting.
|
||||
Advisory branch mapping checks 709 same-mnemonic branch pairs with zero
|
||||
mapped destination mismatches, and 73/73 helper calls. It is not an exactness
|
||||
or formal equivalence claim.
|
||||
|
||||
Full 43U build passes with the approved wrapper and WIBO_SJIS_MISSING_IMPORTS=1.
|
||||
DOL SHA1: 26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
git diff --check passes. No remote actions were performed.
|
||||
@@ -0,0 +1,65 @@
|
||||
# Alpha output and scan reconstruction follow-on, 2026-10-02
|
||||
|
||||
Parent candidate: `94b7f57e`. Its source/log were left unchanged during
|
||||
independent side experiments. No ABI/header/linking changes are included.
|
||||
Changed source: `libs/RVLMiddleware/eZiText/src/clib/zi8alpha.c` only.
|
||||
|
||||
## Target evidence and retained changes
|
||||
|
||||
- At `Zi8AlphaGetCandidates +0x3178`, the original emits wide-character
|
||||
output before the encoded-byte alternative. The wide path assigns the
|
||||
same zero to output elements 2 and 1 (+0x31A4/+0x31A8), then advances by
|
||||
two characters. The encoded path likewise shares its zero assignment.
|
||||
Restored that positive branch and ordinary chained zero assignments.
|
||||
- The dictionary comparison loop branches from +0x2904 to its bound check
|
||||
at +0x292C. The comparison body exits on a character mismatch at +0x2924;
|
||||
a matched character increments the index at +0x2928. Replaced the merged
|
||||
`for` condition with the corresponding bounded loop and explicit break.
|
||||
- The punctuation output block at +0x1B0C..+0x1B1C reads the current cursor,
|
||||
emits its character and advances that same cursor. Expressed this with
|
||||
`wordCursor[1] = *punctuationCursor++`. It does not reuse a mutated index
|
||||
in another operand or introduce an unsequenced read/write.
|
||||
|
||||
## Independently compiled, isolated trials
|
||||
|
||||
Each trial used the exact 43U MWCC flags from the live Ninja command and a
|
||||
separate object/report under `/tmp/ezi-side`, without altering the reviewed
|
||||
worktree candidate. Report columns below are function fuzzy, unit fuzzy,
|
||||
matched data bytes and exact-function count:
|
||||
|
||||
- Early candidate-skip block: 94.65585, 96.10635, 408, 11; excluded
|
||||
- Wide output first: 94.887985, 96.27548, 516, 11; retained
|
||||
- Next-dictionary switches: 94.4037, 95.92264, 408, 11; excluded
|
||||
- Explicit dictionary-scan break: 94.62088, 96.08087, 516, 11; retained
|
||||
- Combined candidate-count limit: 94.35884, 95.88995, 408, 11; excluded
|
||||
- Punctuation cursor increment: 94.4782, 95.97692, 516, 11; retained
|
||||
- Wide output plus scan: 95.02306, 96.37389, 516, 11
|
||||
- Final three-change subset: 95.02813, 96.37759, 516, 11
|
||||
|
||||
## Full current-worktree validation
|
||||
|
||||
Fresh report: `/tmp/ezi-alpha-followup.json`.
|
||||
Full build log: `/tmp/ezi-alpha-followup-build.log`.
|
||||
Exact functions 11/12 unchanged; exact code 5880/21664 unchanged;
|
||||
exact data 516/564 unchanged. Unit fuzzy 95.97323% -> 96.37759%.
|
||||
Function fuzzy 94.47314% -> 95.02813%, about 88 additional weighted bytes.
|
||||
Relative to initial 449529d9, unit fuzzy improves 94.17892% -> 96.37759%.
|
||||
|
||||
Pool first: identical (no narrow strings in either pool).
|
||||
Main function: 3946/3946 instructions, 0x3DA8 bytes each, frame 0x2B0.
|
||||
Strict ctxdiff remains nonzero (3745 differences), dominated by the known
|
||||
scalar-stack displacement, instruction placement and GPR allocation. No
|
||||
new exact function is claimed. Each of the existing 11 exact functions
|
||||
retains identical instruction counts and ctxdiff diffs 0.
|
||||
|
||||
All non-text section scores match the parent: .rodata, extab and extabindex
|
||||
remain 100%; the existing 48-byte generated switch table remains unmatched.
|
||||
The advisory register-normalized/control-flow alignment checked 701 branch
|
||||
pairs with zero destination mismatches and 73/73 helper calls. This is a
|
||||
coverage check, not an exactness claim.
|
||||
|
||||
Full 43U build succeeds with the approved wrapper and
|
||||
`WIBO_SJIS_MISSING_IMPORTS=1`. DOL SHA1:
|
||||
`26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
`git diff --check` succeeds. No new assembly, volatile workaround, register
|
||||
forcing, undefined value, dummy storage, prototype or shared-header change.
|
||||
@@ -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,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,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,108 @@
|
||||
# One-key candidate boundary reconstruction, 2026-10-02
|
||||
|
||||
Parent commits: alpha 94b7f57e and 35677806, neutral Chinese ABI 105f3b45.
|
||||
This pass changes only `libs/RVLMiddleware/eZiText/src/clib/zi81key.c`.
|
||||
Alpha source/logs and Chinese source/log are unchanged.
|
||||
|
||||
## Retained target-defined boundaries
|
||||
|
||||
- `Zi8IsMatch1Key` consumes a halfword key. Six candidate calls narrow that
|
||||
argument after Zi8GetPCode: target +0x0B0C, +0x0F30, +0x16C0, +0x1BA4,
|
||||
+0x1F4C and +0x22A8. Restored the ziU16 formal and removed its three
|
||||
redundant key masks. The helper itself remains 97/97 instructions,
|
||||
objdiff 100%, ctxdiff diffs 0. All source call sites are in this same unit.
|
||||
- Each of the six duplicate-bit checks consumes a byte result in the target.
|
||||
Made the byte conversion explicit at these call boundaries rather than
|
||||
changing the already-exact full-width duplicate helper.
|
||||
- The user-dictionary availability result is narrowed to a byte at target
|
||||
+0x1E00. The existing full-width declaration remains; the caller now
|
||||
performs the demonstrated conversion explicitly.
|
||||
- User ordinal decoding narrows the masked high byte to a halfword before
|
||||
its shift at target +0x1E44. Recovered that type boundary.
|
||||
- Final output termination stores through the current output index and then
|
||||
increments that index without reloading it (+0x2524..+0x2534). Recovered
|
||||
the ordinary postfix-index store. Its right-hand side is constant zero,
|
||||
so there is no unsequenced index read/write.
|
||||
|
||||
These are source/ABI shape reconstructions with demonstrated target
|
||||
conversions; no callee-saved-register or declaration-order sweep was used.
|
||||
|
||||
## Isolated source trials
|
||||
|
||||
Each trial used the exact 43U Ninja compiler command in `/tmp/ezi-onekey-pass`,
|
||||
without modifying the worktree until the final candidate was selected.
|
||||
Below: candidate-function fuzzy / unit fuzzy / matched data / exact functions.
|
||||
|
||||
- Halfword formal retaining old masks: 95.26784 / 97.65741 / 1232 / 4; rejected
|
||||
- Byte duplicate-helper return: 94.73383 / 97.4822 / 1232 / 5; rejected
|
||||
- Explicit duplicate-result bytes alone: same as preceding; not retained alone
|
||||
- User-dictionary result byte alone: 95.240715 / 97.708664 / 1280 / 5
|
||||
- User ordinal halfword alone: 95.30121 / 97.735695 / 1280 / 5
|
||||
- Combined count-limit increments: 95.106384 / 97.64865 / 1232 / 5; rejected
|
||||
- Terminal postfix index alone: 95.4368 / 97.79627 / 1280 / 5
|
||||
- Halfword formal/old masks + duplicate bytes + limits:
|
||||
95.984566 / 97.97763 / 1232 / 4; rejected
|
||||
- Halfword formal with ordinary typed uses:
|
||||
95.26784 / 97.72078 / 1232 / 5; restores the exact helper
|
||||
- Typed key + duplicate bytes: 95.83312 / 97.97334 / 1280 / 5
|
||||
- Typed key + duplicate bytes + count limits:
|
||||
95.984566 / 98.04101 / 1232 / 5; excluded for data regression
|
||||
- Preceding plus terminal postfix: 96.01794 / 98.055916 / 1232 / 5; excluded
|
||||
- Preceding plus user-dictionary/ordinal conversions:
|
||||
95.926155 / 98.01491 / 1232 / 5; excluded
|
||||
- Typed key + duplicate bytes + terminal postfix:
|
||||
95.858154 / 97.98453 / 1280 / 5
|
||||
- Typed key + duplicate bytes + user-dictionary byte:
|
||||
95.87484 / 97.99198 / 1280 / 5
|
||||
- Typed key + duplicate bytes + ordinal halfword:
|
||||
95.93533 / 98.01901 / 1280 / 5
|
||||
- Typed key + duplicate bytes + terminal postfix + user-dictionary byte:
|
||||
95.86858 / 97.98919 / 1280 / 5
|
||||
- Typed key + duplicate bytes + terminal postfix + ordinal halfword:
|
||||
95.98957 / 98.04324 / 1280 / 5
|
||||
- Final complete boundary subset: 96.41927 / 98.23523 / 1280 / 5
|
||||
|
||||
After selecting that subset, the three count-limit blocks were tested
|
||||
individually against it. OEM: 96.17564 / 98.12637 / 1280 / 5; PUD:
|
||||
95.725075 / 97.92507 / 1232 / 5; phrase: 95.93575 / 98.019196 / 1280 / 5.
|
||||
All three were rejected. No count-limit rewrite remains in the candidate.
|
||||
|
||||
## Full validation and exact data disclosure
|
||||
|
||||
Fresh report `/tmp/ezi-onekey-boundary.json`; full-build log
|
||||
`/tmp/ezi-onekey-boundary-build.log`.
|
||||
|
||||
Unit fuzzy 97.778564% -> 98.23523%. Candidate-function fuzzy
|
||||
95.39716% -> 96.41927%, about 98 fewer weighted deficit bytes.
|
||||
Exact functions remain 5/9; exact code remains 3952/21460;
|
||||
matched data remains 1280/1388. All five baseline exact functions have
|
||||
ctxdiff diffs 0 and identical instruction counts.
|
||||
|
||||
Candidate instructions: 2387 -> 2405 versus target 2397; size
|
||||
0x254C -> 0x2594 versus target 0x2574. Frame remains 0x140.
|
||||
It is not exact, and no new exact function is claimed.
|
||||
|
||||
The spelling tables remain 1152 byte-identical bytes. .sdata2 and extab
|
||||
remain byte-identical at 8 and 72 bytes. The switch table's source is 44
|
||||
bytes versus target 48, the pre-existing four-byte section-alignment tail;
|
||||
all 44 bytes and all eleven canonical relocation targets/addends match.
|
||||
No real data object was resized or renamed and no padding was added.
|
||||
|
||||
The already-unmatched 108-byte extabindex still has two differing bytes at
|
||||
0x4F and 0x5B, with the same 98.14815% section score. They are the function
|
||||
extent words: spelling remains 0x1A94 versus target 0x1A90; candidate extent
|
||||
changes from 0x254C to 0x2594 versus target 0x2574. This is changed unmatched
|
||||
metadata, not a claim that all data bytes are unchanged.
|
||||
|
||||
Pool check: identical (no narrow strings). Advisory branch mapping: all 351
|
||||
pairs preserve their destination and all 71 helper calls correspond. A
|
||||
register-value-aware linear audit pairs 621 observable store/call/branch
|
||||
effects. The seven missing byte-boundary differences are resolved; its
|
||||
remaining three differences are the unchanged count-limit reloads, not a
|
||||
formal proof or an exactness claim.
|
||||
|
||||
Full 43U build succeeds with the approved wrapper and
|
||||
WIBO_SJIS_MISSING_IMPORTS=1. DOL SHA1:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
`git diff --check` succeeds. No remote, linking, shared-header, assembly,
|
||||
volatile, register-forcing, dummy-storage or undefined-value changes.
|
||||
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,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.
|
||||
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.
|
||||
@@ -127,3 +127,73 @@ The harness is supplemental behavioral validation, not a retail runtime test.
|
||||
|
||||
GATE: focused decompilation improvement; full 43U/DOL and no-regression checks
|
||||
pass; exact-matching gate remains incomplete at 30/31. No linking claimed.
|
||||
|
||||
## Follow-on: recover the last ESMisc structural differences
|
||||
|
||||
Baseline for this follow-on is the accepted reconstruction `1f9db89d`:
|
||||
30/31 exact functions, function 95.830734%, unit 99.33143%, 446/449 instructions,
|
||||
data 4416/4416. The source/header correction remains intact.
|
||||
|
||||
Natural source attempts, in order:
|
||||
|
||||
| Attempt | Instructions | Function fuzzy | Disposition |
|
||||
| --- | ---: | ---: | --- |
|
||||
| Ticket helper uses error-first cleanup and returns early with no tickets | 446/449 | 95.830734% | Same generated code |
|
||||
| Caller gives aligned ticket scratch an explicit pointer lifetime | 448/449 | 98.004456% | Improved |
|
||||
| Move aligned ticket scratch into the ticket helper | 446/449 | 95.817375% | Rejected |
|
||||
| Scope caller's scratch pointer to successful title enumeration | 448/449 | 98.89755% | Retained |
|
||||
| Restore nested ticket helper with scoped scratch | 448/449 | 98.89755% | Same generated code |
|
||||
| Ticket helper returns its actual ES operation status | 449/449 | 99.14254% | Retained |
|
||||
|
||||
The scratch pointer is initialized only in the block reached after successful
|
||||
second enumeration, and remains live across the title loop. This restores the
|
||||
saved scratch cursor and per-iteration 64-bit mask materialization. No pointer
|
||||
is used before initialization and no artificial use extends its lifetime.
|
||||
|
||||
The private ticket helper now returns the status already obtained from
|
||||
ES_GetTicketViews or ES_DeleteTicket, including its zero-ticket early return
|
||||
and normal cleanup. Its caller intentionally discards that status. The return
|
||||
contract of an independently emitted original helper cannot be established
|
||||
because this helper was fully inlined; this is a natural equivalent source
|
||||
form whose zero-ticket branch structure is confirmed by the target. It does
|
||||
not overwrite the outer enumeration status or change the public ABI further.
|
||||
|
||||
Final ctxdiff: 449/449 instructions, 74 differences. Every mnemonic,
|
||||
non-register operand, stack offset, resolved call target and branch target
|
||||
agrees. The remaining differences are register substitutions, including the
|
||||
title list, scratch cursor, title index, verifier flags and title halves. No
|
||||
register/declaration permutation search was performed after reaching this
|
||||
structural agreement.
|
||||
|
||||
Measurements after a fresh full report:
|
||||
|
||||
- ESMisc exact functions 30/31 -> 30/31
|
||||
- ESMisc exact code 9404/11200 -> 9404/11200
|
||||
- ESMisc fuzzy 99.33143% -> 99.8625%
|
||||
- DeleteUnauthorizedData fuzzy 95.830734% -> 99.14254%
|
||||
- Matched data 4416/4416 -> 4416/4416
|
||||
- Pool: all 114 strings identical
|
||||
- Literal audit: 204 arguments in 30 exact functions, no candidates/errors
|
||||
- Every other unit's full report is unchanged
|
||||
- Full 43U build/check and DOL SHA1 pass:
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- The same 12 ASan/UBSan host control-flow scenarios pass on helper bodies
|
||||
freshly extracted from this final candidate (LeakSanitizer disabled only
|
||||
for the environment limitation already noted)
|
||||
- git diff --check passes
|
||||
|
||||
This remains a partial matching improvement, not an exact function or unit.
|
||||
|
||||
### Rejected ATERM ownership experiment
|
||||
|
||||
Read-only target evidence identified that the old typed reply view spans the
|
||||
last eight bytes of one BSS object and the following option-buffer allocation.
|
||||
With parent approval, tried a real two-object protocol-workspace aggregate and
|
||||
corresponding narrow metadata consolidation. It preserved storage, addresses,
|
||||
all 17 exact functions and matched data, and reduced the main protocol from
|
||||
972 to 959 instructions (target 951). However, its unit fuzzy regressed from
|
||||
96.624664% to 96.49781%; wider grouping and a decoder-helper experiment also
|
||||
failed the no-regression condition. All ATERM source and symbol metadata were
|
||||
restored. Fresh report after restoration was identical to the accepted ESMisc
|
||||
baseline, and the DOL hash passed. Detailed rejected source/metadata and
|
||||
address evidence were kept privately for future work; none is in this commit.
|
||||
|
||||
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.
|
||||
23
tools/decomp-assist/attempts/iplSetting-worker3-draw.md
Normal file
23
tools/decomp-assist/attempts/iplSetting-worker3-draw.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# iplSetting worker3 — Setting::draw (Oct 2 2026)
|
||||
|
||||
Worktree: `/workspace/worktrees/iplSetting-draw`
|
||||
Branch: `agent/grok/decomp-worker-3/draw`
|
||||
Unit: `src/scene/setting/iplSetting.cpp` `Setting::draw` only.
|
||||
`scanAP` / `convertRevIP` source not touched. File stays `NonMatching` (not linked).
|
||||
|
||||
## Result
|
||||
|
||||
**632/632 byte-identical** to retail (`draw__Q33ipl5scene7SettingFv`, 2528 bytes, 0 diffs).
|
||||
A HEAD compile of the same TU differs from this object only in `draw`. No sibling codegen change (`-ipa file`).
|
||||
|
||||
## Levers that closed it
|
||||
|
||||
1. `wideTopL` / `wideTopR` as separate locals (no CSE of the int-to-float). Gets `xoris r6,r6` and `fsubs f2`.
|
||||
2. One `void* held` is the browser thread, then overwritten by the standard-buffer fetch, so browser and `standardBuffer` share r31.
|
||||
3. Tex0 material pointer reused as the scroll `FrameController*` (`wideMaterial`), with `initFrame`/`restart` duplicated in each arm.
|
||||
4. Field copy through `volatile GXRenderModeObj*` so loads and stores interleave on r4/r0.
|
||||
5. Sample-pattern loop is direct `dst[1]=src[1]; dst[2]=src[2]` with `src` declared before `dst` is assigned (`u8* src; u8* dst = ...; src = ...`).
|
||||
|
||||
## Not linked
|
||||
|
||||
`configure.py` still has `Object(NonMatching, "scene/setting/iplSetting.cpp")`. DOL SHA1 is unchanged because this TU is not linked. Do not flip the object to Matching until `scanAP` / `convertRevIP` (and the rest of the TU) match.
|
||||
@@ -16,3 +16,11 @@ Claim was only `cdj_d_decompressLoop`. colorConv, huffmanDecoder, and LineConv11
|
||||
- 2x2 tail stores the updated plane in `requiredBlockEnd` and the end pointer in `planeOffset`. That is what puts the plane in r15 and the end in r16 (`addi r15, r3, -8` / `add r16, r15, r18`). Assigning the plane back to `planeOffset` left those two callee-saves swapped (7 diffs). Splitting the `-8` let MWCC cancel it against the later `+8` and dropped to 897.
|
||||
|
||||
colorConv left at the 18 pairwise wall. Not in this diff.
|
||||
|
||||
## colorConv (2026-10-02)
|
||||
|
||||
`cdj_c_colorConv` **77/77, 0 diffs, byte-identical** (308 bytes). Was 18, then 13, then 8.
|
||||
|
||||
- Drop `paddedWidth`. The row loop adds `paddedDimensions[0]`, which hoists `lhz r24` and `lis r23` / `addi r10, r23, 0`.
|
||||
- Pad loop: `u16 remainder = dimensions[i] & 7`, then `(dimensions[i] + 8) - remainder`. Width stays r8, the indexed load stays r7, the mask stays r9. Naming both a dimension and a remainder swaps width off r8.
|
||||
- Declare `sourceStride` after `rowIndex` (cb/cr stay above it). That assigns stride r29 and `cbPlane` r22. Computing stride before the planes shortens the function to 76 and shifts the callee-saves. huffmanDecoder and LineConv11 were not edited. `cdj_d_decompressLoop` stays 899/899.
|
||||
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
244
tools/decomp-assist/jpeg-exif-allhands-attempts.md
Normal file
244
tools/decomp-assist/jpeg-exif-allhands-attempts.md
Normal file
@@ -0,0 +1,244 @@
|
||||
# EXIF parser reconstruction and aliasing audit
|
||||
|
||||
Base: `2a33684c` on `agent/bittle/allhands-jpeg-decompile`; EXIF source itself is
|
||||
unchanged from baseline `449529d9`. This is a separate candidate from the prior
|
||||
JPEG converter/IDCT commit. Those files and their logs were left unchanged.
|
||||
|
||||
## Retained reconstruction
|
||||
|
||||
1. The IFD0 entry parameter is `u8*`, with corresponding call-site casts from the
|
||||
parser's read-only directory cursor. With the reconstructed `const u8*`
|
||||
parameter, MWCC hoists all four version-byte loads before their stores.
|
||||
Removing this unsupported qualifier reproduces the original interleaved
|
||||
load/store sequence for tags 0x9000, 0x9101 and 0xA000.
|
||||
2. IFD0's decoded field type is widened to `u32` and both entry fields use the
|
||||
existing `readExifU16` reader. This reproduces the target's eager zero
|
||||
extension and initial instruction order; it does not change TIFF field size.
|
||||
3. IFD1 explicitly includes ignored 0x011C and 0xA000..0xA002 cases alongside
|
||||
existing ignored tags. Target dispatch compares against 0x011C and 0xA004;
|
||||
these case labels improve the recovered decision tree. The precise original
|
||||
no-op case list cannot be proved uniquely, since unknown tags also return
|
||||
unchanged. No new tag interpretation or payload write is introduced.
|
||||
4. IFD1 rational denominators use `thumbnailData + (offset + 4)` without a
|
||||
redundant same-type cast.
|
||||
|
||||
No new exact functions. Exact stays 3/6, matched code 1348/5088 bytes, allocated
|
||||
data 0 bytes / 100%, and linking is unchanged. Unit fuzzy 96.50157 -> 98.94104.
|
||||
|
||||
| Function | Before | After | Source/target instructions |
|
||||
| --- | ---: | ---: | ---: |
|
||||
| TMCCJPEGDecGetOffsetEXIF | 100 | 100 | 155/155, ctxdiff 0 |
|
||||
| TMCCJPEGDecGetInfoEXIF | 100 | 100 | 132/132, ctxdiff 0 |
|
||||
| TMCJPEGDEC_exif_parse | 99.43396 | 99.43396 | 212/212 |
|
||||
| TMCJPEGDEC_IFD0_tag_parse | 94.46986 | 99.386696 | 480/481 |
|
||||
| TMCJPEGDEC_IFD1_tag_parse | 93.099174 | 96.14876 | 239/242 |
|
||||
| TMCJPEGDEC_ThumbnailCheck | 100 | 100 | 50/50, ctxdiff 0 |
|
||||
|
||||
IFD0 still lacks the original low-tag `bltlr` leaf. Aligning that instruction and
|
||||
its branch displacements leaves 32 GPR-operand differences in the two rational
|
||||
field cases. IFD1 still has decision-tree and register differences. The parser
|
||||
retains 21 GPR-operand differences. Nothing here claims exact completion.
|
||||
|
||||
## Concrete behavioral distinction
|
||||
|
||||
An internal IFD0 entry can be arranged with its four version bytes overlapping
|
||||
the destination by one byte. Initial source bytes 01 02 03 04 produce:
|
||||
|
||||
- Baseline compiled code: destination 01 02 03 04
|
||||
- Original object: destination 01 01 01 01
|
||||
- Corrected compiled code: destination 01 01 01 01
|
||||
|
||||
This is evidence about the internal parser's byte-copy/aliasing behavior. It is
|
||||
not a claim that ordinary nonoverlapping EXIF input was decoded incorrectly, or
|
||||
that a public API vulnerability has been established. Both byte orders and all
|
||||
three version fields were checked at offsets -3 through +3, giving 42 overlap
|
||||
cases. The unchanged baseline object fails this regression test; the final
|
||||
object passes all 42. Local destination casts, explicit loops and removal of
|
||||
other const qualifiers did not fix the discrepancy and were restored.
|
||||
|
||||
## Validation
|
||||
|
||||
- Pool checked before tuning and after the final build: identical, zero strings
|
||||
- No allocated non-code sections in either EXIF object
|
||||
- Fresh official report: all six function scores compared with baseline,
|
||||
zero regressions; all three exact functions retain ctxdiff zero differences
|
||||
- Full 4.3U build: PASS
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- `git diff --check 2a33684c`: PASS, including the committed candidate diff
|
||||
- No header/configuration/linking edits, no changes to the separately owned
|
||||
entropy decoder, no remote writes or original binary data committed
|
||||
|
||||
Build/report commands:
|
||||
|
||||
```sh
|
||||
python3 configure.py --version 43U --wrapper ../toolchain/wibo-build/wibo
|
||||
WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja
|
||||
build/tools/objdiff-cli report generate -p . -o build/43U/report.json -f json
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python tools/decomp-assist/pool_diff.py build/43U/src/libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse.o build/43U/obj/libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse.o
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python tools/decomp-assist/ctxdiff.py libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse <symbol>
|
||||
../.venv/bin/python tools/decomp-assist/jpeg_exif_differential_audit.py
|
||||
../.venv/bin/python tools/decomp-assist/jpeg_exif_differential_audit.py --overlap-only
|
||||
```
|
||||
|
||||
## Differential test scope
|
||||
|
||||
`jpeg_exif_differential_audit.py` is a read-only bounded integer PPC interpreter
|
||||
and deterministic test generator. It reads local ELF objects and never writes
|
||||
original executable bytes to the repository. It is a separate test tool; the
|
||||
previous converter/IDCT audit remains unchanged.
|
||||
|
||||
- 267,282 paired calls, seed 449529
|
||||
- Every 16-bit tag selector in both byte orders for both IFD handlers
|
||||
- Field types 0, 3, 4 and 0xFFFF; valid, boundary, out-of-range and wrapping
|
||||
offsets for supported scalar/rational/byte-array tags
|
||||
- Header sizes and offsets, valid/invalid byte order and TIFF magic, truncated
|
||||
entry arrays, IFD0/IFD1/Exif-directory chains and directory-boundary lengths
|
||||
- 42 overlapping version-byte cases that distinguish baseline from original
|
||||
- Every non-stack byte compared, including guard regions; parser return values,
|
||||
stack pointer, LR and GPR14..GPR31 preservation checked
|
||||
- Complete instruction-address coverage of IFD0 and the central parser in both
|
||||
objects; IFD1 covers every source instruction and 241/242 target instructions
|
||||
(one unreachable return in the target dispatch is not visited)
|
||||
|
||||
Limitations: this is not formal equivalence or a Wii runtime test. Instruction
|
||||
coverage is not exhaustive path/input coverage. The custom interpreter models
|
||||
only the observed integer subset, condition comparisons and internal EXIF calls;
|
||||
unsupported instructions/relocations/callees fail closed. FPU, XER overflow,
|
||||
exceptions, timing, cache/MMIO and a full system ABI are not modeled. Relocations
|
||||
use collision-checked symbol tokens; actual linked addresses are not tested.
|
||||
Public JPEG I/O, thumbnail decoding, arbitrary pointer values and all possible
|
||||
payload alias layouts are outside this test. The three exact wrappers are
|
||||
checked by objdiff/ctxdiff rather than executing their external dependencies.
|
||||
|
||||
Run from the repository root with pyelftools and Capstone available, and without
|
||||
Python's `-O` option. `--source-object` and `--target-object` can select separately
|
||||
compiled objects, allowing the overlap regression to be reproduced on baseline
|
||||
without changing the working tree. Final output is in
|
||||
`jpeg-exif-allhands-differential-results.txt`.
|
||||
|
||||
## Existing external branch overlap
|
||||
|
||||
Read-only comparison used the already fetched ref
|
||||
`origin/agent/w1009/tmc` at `cd90be696cb86258a1bc9fb9dc2b304f2bed318d`.
|
||||
No fetch, author communication, branch checkout or merge was performed.
|
||||
|
||||
Its `1c7cf40c` independently removes const from both tag-entry parameters, so the
|
||||
central IFD0 qualifier correction overlaps. Its `81440c32` then uses a u16 tag,
|
||||
u16 type and explicit tag remask. Its no-op case ranges differ from this
|
||||
candidate's explicit ignored tags. It also changes the shared 16-bit reader and
|
||||
parser declaration order. This candidate does not contain those changes.
|
||||
|
||||
An isolated `/tmp` compile of that branch's EXIF source, using the current
|
||||
checkout's original MWCC flags, produced:
|
||||
|
||||
| Measure/function | This candidate | cd90be69 EXIF object |
|
||||
| --- | ---: | ---: |
|
||||
| Unit fuzzy | 98.94104 | 99.01337 |
|
||||
| Central parser | 99.43396 | 98.679245 |
|
||||
| IFD0 | 99.386696 | 98.37838 |
|
||||
| IFD1 | 96.14876 | 99.194214 |
|
||||
| Exact functions | 3/6 | 3/6 |
|
||||
|
||||
Neither candidate wholly supersedes the other. This candidate has the better
|
||||
IFD0 and preserves the current parser score; the external candidate has the
|
||||
better IFD1. Integration must preserve the parser score and independently
|
||||
revalidate any combined source. The isolated comparison is not a full gate of
|
||||
the external branch or its other files.
|
||||
|
||||
Relative to baseline 449529d9, the external RGB565 edits concern its setter and
|
||||
do not overlap the prior candidate's RGB444 body. Its RGBA420 edge edits overlap
|
||||
that prior candidate's changed expression context. It does not change IDCT.
|
||||
The previously committed JPEG candidate remains separate and unchanged.
|
||||
|
||||
## Attempts
|
||||
|
||||
All rejected/equal variants were restored. The lower-tag 0x0100 experiment had a
|
||||
fuzzy improvement but was explicitly discarded after review: the original
|
||||
branch shape does not establish that particular no-op label, and it changed
|
||||
other lower dispatch comparisons. It is absent from the final source.
|
||||
|
||||
### trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse word-width-field-type: 94.469860 -> 95.122660; RETAIN
|
||||
TMCJPEGDEC_IFD0_tag_parse explicit-ignored-compression-return: 95.122660 -> 94.914764; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse explicit-ignored-compression-break: 95.122660 -> 95.122660; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse recognized-ignored-planar-and-pixel-tags: 93.099174 -> 95.942150; RETAIN
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-low-strip-offset-own-return: 95.942150 -> 95.342970; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-orientation-own-return: 95.942150 -> 95.533060; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-datetime-own-return: 95.942150 -> 95.528920; restore
|
||||
```
|
||||
|
||||
### control-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse explicit-unknown-tag-return: 95.122660 -> 94.498960; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse explicit-unknown-tag-break: 95.122660 -> 95.122660; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse explicit-unknown-tag-return: 95.942150 -> 95.876030; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse explicit-unknown-tag-break: 95.942150 -> 95.942150; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ifd1-orientation-uses-unknown-exit: 95.942150 -> 95.756195; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ifd1-planar-uses-unknown-exit: 95.942150 -> 91.694214; restore
|
||||
```
|
||||
|
||||
### ignored-tag-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-image-fields-before-compression: 95.122660 -> 95.110180; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-image-fields: 95.942150 -> 95.735535; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ifd1-planar-logical-case-order: 95.942150 -> 95.942150; restore
|
||||
```
|
||||
|
||||
### reader-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse shared-exif-tag-reader: 95.122660 -> 95.195430; RETAIN
|
||||
TMCJPEGDEC_IFD0_tag_parse shared-exif-type-reader: 95.195430 -> 95.517670; RETAIN
|
||||
TMCJPEGDEC_IFD0_tag_parse shared-exif-short-reader: 95.517670 -> 95.517670; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse shared-exif-tag-reader: 95.942150 -> 95.942150; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse shared-exif-short-reader: 95.942150 -> 95.942150; restore
|
||||
```
|
||||
|
||||
### lower-tag-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(256,): 95.517670 -> 93.004160; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(257,): 95.517670 -> 93.004160; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(258,): 95.517670 -> 95.505196; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(256, 257): 95.517670 -> 93.004160; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(256, 258): 95.517670 -> 93.004160; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(257, 258): 95.517670 -> 95.505196; restore
|
||||
TMCJPEGDEC_IFD0_tag_parse ignored-lower-tags-(256, 257, 258): 95.517670 -> 95.505196; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(256,): 95.942150 -> 96.665290; RETAIN
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(257,): 96.665290 -> 96.665290; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(258,): 96.665290 -> 95.735535; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(256, 257): 96.665290 -> 96.644630; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(256, 258): 96.665290 -> 96.256195; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(257, 258): 96.665290 -> 95.735535; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse ignored-lower-tags-(256, 257, 258): 96.665290 -> 95.735535; restore
|
||||
```
|
||||
|
||||
### byte-copy-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse alias-preserving-version-byte-copy: 95.517670 -> 95.517670; restore
|
||||
```
|
||||
|
||||
### version-loop-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse forward-version-byte-loops: 95.517670 -> 95.517670; restore
|
||||
```
|
||||
|
||||
### qualifier-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD0_tag_parse mutable-entry-view: 95.517670 -> 99.386696; RETAIN
|
||||
TMCJPEGDEC_IFD1_tag_parse mutable-entry-view: 95.942150 -> 95.942150; restore
|
||||
```
|
||||
|
||||
### pointer-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IFD1_tag_parse mutable-rational-byte-view: 95.942150 -> 95.942150; restore
|
||||
TMCJPEGDEC_IFD1_tag_parse direct-denominator-byte-address: 95.942150 -> 96.148760; RETAIN
|
||||
```
|
||||
@@ -0,0 +1,6 @@
|
||||
TMCJPEGDEC_IFD0_tag_parse 131072 selector cases PASS
|
||||
TMCJPEGDEC_IFD1_tag_parse 131072 selector cases PASS
|
||||
TMCJPEGDEC_IFD0_tag_parse 132746 cases PASS; own-body instruction coverage 480 / 480 source; 481 / 481 original
|
||||
TMCJPEGDEC_IFD1_tag_parse 132704 cases PASS; own-body instruction coverage 239 / 239 source; 241 / 242 original
|
||||
TMCJPEGDEC_exif_parse 1832 cases PASS; own-body instruction coverage 212 / 212 source; 212 / 212 original
|
||||
TOTAL 267282 paired EXIF calls PASS
|
||||
82
tools/decomp-assist/jpeg-next-reconstruction-attempts.md
Normal file
82
tools/decomp-assist/jpeg-next-reconstruction-attempts.md
Normal file
@@ -0,0 +1,82 @@
|
||||
# JPEG follow-on reconstruction
|
||||
|
||||
Base: `813660b9`, branch `agent/bittle/jpeg-reconstruction-next`.
|
||||
The already-reviewed EXIF candidate `b9305280` was preserved unchanged as local
|
||||
cherry-pick `164dbbc5`. This log concerns a separate follow-on to that candidate.
|
||||
|
||||
## Retained change
|
||||
|
||||
IFD0 rational denominator addresses now use the same explicit offset grouping as
|
||||
IFD1: add four to the TIFF offset, then add the thumbnail-data base. The redundant
|
||||
same-type pointer cast is removed. This is a two-line source change; it introduces
|
||||
no new tag interpretation, new memory access, or function.
|
||||
|
||||
- `TMCJPEGDEC_IFD0_tag_parse`: 99.386696 -> 99.49065 fuzzy
|
||||
- EXIF unit: 98.94104 -> 98.98035 fuzzy
|
||||
- EXIF exact functions: 3/6 -> 3/6; matched code remains 1348/5088 bytes
|
||||
- IFD0 remains 480/481 instructions; this is not an exact match or linking result
|
||||
- All other 33 owned functions retain their baseline scores
|
||||
|
||||
No changes are retained in the color converters or IDCT. No declaration-order
|
||||
search, forced registers, volatile, assembly, padding, headers, configuration,
|
||||
linking changes, remote writes, or edits to the entropy decoder were made.
|
||||
|
||||
## Rejected reconstruction trials
|
||||
|
||||
Every equal or regressing trial was restored before validation.
|
||||
|
||||
- Separate rational numerator/denominator pointer lifetimes in IFD0 and IFD1:
|
||||
unchanged from the retained expression; restored
|
||||
- RGB444's common edge-sibling channel evaluation and clipping order with a
|
||||
separate luminance value: 98.71429 -> 98.62637; restored
|
||||
- Explicit odd-coefficient differences in the luminance second-pass butterfly:
|
||||
83.05058 -> 81.42802; restored
|
||||
- Extract the luminance first-pass row transform to a static inline helper:
|
||||
83.05058 -> 81.12062; restored. The trial script initially omitted helper
|
||||
local declarations, causing a compiler error; that experiment was corrected,
|
||||
measured, and then fully restored
|
||||
- Extract RGBA pixel packing to a static inline helper:
|
||||
- 411: 82.6033 -> 81.72314; restored
|
||||
- 422 and edge: unchanged at 87.72298 and 90.08849; restored
|
||||
- 420 and edge: unchanged at 89.40523 and 87.458336; restored
|
||||
- 211 and edge: unchanged at 91.15385 and 92.0; restored
|
||||
- 444: unchanged at 90.670105; restored
|
||||
- 444 edge: 88.90909 -> 87.70909; restored
|
||||
|
||||
These were source-structure trials, not permutations of register declarations.
|
||||
The source-neutral scheduling differences that remain were not chased through
|
||||
artificial source changes.
|
||||
|
||||
## Verification
|
||||
|
||||
The baseline report was generated after building the unchanged cherry-picked
|
||||
candidate. The final report was freshly generated after restoring every rejected
|
||||
trial and rebuilding all four owned objects.
|
||||
|
||||
- Full 4.3U build: PASS
|
||||
- All 34 owned function scores compared against the baseline: zero regressions
|
||||
- All 11 previously exact functions retain exact-name objdiff 100 and ctxdiff 0
|
||||
- Pool checks before trials and after the final build: all four identical,
|
||||
zero strings
|
||||
- Neither source nor original object has allocated non-code sections in any of
|
||||
the four owned units
|
||||
- DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`
|
||||
- The existing read-only bounded PPC audit tools were inspected before use;
|
||||
their scripts are unchanged
|
||||
- Converter/IDCT audit: all 9,456 paired calls pass
|
||||
|
||||
- EXIF audit: all 267,282 paired calls pass, including the 42 version-byte
|
||||
overlap cases preserved by the preceding candidate
|
||||
- `git diff --check 813660b9`: PASS, including the base-relative committed diff
|
||||
- The working tree is paused for parent review after the focused local commit
|
||||
These interpreter tests are bounded samples, not formal equivalence or Wii
|
||||
runtime tests. Their existing coverage and modeling limitations still apply.
|
||||
|
||||
## Existing external overlap
|
||||
|
||||
The prior EXIF log documents the already fetched
|
||||
`origin/agent/w1009/tmc` branch's overlap with EXIF and color reconstruction.
|
||||
That overlap remains relevant to parent integration. This follow-on was derived
|
||||
from the current source, the prior owned reconstruction, and local object
|
||||
comparisons. No external branch was merged, copied, fetched, or contacted.
|
||||
The parent should preserve the previously queued EXIF candidate separately.
|
||||
63
tools/decomp-assist/jpeg-next-reconstruction-validation.txt
Normal file
63
tools/decomp-assist/jpeg-next-reconstruction-validation.txt
Normal file
@@ -0,0 +1,63 @@
|
||||
main/libs/RVLMiddleware/TMC_JPEG/src/buffer/idct_block_var 89.06892 -> 89.06892
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0)
|
||||
No allocated non-code sections in either object
|
||||
main/libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse 98.94104 -> 98.98035
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0)
|
||||
TMCCJPEGDecGetOffsetEXIF: src 0x26c base 0x26c insns 155/155; diffs 0: []
|
||||
TMCCJPEGDecGetInfoEXIF: src 0x210 base 0x210 insns 132/132; diffs 0: []
|
||||
TMCJPEGDEC_IFD0_tag_parse 99.386696 -> 99.49065
|
||||
TMCJPEGDEC_ThumbnailCheck: src 0xc8 base 0xc8 insns 50/50; diffs 0: []
|
||||
No allocated non-code sections in either object
|
||||
main/libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGB565 96.44502 -> 96.44502
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0)
|
||||
TMCJPEGDEC_converterYUV422toRGB565edge: src 0x1ac base 0x1ac insns 107/107; diffs 0: []
|
||||
TMCJPEGDEC_converterYUV211toRGB565: src 0x188 base 0x188 insns 98/98; diffs 0: []
|
||||
TMCJPEGDEC_converterYUV211toRGB565edge: src 0x1b4 base 0x1b4 insns 109/109; diffs 0: []
|
||||
TMCJPEGDEC_converterYUV444toRGB565edge: src 0x1a0 base 0x1a0 insns 104/104; diffs 0: []
|
||||
TMCJPEGDEC_converterYUV400toRGB565: src 0x118 base 0x118 insns 70/70; diffs 0: []
|
||||
TMCJPEGDEC_converterYUV400toRGB565edge: src 0x14c base 0x14c insns 83/83; diffs 0: []
|
||||
No allocated non-code sections in either object
|
||||
main/libs/RVLMiddleware/TMC_JPEG/src/texturecvtr/Texture_MCUtoRGBA8 90.32323 -> 90.32323
|
||||
POOL IDENTICAL up to 0 (mine=0 base=0)
|
||||
TMCJPEGDEC_converterYUV400toRGBA8: src 0x130 base 0x130 insns 76/76; diffs 0: []
|
||||
TMCJPEGDEC_converterYUV400toRGBA8edge: src 0x164 base 0x164 insns 89/89; diffs 0: []
|
||||
No allocated non-code sections in either object
|
||||
34 owned function scores checked; 11 exact functions preserved; zero regressions
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d build/43U/main.dol
|
||||
|
||||
TMCJPEGDEC_IFD0_tag_parse 131072 selector cases PASS
|
||||
TMCJPEGDEC_IFD1_tag_parse 131072 selector cases PASS
|
||||
TMCJPEGDEC_IFD0_tag_parse 132746 cases PASS; own-body instruction coverage 480 / 480 source; 481 / 481 original
|
||||
TMCJPEGDEC_IFD1_tag_parse 132704 cases PASS; own-body instruction coverage 239 / 239 source; 241 / 242 original
|
||||
TMCJPEGDEC_exif_parse 1832 cases PASS; own-body instruction coverage 212 / 212 source; 212 / 212 original
|
||||
TOTAL 267282 paired EXIF calls PASS
|
||||
|
||||
TMCJPEGDEC_converterYUV411toRGBA8: 100 cases PASS; instruction coverage source 242/242, original 242/242
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge: 400 cases PASS; instruction coverage source 112/112, original 112/112
|
||||
TMCJPEGDEC_converterYUV422toRGBA8: 100 cases PASS; instruction coverage source 148/148, original 148/148
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge: 400 cases PASS; instruction coverage source 113/113, original 113/113
|
||||
TMCJPEGDEC_converterYUV420toRGBA8: 100 cases PASS; instruction coverage source 153/153, original 153/153
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge: 400 cases PASS; instruction coverage source 120/120, original 120/120
|
||||
TMCJPEGDEC_converterYUV211toRGBA8: 100 cases PASS; instruction coverage source 104/104, original 104/104
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge: 400 cases PASS; instruction coverage source 115/115, original 115/115
|
||||
TMCJPEGDEC_converterYUV444toRGBA8: 100 cases PASS; instruction coverage source 97/97, original 97/97
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge: 400 cases PASS; instruction coverage source 110/110, original 110/110
|
||||
TMCJPEGDEC_converterYUV400toRGBA8: 100 cases PASS; instruction coverage source 57/76, original 57/76
|
||||
TMCJPEGDEC_converterYUV400toRGBA8edge: 400 cases PASS; instruction coverage source 70/89, original 70/89
|
||||
TMCJPEGDEC_set_converterRGBA8: 1024 cases PASS; instruction coverage source 168/169, original 169/170
|
||||
TMCJPEGDEC_converterYUV411toRGB565: 100 cases PASS; instruction coverage source 217/217, original 217/217
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge: 400 cases PASS; instruction coverage source 106/106, original 106/106
|
||||
TMCJPEGDEC_converterYUV422toRGB565: 100 cases PASS; instruction coverage source 136/136, original 136/136
|
||||
TMCJPEGDEC_converterYUV422toRGB565edge: 400 cases PASS; instruction coverage source 107/107, original 107/107
|
||||
TMCJPEGDEC_converterYUV420toRGB565: 100 cases PASS; instruction coverage source 141/141, original 141/141
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge: 400 cases PASS; instruction coverage source 114/114, original 114/114
|
||||
TMCJPEGDEC_converterYUV211toRGB565: 100 cases PASS; instruction coverage source 98/98, original 98/98
|
||||
TMCJPEGDEC_converterYUV211toRGB565edge: 400 cases PASS; instruction coverage source 109/109, original 109/109
|
||||
TMCJPEGDEC_converterYUV444toRGB565: 100 cases PASS; instruction coverage source 91/91, original 91/91
|
||||
TMCJPEGDEC_converterYUV444toRGB565edge: 400 cases PASS; instruction coverage source 104/104, original 104/104
|
||||
TMCJPEGDEC_converterYUV400toRGB565: 100 cases PASS; instruction coverage source 51/70, original 51/70
|
||||
TMCJPEGDEC_converterYUV400toRGB565edge: 400 cases PASS; instruction coverage source 64/83, original 64/83
|
||||
TMCJPEGDEC_set_converterRGB565: 1024 cases PASS; instruction coverage source 168/169, original 169/170
|
||||
TMCJPEGDEC_IdctBlock_Lumi: 704 cases PASS; instruction coverage source 257/257, original 257/257
|
||||
TMCJPEGDEC_IdctBlock_Col: 704 cases PASS; instruction coverage source 454/454, original 454/454
|
||||
TOTAL: 9456 differential cases PASS; GPR14-GPR31, stack pointer and LR preserved
|
||||
276
tools/decomp-assist/jpeg-remainder-attempts.md
Normal file
276
tools/decomp-assist/jpeg-remainder-attempts.md
Normal file
@@ -0,0 +1,276 @@
|
||||
# JPEG remainder: semantic audit and source-shape reconstruction
|
||||
|
||||
Baseline: `449529d9`, branch `agent/bittle/allhands-jpeg-decompile`, 4.3U only.
|
||||
No remote writes, header changes, configuration changes, linking changes, assembly,
|
||||
volatile forcing, padding, or edits to the separately owned entropy decoder.
|
||||
|
||||
## Result
|
||||
|
||||
All 28 owned functions were already implemented. No semantic mismatch was found
|
||||
in a bounded differential comparison of their current compiled PPC against their
|
||||
original ELF function bodies. This is additional test evidence, not a formal
|
||||
proof of equivalence and not a Wii runtime test.
|
||||
|
||||
Three natural source-shape changes improved the report without a function-score
|
||||
regression:
|
||||
|
||||
- Luminance IDCT now uses explicit odd-coefficient sum/difference temporaries,
|
||||
matching the existing chroma first-pass butterfly. Function fuzzy
|
||||
82.31518 -> 83.05058; 257/257 instructions, 187 ctxdiff differences remain
|
||||
- RGB444 consumes the luminance temporary as the red channel and uses the
|
||||
existing exact edge sibling's red/green packing association. Function fuzzy
|
||||
97.96703 -> 98.71429; 91/91 instructions, 13 ctxdiff differences remain
|
||||
- RGBA420 edge consumes the luminance temporary as red after calculating the
|
||||
other channels. Function fuzzy 87.4 -> 87.458336; 120/120 instructions,
|
||||
77 ctxdiff differences remain
|
||||
|
||||
No new exact matches. This candidate is not an exact-matching or linking result.
|
||||
|
||||
| Unit | Exact before -> after | Fuzzy before -> after | Allocated data |
|
||||
| --- | --- | --- | --- |
|
||||
| Texture_MCUtoRGBA8 | 2/13 -> 2/13 | 90.318985 -> 90.32323 | 0 bytes; 100% |
|
||||
| Texture_MCUtoRGB565 | 6/13 -> 6/13 | 96.40103 -> 96.44502 | 0 bytes; 100% |
|
||||
| idct_block_var | 0/2 -> 0/2 | 88.80309 -> 89.06892 | 0 bytes; 100% |
|
||||
|
||||
All eight previously exact functions still have exact-name objdiff 100% and
|
||||
ctxdiff zero differences. Each setter remains 169/170 instructions, with one
|
||||
folded buffer-base address operation; the other 26 functions retain their
|
||||
original instruction counts. Every owned function and both input objects were
|
||||
checked for allocated non-code sections: none. Pool checks were run before tuning and after the final build; all three were
|
||||
identical, with zero strings.
|
||||
|
||||
The baseline comparison was regenerated by rebuilding saved unmodified versions
|
||||
of the three owned sources, reporting them, then restoring/rebuilding the final
|
||||
sources. All 28 function scores were compared; zero regressions.
|
||||
|
||||
Full build: PASS. `git diff --check`: PASS.
|
||||
DOL SHA1: `26116613f624061ba99c8d1a299aaa6efa85670d`.
|
||||
|
||||
Commands used:
|
||||
|
||||
```sh
|
||||
python3 configure.py --version 43U --wrapper ../toolchain/wibo-build/wibo
|
||||
WIBO_SJIS_MISSING_IMPORTS=1 ../.venv/bin/ninja
|
||||
build/tools/objdiff-cli report generate -p . -o build/43U/report.json -f json
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python tools/decomp-assist/pool_diff.py <source-object> <original-object>
|
||||
PYTHONPATH=../local-tools ../.venv/bin/python tools/decomp-assist/ctxdiff.py <unit> <symbol>
|
||||
../.venv/bin/python tools/decomp-assist/jpeg_differential_audit.py
|
||||
sha1sum build/43U/main.dol
|
||||
```
|
||||
|
||||
## Differential test scope and limitations
|
||||
|
||||
The committed `jpeg_differential_audit.py` is a bounded integer PPC interpreter
|
||||
and deterministic test generator. It reads the locally available source/original
|
||||
ELF objects and does not distribute original executable bytes. Capstone and
|
||||
pyelftools are required. Run it from the repository root after building the
|
||||
three objects; do not run Python with assertions disabled.
|
||||
|
||||
- 9,456 paired calls across all 28 functions, seed 449529
|
||||
- Normal and edge converters: scales 1, 2, 4, 8; multiple MCU origins; both
|
||||
edge-dimension branches; zero, partial and full extents; constant and random
|
||||
luminance/chroma bytes, including negative signed chroma and clipping
|
||||
- Setters: all 256 component selectors and four supported IDCT sizes;
|
||||
randomized 16-bit image dimensions; return values, converter identities and
|
||||
non-stack side effects compared
|
||||
- IDCT: all row extents 1..8 and column-mode representatives 1, 2, 3, 8;
|
||||
DC-only, sparse and dense coefficients; positive/negative coefficients and
|
||||
clipping-boundary DC values; pitches 8, 16, 32
|
||||
- Every non-stack byte is compared, including guard regions, along with setter
|
||||
return values. Stack pointer, LR and GPR14..GPR31 restoration are checked
|
||||
- Full instruction-address coverage was reached for all 20 non-grayscale
|
||||
converter bodies and both IDCT functions. This does not mean exhaustive
|
||||
branch/path/input coverage. Four grayscale bodies retain 19 unvisited
|
||||
instructions each in saturation paths that follow an unsigned byte load;
|
||||
each setter has one unvisited negative-selector branch instruction
|
||||
- Function address relocations are normalized to deterministic symbol tokens,
|
||||
with collision checks. Real linked addresses and integration are not tested
|
||||
- Only the observed integer instruction subset is implemented. Unsupported
|
||||
instructions/relocations/callees fail closed. No FPU, exceptions, cache/MMIO,
|
||||
timing, alignment faults, XER behavior or complete condition-register model
|
||||
- `memset` is modeled by its memory effects and ABI-permitted volatile-register
|
||||
clobbers; its actual library machine code is not executed
|
||||
- Inputs are bounded samples. Invalid pointers, zero scale, arbitrary invalid
|
||||
IDCT descriptors, all 32-bit coefficient patterns, concurrency, real JPEG
|
||||
streams and other units are not covered
|
||||
- This custom interpreter is itself test tooling rather than a formally verified
|
||||
CPU implementation. Official objdiff, ctxdiff and full-DOL checks remain the
|
||||
matching/integration authority
|
||||
|
||||
Exact run output is preserved in `jpeg-remainder-differential-results.txt`.
|
||||
|
||||
## Attempts
|
||||
|
||||
Only strictly improved candidates without other function regressions were kept.
|
||||
No declaration-order permutation search was performed. Failed/equal candidates
|
||||
were restored. The one temporary compile error in the luminance-consumption
|
||||
script was a duplicate local declaration; it was corrected and no broken
|
||||
candidate was retained.
|
||||
|
||||
### type-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_converterYUV411toRGBA8 signed-chroma-pointers: 82.603300 -> 82.500000; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8 signed-chroma-coefficients: 82.603300 -> 82.603300; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8 signed-chroma-domain: 82.603300 -> 81.570250; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge signed-chroma-pointers: 93.883930 -> 91.964290; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge signed-chroma-coefficients: 93.883930 -> 93.750000; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge signed-chroma-domain: 93.883930 -> 92.187500; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8 signed-chroma-pointers: 87.722980 -> 87.722980; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8 signed-chroma-coefficients: 87.722980 -> 87.722980; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8 signed-chroma-domain: 87.722980 -> 87.722980; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8 byte-luminance: 87.722980 -> 87.689186; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge signed-chroma-pointers: 90.088490 -> 90.088490; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge signed-chroma-coefficients: 90.088490 -> 90.088490; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge signed-chroma-domain: 90.088490 -> 88.628320; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge byte-luminance: 90.088490 -> 90.088490; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8 signed-chroma-pointers: 89.405230 -> 89.176470; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8 signed-chroma-coefficients: 89.405230 -> 89.307190; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8 signed-chroma-domain: 89.405230 -> 86.464050; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8 byte-luminance: 89.405230 -> 87.379080; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge signed-chroma-pointers: 87.400000 -> 80.666664; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge signed-chroma-domain: 87.400000 -> 80.666664; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 signed-chroma-pointers: 91.153850 -> 91.153850; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 signed-chroma-coefficients: 91.153850 -> 91.153850; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 signed-chroma-domain: 91.153850 -> 91.153850; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 byte-luminance: 91.153850 -> 91.153850; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge signed-chroma-pointers: 92.000000 -> 91.869570; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge signed-chroma-coefficients: 92.000000 -> 91.869570; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge signed-chroma-domain: 92.000000 -> 91.869570; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 signed-chroma-pointers: 90.670105 -> 90.515465; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 signed-chroma-coefficients: 90.670105 -> 90.515465; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 signed-chroma-domain: 90.670105 -> 90.618550; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 byte-luminance: 90.670105 -> 90.670105; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge signed-chroma-pointers: 88.909090 -> 88.909090; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge signed-chroma-coefficients: 88.909090 -> 88.909090; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge signed-chroma-domain: 88.909090 -> 87.645454; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge byte-luminance: 88.909090 -> 88.909090; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 signed-chroma-pointers: 90.599075 -> 90.599075; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 signed-chroma-coefficients: 90.599075 -> 90.599075; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 signed-chroma-domain: 90.599075 -> 90.599075; restore
|
||||
TMCJPEGDEC_converterYUV422toRGB565 signed-chroma-pointers: 96.691180 -> 96.691180; restore
|
||||
TMCJPEGDEC_converterYUV422toRGB565 signed-chroma-coefficients: 96.691180 -> 96.691180; restore
|
||||
TMCJPEGDEC_converterYUV422toRGB565 signed-chroma-domain: 96.691180 -> 96.691180; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 signed-chroma-pointers: 94.609930 -> 94.609930; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 signed-chroma-coefficients: 94.609930 -> 94.609930; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 signed-chroma-domain: 94.609930 -> 94.609930; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 byte-luminance: 94.609930 -> 92.907800; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 signed-chroma-pointers: 97.967030 -> 97.362640; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 signed-chroma-coefficients: 97.967030 -> 97.802200; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 signed-chroma-domain: 97.967030 -> 97.340660; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 byte-luminance: 97.967030 -> 91.373630; restore
|
||||
```
|
||||
|
||||
### idct-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_IdctBlock_Lumi nested-odd-output-sum: 82.315180 -> 79.708170; restore
|
||||
TMCJPEGDEC_IdctBlock_Lumi explicit-ac-or-tree: 82.315180 -> 74.984436; restore
|
||||
TMCJPEGDEC_IdctBlock_Lumi ac-coefficients-direct-condition: 82.315180 -> 74.984436; restore
|
||||
TMCJPEGDEC_IdctBlock_Lumi nested-even-output-sum: 82.315180 -> 82.315180; restore
|
||||
TMCJPEGDEC_IdctBlock_Lumi direct-product-shifts: 82.315180 -> 82.315180; restore
|
||||
TMCJPEGDEC_IdctBlock_Col nested-odd-output-sum: 92.475770 -> 87.907486; restore
|
||||
TMCJPEGDEC_IdctBlock_Col explicit-ac-or-tree: 92.475770 -> 90.651985; restore
|
||||
TMCJPEGDEC_IdctBlock_Col ac-coefficients-direct-condition: 92.475770 -> 90.651985; restore
|
||||
TMCJPEGDEC_IdctBlock_Col nested-even-output-sum: 92.475770 -> 92.475770; restore
|
||||
TMCJPEGDEC_IdctBlock_Col direct-product-shifts: 92.475770 -> 92.475770; restore
|
||||
```
|
||||
|
||||
### packing-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_converterYUV411toRGBA8 explicit-channel-clamp-branches: 82.603300 -> 61.962810; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8 structured-nonnegative-clamp: 82.603300 -> 68.442150; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge explicit-channel-clamp-branches: 93.883930 -> 80.008930; restore
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge structured-nonnegative-clamp: 93.883930 -> 85.714290; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8 explicit-channel-clamp-branches: 87.722980 -> 71.222980; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8 structured-nonnegative-clamp: 87.722980 -> 75.533780; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge explicit-channel-clamp-branches: 90.088490 -> 76.097340; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge structured-nonnegative-clamp: 90.088490 -> 82.123890; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8 explicit-channel-clamp-branches: 89.405230 -> 73.372550; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8 structured-nonnegative-clamp: 89.405230 -> 76.797386; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge explicit-channel-clamp-branches: 87.400000 -> 77.841670; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge structured-nonnegative-clamp: 87.400000 -> 82.400000; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 explicit-channel-clamp-branches: 91.153850 -> 74.701920; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 structured-nonnegative-clamp: 91.153850 -> 82.211540; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge explicit-channel-clamp-branches: 92.000000 -> 77.730440; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge structured-nonnegative-clamp: 92.000000 -> 84.043480; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 explicit-channel-clamp-branches: 90.670105 -> 73.030930; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 structured-nonnegative-clamp: 90.670105 -> 81.082470; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge explicit-channel-clamp-branches: 88.909090 -> 75.463640; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge structured-nonnegative-clamp: 88.909090 -> 81.000000; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 normalize-packed-channels: 90.599075 -> 87.004610; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 group-red-green-packing: 90.599075 -> 88.755760; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 pack-before-output-address: 90.599075 -> 90.599075; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 explicit-channel-clamp-branches: 90.599075 -> 59.511520; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565 structured-nonnegative-clamp: 90.599075 -> 71.640560; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge normalize-packed-channels: 95.377360 -> 93.820755; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge group-red-green-packing: 95.377360 -> 93.613205; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge pack-before-output-address: 95.377360 -> 95.377360; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge explicit-channel-clamp-branches: 95.377360 -> 79.801890; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge structured-nonnegative-clamp: 95.377360 -> 86.179245; restore
|
||||
TMCJPEGDEC_converterYUV422toRGB565 explicit-channel-clamp-branches: 96.691180 -> 78.507355; restore
|
||||
TMCJPEGDEC_converterYUV422toRGB565 structured-nonnegative-clamp: 96.691180 -> 79.044120; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 normalize-packed-channels: 94.609930 -> 90.248230; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 group-red-green-packing: 94.609930 -> 91.560290; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 pack-before-output-address: 94.609930 -> 94.609930; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 explicit-channel-clamp-branches: 94.609930 -> 73.127660; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565 structured-nonnegative-clamp: 94.609930 -> 76.751770; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge normalize-packed-channels: 94.692986 -> 89.912280; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge group-red-green-packing: 94.692986 -> 91.798250; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge pack-before-output-address: 94.692986 -> 94.692986; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge explicit-channel-clamp-branches: 94.692986 -> 81.894740; restore
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge structured-nonnegative-clamp: 94.692986 -> 86.315790; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 normalize-packed-channels: 97.967030 -> 96.648350; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 group-red-green-packing: 97.967030 -> 98.681320; RETAIN
|
||||
TMCJPEGDEC_converterYUV444toRGB565 explicit-channel-clamp-branches: 98.681320 -> 85.120880; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 structured-nonnegative-clamp: 98.681320 -> 82.802200; restore
|
||||
```
|
||||
|
||||
### control-trials
|
||||
|
||||
```text
|
||||
structured-col-low-mode-first: {'TMCJPEGDEC_IdctBlock_Lumi': 82.31518, 'TMCJPEGDEC_IdctBlock_Col': 92.47577} -> {'TMCJPEGDEC_IdctBlock_Lumi': 82.31518, 'TMCJPEGDEC_IdctBlock_Col': 92.47577}; restore
|
||||
structured-col-high-mode-first: {'TMCJPEGDEC_IdctBlock_Lumi': 82.31518, 'TMCJPEGDEC_IdctBlock_Col': 92.47577} -> {'TMCJPEGDEC_IdctBlock_Lumi': 82.31518, 'TMCJPEGDEC_IdctBlock_Col': 50.55066}; restore
|
||||
shared-full-row-butterfly: {'TMCJPEGDEC_IdctBlock_Lumi': 82.31518, 'TMCJPEGDEC_IdctBlock_Col': 92.47577} -> {'TMCJPEGDEC_IdctBlock_Lumi': 83.05058, 'TMCJPEGDEC_IdctBlock_Col': 92.47577}; RETAIN
|
||||
```
|
||||
|
||||
### luma-reuse-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge consume-luminance-as-blue: 90.088490 -> 90.088490; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge consume-luminance-as-red: 90.088490 -> 89.955750; restore
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge consume-luminance-as-green: 90.088490 -> 90.088490; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge consume-luminance-as-blue: 87.400000 -> 87.400000; restore
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge consume-luminance-as-red: 87.400000 -> 87.458336; RETAIN
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 consume-luminance-as-blue: 91.153850 -> 91.153850; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 consume-luminance-as-red: 91.153850 -> 86.067310; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8 consume-luminance-as-green: 91.153850 -> 78.307690; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge consume-luminance-as-blue: 92.000000 -> 91.565216; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge consume-luminance-as-red: 92.000000 -> 87.617390; restore
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge consume-luminance-as-green: 92.000000 -> 79.547830; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 consume-luminance-as-blue: 90.670105 -> 90.670105; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 consume-luminance-as-red: 90.670105 -> 85.216490; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8 consume-luminance-as-green: 90.670105 -> 74.577320; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge consume-luminance-as-blue: 88.909090 -> 88.909090; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge consume-luminance-as-red: 88.909090 -> 85.645454; restore
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge consume-luminance-as-green: 88.909090 -> 78.772730; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge consume-luminance-as-blue: 95.377360 -> 91.396225; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge consume-luminance-as-red: 95.377360 -> 93.707550; restore
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge consume-luminance-as-green: 95.377360 -> 95.330185; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 consume-luminance-as-blue: 98.681320 -> 98.681320; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 consume-luminance-as-red: 98.681320 -> 98.714290; RETAIN
|
||||
```
|
||||
|
||||
### rgb444-trials
|
||||
|
||||
```text
|
||||
TMCJPEGDEC_converterYUV444toRGB565 reused-luminance-green-red-group: 98.714290 -> 89.923080; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 reused-luminance-blue-green-group: 98.714290 -> 98.549450; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 reused-luminance-red-blue-group: 98.714290 -> 90.945050; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 reused-luminance-red-green-group: 98.714290 -> 98.714290; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 separate-luminance-green-red-group: 98.714290 -> 98.131870; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 separate-luminance-blue-green-group: 98.714290 -> 98.516490; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 separate-luminance-red-blue-group: 98.714290 -> 91.406590; restore
|
||||
TMCJPEGDEC_converterYUV444toRGB565 separate-luminance-red-green-group: 98.714290 -> 98.681320; restore
|
||||
```
|
||||
29
tools/decomp-assist/jpeg-remainder-differential-results.txt
Normal file
29
tools/decomp-assist/jpeg-remainder-differential-results.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
TMCJPEGDEC_converterYUV411toRGBA8: 100 cases PASS; instruction coverage source 242/242, original 242/242
|
||||
TMCJPEGDEC_converterYUV411toRGBA8edge: 400 cases PASS; instruction coverage source 112/112, original 112/112
|
||||
TMCJPEGDEC_converterYUV422toRGBA8: 100 cases PASS; instruction coverage source 148/148, original 148/148
|
||||
TMCJPEGDEC_converterYUV422toRGBA8edge: 400 cases PASS; instruction coverage source 113/113, original 113/113
|
||||
TMCJPEGDEC_converterYUV420toRGBA8: 100 cases PASS; instruction coverage source 153/153, original 153/153
|
||||
TMCJPEGDEC_converterYUV420toRGBA8edge: 400 cases PASS; instruction coverage source 120/120, original 120/120
|
||||
TMCJPEGDEC_converterYUV211toRGBA8: 100 cases PASS; instruction coverage source 104/104, original 104/104
|
||||
TMCJPEGDEC_converterYUV211toRGBA8edge: 400 cases PASS; instruction coverage source 115/115, original 115/115
|
||||
TMCJPEGDEC_converterYUV444toRGBA8: 100 cases PASS; instruction coverage source 97/97, original 97/97
|
||||
TMCJPEGDEC_converterYUV444toRGBA8edge: 400 cases PASS; instruction coverage source 110/110, original 110/110
|
||||
TMCJPEGDEC_converterYUV400toRGBA8: 100 cases PASS; instruction coverage source 57/76, original 57/76
|
||||
TMCJPEGDEC_converterYUV400toRGBA8edge: 400 cases PASS; instruction coverage source 70/89, original 70/89
|
||||
TMCJPEGDEC_set_converterRGBA8: 1024 cases PASS; instruction coverage source 168/169, original 169/170
|
||||
TMCJPEGDEC_converterYUV411toRGB565: 100 cases PASS; instruction coverage source 217/217, original 217/217
|
||||
TMCJPEGDEC_converterYUV411toRGB565edge: 400 cases PASS; instruction coverage source 106/106, original 106/106
|
||||
TMCJPEGDEC_converterYUV422toRGB565: 100 cases PASS; instruction coverage source 136/136, original 136/136
|
||||
TMCJPEGDEC_converterYUV422toRGB565edge: 400 cases PASS; instruction coverage source 107/107, original 107/107
|
||||
TMCJPEGDEC_converterYUV420toRGB565: 100 cases PASS; instruction coverage source 141/141, original 141/141
|
||||
TMCJPEGDEC_converterYUV420toRGB565edge: 400 cases PASS; instruction coverage source 114/114, original 114/114
|
||||
TMCJPEGDEC_converterYUV211toRGB565: 100 cases PASS; instruction coverage source 98/98, original 98/98
|
||||
TMCJPEGDEC_converterYUV211toRGB565edge: 400 cases PASS; instruction coverage source 109/109, original 109/109
|
||||
TMCJPEGDEC_converterYUV444toRGB565: 100 cases PASS; instruction coverage source 91/91, original 91/91
|
||||
TMCJPEGDEC_converterYUV444toRGB565edge: 400 cases PASS; instruction coverage source 104/104, original 104/104
|
||||
TMCJPEGDEC_converterYUV400toRGB565: 100 cases PASS; instruction coverage source 51/70, original 51/70
|
||||
TMCJPEGDEC_converterYUV400toRGB565edge: 400 cases PASS; instruction coverage source 64/83, original 64/83
|
||||
TMCJPEGDEC_set_converterRGB565: 1024 cases PASS; instruction coverage source 168/169, original 169/170
|
||||
TMCJPEGDEC_IdctBlock_Lumi: 704 cases PASS; instruction coverage source 257/257, original 257/257
|
||||
TMCJPEGDEC_IdctBlock_Col: 704 cases PASS; instruction coverage source 454/454, original 454/454
|
||||
TOTAL: 9456 differential cases PASS; GPR14-GPR31, stack pointer and LR preserved
|
||||
319
tools/decomp-assist/jpeg_differential_audit.py
Normal file
319
tools/decomp-assist/jpeg_differential_audit.py
Normal file
@@ -0,0 +1,319 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Read-only, bounded PPC integer interpreter for differential JPEG checks.
|
||||
Loads source and original ELF .text; never copies original code into sources.
|
||||
Only memset is external. No FPU/system instructions are supported.
|
||||
"""
|
||||
import random
|
||||
import re
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
import capstone
|
||||
from elftools.elf.elffile import ELFFile
|
||||
U32 = 0xFFFFFFFF
|
||||
|
||||
def signed(x):
|
||||
x &= U32
|
||||
return x - 0x100000000 if x & 0x80000000 else x
|
||||
|
||||
def rotate(x, n):
|
||||
return (x << n | x >> (32 - n if n else 32)) & U32
|
||||
|
||||
def mask(b, e):
|
||||
return sum((1 << 31 - i for i in range(32) if b <= i <= e or (b > e and (i >= b or i <= e))))
|
||||
|
||||
def load_object(path):
|
||||
with open(path, 'rb') as f:
|
||||
e = ELFFile(f)
|
||||
section = e.get_section_by_name('.text')
|
||||
data = bytearray(section.data())
|
||||
syms = e.get_section_by_name('.symtab')
|
||||
calls = {}
|
||||
symbol_addresses = {}
|
||||
rel = e.get_section_by_name('.rela.text')
|
||||
if rel:
|
||||
for r in rel.iter_relocations():
|
||||
name = syms.get_symbol(r['r_info_sym']).name
|
||||
off = r['r_offset']
|
||||
typ = r['r_info_type']
|
||||
addr = 0x800000 + (zlib.crc32(name.encode()) & 0x7FFF) * 4 + r['r_addend']
|
||||
assert addr not in symbol_addresses or symbol_addresses[addr] == name
|
||||
symbol_addresses[addr] = name
|
||||
if typ == 10:
|
||||
calls[off] = name
|
||||
elif typ == 4:
|
||||
data[off:off + 2] = struct.pack('>H', addr & 65535)
|
||||
elif typ == 6:
|
||||
data[off:off + 2] = struct.pack('>H', addr + 0x8000 >> 16 & 65535)
|
||||
else:
|
||||
raise ValueError(('relocation', typ))
|
||||
dis = capstone.Cs(capstone.CS_ARCH_PPC, capstone.CS_MODE_32 | capstone.CS_MODE_BIG_ENDIAN)
|
||||
funcs = {}
|
||||
for sym in syms.iter_symbols():
|
||||
if sym['st_info']['type'] != 'STT_FUNC' or not sym['st_size']:
|
||||
continue
|
||||
start = sym['st_value']
|
||||
size = sym['st_size']
|
||||
inst = {}
|
||||
for i in dis.disasm(bytes(data[start:start + size]), start):
|
||||
ops = []
|
||||
for o in i.op_str.split(', '):
|
||||
if not o:
|
||||
continue
|
||||
if o.startswith('cr'):
|
||||
ops.append(('cr', int(o[2:])))
|
||||
elif o.startswith('r'):
|
||||
ops.append(int(o[1:]))
|
||||
elif '(' in o:
|
||||
off, reg = o.split('(')
|
||||
ops.append((int(off, 0), int(reg[1:-1])))
|
||||
else:
|
||||
ops.append(int(o, 0))
|
||||
inst[i.address] = (i.mnemonic, ops)
|
||||
funcs[sym.name] = (start, inst, calls)
|
||||
return funcs
|
||||
|
||||
def run(fn, initial, args):
|
||||
pc, ins, calls = fn
|
||||
mem = bytearray(initial)
|
||||
r = [i * 1122867 & U32 for i in range(32)]
|
||||
r[1] = 0x3F000
|
||||
r[3:3 + len(args)] = args
|
||||
saved_registers = r[14:].copy()
|
||||
cr = [0] * 8
|
||||
ctr = 0
|
||||
lr = 0
|
||||
steps = 0
|
||||
coverage = set()
|
||||
|
||||
def ld(a, n):
|
||||
assert 0 <= a <= len(mem) - n, hex(a)
|
||||
return int.from_bytes(mem[a:a + n], 'big')
|
||||
|
||||
def st(a, v, n):
|
||||
assert 0 <= a <= len(mem) - n, hex(a)
|
||||
mem[a:a + n] = (v & (1 << 8 * n) - 1).to_bytes(n, 'big')
|
||||
while True:
|
||||
steps += 1
|
||||
if steps > 100000:
|
||||
raise RuntimeError('step bound')
|
||||
coverage.add(pc)
|
||||
op, a = ins[pc]
|
||||
pc += 4
|
||||
dot = op.endswith('.')
|
||||
op = op.rstrip('.')
|
||||
val = None
|
||||
if op == 'blr':
|
||||
break
|
||||
elif op == 'bl':
|
||||
assert calls.get(pc - 4) == 'memset', calls.get(pc - 4)
|
||||
assert r[3] + r[5] <= len(mem)
|
||||
mem[r[3]:r[3] + r[5]] = bytes([r[4] & 255]) * r[5]
|
||||
# Model ABI-permitted call clobbers rather than preserving temporaries.
|
||||
for reg in [0] + list(range(4, 13)):
|
||||
r[reg] = (0xBAD00000 + reg) & U32
|
||||
for field in [0, 1, 5, 6, 7]:
|
||||
cr[field] = -1
|
||||
lr = pc
|
||||
elif op == 'b':
|
||||
pc = a[0]
|
||||
elif op == 'bdnz':
|
||||
ctr = ctr - 1 & U32
|
||||
if ctr:
|
||||
pc = a[0]
|
||||
elif op in ['beq', 'bne', 'ble', 'bge', 'blt', 'bgt']:
|
||||
c = cr[a[0][1]] if len(a) > 1 else cr[0]
|
||||
if {'beq': c == 0, 'bne': c != 0, 'ble': c <= 0, 'bge': c >= 0, 'blt': c < 0, 'bgt': c > 0}[op]:
|
||||
pc = a[-1]
|
||||
elif op in ['cmpwi', 'cmpw', 'cmplw']:
|
||||
c = a[0][1] if isinstance(a[0], tuple) else 0
|
||||
a = ins[pc - 4][1]
|
||||
if isinstance(a[0], tuple):
|
||||
a = a[1:]
|
||||
x = r[a[0]]
|
||||
y = a[1] if op == 'cmpwi' else r[a[1]]
|
||||
if op != 'cmplw':
|
||||
x = signed(x)
|
||||
y = signed(y)
|
||||
cr[c] = (x > y) - (x < y)
|
||||
elif op in ['lbz', 'lhz', 'lwz', 'lmw']:
|
||||
off, reg = a[1]
|
||||
addr = (r[reg] if reg else 0) + off & U32
|
||||
if op == 'lmw':
|
||||
for j in range(a[0], 32):
|
||||
r[j] = ld(addr + (j - a[0]) * 4, 4)
|
||||
else:
|
||||
r[a[0]] = ld(addr, {'lbz': 1, 'lhz': 2, 'lwz': 4}[op])
|
||||
elif op in ['stb', 'sth', 'stw', 'stwu', 'stmw']:
|
||||
off, reg = a[1]
|
||||
addr = (r[reg] if reg else 0) + off & U32
|
||||
if op == 'stmw':
|
||||
for j in range(a[0], 32):
|
||||
st(addr + (j - a[0]) * 4, r[j], 4)
|
||||
else:
|
||||
st(addr, r[a[0]], {'stb': 1, 'sth': 2, 'stw': 4, 'stwu': 4}[op])
|
||||
if op == 'stwu':
|
||||
r[reg] = addr
|
||||
elif op in ['stbx', 'sthx']:
|
||||
st((r[a[1]] if a[1] else 0) + r[a[2]] & U32, r[a[0]], 1 if op == 'stbx' else 2)
|
||||
elif op == 'mflr':
|
||||
r[a[0]] = lr
|
||||
elif op == 'mtlr':
|
||||
lr = r[a[0]]
|
||||
elif op == 'mtctr':
|
||||
ctr = r[a[0]]
|
||||
else:
|
||||
d = a[0]
|
||||
if op == 'li':
|
||||
val = a[1]
|
||||
elif op == 'lis':
|
||||
val = a[1] << 16
|
||||
elif op == 'mr':
|
||||
val = r[a[1]]
|
||||
elif op == 'add':
|
||||
val = r[a[1]] + r[a[2]]
|
||||
elif op == 'addi':
|
||||
val = (r[a[1]] if a[1] else 0) + a[2]
|
||||
elif op == 'addis':
|
||||
val = (r[a[1]] if a[1] else 0) + (a[2] << 16)
|
||||
elif op == 'subf':
|
||||
val = r[a[2]] - r[a[1]]
|
||||
elif op == 'subfic':
|
||||
val = a[2] - r[a[1]]
|
||||
elif op == 'mulli':
|
||||
val = r[a[1]] * a[2]
|
||||
elif op == 'mullw':
|
||||
val = r[a[1]] * r[a[2]]
|
||||
elif op == 'divw':
|
||||
x = signed(r[a[1]])
|
||||
y = signed(r[a[2]])
|
||||
val = abs(x) // abs(y) * (-1 if (x < 0) != (y < 0) else 1)
|
||||
elif op == 'or':
|
||||
val = r[a[1]] | r[a[2]]
|
||||
elif op == 'andc':
|
||||
val = r[a[1]] & ~r[a[2]]
|
||||
elif op == 'andi':
|
||||
val = r[a[1]] & a[2]
|
||||
elif op == 'neg':
|
||||
val = -r[a[1]]
|
||||
elif op == 'extsb':
|
||||
val = (r[a[1]] & 255) - (256 if r[a[1]] & 128 else 0)
|
||||
elif op == 'srawi':
|
||||
val = signed(r[a[1]]) >> a[2]
|
||||
elif op == 'srwi':
|
||||
val = r[a[1]] >> a[2]
|
||||
elif op == 'slwi':
|
||||
val = r[a[1]] << a[2]
|
||||
elif op == 'clrlwi':
|
||||
val = r[a[1]] & (1 << 32 - a[2]) - 1
|
||||
elif op == 'rotlwi':
|
||||
val = rotate(r[a[1]], a[2])
|
||||
elif op == 'rlwinm':
|
||||
val = rotate(r[a[1]], a[2]) & mask(a[3], a[4])
|
||||
else:
|
||||
raise ValueError((hex(pc - 4), op, a))
|
||||
r[d] = val & U32
|
||||
if dot:
|
||||
cr[0] = (signed(val) > 0) - (signed(val) < 0)
|
||||
assert r[1] == 0x3F000, 'Stack pointer not restored'
|
||||
assert lr == 0, 'Link register not restored'
|
||||
assert r[14:] == saved_registers, 'Nonvolatile registers not restored'
|
||||
return (mem, r[3], coverage)
|
||||
|
||||
def put(m, a, v, n=4):
|
||||
m[a:a + n] = (v & (1 << 8 * n) - 1).to_bytes(n, 'big')
|
||||
|
||||
def compare(src, orig, name, m, args, case, returns=False):
|
||||
a, ra, ca = run(src[name], m, args)
|
||||
b, rb, cb = run(orig[name], m, args)
|
||||
# The stack can differ because each implementation owns its frame.
|
||||
if a[:0x3E000] != b[:0x3E000]:
|
||||
diff = [hex(i) for i in range(0x3E000) if a[i] != b[i]][:12]
|
||||
raise AssertionError((name, case, 'memory mismatch', diff))
|
||||
if returns and ra != rb:
|
||||
raise AssertionError((name, case, 'return', ra, rb))
|
||||
return (ca, cb)
|
||||
|
||||
def main():
|
||||
total_cases = 0
|
||||
rng = random.Random(449529)
|
||||
root = 'build/43U/{}/libs/RVLMiddleware/TMC_JPEG/src/{}'
|
||||
for unit in ['texturecvtr/Texture_MCUtoRGBA8', 'texturecvtr/Texture_MCUtoRGB565', 'buffer/idct_block_var']:
|
||||
src = load_object(root.format('src', unit) + '.o')
|
||||
orig = load_object(root.format('obj', unit) + '.o')
|
||||
assert src.keys() == orig.keys(), (unit, 'Function sets differ')
|
||||
assert len(src) == (2 if unit.startswith('buffer/') else 13)
|
||||
for name in src:
|
||||
n = 0
|
||||
sa = set()
|
||||
sb = set()
|
||||
if 'IdctBlock' in name:
|
||||
for rows in range(1, 9):
|
||||
for cols in [1, 2, 3, 8]:
|
||||
for pattern in range(22):
|
||||
m = bytearray([0xA5]) * 0x40000
|
||||
block = [0] * 64
|
||||
for y in range(rows):
|
||||
for x in range(cols):
|
||||
if pattern < 6:
|
||||
block[y * 8 + x] = [0, 1, -1, 0x3FFFF, 0x40000, -0x40000][pattern] if x == 0 and y == 0 else 0
|
||||
elif pattern < 14:
|
||||
block[y * 8 + x] = rng.randrange(-10000, 10001) if rng.randrange(4) == 0 else 0
|
||||
else:
|
||||
block[y * 8 + x] = rng.randrange(-150000, 150001)
|
||||
for i, v in enumerate(block):
|
||||
put(m, 0x1000 + i * 4, v)
|
||||
pitch = [8, 16, 32][pattern % 3]
|
||||
args = [0x1000, 0x2000, pitch, rows << 4 | cols]
|
||||
ca, cb = compare(src, orig, name, m, args, (rows, cols, pattern))
|
||||
sa |= ca
|
||||
sb |= cb
|
||||
n += 1
|
||||
elif 'set_converter' in name:
|
||||
for component in range(256):
|
||||
for mode in [1, 2, 4, 8]:
|
||||
m = bytearray([0xA5]) * 0x40000
|
||||
work = 0x1000
|
||||
state = 0x4000
|
||||
put(m, work + 0x17FC, component, 1)
|
||||
put(m, work + 0x19DC, mode, 1)
|
||||
put(m, work + 0x19E4, state)
|
||||
put(m, state + 0x24, rng.randrange(65536), 2)
|
||||
put(m, state + 0x26, rng.randrange(65536), 2)
|
||||
ca, cb = compare(src, orig, name, m, [work], (component, mode), True)
|
||||
sa |= ca
|
||||
sb |= cb
|
||||
n += 1
|
||||
else:
|
||||
sampling = re.search('YUV(\\d+)to', name)[1]
|
||||
w, h = {'411': (32, 8), '422': (16, 8), '420': (16, 16), '211': (8, 16), '444': (8, 8), '400': (8, 8)}[sampling]
|
||||
for scale in [1, 2, 4, 8]:
|
||||
for pattern in range(25):
|
||||
for border in range(4 if name.endswith('edge') else 1):
|
||||
m = bytearray([0xA5]) * 0x40000
|
||||
work = 0x1000
|
||||
state = 0x4000
|
||||
tex = 0x8000
|
||||
x = 32 * (pattern % 2)
|
||||
y = 16 * (pattern % 3)
|
||||
ww = w // scale
|
||||
hh = h // scale
|
||||
put(m, work + 0x19E4, state)
|
||||
put(m, state + 0x20, scale, 1)
|
||||
put(m, state + 0x2C, 96)
|
||||
put(m, state + 0x48, tex)
|
||||
put(m, state + 0x18, x if border & 1 else x + 1)
|
||||
put(m, state + 0x1C, y if border & 2 else y + 1)
|
||||
put(m, state + 0x16, pattern % (ww + 1), 1)
|
||||
put(m, state + 0x17, pattern % (hh + 1), 1)
|
||||
for i in range(0x184):
|
||||
m[work + 0x1858 + i] = [0, 127, 128, 255][pattern % 4] if pattern < 4 else rng.randrange(256)
|
||||
ca, cb = compare(src, orig, name, m, [work, x, y], (scale, pattern, border))
|
||||
sa |= ca
|
||||
sb |= cb
|
||||
n += 1
|
||||
total_cases += n
|
||||
print(f'{name}: {n} cases PASS; instruction coverage source {len(sa)}/{len(src[name][1])}, original {len(sb)}/{len(orig[name][1])}', flush=True)
|
||||
print(f'TOTAL: {total_cases} differential cases PASS; GPR14-GPR31, stack pointer and LR preserved')
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
368
tools/decomp-assist/jpeg_exif_differential_audit.py
Normal file
368
tools/decomp-assist/jpeg_exif_differential_audit.py
Normal file
@@ -0,0 +1,368 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Read-only, bounded PPC integer interpreter for differential EXIF checks.
|
||||
Loads source and original ELF .text; never copies original code into sources.
|
||||
Only internal EXIF calls are supported. No FPU/system instructions are supported.
|
||||
"""
|
||||
import random
|
||||
import re
|
||||
import struct
|
||||
import zlib
|
||||
|
||||
import capstone
|
||||
from elftools.elf.elffile import ELFFile
|
||||
U32 = 0xFFFFFFFF
|
||||
|
||||
def signed(x):
|
||||
x &= U32
|
||||
return x - 0x100000000 if x & 0x80000000 else x
|
||||
|
||||
def rotate(x, n):
|
||||
return (x << n | x >> (32 - n if n else 32)) & U32
|
||||
|
||||
def mask(b, e):
|
||||
return sum((1 << 31 - i for i in range(32) if b <= i <= e or (b > e and (i >= b or i <= e))))
|
||||
|
||||
def load_object(path):
|
||||
with open(path, 'rb') as f:
|
||||
e = ELFFile(f)
|
||||
section = e.get_section_by_name('.text')
|
||||
data = bytearray(section.data())
|
||||
syms = e.get_section_by_name('.symtab')
|
||||
calls = {}
|
||||
symbol_addresses = {}
|
||||
rel = e.get_section_by_name('.rela.text')
|
||||
if rel:
|
||||
for r in rel.iter_relocations():
|
||||
name = syms.get_symbol(r['r_info_sym']).name
|
||||
off = r['r_offset']
|
||||
typ = r['r_info_type']
|
||||
addr = 0x800000 + (zlib.crc32(name.encode()) & 0x7FFF) * 4 + r['r_addend']
|
||||
assert addr not in symbol_addresses or symbol_addresses[addr] == name
|
||||
symbol_addresses[addr] = name
|
||||
if typ == 10:
|
||||
calls[off] = name
|
||||
elif typ == 4:
|
||||
data[off:off + 2] = struct.pack('>H', addr & 65535)
|
||||
elif typ == 6:
|
||||
data[off:off + 2] = struct.pack('>H', addr + 0x8000 >> 16 & 65535)
|
||||
else:
|
||||
raise ValueError(('relocation', typ))
|
||||
dis = capstone.Cs(capstone.CS_ARCH_PPC, capstone.CS_MODE_32 | capstone.CS_MODE_BIG_ENDIAN)
|
||||
funcs = {}
|
||||
for sym in syms.iter_symbols():
|
||||
if sym['st_info']['type'] != 'STT_FUNC' or not sym['st_size']:
|
||||
continue
|
||||
start = sym['st_value']
|
||||
size = sym['st_size']
|
||||
inst = {}
|
||||
for i in dis.disasm(bytes(data[start:start + size]), start):
|
||||
ops = []
|
||||
for o in i.op_str.split(', '):
|
||||
if not o:
|
||||
continue
|
||||
if o.startswith('cr'):
|
||||
ops.append(('cr', int(o[2:])))
|
||||
elif o.startswith('r'):
|
||||
ops.append(int(o[1:]))
|
||||
elif '(' in o:
|
||||
off, reg = o.split('(')
|
||||
ops.append((int(off, 0), int(reg[1:-1])))
|
||||
else:
|
||||
ops.append(int(o, 0))
|
||||
inst[i.address] = (i.mnemonic, ops)
|
||||
funcs[sym.name] = (start, inst, calls)
|
||||
return funcs
|
||||
|
||||
def run(functions, name, initial, args):
|
||||
pc = functions[name][0]
|
||||
ins = {address: instruction for _, body, _ in functions.values() for address, instruction in body.items()}
|
||||
calls = functions[name][2]
|
||||
mem = bytearray(initial)
|
||||
r = [i * 1122867 & U32 for i in range(32)]
|
||||
r[1] = 0x3F000
|
||||
r[3:3 + len(args)] = args
|
||||
saved_registers = r[14:].copy()
|
||||
cr = [0] * 8
|
||||
ctr = 0
|
||||
lr = 0
|
||||
steps = 0
|
||||
coverage = set()
|
||||
|
||||
def ld(a, n):
|
||||
assert 0 <= a <= len(mem) - n, hex(a)
|
||||
return int.from_bytes(mem[a:a + n], 'big')
|
||||
|
||||
def st(a, v, n):
|
||||
assert 0 <= a <= len(mem) - n, hex(a)
|
||||
mem[a:a + n] = (v & (1 << 8 * n) - 1).to_bytes(n, 'big')
|
||||
while True:
|
||||
steps += 1
|
||||
if steps > 100000:
|
||||
raise RuntimeError('step bound')
|
||||
coverage.add(pc)
|
||||
op, a = ins[pc]
|
||||
pc += 4
|
||||
dot = op.endswith('.')
|
||||
op = op.rstrip('.')
|
||||
val = None
|
||||
if op == 'blr':
|
||||
if lr == 0:
|
||||
break
|
||||
pc = lr
|
||||
elif op == 'bl':
|
||||
callee = calls.get(pc - 4)
|
||||
assert callee in functions, ('Unsupported external call', callee)
|
||||
lr = pc
|
||||
pc = functions[callee][0]
|
||||
elif op == 'b':
|
||||
pc = a[0]
|
||||
elif op == 'bdnz':
|
||||
ctr = ctr - 1 & U32
|
||||
if ctr:
|
||||
pc = a[0]
|
||||
elif op in ['beqlr', 'bnelr', 'blelr', 'bgelr', 'bltlr', 'bgtlr']:
|
||||
c = cr[a[0][1]] if a else cr[0]
|
||||
condition = {'beqlr': c == 0, 'bnelr': c != 0, 'blelr': c <= 0, 'bgelr': c >= 0, 'bltlr': c < 0, 'bgtlr': c > 0}[op]
|
||||
if condition:
|
||||
if lr == 0:
|
||||
break
|
||||
pc = lr
|
||||
elif op in ['beq', 'bne', 'ble', 'bge', 'blt', 'bgt']:
|
||||
c = cr[a[0][1]] if len(a) > 1 else cr[0]
|
||||
if {'beq': c == 0, 'bne': c != 0, 'ble': c <= 0, 'bge': c >= 0, 'blt': c < 0, 'bgt': c > 0}[op]:
|
||||
pc = a[-1]
|
||||
elif op in ['cmpwi', 'cmpw', 'cmplw', 'cmplwi']:
|
||||
c = a[0][1] if isinstance(a[0], tuple) else 0
|
||||
a = ins[pc - 4][1]
|
||||
if isinstance(a[0], tuple):
|
||||
a = a[1:]
|
||||
x = r[a[0]]
|
||||
y = a[1] if op in ['cmpwi', 'cmplwi'] else r[a[1]]
|
||||
if op not in ['cmplw', 'cmplwi']:
|
||||
x = signed(x)
|
||||
y = signed(y)
|
||||
cr[c] = (x > y) - (x < y)
|
||||
elif op in ['lbz', 'lhz', 'lwz', 'lmw']:
|
||||
off, reg = a[1]
|
||||
addr = (r[reg] if reg else 0) + off & U32
|
||||
if op == 'lmw':
|
||||
for j in range(a[0], 32):
|
||||
r[j] = ld(addr + (j - a[0]) * 4, 4)
|
||||
else:
|
||||
r[a[0]] = ld(addr, {'lbz': 1, 'lhz': 2, 'lwz': 4}[op])
|
||||
elif op in ['stb', 'sth', 'stw', 'stwu', 'stmw']:
|
||||
off, reg = a[1]
|
||||
addr = (r[reg] if reg else 0) + off & U32
|
||||
if op == 'stmw':
|
||||
for j in range(a[0], 32):
|
||||
st(addr + (j - a[0]) * 4, r[j], 4)
|
||||
else:
|
||||
st(addr, r[a[0]], {'stb': 1, 'sth': 2, 'stw': 4, 'stwu': 4}[op])
|
||||
if op == 'stwu':
|
||||
r[reg] = addr
|
||||
elif op in ['stbx', 'sthx']:
|
||||
st((r[a[1]] if a[1] else 0) + r[a[2]] & U32, r[a[0]], 1 if op == 'stbx' else 2)
|
||||
elif op == 'mflr':
|
||||
r[a[0]] = lr
|
||||
elif op == 'mtlr':
|
||||
lr = r[a[0]]
|
||||
elif op == 'mtctr':
|
||||
ctr = r[a[0]]
|
||||
else:
|
||||
d = a[0]
|
||||
if op == 'li':
|
||||
val = a[1]
|
||||
elif op == 'lis':
|
||||
val = a[1] << 16
|
||||
elif op == 'mr':
|
||||
val = r[a[1]]
|
||||
elif op == 'add':
|
||||
val = r[a[1]] + r[a[2]]
|
||||
elif op == 'addi':
|
||||
val = (r[a[1]] if a[1] else 0) + a[2]
|
||||
elif op == 'addis':
|
||||
val = (r[a[1]] if a[1] else 0) + (a[2] << 16)
|
||||
elif op == 'subf':
|
||||
val = r[a[2]] - r[a[1]]
|
||||
elif op == 'subfic':
|
||||
val = a[2] - r[a[1]]
|
||||
elif op == 'mulli':
|
||||
val = r[a[1]] * a[2]
|
||||
elif op == 'mullw':
|
||||
val = r[a[1]] * r[a[2]]
|
||||
elif op == 'divw':
|
||||
x = signed(r[a[1]])
|
||||
y = signed(r[a[2]])
|
||||
val = abs(x) // abs(y) * (-1 if (x < 0) != (y < 0) else 1)
|
||||
elif op == 'or':
|
||||
val = r[a[1]] | r[a[2]]
|
||||
elif op == 'andc':
|
||||
val = r[a[1]] & ~r[a[2]]
|
||||
elif op == 'andi':
|
||||
val = r[a[1]] & a[2]
|
||||
elif op == 'neg':
|
||||
val = -r[a[1]]
|
||||
elif op == 'extsb':
|
||||
val = (r[a[1]] & 255) - (256 if r[a[1]] & 128 else 0)
|
||||
elif op == 'srawi':
|
||||
val = signed(r[a[1]]) >> a[2]
|
||||
elif op == 'srwi':
|
||||
val = r[a[1]] >> a[2]
|
||||
elif op == 'slwi':
|
||||
val = r[a[1]] << a[2]
|
||||
elif op == 'clrlwi':
|
||||
val = r[a[1]] & (1 << 32 - a[2]) - 1
|
||||
elif op == 'rotlwi':
|
||||
val = rotate(r[a[1]], a[2])
|
||||
elif op == 'rlwimi':
|
||||
bits = mask(a[3], a[4])
|
||||
val = (r[d] & ~bits) | (rotate(r[a[1]], a[2]) & bits)
|
||||
elif op == 'rlwinm':
|
||||
val = rotate(r[a[1]], a[2]) & mask(a[3], a[4])
|
||||
else:
|
||||
raise ValueError((hex(pc - 4), op, a))
|
||||
r[d] = val & U32
|
||||
if dot:
|
||||
cr[0] = (signed(val) > 0) - (signed(val) < 0)
|
||||
assert r[1] == 0x3F000, 'Stack pointer not restored'
|
||||
assert lr == 0, 'Link register not restored'
|
||||
assert r[14:] == saved_registers, 'Nonvolatile registers not restored'
|
||||
return (mem, r[3], coverage)
|
||||
|
||||
def put(m, a, v, n=4):
|
||||
m[a:a + n] = (v & (1 << 8 * n) - 1).to_bytes(n, 'big')
|
||||
|
||||
def compare(src, orig, name, m, args, case, returns=False):
|
||||
a, ra, ca = run(src, name, m, args)
|
||||
b, rb, cb = run(orig, name, m, args)
|
||||
# The stack can differ because each implementation owns its frame.
|
||||
if a[:0x3E000] != b[:0x3E000]:
|
||||
diff = [hex(i) for i in range(0x3E000) if a[i] != b[i]][:12]
|
||||
raise AssertionError((name, case, 'memory mismatch', diff))
|
||||
if returns and ra != rb:
|
||||
raise AssertionError((name, case, 'return', ra, rb))
|
||||
return (ca, cb)
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
from collections import defaultdict
|
||||
path = 'build/43U/{}/libs/RVLMiddleware/TMC_JPEG/src/exif/exif_parse.o'
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--source-object', default=path.format('src'))
|
||||
parser.add_argument('--target-object', default=path.format('obj'))
|
||||
parser.add_argument('--overlap-only', action='store_true')
|
||||
args = parser.parse_args()
|
||||
src = load_object(args.source_object)
|
||||
orig = load_object(args.target_object)
|
||||
assert src.keys() == orig.keys()
|
||||
assert len(src) == 6
|
||||
names = ['TMCJPEGDEC_IFD0_tag_parse', 'TMCJPEGDEC_IFD1_tag_parse', 'TMCJPEGDEC_exif_parse']
|
||||
coverage = {name: [set(), set()] for name in names}
|
||||
counts = defaultdict(int)
|
||||
rng = random.Random(449529)
|
||||
info, entry, data = 0x1000, 0x2000, 0x3000
|
||||
memory = bytearray([0xA5]) * 0x40000
|
||||
memory[data:data + 0x2000] = bytes(rng.randrange(256) for _ in range(0x2000))
|
||||
put(memory, info + 0x674, data)
|
||||
put(memory, info + 0x678, data + 0x1000)
|
||||
|
||||
def exif_put(m, pos, value, size, order):
|
||||
m[pos:pos + size] = (value & ((1 << (8 * size)) - 1)).to_bytes(size, 'little' if order == 0x4949 else 'big')
|
||||
|
||||
def check(name, m, args, case, returns=False):
|
||||
ca, cb = compare(src, orig, name, m, args, case, returns)
|
||||
coverage[name][0].update(ca)
|
||||
coverage[name][1].update(cb)
|
||||
counts[name] += 1
|
||||
|
||||
for order in [0x4949, 0x4D4D]:
|
||||
for tag, offset in [(0x9000, 0x63C), (0x9101, 0x640), (0xA000, 0x644)]:
|
||||
for delta in range(-3, 4):
|
||||
m = bytearray(memory)
|
||||
destination = info + offset
|
||||
aliased_entry = destination + delta - 8
|
||||
exif_put(m, aliased_entry, tag, 2, order)
|
||||
m[aliased_entry + 8:aliased_entry + 12] = bytes([1, 2, 3, 4])
|
||||
check(names[0], m, [info, order, aliased_entry], ('overlapping-version-bytes', order, tag, delta))
|
||||
|
||||
if args.overlap_only:
|
||||
print('TOTAL', sum(counts.values()), 'overlapping version-byte calls PASS')
|
||||
return
|
||||
|
||||
for name in names[:2]:
|
||||
selector_start = counts[name]
|
||||
for order in [0x4949, 0x4D4D]:
|
||||
exif_put(memory, entry + 2, 4, 2, order)
|
||||
exif_put(memory, entry + 4, 1, 4, order)
|
||||
exif_put(memory, entry + 8, 0x100, 4, order)
|
||||
for tag in range(0x10000):
|
||||
exif_put(memory, entry, tag, 2, order)
|
||||
check(name, memory, [info, order, entry], ('all-tags', order, tag))
|
||||
print(name, counts[name] - selector_start, 'selector cases PASS', flush=True)
|
||||
for order in [0x4949, 0x4D4D]:
|
||||
for tag in [0x103, 0x112, 0x11A, 0x11B, 0x128, 0x12D, 0x132, 0x201, 0x202, 0x213, 0x8769, 0x9000, 0x9101, 0xA000, 0xA001, 0xA002, 0xA003]:
|
||||
exif_put(memory, entry, tag, 2, order)
|
||||
for field_type in [0, 3, 4, 0xFFFF]:
|
||||
exif_put(memory, entry + 2, field_type, 2, order)
|
||||
for offset in [0, 1, 0xFF0, 0xFEC, 0xFF8, 0xFFC, 0xFFE, 0xFFF, 0x1000, 0x1001, 0xFFFFFFFF, 0xFFFFD000]:
|
||||
exif_put(memory, entry + 8, offset, 4, order)
|
||||
check(name, memory, [info, order, entry], ('bounds', order, tag, field_type, offset))
|
||||
|
||||
name = names[2]
|
||||
for order in [0x4949, 0x4D4D, 0, 0x1234]:
|
||||
for size in [0, 1, 7, 8, 9, 10, 13, 14, 25, 26, 40, 64, 128, 0x1000]:
|
||||
for ifd_offset in [0, 2, 8, 10, 0x1000, 0xFFFFFFFF]:
|
||||
for count in [0, 1, 2, 0xFFFF]:
|
||||
m = bytearray(memory)
|
||||
m[data:data + 0x1000] = bytes(0x1000)
|
||||
exif_put(m, data, order, 2, order)
|
||||
exif_put(m, data + 2, 42, 2, order)
|
||||
exif_put(m, data + 4, ifd_offset, 4, order)
|
||||
if 8 <= ifd_offset < 0x1000:
|
||||
exif_put(m, data + ifd_offset, count, 2, order)
|
||||
check(name, m, [data, size, info], ('header-bounds', order, size, ifd_offset, count), True)
|
||||
|
||||
for order in [0x4949, 0x4D4D]:
|
||||
for magic in [0, 41, 43, 0xFFFF]:
|
||||
m = bytearray(memory)
|
||||
exif_put(m, data, order, 2, order)
|
||||
exif_put(m, data + 2, magic, 2, order)
|
||||
check(name, m, [data, 128, info], ('invalid-TIFF-magic', order, magic), True)
|
||||
|
||||
for order in [0x4949, 0x4D4D]:
|
||||
for count0 in [0, 1, 2, 3]:
|
||||
for count1 in [0, 1, 2, 3]:
|
||||
for size in [40, 64, 65, 66, 70, 79, 80, 100, 128, 129, 130, 140, 144, 160, 256]:
|
||||
m = bytearray(memory)
|
||||
m[data:data + 0x1000] = bytes(0x1000)
|
||||
exif_put(m, data, order, 2, order)
|
||||
exif_put(m, data + 2, 42, 2, order)
|
||||
exif_put(m, data + 4, 8, 4, order)
|
||||
exif_put(m, data + 8, count0, 2, order)
|
||||
for index, tag in enumerate([0x112, 0xA002, 0x8769][:count0]):
|
||||
pos = data + 10 + index * 12
|
||||
exif_put(m, pos, tag, 2, order)
|
||||
exif_put(m, pos + 2, 4, 2, order)
|
||||
exif_put(m, pos + 8, 128 if tag == 0x8769 else 3, 4, order)
|
||||
exif_put(m, data + 10 + count0 * 12, 64, 4, order)
|
||||
exif_put(m, data + 64, count1, 2, order)
|
||||
for index, tag in enumerate([0x103, 0x201, 0x202][:count1]):
|
||||
pos = data + 66 + index * 12
|
||||
exif_put(m, pos, tag, 2, order)
|
||||
exif_put(m, pos + 2, 4, 2, order)
|
||||
exif_put(m, pos + 8, 6, 4, order)
|
||||
exif_put(m, data + 128, 1, 2, order)
|
||||
exif_put(m, data + 130, 0xA003, 2, order)
|
||||
exif_put(m, data + 132, 4, 2, order)
|
||||
exif_put(m, data + 138, 640, 4, order)
|
||||
check(name, m, [data, size, info], ('directory-chain', order, count0, count1, size), True)
|
||||
|
||||
for name in names:
|
||||
source_body = set(src[name][1])
|
||||
original_body = set(orig[name][1])
|
||||
print(name, counts[name], 'cases PASS; own-body instruction coverage', len(coverage[name][0] & source_body), '/', len(source_body), 'source;', len(coverage[name][1] & original_body), '/', len(original_body), 'original', flush=True)
|
||||
print('TOTAL', sum(counts.values()), 'paired EXIF calls PASS')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
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.
|
||||
1334
tools/decomp-assist/perm7.attempts.md
Normal file
1334
tools/decomp-assist/perm7.attempts.md
Normal file
File diff suppressed because it is too large
Load Diff
139
tools/decomp-assist/perm8.attempts.md
Normal file
139
tools/decomp-assist/perm8.attempts.md
Normal file
@@ -0,0 +1,139 @@
|
||||
# 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
|
||||
```
|
||||
51
tools/decomp-assist/run-fixed-stack.attempts.md
Normal file
51
tools/decomp-assist/run-fixed-stack.attempts.md
Normal file
@@ -0,0 +1,51 @@
|
||||
# Run fixed-stack relocation correction
|
||||
|
||||
This is a narrow follow-up to #973, not another Run implementation or a new
|
||||
match. The existing assembly, cache loop, register clearing, labels and handoff
|
||||
remain intact. No linking flag changes.
|
||||
|
||||
## Evidence
|
||||
|
||||
The hash-verified original DOL and linked ELF contain Run at 0x8137B3EC,
|
||||
size 0xAC (43 instructions). Its instructions at 0x8137B468/0x8137B46C establish
|
||||
SP as 0x81600000. This architectural stack value should not depend on placement
|
||||
of an unrelated formatted-output routine.
|
||||
|
||||
Automatic extraction had attached two relocations to __pformatter + 0x280:
|
||||
R_PPC_ADDR16_HI at Run+0x7E and R_PPC_ADDR16_LO at Run+0x82. The linked formatter
|
||||
address happens to make this expression equal 0x81600000 in this target, but
|
||||
that is a false semantic dependency in the reconstruction.
|
||||
|
||||
DTK block_relocations uses instruction addresses, not ELF halfword offsets.
|
||||
The two exclusions are therefore .text:0x8137B468 and .text:0x8137B46C.
|
||||
The source removes the unrelated extern and uses the fixed high/low immediate.
|
||||
No other source instructions or original bytes are replaced.
|
||||
|
||||
## Independent validation
|
||||
|
||||
- Full 43U all_source, progress, report and DOL check pass.
|
||||
- Original app and rebuilt DOL SHA1 both remain
|
||||
26116613f624061ba99c8d1a299aaa6efa85670d.
|
||||
- Run remains 100%, 43/43 instructions, ctxdiff zero. No new match attribution.
|
||||
- Whole report is unchanged: no code, data, function, linking or fuzzy delta.
|
||||
- Pool: all 91 strings identical.
|
||||
- All 1027 native source objects compared: only BS2Mach .text changes; size
|
||||
16960 is unchanged. Exactly the two false text relocations are removed.
|
||||
All other allocated objects and data sections are unchanged.
|
||||
- All 1027 active extracted objects compared, plus the same obsolete cached
|
||||
tiManager.o in both trees. Only BS2Mach .text changes: size 16980 unchanged;
|
||||
only Run's high immediate placeholder bytes at +0x7E/+0x7F become 0x81,0x60.
|
||||
Exactly the two formatter relocations disappear, with no added relocations.
|
||||
Defined target symbols and non-text sections stay unchanged.
|
||||
- Supplemental integer-PPC contract model checks the compiled source for 1,
|
||||
4 and 131072 cache lines, preserved LR entry, SP 0x81600000, cleared GPRs and
|
||||
alternating dcbz/dcbf events. The zero-count prefix retains the original CTR
|
||||
wrap to 0xFFFFFFFF; the full 2^32-iteration path is not executed. This is an
|
||||
abstract contract test, not actual cache/MMIO or console execution.
|
||||
- Workflow/literal/jump-table/pool tests: 8/36/27/8 passed.
|
||||
- Diff check passes.
|
||||
|
||||
Assembly was already introduced by #973. The original isolated full-Run
|
||||
experiment is deliberately not included here. This correction adds no new
|
||||
assembly instructions, forced register uses, retail .s objects or padding.
|
||||
Please review the metadata/source constant attribution explicitly.
|
||||
70
tools/decomp-assist/sd-selection-event-predicate-20261003.md
Normal file
70
tools/decomp-assist/sd-selection-event-predicate-20261003.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# SD channel event predicate correction, 2026-10-03
|
||||
|
||||
Separate follow-on to eac8c5d6 (scissor reconstruction), on baseline b9407106.
|
||||
Only four call sites in SDChannelSelectEventHandler::onEvent change.
|
||||
No headers, metadata, other source units, constructor aliases or linking change.
|
||||
|
||||
## Original binary evidence
|
||||
|
||||
Independently parsed the DOL section table in orig/43U/00000008.app, verified
|
||||
SHA1 26116613f624061ba99c8d1a299aaa6efa85670d, and decoded the signed relative
|
||||
branch displacement at each call. No symbol-name or objdiff assumption was
|
||||
used to select the destinations.
|
||||
|
||||
onEvent begins at 0x813E28B4. Its calls at offsets 0x124, 0x1DC, 0x218 and
|
||||
0x270 (addresses 0x813E29D8, 0x813E2A90, 0x813E2ACC, 0x813E2B24) all branch
|
||||
to 0x813E3330. The raw callee reads the channel word at offset 0x84 and
|
||||
returns true for values zero or three. The extracted object relocations
|
||||
independently name iplSDChannelObj_hasAppMeta at all four calls, and its
|
||||
source reads mStateFlags with those same tests.
|
||||
|
||||
The old source instead calls isChannelReady, whose original address is
|
||||
0x813DF1E4. That raw callee reads offset 0x14 and returns true only for three.
|
||||
Its source tests mState == 3. These are distinct fields and predicates, not
|
||||
interchangeable aliases. Restore hasAppMeta for trigger, drag, point and
|
||||
leave event dispatch. Keep every existing event/state/controller/card guard.
|
||||
|
||||
For the separately observed constructor-name mismatches, raw original bodies
|
||||
at 0x81362A5C and 0x81374884 are byte-identical. No constructor change is made
|
||||
merely to alter names. Existing vtable placement/binding differences also
|
||||
remain outside this patch.
|
||||
|
||||
## Measurement and verification
|
||||
|
||||
- onEvent was reported 100% before this correction and remains 100%; no
|
||||
progress credit is claimed for the semantic repair
|
||||
- Relocation-aware ctxdiff improves four differences -> zero, 168/168 instructions
|
||||
- Compared to eac8c5d6, only the four call relocations change; every other
|
||||
function's normalized instructions/relocations remain identical
|
||||
- All allocated section bytes, including raw .text, remain identical to
|
||||
eac8c5d6; this is why relocation targets must be checked separately
|
||||
- The complete project report is identical to the scissor candidate
|
||||
- Unit remains 122/129 reported-exact, code 29412/33828, data 2960/2960,
|
||||
fuzzy 99.749435%; setChannelScissor remains 99.5279%
|
||||
- Full 43U all_source/report/ok build passes
|
||||
- Pool identical, 101/101; literal audit 73 arguments across 122 functions,
|
||||
no skips/candidates/errors
|
||||
- DOL SHA1 remains 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
## Distinguishing tests
|
||||
|
||||
The native C++ harness extracts the old/new handler bodies and supplies
|
||||
local event/controller/scene mocks. The two predicates use the independently
|
||||
verified field tests. GCC -O2 -Wall -Wextra -Werror (excluding the preexisting
|
||||
unused label warning), with UBSan enabled, passes 198 cases.
|
||||
|
||||
Six channel-state values, eight state-flag values and all four events give
|
||||
192 combinations, including 64 cases where the old predicate dispatched
|
||||
differently. State 0 with flags 0 is accepted by the original predicate;
|
||||
state 3 with flags 2 is rejected. Six additional checks preserve the scene,
|
||||
broken-card and write-protection guards. These are focused handler tests,
|
||||
not a UI or console integration test.
|
||||
|
||||
Local tools: /tmp/sdselection-dol-audit.py and
|
||||
/tmp/sdselection-event-test.cpp (executable without .cpp).
|
||||
No original binary or disassembly is committed.
|
||||
|
||||
GATE: raw-DOL/relocation destination agreement, exact corrected function,
|
||||
complete-report and other-function preservation, pool/literals/data,
|
||||
focused event tests, full 43U build and DOL checks pass.
|
||||
66
tools/decomp-assist/sd-selection-scissor-20261003.md
Normal file
66
tools/decomp-assist/sd-selection-scissor-20261003.md
Normal file
@@ -0,0 +1,66 @@
|
||||
# SD channel scissor reconstruction, 2026-10-03
|
||||
|
||||
Baseline b9407106. Read AGENTS and the prior SD selection, fz16, scene4,
|
||||
data-d5, and structural-round attempt records. Only the owned SD selection
|
||||
source and this evidence file change; no header or linking changes.
|
||||
|
||||
## Retained expression reconstruction
|
||||
|
||||
- Express each orthographic bound directly from position and the projection
|
||||
quotient, rather than keeping four extra quotient temporaries.
|
||||
- Keep the input projection width distinct from the output scissor width.
|
||||
- Calculate transformed X before Y and use the width quotient directly,
|
||||
removing the one-use widthScale temporary.
|
||||
|
||||
These ordinary expressions also occur in the sibling ChannelSelect routine.
|
||||
The arithmetic grouping is preserved. The original framebuffer conversion,
|
||||
projection and transformed-bound sequence is recovered; no register sweep or
|
||||
allocation directive was used.
|
||||
|
||||
setChannelScissor: 93.4721% -> 99.14163% with separated projection width and
|
||||
X/Y calculations, then -> 99.5279% with direct orthographic bounds.
|
||||
233/233 instructions throughout. Fifteen register substitutions remain,
|
||||
primarily exchanging the X and width values. Unit fuzzy:
|
||||
99.582596% -> 99.749435%. Exact code stays 29412/33828, functions 122/129,
|
||||
and data 2960/2960. All other functions and all other units are unchanged.
|
||||
|
||||
collectTitlesBySpecialChannels remains unchanged. The 361/361-instruction
|
||||
comparison has four repeated count-store/threshold-load schedules, 16 total
|
||||
instruction differences. Lookup arguments, special-title constants, reverse
|
||||
NAND and cache traversal, 42-byte names, 64-bit title writes, usage additions,
|
||||
and threshold exits agree. No new qualifier or forced alias barrier was used.
|
||||
|
||||
## Verification
|
||||
|
||||
- Configured 43U with ../toolchain/wibo-build/wibo
|
||||
- Full all_source/report/ok build passes
|
||||
- Pool identical, 101/101 strings
|
||||
- Literal audit: 73 arguments in 122 reported-exact functions, no skips/errors
|
||||
- Every reported-exact function is instruction/relocation-identical to the
|
||||
baseline; 117 also have zero ctxdiff against the original
|
||||
- Five preexisting reported-exact functions have relocation differences:
|
||||
constructor and createBaseLayout vtable offsets/binding, draw and
|
||||
getChannelPanePosition VEC3 constructor family, and four onEvent predicate
|
||||
calls. The predicate calls test different fields and were reported to the
|
||||
parent immediately for a separate correction; no claim that all 122
|
||||
functions are semantically exact is made
|
||||
- Every allocated non-code section is byte-identical to the baseline
|
||||
- Complete report comparison: only setChannelScissor improves; no regression
|
||||
- DOL SHA1 26116613f624061ba99c8d1a299aaa6efa85670d
|
||||
- git diff --check passes
|
||||
|
||||
The native C++ harness uses the extracted before/after function bodies with
|
||||
local matrix/render-mode shims and captured GX calls. With floating-point
|
||||
contraction disabled and UBSan/float-cast checks enabled, 250000 finite cases
|
||||
pass, including all three transformed states, ordinary states, framebuffer
|
||||
boundaries up to the existing 1705 clip cap, and 219852 fully clipped cases.
|
||||
All orthographic bounds are bit-identical and all four GX arguments agree.
|
||||
This checks the local equations and clipping, not the Wii rendering pipeline.
|
||||
An initial out-of-domain test with 65535-wide framebuffers reproduced an
|
||||
existing negative-to-unsigned clipping conversion; that domain is excluded
|
||||
from the equivalence test, not changed in production.
|
||||
|
||||
Local harness: /tmp/sdselection-scissor-test.cpp, executable without .cpp.
|
||||
GATE: full build, DOL, pool, literal, data/exact preservation, report
|
||||
nonregression and focused numeric tests pass. Known preexisting relocation
|
||||
false positives are recorded above and require separate review.
|
||||
63
tools/progress_badges.py
Normal file
63
tools/progress_badges.py
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Write shields.io endpoint JSON files from an objdiff report.
|
||||
|
||||
usage: progress_badges.py <report.json> <out-dir>
|
||||
|
||||
The README badges read these files from the progress-data branch, so the
|
||||
numbers update without committing to main.
|
||||
"""
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
|
||||
COLOR = "33b8ff"
|
||||
DONE_COLOR = "brightgreen"
|
||||
|
||||
|
||||
def badge(label, message, done):
|
||||
return {
|
||||
"schemaVersion": 1,
|
||||
"label": label,
|
||||
"message": message,
|
||||
"color": DONE_COLOR if done else COLOR,
|
||||
"labelColor": "7c7c7c",
|
||||
"style": "plastic",
|
||||
}
|
||||
|
||||
|
||||
def percent(measures, key):
|
||||
value = float(measures.get(key) or 0.0)
|
||||
return f"{value:.2f}%", value >= 100.0
|
||||
|
||||
|
||||
def count(measures, done_key, total_key):
|
||||
done = int(measures.get(done_key) or 0)
|
||||
total = int(measures.get(total_key) or 0)
|
||||
return f"{done:,} / {total:,}", total > 0 and done == total
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 3:
|
||||
raise SystemExit(__doc__)
|
||||
report_path, out_dir = sys.argv[1], sys.argv[2]
|
||||
measures = json.load(open(report_path))["measures"]
|
||||
|
||||
badges = {
|
||||
"decompiled": ("Decompiled", percent(measures, "fuzzy_match_percent")),
|
||||
"matched": ("Matched", percent(measures, "matched_code_percent")),
|
||||
"linked": ("Linked", percent(measures, "complete_code_percent")),
|
||||
"data": ("Data", percent(measures, "matched_data_percent")),
|
||||
"functions": ("Functions", count(measures, "matched_functions", "total_functions")),
|
||||
"units": ("Units", count(measures, "complete_units", "total_units")),
|
||||
}
|
||||
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
for name, (label, (message, done)) in badges.items():
|
||||
with open(os.path.join(out_dir, f"{name}.json"), "w", encoding="utf-8") as f:
|
||||
json.dump(badge(label, message, done), f)
|
||||
f.write("\n")
|
||||
print(f"{label}: {message}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user