Compare commits

..

1 Commits

Author SHA1 Message Date
coah
fb2b60534b Decompile hardware keyboard input dispatch 2026-10-01 19:51:18 -05:00
22 changed files with 637 additions and 867 deletions

164
AGENTS.md
View File

@@ -164,8 +164,9 @@ This repository targets only Wii Menu 4.3U. Do not configure or build 43E,
43J, or 43K while doing matching work.
Most workers should pursue exact matching or safe linking; assign the remainder
to decompilation. Keep every worker slot busy (currently four Codex slots; see
"Orchestrator loop" below). Fill completed slots with disjoint tasks. Never duplicate a source file or function
to decompilation. Keep up to 75 live workers when the runtime allows it, while
reserving capacity for fixer and validation workers. Fill completed slots with
disjoint tasks. Never duplicate a source file or function
range. Workers return changed paths, exact objdiff measurements, and validation
results. Fuzzy-only results are not accepted.
@@ -245,12 +246,6 @@ and merge the PR, fast-forward `origin/main`, and publish progress. If a
candidate fails validation, return it to its worker; do not fix the candidate
inline in the orchestrator.
Two exceptions, both set by the human: once a leaf has failed at `max` effort
(see the effort scale below) the orchestrator itself takes a crack at it, and
the orchestrator may finish PRs whose authors are gone (rebase, drop a
forbidden pattern, close with evidence). Record every such attempt in the
policy log, including the ones that fail.
A new thread must begin by reading this file, checking the live 43U report and
remote branch, and dispatching the worker pool. The parent must not claim a
match without fresh independent verification.
@@ -325,159 +320,6 @@ Linked: <percent> | Fuzzy: <percent> | Data: <percent>
Do not report stale values, unmerged PR results, or add other text to that
update. Continue all required verification and coordination silently.
## Orchestrator loop (Claude orchestrator, Codex workers)
This is the loop currently in use. One Claude session is the orchestrator.
It does not spawn Claude subagents. All decompilation work goes to Codex CLI
workers running `gpt-6.1-sol`. The orchestrator assigns leaves, verifies,
lands, reviews outside PRs, and only decompiles by hand in the cases listed
under the ownership boundary above.
Only one orchestrator session may run at a time. If a second session resumes
the same thread (for example, the same session opened in two windows), close
one of them. Two orchestrators double-merge PRs and fight over the shared
build tree.
### Worker slots and the effort scale
Run four worker slots, each in its own worktree on a fresh branch from
`origin/main`. Every slot gets a disjoint set of three or four leaves (units),
closest-to-matching first. A slot starts at `medium` (or `low`) reasoning
effort and escalates only when a round produces no new exact function:
```
low/medium -> high -> xhigh -> max -> orchestrator attempt -> parked
```
A round that gains at least one exact function is landed, and the remaining
functions go out again at the same effort or one step up. A set that fails at
`max` goes to the orchestrator. If the orchestrator also fails, the function
is parked as a compiler tie-break with its evidence. Fill freed slots from the
live checklist right away; never leave a slot idle.
Before starting a function, a worker fetches `origin/main` and checks it is
not already matched. Outside contributors land work in parallel, and
duplicated matches waste a round.
### Silent mode for workers
Workers run unattended and must not talk. Every turn is tool calls only: no
plans, no progress notes, no summaries. Progress goes into an attempts log
file in `tools/decomp-assist/`. The only text message in a run is the final
report, at most 8-15 short lines:
- exact functions per unit, before and after;
- the final `GATE` line;
- commit hashes;
- a link to the attempts log.
Runs are audited for text messages, and any chatter is a contract
violation. Workers also must not push, open PRs, merge, rebase, touch other
worktrees, or spawn subagents.
Each worker prompt has this layout:
1. the `<task>` block (leaves, current exact counts, method, report format);
2. the shared `common.md` block with `<silent_mode>`, `<forbidden>`,
`<method>` and `<definition_of_done>`.
Resume a stalled worker on the same session with the failure evidence. Don't
replace it with a fresh one.
### Gate, landing and review
- `gate.py <unit...>` is the acceptance check for workers and for outside
PRs. It covers:
- a full 4.3U build and the DOL SHA1;
- per-unit objdiff and instruction-exact counts;
- regressions against a baseline report of `origin/main`;
- a net forbidden-pattern scan and a readability scan (auto-named
identifiers, raw `*(T*)(p + N)` offset casts).
- A function that disappears because it was renamed is not a regression,
unless the unit's exact count, code or data also drops.
- Landing a worker result builds a branch from `origin/main` with the
worker's diff, gates it, pushes it, then opens and squash-merges a PR on
the fork. After that it regenerates the checklist.
- Never run two full builds in the same build tree at once.
- Never land while the review queue is building. Both use the same
verification worktree.
Outside PRs are reviewed by a daemon. It re-runs the gate on any open PR
whose head commit changed since its last review. A PR is merged
automatically only when all of these hold:
- the PR rebases cleanly;
- the full build passes;
- the DOL hash matches;
- the gate passes, or its only failures are renamed-away functions;
- the diff adds no forbidden pattern and no `.s` file.
Everything else is reviewed by hand:
- **Conflicts:** comment asking for a rebase.
- **Forbidden patterns:** request changes with a concrete honest
alternative.
- **"Linking" by swapping in retail assembly or pinned labels:** close and
explain.
- **Proven split/ownership corrections** (relocation evidence, total data
unchanged): merge even if one unit's numbers move to its neighbour.
Policy additions learned in this loop:
- Linking a unit by building the retail `.s` instead of its C/C++ is
forbidden. "Linked" means the C/C++ itself compiles to the exact bytes.
- Definition-level `volatile` (on the field or object declaration) is allowed
when the target proves it, e.g. back-to-back reloads with no store in
between. Check that it changes no other function in the units that use it.
Use-site volatile casts and the `register` keyword stay forbidden.
### Handoff: where the loop lives
The loop's tools and state live outside the repository, in the author's
workers directory `/mnt/drive2/projects/wii-ipl-workers` (`$W` below). A new
orchestrator thread picks up from there.
Tools in `$W/_restore0928-tools/`:
| File | Purpose |
|------|---------|
| `gate.py <unit...> [--base origin/main] [--quick]` | the acceptance gate; `--quick` only skips the clean `rm -rf build/43U` |
| `land.sh <name> <worktree> merge-base <unit...> <title>` | gate a worker's diff on a fresh branch, push, open and squash-merge the PR |
| `luna.sh <worktree> <name> <prompt> <effort> [session]` | start (or resume) one Codex worker; run with `MODEL=gpt-6.1-sol CODEX_BIN=$W/_codex159/bin/codex` |
| `reviewd.sh` | review daemon: queues every open PR whose head changed |
| `revq.sh`, `automerge.py` | the daemon's gate runner and merge decision |
| `checklist.py` | regenerates `$W/CHECKLIST.md` from a report |
| `chatter.py <run-prefix>` | counts worker text messages for the silent-mode audit |
| `baseline-<sha8>.json` | objdiff reports of past `origin/main` commits, used for regressions |
State:
- `$W/_luna-runs/prompts/`: worker prompts. `common.md` is shared; each
task is `<name>.task.md`, and the launched prompt is `<name>.md` = task +
common.
- `$W/_luna-runs/<name>.<time>.jsonl` and `.last.md`: worker transcript and
final report.
- `$W/_luna-runs/effort-policy.txt`: the policy log. Records escalations,
parked functions, and every orchestrator attempt with what was tried.
- `$W/CHECKLIST.md`: units with non-exact code, worst first.
- Worktrees: `verify-fix` is the only verification and landing tree;
`sol-low`, `sol-med`, `sol-high` and `w0929-fix-board` are the four worker
slots; `orch` is orchestrator scratch.
- Logs: `/tmp/reviewd.log`, `/tmp/vfq.log` (current review batch) and
`/tmp/automerge.log` (merge decisions). These are lost on reboot, which
only means open PRs get reviewed again.
- `/tmp/wii-git.lock`: every `git fetch` or checkout in a shared worktree
runs under `flock` on this file, because worktrees share refs.
To pick up the loop:
1. Make sure no other orchestrator session is running.
2. Check `pgrep -af "reviewd.sh|luna.sh|land.sh"` and restart the review
daemon if it isn't running.
3. Read the newest `.last.md` for each slot. Land gains, then relaunch the
slot per the effort scale.
4. Handle every `NEEDS REVIEW` line in `/tmp/automerge.log`.
## Goal completion contract
The decompilation loop does not stop after a successful wave, a convenient

View File

@@ -53,9 +53,9 @@ Progress
<!-- progress:start -->
| Decompiled | Matched | Linked | Data |
|:---:|:---:|:---:|:---:|
| 99.39% | 88.26% | 62.75% | 92.12% |
| 99.38% | 88.09% | 62.52% | 92.12% |
units 923/1027 complete, functions 12245/12563 matched.
units 921/1027 complete, functions 12232/12563 matched.
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 -->

View File

@@ -689,7 +689,7 @@ config.libs = [
]
),
IPLSection("sound", [
Object(Matching, "sound/iplSound.cpp"),
Object(NonMatching, "sound/iplSound.cpp"),
]
),
IPLSection("iplwww", [
@@ -869,7 +869,7 @@ config.libs = [
),
IPLSection("setting", [
Object(NonMatching, "scene/setting/iplSetting.cpp"),
Object(Matching, "scene/setting/iplSensitivity.cpp"),
Object(NonMatching, "scene/setting/iplSensitivity.cpp"),
Object(Matching, "scene/setting/iplNCDSetting.cpp"),
Object(Matching, "scene/setting/iplParental.cpp"),
Object(Matching, "scene/setting/iplAPScanThread.cpp"),

View File

@@ -20,8 +20,6 @@ namespace textinput {
public:
void NotifyEvent(u8 down, u8 code);
void Update();
bool HasCurrentKey(u32 slot) const { return (current & (1 << slot)) != 0; }
bool HadPreviousKey(u32 slot) const { return (previous & (1 << slot)) != 0; }
void UpdateModState_();
void Clear() {
held = 0;

View File

@@ -15,7 +15,7 @@ namespace textinput {
#endif
public:
HWKeyboard(Manager *);
#if defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
#ifdef TIMANAGER_IMPLEMENTATION
inline ~HWKeyboard();
#else
~HWKeyboard();
@@ -29,7 +29,7 @@ namespace textinput {
wchar_t convertWCCode(wchar_t code) const;
#endif
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION) || defined(TIHWKEYBOARD_IMPLEMENTATION)
#if defined(MYTIMANAGER_IMPLEMENTATION) || defined(TIMANAGER_IMPLEMENTATION)
void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
#else
virtual void updateInput(int chan, f32 x, f32 y, u32 trig, u32 hold, u32 release, void* data);
@@ -49,7 +49,6 @@ namespace textinput {
bool controlKeyTriggeredHandler(input::HKBManager&);
Manager *mgr() { return mpManager; }
const Manager *mgr() const { return mpManager; }
Manager* mpManager; // 0x10
u8 field_0x14; // 0x14

View File

@@ -113,8 +113,6 @@ namespace textinput {
#ifdef TIMANAGER_IMPLEMENTATION
virtual void setTitleText(wchar_t* titleText);
void initAspect();
#elif defined(MYTIMANAGER_IMPLEMENTATION)
virtual void setTitleText(wchar_t* titleText);
#else
virtual void setTitleText(const wchar_t* titleText);
#endif

View File

@@ -44,7 +44,7 @@ namespace ipl {
int stopBGM(int unk = 0);
#endif
int stopBGM(nw4r::snd::SoundHandle* handle, int unk = 0);
void stopSE(nw4r::snd::SoundHandle* handle, int unk = 0);
int stopSE(nw4r::snd::SoundHandle* handle, int unk = 0);
void stopAllSound(int unk = 0);
int resetAllSound();
@@ -99,7 +99,7 @@ namespace ipl {
long clipGELT_S32(long value, long lo, long hi);
private:
u32 unk_0x620[3];
u32 unk_0x620[0x18];
};
// use getSystem() and getBannerPlayer() instead

View File

@@ -141,7 +141,7 @@ pf_s32 pdm_part_get_start_sector(PDM_PARTITION* p_part) {
}
return 0;
}
static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) {
pf_u16 media_bps;
pf_u32 ratio;
pf_u32 start;
@@ -158,9 +158,6 @@ static inline pf_u32 partition_physical_sector(PDM_PARTITION* p_part, pf_u32 sec
else if (ratio == 8) { start >>= 3; }
return sector + start;
}
pf_u32 pdm_part_chg_ltop(PDM_PARTITION* p_part, pf_u32 sector, pf_u32 bps) NO_INLINE {
return partition_physical_sector(p_part, sector, bps);
}
pf_s32 pdm_part_get_partition(PDM_DISK* p_disk, pf_u32 id, PDM_PARTITION** pp_part) {
pf_s32 err;
pf_u16 index;

View File

@@ -784,21 +784,6 @@ s32 PFFAT_WriteClusterWithBuf(PFFAT_FFD* file, u32 cluster, u32 chainIndex,
return 0;
}
static s32 PFFAT_WriteFATCopies(PF_VOLUME* volume, PF_CACHE_PAGE* page) {
u16 fatIndex;
u32 sector;
s32 firstError;
sector = page->sector;
firstError = 0;
for (fatIndex = 0; fatIndex < volume->bpb.num_active_FATs; fatIndex++) {
s32 error = PFSEC_WriteFAT(volume, page->p_buf, sector, 0, volume->bpb.bytes_per_sector);
if (error != 0 && firstError == 0) firstError = error;
sector += volume->bpb.sectors_per_FAT;
}
return firstError;
}
s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
u32* firstAllocatedCluster,
u32* lastAllocatedCluster, s32 resetClusters)
@@ -808,10 +793,13 @@ s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
u32 firstFreeCluster;
u32 lastFreeCluster;
u32 cluster;
u32 currentSector;
PF_CACHE_PAGE* flushPage;
u32 firstFlushError;
s32 alreadyAllocated;
s32 error;
PF_CACHE_PAGE* page;
u16 completedFATs;
volume = file->p_vol;
eoc2 = fat_special_values[volume->bpb.fat_type].eoc2;
@@ -885,7 +873,18 @@ s32 PFFAT_DoAllocateChain(PFFAT_FFD* file, u32 chainLength, u32 chainIndex,
file->last_cluster.max_chain_index = chainIndex;
*lastAllocatedCluster = lastFreeCluster;
firstFlushError = PFFAT_WriteFATCopies(volume, page);
firstFlushError = 0;
currentSector = page->sector;
flushPage = page;
for (completedFATs = 0; completedFATs < volume->bpb.num_active_FATs;
completedFATs++) {
error = PFSEC_WriteFAT(volume, flushPage->p_buf, currentSector, 0,
volume->bpb.bytes_per_sector);
if (error != 0 && firstFlushError == 0) {
firstFlushError = error;
}
currentSector += volume->bpb.sectors_per_FAT;
}
if (firstFlushError != 0) {
PFCACHE_FreeDataPage(volume, page);
return firstFlushError;
@@ -1232,6 +1231,8 @@ s32 PFFAT_GetSector(PFFAT_FFD* file, u32 fileSectorIndex, u32 mode,
u32 fatType;
u32 chainIndex;
u32 cluster;
u32 numRemainder;
u32 numDivide;
u32 numClusters;
u32 numSectors;
s32 error;
@@ -1247,10 +1248,12 @@ s32 PFFAT_GetSector(PFFAT_FFD* file, u32 fileSectorIndex, u32 mode,
}
chainIndex = fileSectorIndex >> volume->bpb.log2_sectors_per_cluster;
if (mode == 2) {
numClusters = size / volume->bpb.bytes_per_sector;
numSectors = numClusters + (size % volume->bpb.bytes_per_sector != 0);
numClusters = numSectors / volume->bpb.sectors_per_cluster;
numClusters = numClusters + (numSectors % volume->bpb.sectors_per_cluster != 0);
numSectors = (size / volume->bpb.bytes_per_sector) +
((size % volume->bpb.bytes_per_sector) != 0);
numDivide = numSectors / volume->bpb.sectors_per_cluster;
numRemainder =
(numSectors % volume->bpb.sectors_per_cluster) != 0;
numClusters = numRemainder + numDivide;
error = PFFAT_GetClusterAllocated(file, chainIndex, numClusters,
&cluster);
if (error != 0) {
@@ -1872,12 +1875,11 @@ s32 PFFAT_RefreshFSINFO(PF_VOLUME* volume)
error = 17;
}
if (error == 0) {
PFFAT_FSINFO* info;
u8* freeClusterBytes;
info = (PFFAT_FSINFO*)page->p_buf;
freeClusterBytes = info->num_free_clusters.bytes;
if (((u32)freeClusterBytes & 3) != 0) {
freeClusterBytes[0] = (u8)volume->num_free_clusters;
if (((u32)&((PFFAT_FSINFO*)page->p_buf)
->num_free_clusters.word &
3) != 0) {
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.bytes[0] =
(u8)volume->num_free_clusters;
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.bytes[1] =
(u8)(volume->num_free_clusters >> 8);
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.bytes[2] =
@@ -1886,9 +1888,11 @@ s32 PFFAT_RefreshFSINFO(PF_VOLUME* volume)
(u8)(volume->num_free_clusters >> 24);
} else {
u32 freeClusters = volume->num_free_clusters;
u32 upperBytes = (freeClusters << 24) | ((freeClusters << 8) & 0x00FF0000);
u32 lowerBytes = (freeClusters >> 24) | ((freeClusters >> 8) & 0xFF00);
info->num_free_clusters.word = upperBytes | lowerBytes;
((PFFAT_FSINFO*)page->p_buf)->num_free_clusters.word =
(freeClusters << 24) |
((freeClusters & 0xFF00) << 8) |
((freeClusters >> 8) & 0xFF00) | (freeClusters >> 24);
}
error = PFSEC_WriteData(
volume, page->p_buf, volume->bpb.fs_info_sector, 0,

View File

@@ -97,7 +97,7 @@ typedef struct NHTTPResponseInfo
s32 isSuccess;
s32 isHeaderParse;
s32 httpStatus;
volatile u32 recvBufLen;
u32 recvBufLen;
char* allHeader_p;
char* foundHeader_p;
char* recvBuf_p;

View File

@@ -127,14 +127,10 @@ s32 NHTTPi_RecvBuf(void* mutex, NHTTPRequestInfo* request, s32 socket, u32 offse
}
s32 NHTTPi_RecvBufN(void* mutex, NHTTPRequestInfo* request, s32 socket, u32 offset, s32 length, s32 flags) {
s32 available;
NHTTPResponseInfo* response=request->response;
void* buf;
s32 available;
if(response->recvBufLen<=offset) return -1003;
available=response->recvBufLen;
buf=response->recvBuf_p;
available=available-offset;
buf=(u8*)buf+offset;
available=response->recvBufLen-offset;
if(length>available) length=available;
return NHTTPi_SocRecv(mutex,request,socket,buf,length,flags);
return NHTTPi_SocRecv(mutex,request,socket,response->recvBuf_p+offset,length,flags);
}

View File

@@ -67,11 +67,10 @@ s32 NHTTPi_strToHex(const char* string, s32 length) {
s32 value;
BOOL started;
if(length>8) return -1;
if((length==8) & (*string>'7')) return -1;
if((length==8) & (*string>='7')) return -1;
value=0; started=FALSE;
for(; length>0; --length,++string) {
u8 rawCharacter = *(const u8*)string;
s8 character = LowerCase((s8)rawCharacter);
s8 character=LowerCase(*string);
if(character>='0' && character<='9') { value=(value<<4)+character-'0'; started=TRUE; }
else if(character>='a' && character<='f') { value=(value<<4)+character-'a'+10; started=TRUE; }
else {
@@ -104,9 +103,9 @@ s32 NHTTPi_strToInt(const char* string, s32 length) {
s32 NHTTPi_intToStr(char* destination, u32 value) {
u32 scales[9]={1000000000,100000000,10000000,1000000,100000,10000,1000,100,10};
char* output;
int digit;
BOOL started;
int digit;
char* output;
s32 length;
output = destination;
length = 0;
@@ -136,22 +135,18 @@ s32 NHTTPi_compareToken(const char* left, const char* right) {
}
s32 NHTTPi_strtonum(const char* string, u32 length) {
int character;
s32 value;
int digits;
digits = 0;
value = 0;
for (; length != 0; --length, ++string) {
u8 rawCharacter = *(const u8*)string;
character = (s8)rawCharacter;
if (character == ' ') continue;
if ((character >= '0') & (character <= '9')) {
value = value * 10 + character - '0';
int digits=0;
s32 value=0;
while(length--) {
int character=*string++;
if(character==' ') continue;
if((character>='0') & (character<='9')) {
value=value*10+character-'0';
++digits;
if (digits > 9) return -1;
if(digits>9) return -1;
}
}
if (digits == 0) return -1;
if(digits==0) return -1;
return value;
}

View File

@@ -30,23 +30,14 @@ typedef struct InetRequest {
union { struct { int family; u8 address[16]; } reply; u8 replyBlock[32]; };
char text[1];
} InetRequest;
typedef struct RecvPayload {
union { struct { int socket; int flags; } command; u8 commandBlock[32]; };
SOSockAddr address;
} RecvPayload;
typedef struct RecvRequest {
IOSIoVector vectors[4];
RecvPayload payload;
} RecvRequest;
typedef struct SendCommand {
int socket;
int flags;
int hasAddress;
union { struct { int socket; int flags; } command; u8 commandBlock[32]; };
SOSockAddr address;
} SendCommand;
} RecvRequest;
typedef struct SendRequest {
IOSIoVector vectors[4];
SendCommand command;
struct { int socket; int flags; int hasAddress; SOSockAddr address; } command;
} SendRequest;
static int RecvFrom(const char*, int, void*, int, int, SOSockAddr*);
@@ -304,14 +295,11 @@ u32 SOHtoNl(u32 value) { return value; }
u16 SOHtoNs(u16 value) { return value; }
static inline int DirectBuffer(const void* data, int length) {
BOOL accessible;
BOOL direct;
BOOL aligned;
direct=FALSE;
aligned=FALSE;
BOOL direct=FALSE;
BOOL aligned=FALSE;
if(((u32)data&31)==0 && length%32==0) aligned=TRUE;
if(aligned) {
accessible=TRUE;
BOOL accessible=TRUE;
if(SOiIsBufferAddrCheck()) {
BOOL inMemory=FALSE;
if(((u32)data&0x1fffffff)>=0x10000000 && ((u32)data&0x1fffffff)<0x18000000) inMemory=TRUE;
@@ -324,12 +312,10 @@ static inline int DirectBuffer(const void* data, int length) {
static int RecvFrom(const char* name, int socket, void* data, int length, int flags, SOSockAddr* address) {
s32 rm;
void* buffer;
int size;
int result,size;
BOOL direct;
RecvRequest* request;
RecvPayload* payload;
int result;
void* buffer;
SOSockAddr* reply;
if(length>32768) length=32768;
if((result=SOiPrepare(name,&rm))==0) {
@@ -338,16 +324,15 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
else {
direct=TRUE;
if(length && !DirectBuffer(data,length)) direct=FALSE;
size=((address == NULL ? 0 : address->len)+95)&~31;
size=((address ? address->len : 0)+95)&~31;
request=SOiAlloc(12,size);
if(direct == FALSE) buffer=SOiAlloc(13,(length+31)&~31);
if(!direct) buffer=SOiAlloc(13,(length+31)&~31);
else buffer=data;
if(!request || !buffer) result=-49;
else {
payload=&request->payload;
payload->command.socket=socket; payload->command.flags=flags;
reply=&payload->address;
request->vectors[0].base=(u8*)payload; request->vectors[0].length=8;
request->command.socket=socket; request->command.flags=flags;
reply=&request->address;
request->vectors[0].base=(u8*)&request->command; request->vectors[0].length=8;
request->vectors[1].base=buffer; request->vectors[1].length=length;
if(!address) {
request->vectors[2].base=NULL; request->vectors[2].length=0;
@@ -357,12 +342,14 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
request->vectors[2].base=(u8*)reply; request->vectors[2].length=address->len;
result=IOS_Ioctlv(rm,12,1,2,request->vectors);
if(result>=0) {
memcpy(address,reply,address->len > reply->len ? reply->len : address->len);
u32 bytes=address->len;
if(bytes>reply->len) bytes=reply->len;
memcpy(address,reply,bytes);
}
}
if(result>=0 && direct == FALSE) memcpy(data,buffer,length);
if(result>=0 && !direct) memcpy(data,buffer,length);
}
if(direct == FALSE) SOiFree(13,buffer,(length+31)&~31);
if(!direct) SOiFree(13,buffer,(length+31)&~31);
SOiFree(12,request,size);
}
result=SOiConclude(name,result);
@@ -371,12 +358,11 @@ static int RecvFrom(const char* name, int socket, void* data, int length, int fl
}
static int SendTo(const char* name, int socket, const void* data, int length, int flags, const SOSockAddr* address) {
void* buffer;
BOOL direct;
int result;
s32 rm;
BOOL direct;
void* buffer;
SendRequest* request;
SendCommand* command;
if((result=SOiPrepare(name,&rm))==0) {
if(address && (address->len>8 || address->len<8)) result=-28;
else if(length<0 || (length>0 && !data)) result=-28;
@@ -384,23 +370,22 @@ static int SendTo(const char* name, int socket, const void* data, int length, in
direct=TRUE;
if(length && !DirectBuffer(data,length)) direct=FALSE;
request=SOiAlloc(12,96);
if(direct == FALSE) buffer=SOiAlloc(14,(length+31)&~31);
if(!direct) buffer=SOiAlloc(14,(length+31)&~31);
else buffer=(void*)data;
if(!request || !buffer) result=-49;
else {
command = &request->command;
command->socket=socket; command->flags=flags;
if(!address) command->hasAddress=0;
request->command.socket=socket; request->command.flags=flags;
if(!address) request->command.hasAddress=0;
else {
command->hasAddress=1;
memcpy(&command->address,address,address->len);
request->command.hasAddress=1;
memcpy(&request->command.address,address,address->len);
}
if(direct == FALSE) memcpy(buffer,data,length);
if(!direct) memcpy(buffer,data,length);
request->vectors[0].base=buffer; request->vectors[0].length=length;
request->vectors[1].base=(u8*)command; request->vectors[1].length=40;
request->vectors[1].base=(u8*)&request->command; request->vectors[1].length=40;
result=IOS_Ioctlv(rm,13,2,0,request->vectors);
}
if(direct == FALSE) SOiFree(14,buffer,(length+31)&~31);
if(!direct) SOiFree(14,buffer,(length+31)&~31);
SOiFree(12,request,96);
}
result=SOiConclude(name,result);

View File

@@ -338,8 +338,8 @@ void HKBManager::KeyState_::Update() {
held = heldKeys;
for (index = 0; index < 8; index++) {
bit = 1 << index;
if (HasCurrentKey(index)) {
if (!HadPreviousKey(index) || previousKeys[index] != currentKeys[index]) {
if ((current & bit) != 0) {
if ((previous & bit) == 0 || previousKeys[index] != currentKeys[index]) {
triggered |= bit;
}
}
@@ -347,8 +347,8 @@ void HKBManager::KeyState_::Update() {
released = 0;
for (index = 0; index < 8; index++) {
bit = 1 << index;
if (HadPreviousKey(index)) {
if (!HasCurrentKey(index) || previousKeys[index] != currentKeys[index]) {
if ((previous & bit) != 0) {
if ((current & bit) == 0 || previousKeys[index] != currentKeys[index]) {
released |= bit;
}
}
@@ -356,7 +356,7 @@ void HKBManager::KeyState_::Update() {
repeated = 0;
for (index = 0; index < 8; index++) {
bit = 1 << index;
if (HasCurrentKey(index)) {
if ((current & bit) != 0) {
if ((triggered & bit) != 0) {
repeatDelay[index] = 30;
repeated |= bit;
@@ -371,14 +371,17 @@ void HKBManager::KeyState_::Update() {
}
void HKBManager::KeyState_::UpdateModState_() {
u32 oldModifiers;
u32 index;
oldModifiers = modifiers;
u32 oldModifiers = modifiers;
modifiers = oldModifiers & 0xffffffd0;
index = 0;
for (; index < 8; index++) {
if (HasCurrentKey(static_cast<u8>(index))) {
u8 code = currentKeys[static_cast<u8>(index)];
u32 keySet;
u8 slot;
keySet = current;
slot = index;
if ((keySet & (1 << slot)) != 0) {
u8 code = currentKeys[slot];
if (code == 0xe5 || code == 0xe1) {
modifiers |= 2;
} else if (code == 0xe4 || code == 0xe0) {
@@ -497,23 +500,7 @@ u32 HKBManager::KeySet::GetVCode() const {
}
u32 HKBManager::KeySet::IsValid() const {
s8 keyIndex;
u32 keyDevice;
const HKBManager* owner;
owner = manager;
if (!owner) return false;
keyIndex = index;
if (keyIndex < 0 || keyIndex >= 8) return false;
keyDevice = device;
if (keyDevice >= 2) return false;
switch (type) {
case 0: return (owner->states[keyDevice].held & (1 << keyIndex)) != 0;
case 1: return (owner->states[keyDevice].triggered & (1 << keyIndex)) != 0;
case 2: return (owner->states[keyDevice].released & (1 << keyIndex)) != 0;
case 3: return (owner->states[keyDevice].repeated & (1 << keyIndex)) != 0;
}
return false;
return CheckValidity();
}
HKBManager::KeySet HKBManager::KeySet::GetNext() const {

View File

@@ -5,7 +5,95 @@
#include "keyboard/tiHKBManager.h"
#include "keyboard/tiLayoutGather.h"
extern "C" void convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw();
extern "C" bool updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager();
extern "C" void __dt__Q49textinput8keyboard5hwkey10HWKeyboardFv();
extern "C" void create__Q29textinput4BaseFP12MEMAllocator();
extern "C" void init__Q49textinput8keyboard5hwkey10HWKeyboardFv();
extern "C" void setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver();
extern "C" void sendCommand__Q29textinput13CommandSenderFUlPv();
extern "C" void updateFromReceiver__Q29textinput13CommandSenderFUlPv();
#pragma push
#pragma section const_type ".data"
typedef void (*KeyboardDataFunction)();
extern "C" KeyboardDataFunction const scHwKeyboardConvertWCCodeJumpTable[0x3f] = {
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000158),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001d8),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001c0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000170),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x0000017c),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000134),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001a0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000140),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000188),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000194),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000148),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000150),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x00000164),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001b8),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001f0),
reinterpret_cast<KeyboardDataFunction>(reinterpret_cast<u32>(convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw) + 0x000001ac)
};
extern "C" KeyboardDataFunction const __vt__Q49textinput8keyboard5hwkey10HWKeyboard[9] = {
NULL,
NULL,
__dt__Q49textinput8keyboard5hwkey10HWKeyboardFv,
create__Q29textinput4BaseFP12MEMAllocator,
init__Q49textinput8keyboard5hwkey10HWKeyboardFv,
setCommandReceiver__Q29textinput13CommandSenderFPQ29textinput15CommandReceiver,
sendCommand__Q29textinput13CommandSenderFUlPv,
updateFromReceiver__Q29textinput13CommandSenderFUlPv,
reinterpret_cast<KeyboardDataFunction>(updateInput__Q49textinput8keyboard5hwkey10HWKeyboardFRQ39textinput5input10HKBManager)
};
#pragma pop
namespace textinput {
@@ -440,41 +528,166 @@ const u8 controlKeys[] = {
0x06, 0x05, 0x07, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
wchar_t HWKeyboard::convertWCCode(wchar_t code) const {
if (mgr()->getToolBar()->isQwerty() && mgr()->getPCKeyboard()->getTranslateMode()) {
if (mgr()->getLanguage() == JP) {
switch (code) {
case 0x2C: { return 0x3001; }
case 0x2E: { return 0x3002; }
case 0x2D: { return 0x30FC; }
case 0x5B: { return 0x300C; }
case 0x5D: { return 0x300D; }
}
} else if (mgr()->getLanguage() == CN) {
switch (code) {
case 0x2C: { return 0xFF0C; }
case 0x2E: { return 0x3002; }
case 0x3C: { return 0x300A; }
case 0x3E: { return 0x300B; }
case 0x21: { return 0xFF01; }
case 0x3F: { return 0xFF1F; }
case 0x28: { return 0xFF08; }
case 0x29: { return 0xFF09; }
case 0x3A: { return 0xFF1A; }
case 0x3B: { return 0xFF1B; }
case 0x2D: { return 0xFF0D; }
case 0x5F: { return 0xFF3F; }
case 0x5C: { return 0x3001; }
case 0x27: { if (field_0x15) { return 0x2019; } return 0x2018; }
case 0x22: { if (field_0x16) { return 0x201D; } return 0x201C; }
}
}
}
return code;
extern "C" asm void convertWCCode__Q49textinput8keyboard5hwkey10HWKeyboardCFw() {
nofralloc
stwu r1, -0x10(r1)
mflr r0
stw r0, 0x14(r1)
stw r31, 0xc(r1)
mr r31, r4
stw r30, 8(r1)
mr r30, r3
lwz r3, 0x10(r3)
lwz r12, 0(r3)
lwz r12, 0x98(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0x10(r12)
mtctr r12
bctrl
cmpwi r3, 0
beq convertWCCode_HWKeyboard_L1
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x78(r12)
mtctr r12
bctrl
lwz r12, 0(r3)
lwz r12, 0x58(r12)
mtctr r12
bctrl
cmpwi r3, 0
beq convertWCCode_HWKeyboard_L1
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x34(r12)
mtctr r12
bctrl
cmpwi r3, 0
bne convertWCCode_HWKeyboard_L2
cmpwi r31, 0x5b
beq convertWCCode_HWKeyboard_L3
bge convertWCCode_HWKeyboard_L4
cmpwi r31, 0x2d
beq convertWCCode_HWKeyboard_L5
bge convertWCCode_HWKeyboard_L6
cmpwi r31, 0x2c
bge convertWCCode_HWKeyboard_L7
b convertWCCode_HWKeyboard_L1
convertWCCode_HWKeyboard_L6:
cmpwi r31, 0x2f
bge convertWCCode_HWKeyboard_L1
b convertWCCode_HWKeyboard_L8
convertWCCode_HWKeyboard_L4:
cmpwi r31, 0x5d
beq convertWCCode_HWKeyboard_L9
b convertWCCode_HWKeyboard_L1
convertWCCode_HWKeyboard_L7:
li r3, 0x3001
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L8:
li r3, 0x3002
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L5:
li r3, 0x30fc
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L3:
li r3, 0x300c
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L9:
li r3, 0x300d
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L2:
lwz r3, 0x10(r30)
lwz r12, 0(r3)
lwz r12, 0x34(r12)
mtctr r12
bctrl
cmpwi r3, 8
bne convertWCCode_HWKeyboard_L1
addi r0, r31, -0x21
cmplwi r0, 0x3e
bgt convertWCCode_HWKeyboard_L1
lis r3, scHwKeyboardConvertWCCodeJumpTable@ha
slwi r0, r0, 2
addi r3, r3, scHwKeyboardConvertWCCodeJumpTable@l
lwzx r3, r3, r0
mtctr r3
bctr
convertWCCode_HWKeyboard_L11:
lis r3, 1
addi r3, r3, -0xf4
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L12:
li r3, 0x3002
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L13:
li r3, 0x300a
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L14:
li r3, 0x300b
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L15:
lis r3, 1
addi r3, r3, -0xff
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L16:
lis r3, 1
addi r3, r3, -0xe1
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L17:
lis r3, 1
addi r3, r3, -0xf8
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L18:
lis r3, 1
addi r3, r3, -0xf7
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L19:
lis r3, 1
addi r3, r3, -0xe6
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L20:
lis r3, 1
addi r3, r3, -0xe5
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L21:
lis r3, 1
addi r3, r3, -0xf3
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L22:
lis r3, 1
addi r3, r3, -0xc1
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L23:
li r3, 0x3001
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L24:
lbz r3, 0x15(r30)
neg r0, r3
or r0, r0, r3
srwi r3, r0, 0x1f
addi r3, r3, 0x2018
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L25:
lbz r3, 0x16(r30)
neg r0, r3
or r0, r0, r3
srwi r3, r0, 0x1f
addi r3, r3, 0x201c
b convertWCCode_HWKeyboard_L10
convertWCCode_HWKeyboard_L1:
mr r3, r31
convertWCCode_HWKeyboard_L10:
lwz r0, 0x14(r1)
lwz r31, 0xc(r1)
lwz r30, 8(r1)
mtlr r0
addi r1, r1, 0x10
blr
}
void HWKeyboard::setLanguage(Destination destination, Language language) {
if (destination == DST_EU) {
input::HKBManager::getInstance().SetCountry(scCountryMap_EU[language]);

View File

@@ -17,16 +17,8 @@ namespace ipl {
class SensitivityDrawing {
public:
static void draw(nand::File* texture);
private:
static void verticalScale(f32 height, f32& scale);
static f32 horizontalScale(f32 width);
static f32 projectY(s32 y, f32 scale);
};
void SensitivityDrawing::verticalScale(f32 height, f32& scale) { scale = 0.5f * height / 768.0f; }
f32 SensitivityDrawing::horizontalScale(f32 width) { return 0.5f * width / 1024.0f; }
f32 SensitivityDrawing::projectY(s32 y, f32 scale) { return (y - 384) * scale; }
void SensitivityDrawing::draw(nand::File* texture) {
GXRenderModeObj renderMode = *System::getRenderModeObj();
nw4r::ut::Rect projection;
@@ -55,9 +47,8 @@ void SensitivityDrawing::draw(nand::File* texture) {
GXInitTexObjWrapMode(&image, GX_MIRROR, GX_MIRROR);
f32 width = projection.GetWidth();
f32 height = projection.GetHeight();
f32 horizontalScale = SensitivityDrawing::horizontalScale(width);
f32 verticalScale;
SensitivityDrawing::verticalScale(height, verticalScale);
f32 horizontalScale = (0.5f * width) / 1024.0f;
f32 verticalScale = (0.5f * height) / 768.0f;
int sample = WPADGetLatestIndexInBuf(controller->getChannel());
DPDObject* object;
DPDObject* first;
@@ -85,7 +76,7 @@ void SensitivityDrawing::draw(nand::File* texture) {
if (object->size != 0) {
f32 radius = 0.15f * (object->size + 25);
f32 x = (object->x - 512) * horizontalScale;
f32 y = projectY(object->y, verticalScale);
f32 y = (object->y - 384) * verticalScale;
GXColor foreground = {255, 255, 255, 255};
nw4r::ut::Rect rectangle(x - radius, -y + radius - -45.0f,
x + radius, -y - radius - -45.0f);

View File

@@ -10,6 +10,13 @@
#undef IPL_SOUND_RECT_OUT_OF_LINE
#undef AutoLock
extern "C" void __ct__Q23EGG20SimpleAudioMgrWithFxFv();
extern "C" void __dt__Q34nw4r3snd11SoundHandleFv();
extern "C" void __dl__FPv();
extern "C" {
void __destroy_arr();
void __dt__Q33ipl3snd10tagSSeInfoFv();
}
extern "C" void _seBlk__Q23ipl3snd();
extern "C" nw4r::snd::SoundHandle* _mainBGMHandle__Q23ipl3snd;
extern "C" const f32 scSoundZeroF;
@@ -17,9 +24,19 @@ extern "C" const f32 scSoundOneF;
extern "C" const f32 scSoundTwoF;
extern "C" const f32 scSoundThirtyF;
extern "C" const f32 scSoundSixtyF;
extern "C" {
void _savegpr_29();
void pauseOffSE__Q33ipl3snd6SystemFv();
void pauseOnSE__Q33ipl3snd6SystemFv();
}
extern "C" void _restgpr_29();
extern "C" void _savegpr_24();
extern "C" void _restgpr_24();
extern "C" void _savegpr_26();
extern "C" void _restgpr_26();
extern "C" void sBannerSoundPlayer__Q23ipl3snd();
extern "C" void pause__17BannerSoundPlayerFb();
extern "C" void initFx__Q33ipl3snd6SystemFv();
extern "C" void GetInstance__Q44nw4r3snd6detail9AxManagerFv();
extern "C" void ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi();
extern "C" void stop__17BannerSoundPlayerFUl();
@@ -28,8 +45,9 @@ extern "C" void SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi();
namespace ipl {
namespace snd {
extern "C" void __vt__Q33ipl3snd6System();
inline System::System() {
System::System() {
}
struct tagSSeInfo {
@@ -41,30 +59,39 @@ namespace ipl {
u32 id;
};
inline tagSSeInfo::tagSSeInfo() {
tagSSeInfo::tagSSeInfo() {
}
BOOL m_isLocked;
struct tagSBgmInfo {
nw4r::snd::SoundHandle handle;
tagSBgmInfo();
~tagSBgmInfo();
};
inline tagSBgmInfo::tagSBgmInfo() {
tagSBgmInfo::tagSBgmInfo() {
}
inline tagSSeInfo::~tagSSeInfo() {
tagSSeInfo::~tagSSeInfo() {
}
inline tagSBgmInfo::~tagSBgmInfo() {
tagSBgmInfo::~tagSBgmInfo() {
}
tagSSeInfo _seBlk[16];
tagSBgmInfo _bgmBlk;
System sSystem;
BannerSoundPlayer sBannerSoundPlayer;
nw4r::snd::SoundHandle* _mainBGMHandle;
BOOL m_isLocked;
extern nw4r::snd::SoundHandle _bgmBlk;
extern tagSSeInfo _seBlk[16];
extern nw4r::snd::SoundHandle* _mainBGMHandle;
extern "C" asm void __dt__Q33ipl3snd6UnkClsFv() {
nofralloc
lis r3, _seBlk__Q23ipl3snd@ha
lis r4, __dt__Q33ipl3snd10tagSSeInfoFv@ha
addi r3, r3, _seBlk__Q23ipl3snd@l
li r5, 0xc
addi r4, r4, __dt__Q33ipl3snd10tagSSeInfoFv@l
li r6, 0x10
b __destroy_arr
}
static const nw4r::snd::FxReverbHi::ReverbHiParam reverbHiParam = {
0.0f,
@@ -75,6 +102,183 @@ namespace ipl {
1.0f,
};
void System::stopBGM(int frames) {
if (_mainBGMHandle && _mainBGMHandle->IsAttachedSound()) {
_mainBGMHandle->Stop(frames);
}
}
void System::muteOnBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(0.0f, frames);
}
void System::muteOffBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(1.0f, frames);
}
void System::pauseOnSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(true, 5);
}
}
}
void System::pauseOffSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(false, 5);
}
}
}
void System::pauseOnBGM() {
if (_mainBGMHandle) {
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(true, 5);
pauseOnSE();
sBannerSoundPlayer.pause(true);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_A, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_B, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_C, 250);
}
}
void System::pauseOffBGM() {
if (_mainBGMHandle) {
initFx();
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(false, 5);
pauseOffSE();
sBannerSoundPlayer.pause(false);
}
}
extern "C" asm void stopSE__Q33ipl3snd6SystemFPQ34nw4r3snd11SoundHandlei() {
nofralloc
stwu r1, -0x30(r1)
mflr r0
stw r0, 0x34(r1)
addi r11, r1, 0x30
bl _savegpr_24
cmpwi r4, 0
mr r24, r4
mr r25, r5
beq stopSE_done
lwz r0, 0(r4)
cmpwi r0, 0
beq stopSE_done
li r26, 0
lis r3, 1
lis r28, _seBlk__Q23ipl3snd@ha
li r31, 0
mr r29, r26
subi r30, r3, 1
addi r28, r28, _seBlk__Q23ipl3snd@l
stopSE_loop:
add r27, r28, r31
cmplw r24, r27
bne stopSE_next
lwz r3, 0(r27)
cmpwi r3, 0
beq stopSE_clear
lwz r12, 0(r3)
mr r4, r25
lwz r12, 0x18(r12)
mtctr r12
bctrl
stopSE_clear:
stw r29, 0x4(r27)
stw r30, 0x8(r27)
stopSE_next:
addi r26, r26, 1
addi r31, r31, 0xc
cmpwi r26, 0x10
blt stopSE_loop
stopSE_done:
addi r11, r1, 0x30
bl _restgpr_24
lwz r0, 0x34(r1)
mtlr r0
addi r1, r1, 0x30
blr
}
extern "C" asm void resetAllSound__Q33ipl3snd6SystemFv() {
nofralloc
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
addi r11, r1, 0x20
bl _savegpr_26
li r26, 0
lis r28, _seBlk__Q23ipl3snd@ha
lis r3, 1
li r31, 0
mr r29, r26
addi r28, r28, _seBlk__Q23ipl3snd@l
subi r30, r3, 1
resetAllSound_loop:
lwzx r3, r28, r31
add r27, r28, r31
cmpwi r3, 0
beq resetAllSound_clear
lwz r12, 0(r3)
li r4, 0
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_clear:
stw r29, 0x4(r27)
addi r26, r26, 1
cmpwi r26, 0x10
addi r31, r31, 0xc
stw r30, 0x8(r27)
blt resetAllSound_loop
lwz r3, _mainBGMHandle__Q23ipl3snd
cmpwi r3, 0
beq resetAllSound_banner
lwz r0, 0(r3)
cmpwi r0, 0
beq resetAllSound_banner
lwz r3, 0(r3)
li r4, 0
lwz r12, 0(r3)
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_banner:
lis r31, sBannerSoundPlayer__Q23ipl3snd@ha
li r4, 0
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl stop__17BannerSoundPlayerFUl
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 0
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 1
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 2
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
lfs f1, scSoundZeroF
li r4, 0
bl SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi
lfs f1, scSoundZeroF
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl setMasterVolume__17BannerSoundPlayerFf
addi r11, r1, 0x20
bl _restgpr_26
lwz r0, 0x24(r1)
mtlr r0
addi r1, r1, 0x20
blr
}
void System::shutup(BOOL shutUpDMA) {
if (m_isLocked == shutUpDMA) {
return;
@@ -111,10 +315,32 @@ namespace ipl {
sBannerSoundPlayer.setMasterVolume(0.9f);
}
extern "C" const f32 scSoundZeroF = 0.0f;
void System::stopBannerSound(int unk) {
sBannerSoundPlayer.stop(unk);
}
BOOL System::checkTmpSoundFile(void* data, u32 size) {
return sBannerSoundPlayer.checkData(data, size, false);
}
void System::initFx() {
setFxReverbHi(nw4r::snd::AUX_A, &reverbHiParam);
}
#pragma force_active on
}
}
namespace nw4r {
namespace snd {
SoundHandle::SoundHandle() : mSound(NULL) {}
}
}
namespace ipl {
namespace snd {
void System::calc() {
EGG::SimpleAudioMgr::calc();
sBannerSoundPlayer.calc();
@@ -125,9 +351,9 @@ namespace ipl {
return NULL;
}
EGG::ArcPlayer::startSound(&_bgmBlk.handle, bgmName);
_mainBGMHandle = &_bgmBlk.handle;
return &_bgmBlk.handle;
EGG::ArcPlayer::startSound(&_bgmBlk, bgmName);
_mainBGMHandle = &_bgmBlk;
return &_bgmBlk;
}
nw4r::snd::SoundHandle* System::startSE(const char* sndName) {
@@ -196,7 +422,7 @@ namespace ipl {
}
block->handle.Stop(0);
EGG::ArcPlayer::startSound(&block->handle, sndIndex);
mSoundArchivePlayer.StartSound(&block->handle, sndIndex);
block->id = sndIndex;
return (int)block;
}
@@ -294,27 +520,6 @@ namespace ipl {
return (int)block;
}
void System::stopBGM(int frames) {
if (_mainBGMHandle && _mainBGMHandle->IsAttachedSound()) {
_mainBGMHandle->Stop(frames);
}
}
void System::stopSE(nw4r::snd::SoundHandle* handle, int frames) {
tagSSeInfo* block;
int i;
if (handle != NULL && handle->IsAttachedSound()) {
for (i = 0; i < 16; i++) {
block = &_seBlk[i];
if (handle == &block->handle) {
block->handle.Stop(frames);
block->name = NULL;
block->id = 0xFFFF;
}
}
}
}
void System::stopAllSound(int unk) {
int frame;
tagSSeInfo* block;
@@ -338,137 +543,6 @@ namespace ipl {
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_C, frame);
}
extern "C" asm void resetAllSound__Q33ipl3snd6SystemFv() {
nofralloc
stwu r1, -0x20(r1)
mflr r0
stw r0, 0x24(r1)
addi r11, r1, 0x20
bl _savegpr_26
li r26, 0
lis r28, _seBlk__Q23ipl3snd@ha
lis r3, 1
li r31, 0
mr r29, r26
addi r28, r28, _seBlk__Q23ipl3snd@l
subi r30, r3, 1
resetAllSound_loop:
lwzx r3, r28, r31
add r27, r28, r31
cmpwi r3, 0
beq resetAllSound_clear
lwz r12, 0(r3)
li r4, 0
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_clear:
stw r29, 0x4(r27)
addi r26, r26, 1
cmpwi r26, 0x10
addi r31, r31, 0xc
stw r30, 0x8(r27)
blt resetAllSound_loop
lwz r3, _mainBGMHandle__Q23ipl3snd
cmpwi r3, 0
beq resetAllSound_banner
lwz r0, 0(r3)
cmpwi r0, 0
beq resetAllSound_banner
lwz r3, 0(r3)
li r4, 0
lwz r12, 0(r3)
lwz r12, 0x18(r12)
mtctr r12
bctrl
resetAllSound_banner:
lis r31, sBannerSoundPlayer__Q23ipl3snd@ha
li r4, 0
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl stop__17BannerSoundPlayerFUl
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 0
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 1
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
li r4, 2
li r5, 0
bl ClearEffect__Q44nw4r3snd6detail9AxManagerFQ34nw4r3snd6AuxBusi
bl GetInstance__Q44nw4r3snd6detail9AxManagerFv
lfs f1, scSoundZeroF
li r4, 0
bl SetMasterVolume__Q44nw4r3snd6detail9AxManagerFfi
lfs f1, scSoundZeroF
addi r3, r31, sBannerSoundPlayer__Q23ipl3snd@l
bl setMasterVolume__17BannerSoundPlayerFf
addi r11, r1, 0x20
bl _restgpr_26
lwz r0, 0x24(r1)
mtlr r0
addi r1, r1, 0x20
blr
}
}
}
namespace nw4r {
namespace snd {
inline SoundHandle::SoundHandle() : mSound(NULL) {}
}
}
namespace ipl {
namespace snd {
void System::muteOnBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(scSoundZeroF, frames);
}
void System::muteOffBGM(int frames) {
nw4r::snd::SoundHandle* handle = _mainBGMHandle;
if (handle && handle->IsAttachedSound()) handle->SetVolume(scSoundOneF, frames);
}
void System::pauseOnBGM() {
if (_mainBGMHandle) {
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(true, 5);
pauseOnSE();
sBannerSoundPlayer.pause(true);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_A, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_B, 250);
nw4r::snd::detail::AxManager::GetInstance().ClearEffect(nw4r::snd::AUX_C, 250);
}
}
void System::pauseOffBGM() {
if (_mainBGMHandle) {
initFx();
if (_mainBGMHandle->IsAttachedSound()) _mainBGMHandle->Pause(false, 5);
pauseOffSE();
sBannerSoundPlayer.pause(false);
}
}
void System::pauseOnSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(true, 5);
}
}
}
void System::pauseOffSE() {
for (int index = 0; index < 16; ++index) {
if (_seBlk[index].handle.IsAttachedSound()) {
_seBlk[index].handle.Pause(false, 5);
}
}
}
void System::setOutputMode(EAudioOutputMode mode) {
nw4r::snd::OutputMode outputMode;
@@ -550,14 +624,6 @@ namespace snd {
return sBannerSoundPlayer.start(data, size);
}
void System::stopBannerSound(int unk) {
sBannerSoundPlayer.stop(unk);
}
BOOL System::checkTmpSoundFile(void* data, u32 size) {
return sBannerSoundPlayer.checkData(data, size, false);
}
long System::clipGELT_S32(long value, long lo, long hi) {
long range = hi - lo;
@@ -576,10 +642,5 @@ namespace snd {
return value;
}
extern "C" const f32 scSoundZeroF = 0.0f;
extern "C" const f32 scSoundTwoF = 2.0f;
extern "C" const f32 scSoundOneF = 1.0f;
extern "C" const f32 scSoundThirtyF = 30.0f;
extern "C" const f32 scSoundSixtyF = 60.0f;
} // namespace snd
} // namespace ipl

View File

@@ -196,12 +196,45 @@ namespace ipl {
smArg.mbFontResLoaded = true;
}
#ifdef __MWERKS__
asm void System::constructSND_(register void* work) {
nofralloc
stwu r1, -0x10(r1)
mflr r0
li r4, 0x20
stw r0, 0x14(r1)
stw r31, 0xc(r1)
lis r31, smArg__Q23ipl6System@ha
addi r31, r31, smArg__Q23ipl6System@l
stw r30, 0x8(r1)
lwz r3, 0x14(r31)
lwz r5, 0xf4(r31)
lwz r12, 0(r3)
lwz r30, 0xa0(r5)
lwz r12, 0x24(r12)
mtctr r12
bctrl
lwz r5, 0x14(r31)
lis r7, sSystem__Q23ipl3snd@ha
mr r6, r3
mr r4, r30
addi r3, r7, sSystem__Q23ipl3snd@l
bl initOnMemory__Q33ipl3snd6SystemFPCvPQ23EGG4HeapUl
li r0, 1
stb r0, 0x2b7(r31)
lwz r0, 0x14(r1)
lwz r31, 0xc(r1)
lwz r30, 0x8(r1)
mtlr r0
addi r1, r1, 0x10
blr
}
#else
void System::constructSND_(void* work) {
const void* buffer = smArg.mResources.file[Arg::SOUND]->getBuffer();
u32 size = getSoundHeap()->getAllocatableSize(32);
snd::getSystem()->initOnMemory(buffer, getSoundHeap(), size);
snd::getSystem()->initOnMemory(smArg.mResources.file[Arg::SOUND]->getBuffer(), getSoundHeap(), getSoundHeap()->getAllocatableSize(32));
smArg.mbSndResLoaded = true;
}
#endif
void* System::loadZiDIC_(void* arcData, const char* fileName) {
void* buffer = NULL;

View File

@@ -5,11 +5,9 @@ Paths follow ctxdiff.py: build/43U/{src,obj}/<unit>.o. Requires pyelftools.
Exit 0: all selected tables match (or no tables); 1: mismatch; 2: invalid or
ambiguous input. This checks relative destinations, not behavioral equivalence.
Automatic selection covers jumptable_* symbols and multi-entry data objects
whose R_PPC_ADDR32 entries all target the selected function, with at least one
interior destination for objects lacking the jumptable_ prefix. This includes
compiler-generated @ names and custom names, but excludes ordinary callback
tables/vtables. Source locations are inferred from corresponding function relocations,
Automatic selection covers local jumptable_* symbols whose R_PPC_ADDR32 entries
all target the selected function. External callback tables/vtables are not
covered. Source locations are inferred from corresponding function relocations,
never from an assumption that both data sections have the same layout.
"""
@@ -115,11 +113,7 @@ def jump_target(obj, relocation, function):
def reference_tables(obj, function, name=None):
candidates = [obj.symbol(name)] if name else [
s for s in obj.symbols if s.size and (
s.name.startswith("jumptable_") or (
s.kind == "STT_OBJECT" and s.size >= 8
and isinstance(s.section, int)
and obj.sections[s.section][0] in (".data", ".rodata", ".sdata", ".sdata2")))]
s for s in obj.symbols if s.name.startswith("jumptable_") and s.size]
result = []
for table in candidates:
if not isinstance(table.section, int) or table.size % 4:
@@ -129,15 +123,10 @@ def reference_tables(obj, function, name=None):
section_size = obj.sections[table.section][1]
if table.value < 0 or table.value + table.size > section_size:
raise ValueError("reference table is outside its section")
targets = []
for offset in range(table.value, table.value + table.size, 4):
target = jump_target(obj, obj.relocs(table.section).get(offset), function)
if target is None:
break
targets.append(target)
if targets and len(targets) == table.size // 4:
if name or table.name.startswith("jumptable_") or any(targets):
result.append((table, targets))
targets = [jump_target(obj, obj.relocs(table.section).get(offset), function)
for offset in range(table.value, table.value + table.size, 4)]
if targets and all(target is not None for target in targets):
result.append((table, targets))
elif name:
raise ValueError("reference table does not target the selected function")
return result

View File

@@ -1,172 +0,0 @@
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Frame and branches match. Target leaves keyMode undefined on invalid enum; ours initializes it and adds mr r31,r30. No undefined-value experiments allowed.", "initial": [106, 105, 99], "fuzzy": 99.04762}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "label": "defined masked enum fallback", "compiled": true, "instructions": [106, 105, 101], "fuzzy": 99.04762, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "label": "defined direct-mode fallback", "compiled": true, "instructions": [106, 105, 101], "fuzzy": 99.04762, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "label": "defined current-mode fallback", "compiled": true, "instructions": [107, 105, 98], "fuzzy": 98.09524, "regressions": [], "measures": {"fuzzy_match_percent": 99.959274, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode", "instructions": [106, 105, 99]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Identical frame, branches and instruction counts; inlined setABCFlag flags and owner exchange r4/r6. Try setter argument boundary, owner lifetime, then declaration order.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "inline setter with explicit state and flags arguments", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "inline setter reads owner directly without temporary", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "bind key state reference before flag extraction", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Identical frame, branches and instruction counts; inlined setABCFlag flags and owner exchange r4/r6. Try setter argument boundary, owner lifetime, then declaration order.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "inline setter with explicit state and flags arguments", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "inline setter reads owner directly without temporary", "compiled": true, "instructions": [39, 39, 11], "fuzzy": 98.46154, "regressions": [], "measures": {"fuzzy_match_percent": 99.971214, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "bind key state reference before flag extraction", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Target frame 0x30 saves r30/r31; ours frame 0x40 saves r29/r30/r31. Target high byte load precedes mid and low byte grouped addition. Pointer and index order differ; correct endian expression/helper first.", "initial": [86, 84, 84], "fuzzy": 86.5}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "inline endian helper with high byte first and two addition groups", "compiled": true, "instructions": [84, 84, 48], "fuzzy": 83.72619, "regressions": [], "measures": {"fuzzy_match_percent": 93.22928, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "evaluate high byte group before low byte group", "compiled": true, "instructions": [86, 84, 85], "fuzzy": 82.27381, "regressions": [], "measures": {"fuzzy_match_percent": 93.09795, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "declare traversal index after pointers at endian helper boundary", "compiled": true, "instructions": [84, 84, 42], "fuzzy": 84.559525, "regressions": [], "measures": {"fuzzy_match_percent": 93.30463, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "instructions": [86, 84, 84]}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "label": "retain best structural helper for ctxdiff and declaration search", "compiled": true, "instructions": [84, 84, 42], "fuzzy": 84.559525, "regressions": [], "measures": {"fuzzy_match_percent": 93.30463, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "declsearch", "function": "pdm_part_is_master_boot_sector", "result": "23 builds, structural 20 exact 42, no improvement"}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_is_master_boot_sector", "instructions": [86, 84, 84]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "Frame 0x2e0 and buffer/array offsets match, 276 instructions each; target groups endian addition as (byte2<<16 + byte0)+(byte3<<24 + byte1<<8), ours chained high-to-low additions. Target end-of-loop stores branch to common exit.", "initial": [276, 276, 146], "fuzzy": 82.56159}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "label": "group low and high endian additions to match target", "compiled": true, "instructions": [276, 276, 141], "fuzzy": 82.61957, "regressions": [], "measures": {"fuzzy_match_percent": 93.49731, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "label": "reverse start/count array declaration order after endian grouping", "compiled": true, "instructions": [276, 276, 148], "fuzzy": 82.58696, "regressions": [], "measures": {"fuzzy_match_percent": 93.48762, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "label": "common success exit from extended partition selection", "compiled": true, "instructions": [275, 276, 202], "fuzzy": 82.677536, "regressions": [], "measures": {"fuzzy_match_percent": 93.514534, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_get_start_sector", "instructions": [276, 276, 146]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "824fe9fc0a89bfca627e6f55e7190796a2bd81fe", "remote_source_identical": true, "diagnosis": "51 instructions each with identical frame, branches and arithmetic. ratio and start swap r0/r3. Try conversion helper, narrower ratio, independent sector ratios, then declaration search.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "inline start-sector conversion helper", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "use media-sector ratio with 16 bit type", "compiled": true, "instructions": [51, 51, 16], "fuzzy": 97.84314, "regressions": [], "measures": {"fuzzy_match_percent": 93.48009, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "separate physical and logical ratios", "compiled": true, "instructions": [51, 51, 16], "fuzzy": 97.84314, "regressions": [], "measures": {"fuzzy_match_percent": 93.48009, "total_code": "3716", "matched_code": "2072", "matched_code_percent": 55.75888, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 17, "matched_functions_percent": 85.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 16]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "Arithmetic inline helper produced standalone exact match but regressed logical read/write. Test real helper argument order while protecting both callers.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order start,media_bps,bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order start,bps,media_bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order media_bps,start,bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order media_bps,bps,start", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order bps,start,media_bps", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "conversion helper argument order bps,media_bps,start", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 16]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "Conversion helper gives exact standalone but changes two already-exact inline callers. Try shared full conversion implementation with public wrapper and direct inline call sites, preserving real function.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "full physical-sector helper with public wrapper", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "logical read/write call shared implementation directly", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 16]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "After frame/branch/helper diagnosis and three structural trials, test setter branch inversion, shared mode temporary, flags assignment lifetime. Check standalone setter and other callers for regressions.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "setter early return on unchanged modifier flags", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "setter names retained input mode before comparison", "compiled": true, "instructions": [50, 49, 41], "fuzzy": 91.734695, "regressions": ["setABCFlag__Q59textinput8keyboard6pctype4Base8KeyStateFUl", "onlyQwerty__Q49textinput8keyboard6pctype4BaseFb", "setLangKeyActive__Q49textinput8keyboard6pctype4BaseFb", "create__Q49textinput8keyboard6pctype12LayoutByNW4RFP12MEMAllocator", "onlyQwerty__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "setLangKeyActive__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "updateInput__Q49textinput8keyboard6pctype12LayoutByNW4RFiffUlUlUlPv"], "measures": {"fuzzy_match_percent": 99.6742, "total_code": "28484", "matched_code": "24948", "matched_code_percent": 87.58601, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 131, "matched_functions_percent": 92.90781, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "separate assigned state and flags locals for declaration search", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "output": "fewer than two leading declarations; pass --lines START END\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "3c9af06f34375ee53e621fc7b90d9f211fd6ee88", "remote_source_identical": true, "diagnosis": "After frame/branch/helper diagnosis and three structural trials, test setter branch inversion, shared mode temporary, flags assignment lifetime. Check standalone setter and other callers for regressions.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "setter early return on unchanged modifier flags", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "setter names retained input mode before comparison", "compiled": true, "instructions": [40, 39, 34], "fuzzy": 94.48718, "regressions": ["setABCFlag__Q59textinput8keyboard6pctype4Base8KeyStateFUl", "onlyQwerty__Q49textinput8keyboard6pctype4BaseFb", "setLangKeyActive__Q49textinput8keyboard6pctype4BaseFb", "create__Q49textinput8keyboard6pctype12LayoutByNW4RFP12MEMAllocator", "onlyQwerty__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "setLangKeyActive__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "updateInput__Q49textinput8keyboard6pctype12LayoutByNW4RFiffUlUlUlPv"], "measures": {"fuzzy_match_percent": 99.6742, "total_code": "28484", "matched_code": "24948", "matched_code_percent": 87.58601, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 131, "matched_functions_percent": 92.90781, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "separate assigned state and flags locals for declaration search", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "output": "fewer than two leading declarations; pass --lines START END\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "9acff807814ebc31117a41f325bab0af803169cd", "remote_source_identical": true, "diagnosis": "126 instructions each, same frame. Target compares depth>=delay; target period step quotient precedes integer LFO resets and signed conversions; history stores follow all conversion stores. Try source/helper boundaries and history loop before register search.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "compute period step first then initialize integer state before conversions", "compiled": true, "instructions": [126, 126, 55], "fuzzy": 69.11905, "regressions": [], "measures": {"fuzzy_match_percent": 91.1535, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "clear history through nested channel/sample loops after LFO conversions", "compiled": true, "instructions": [126, 126, 32], "fuzzy": 92.92857, "regressions": [], "measures": {"fuzzy_match_percent": 95.62444, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "inline LFO state initialization separate from history initialization", "compiled": true, "instructions": [126, 126, 55], "fuzzy": 70.07143, "regressions": [], "measures": {"fuzzy_match_percent": 91.33234, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "retain history loop structural candidate for diagnosis", "compiled": true, "instructions": [126, 126, 32], "fuzzy": 92.92857, "regressions": [], "measures": {"fuzzy_match_percent": 95.62444, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "history loop and target depth comparison with original constant encounter order", "compiled": true, "instructions": [126, 126, 17], "fuzzy": 95.77778, "regressions": [], "measures": {"fuzzy_match_percent": 96.15946, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "integer LFO state first with original floating expression encounter order", "compiled": true, "instructions": [126, 126, 17], "fuzzy": 97.7381, "regressions": [], "measures": {"fuzzy_match_percent": 96.52757, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "load named LFO rate before conversion expressions", "compiled": true, "instructions": [126, 126, 21], "fuzzy": 97.53968, "regressions": [], "measures": {"fuzzy_match_percent": 96.49031, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "inspect closest structural initialization candidate", "compiled": true, "instructions": [126, 126, 17], "fuzzy": 97.7381, "regressions": [], "measures": {"fuzzy_match_percent": 96.52757, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "target step multiplication operand order and retained depth quotient", "compiled": true, "instructions": [126, 126, 18], "fuzzy": 94.47619, "regressions": [], "measures": {"fuzzy_match_percent": 95.915054, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "split meaningful float and loop declarations for allocation search", "compiled": true, "instructions": [126, 126, 18], "fuzzy": 94.47619, "regressions": [], "measures": {"fuzzy_match_percent": 95.915054, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "declsearch", "function": "__InitParams", "output": "fewer than two leading declarations; pass --lines START END\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "retain quotient then divide step by table length", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 97.2619, "regressions": [], "measures": {"fuzzy_match_percent": 96.43815, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "retain step and depth quotients before gradient conversion", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 94.15873, "regressions": [], "measures": {"fuzzy_match_percent": 95.85544, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "name phase step before period step and convert afterward", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 94.15873, "regressions": [], "measures": {"fuzzy_match_percent": 95.85544, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "origin": "426555a34f7dd162e14bc28ead5f55168f090eb8", "remote_source_identical": true, "diagnosis": "Target 65 instructions with 0x10 frame and signed 64-bit value negation, expanded signed 64-bit gradient product, CTR sample loop. Ours 51 instructions, truncates manually and decrements GPR. Restore signed shifts, compound multiplication width and fixed loop.", "initial": [51, 65, 65], "fuzzy": 68.53846}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "signed shifted 64 bit value and fixed count sample loop", "compiled": true, "instructions": [55, 65, 65], "fuzzy": 72.0, "regressions": [], "measures": {"fuzzy_match_percent": 91.637856, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "compound gradient product from signed widened difference", "compiled": true, "instructions": [61, 65, 65], "fuzzy": 62.215385, "regressions": [], "measures": {"fuzzy_match_percent": 90.69002, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "inline signed wide scaling helper for sample and gradient", "compiled": true, "instructions": [55, 65, 65], "fuzzy": 72.0, "regressions": [], "measures": {"fuzzy_match_percent": 91.637856, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "inspect compound widened gradient candidate", "compiled": true, "instructions": [61, 65, 65], "fuzzy": 62.215385, "regressions": [], "measures": {"fuzzy_match_percent": 90.69002, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "independent wide sample and gradient with shifts after both multiplications", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.07692, "regressions": [], "measures": {"fuzzy_match_percent": 92.71088, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "retain widened table difference directly in gradient product", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.30769, "regressions": [], "measures": {"fuzzy_match_percent": 92.73323, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "commute wide gradient operands after table subtraction", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.30769, "regressions": [], "measures": {"fuzzy_match_percent": 92.73323, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "compute sample product before widened table difference", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.07692, "regressions": [], "measures": {"fuzzy_match_percent": 92.71088, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "label": "declare phase before signed value then assign phase", "compiled": true, "instructions": [65, 65, 26], "fuzzy": 83.07692, "regressions": [], "measures": {"fuzzy_match_percent": 92.71088, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "declsearch", "function": "__CalcLFO", "output": "declaration block:\n u32 phase;\n s64 value;\nstart (8, 26)\nbest (8, 26) after 2 builds; source restored; best order was:\n u32 phase;\n s64 value;\n"}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__CalcLFO", "instructions": [51, 65, 65]}
{"event": "begin", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "origin": "31d0f12981dba19bb149c7904032cb1bf5529c79", "remote_source_identical": true, "diagnosis": "158 instructions and 0x40 frames each. Target loads round count first then key cursor; source state initializers live across round temporaries. Target XORs low-byte lookup with rotated byte8 and prior byte24/16 pair, while ours groups final two byte operands. Try XOR tree, helper round boundary, independent declarations.", "initial": [158, 158, 134], "fuzzy": 60.348103}
{"event": "pool", "unit": "libs/RevoEX/src/net/aes", "output": "POOL IDENTICAL up to 4 (mine=4 base=4)\n"}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "label": "explicit target low byte XOR association with nested high-byte pair", "compiled": true, "instructions": [158, 158, 134], "fuzzy": 60.348103, "regressions": [], "measures": {"fuzzy_match_percent": 75.11482, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "label": "inline encryption round lookup helper with target association", "compiled": true, "instructions": [158, 158, 139], "fuzzy": 53.83544, "regressions": [], "measures": {"fuzzy_match_percent": 73.61919, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "label": "separate leading state declarations from round-count and initial key loads", "compiled": true, "instructions": [158, 158, 134], "fuzzy": 60.348103, "regressions": [], "measures": {"fuzzy_match_percent": 75.11482, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "restored", "unit": "libs/RevoEX/src/net/aes", "function": "AESiEncryptBlock", "instructions": [158, 158, 134]}
{"event": "begin", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "origin": "326273b6198accfc1e4062bacb677ed1eec1ab74", "remote_source_identical": true, "diagnosis": "Target 251 instructions versus 249, same 0x40 frame. Target computes context keys base once then round offset; source folds offset into context. Target inverse MixColumns mutates four/twice/value operands separately with rotated accumulator, ours reassociates XOR chains. Structural pointer and mix boundaries first.", "initial": [249, 251, 244], "fuzzy": 61.49004}
{"event": "pool", "unit": "libs/RevoEX/src/net/aes", "output": "POOL IDENTICAL up to 4 (mine=4 base=4)\n"}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "label": "mutate inverse MixColumns intermediate terms in target operand order", "compiled": true, "instructions": [249, 251, 244], "fuzzy": 62.74502, "regressions": [], "measures": {"fuzzy_match_percent": 75.57268, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "label": "retain key schedule base separately before round offset", "compiled": true, "instructions": [251, 251, 224], "fuzzy": 63.836655, "regressions": [], "measures": {"fuzzy_match_percent": 75.97093, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "label": "inline inverse MixColumns column helper", "compiled": true, "instructions": [249, 251, 241], "fuzzy": 62.84462, "regressions": [], "measures": {"fuzzy_match_percent": 75.60901, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "restored", "unit": "libs/RevoEX/src/net/aes", "function": "AESiDecryptBlock", "instructions": [249, 251, 244]}
{"event": "begin", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Target 108 instructions vs 107. Target recomputes words from saved keyLength after memcpy; ours reuses rounds quotient. Target rotated substitution groups byte16 with byte24 then byte0 with byte8; bitfield transform flag is set before round count update. Try inline context setup and explicit substitution helper boundaries.", "initial": [107, 108, 81], "fuzzy": 88.98148}
{"event": "pool", "unit": "libs/RevoEX/src/net/aes", "output": "POOL IDENTICAL up to 4 (mine=4 base=4)\n"}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "label": "inline AES context setup before key word count computation", "compiled": true, "instructions": [107, 108, 77], "fuzzy": 92.73148, "regressions": [], "measures": {"fuzzy_match_percent": 75.70349, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "label": "set transformation bit before round count bitfield", "compiled": true, "instructions": [107, 108, 77], "fuzzy": 92.73148, "regressions": [], "measures": {"fuzzy_match_percent": 75.70349, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "attempt", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "label": "rotated key substitution grouped as target high and low pairs", "compiled": true, "instructions": [107, 108, 81], "fuzzy": 83.14815, "regressions": [], "measures": {"fuzzy_match_percent": 74.19913, "total_code": "2752", "matched_code": "684", "matched_code_percent": 24.85465, "total_data": "2800", "matched_data": "2800", "matched_data_percent": 100.0, "total_functions": 9, "matched_functions": 6, "matched_functions_percent": 66.66667, "total_units": 1}}
{"event": "restored", "unit": "libs/RevoEX/src/net/aes", "function": "NETAESCreateEx", "instructions": [107, 108, 81]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Register-only r4/r6 flags-owner exchange persists after setter boundary trials. Try getter inline boundary and modifier setter wrapper; retain only no-regression exact matches.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "modifier getter inline with state reference", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "modifier getter inline wrapping existing getter", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "modifier setter inline wrapping real member setter", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Register-only r4/r6 flags-owner exchange persists after setter boundary trials. Try getter inline boundary and modifier setter wrapper; retain only no-regression exact matches.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "modifier getter inline with state reference", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "modifier getter inline wrapping existing getter", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "modifier setter inline wrapping real member setter", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "History loop aligns stores and target compare, leaves 17 differences: phase/depth float scheduling and conversion outputs r7/r6/r5 plus zero r4. Introduce named signed conversion outputs and arithmetic lifetime before declaration search.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "separate signed fixed point conversion results from state stores", "compiled": true, "instructions": [126, 126, 23], "fuzzy": 95.53968, "regressions": [], "measures": {"fuzzy_match_percent": 96.11475, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "compute depth quotient before signed phase and period conversions", "compiled": true, "instructions": [126, 126, 26], "fuzzy": 93.69841, "regressions": [], "measures": {"fuzzy_match_percent": 95.769005, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "compound period scaling with retained quotient operand", "compiled": true, "instructions": [126, 126, 29], "fuzzy": 94.007935, "regressions": [], "measures": {"fuzzy_match_percent": 95.827126, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "origin": "a6c7690eb0e3c8f52487c7e736f3032f35bc5bc4", "remote_source_identical": true, "diagnosis": "Standalone full conversion helper matches, but inline logical callers need fresh diagnosis; compare their changed register assignments before searching local declaration order.", "initial": [51, 51, 16], "fuzzy": 97.84314}
{"event": "pool", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "inspect inline logical callers after standalone wrapper match", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": ["pdm_part_logical_read", "pdm_part_logical_write"], "measures": {"fuzzy_match_percent": 86.588806, "total_code": "3716", "matched_code": "1820", "matched_code_percent": 48.977394, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 16, "matched_functions_percent": 80.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "label": "keep logical read/write out-of-line call boundary proved by target using NO_INLINE", "compiled": true, "instructions": [51, 51, 0], "fuzzy": 100.0, "regressions": [], "measures": {"fuzzy_match_percent": 93.598495, "total_code": "3716", "matched_code": "2276", "matched_code_percent": 61.248653, "matched_data_percent": 100.0, "total_functions": 20, "matched_functions": 18, "matched_functions_percent": 90.0, "complete_data_percent": 100.0, "total_units": 1}}
{"event": "accepted", "unit": "libs/RVL_SDK/src/fa/pdm_partition", "function": "pdm_part_chg_ltop", "instructions": [51, 51, 0], "full_gate": "full build: ok\nmain.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d\n[src/keyboard/tiPcKeyboard] pool: IDENTICAL\n[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0\n[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141\n[src/keyboard/tiPcKeyboard] section .bss size 16 match None\n[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0\n[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0\n[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0\n[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332\n[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762\n[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635\n[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615\n[src/keyboard/tiPcKeyboard] baseline: code 27712/28484 data 18548 functions 138 fuzzy 99.9733\n[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL\n[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 93.5985 linked code 0\n[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20\n[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.598495\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159\n[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2072/3716 data None functions 17 fuzzy 93.4801\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 1920/2684 data 48 functions 5 fuzzy 91.3025\n[libs/RevoEX/src/net/aes] pool: IDENTICAL\n[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0\n[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9\n[libs/RevoEX/src/net/aes] section .data size 200 match 100.0\n[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0\n[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0\n[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482\n[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103\n[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004\n[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148\n[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148\nregressions vs baseline: 0\nglobal matched_code_percent: 88.09116 -> 88.09798\nglobal fuzzy_match_percent: 99.38004 -> 99.38019\nglobal complete_code_percent: 62.52416 -> 62.52416\nglobal matched_data_percent: 92.11517 -> 92.11517\nforbidden patterns added (net, per file): 0\nreadability warnings (net, per file; must be 0 in the final result): 0\nGATE PASS\n"}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Partition conversion demonstrated inline public wrapper plus preserved out-of-line call boundary can correct register coloring. Try same legitimate initialization implementation boundary with original validation and repaired history loop.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "discarded", "function": "__InitParams", "reason": "definition-only NO_INLINE too late for earlier callers; wrapper symbol not emitted; no count attributed"}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Partition conversion demonstrated inline public wrapper plus preserved out-of-line call boundary can correct register coloring. Try same legitimate initialization implementation boundary with original validation and repaired history loop.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "initialization helper with integer state first and history loop", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 97.38095, "regressions": [], "measures": {"fuzzy_match_percent": 96.46051, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "initialization helper with original state order and history loop", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 95.42063, "regressions": [], "measures": {"fuzzy_match_percent": 96.0924, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "initialization helper with signed conversion locals", "compiled": true, "instructions": [126, 126, 24], "fuzzy": 95.42063, "regressions": [], "measures": {"fuzzy_match_percent": 96.0924, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Closest 17 positional differences follow repaired history loop. Test direct period division instead of pre-folded reciprocal, signed loop indices, and loop helper lifetime, then stop after declaration search if no exact result.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "direct period divided by LFO table length", "compiled": true, "instructions": [126, 126, 16], "fuzzy": 97.81746, "regressions": [], "measures": {"fuzzy_match_percent": 96.54247, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "signed fixed channel and history sample traversal", "compiled": true, "instructions": [126, 126, 16], "fuzzy": 97.81746, "regressions": [], "measures": {"fuzzy_match_percent": 96.54247, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "inline history array loop helper after LFO conversion stores", "compiled": true, "instructions": [126, 126, 16], "fuzzy": 97.81746, "regressions": [], "measures": {"fuzzy_match_percent": 96.54247, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Structural and helper-boundary attempts exhausted; only flags/owner r4/r6 allocation differs. Run explicit-range declaration search over separately assigned state and flags locals.", "initial": [49, 49, 8], "fuzzy": 99.081635}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "label": "expose assigned modifier state and flags locals for final allocation check", "compiled": true, "instructions": [49, 49, 8], "fuzzy": 99.081635, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "output": "declaration block:\n Base::KeyState* state;\n u32 flags;\nstart (0, 8)\nbest (0, 8) after 2 builds; source restored; best order was:\n Base::KeyState* state;\n u32 flags;\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb", "instructions": [49, 49, 8]}
{"event": "begin", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Structural and helper-boundary attempts exhausted; only flags/owner r4/r6 allocation differs. Run explicit-range declaration search over separately assigned state and flags locals.", "initial": [39, 39, 8], "fuzzy": 98.84615}
{"event": "pool", "unit": "src/keyboard/tiPcKeyboard", "output": "POOL IDENTICAL up to 204 (mine=204 base=204)\n"}
{"event": "attempt", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "label": "expose assigned modifier state and flags locals for final allocation check", "compiled": true, "instructions": [39, 39, 8], "fuzzy": 98.84615, "regressions": [], "measures": {"fuzzy_match_percent": 99.97332, "total_code": "28484", "matched_code": "27712", "matched_code_percent": 97.2897, "total_data": "18564", "matched_data": "18548", "matched_data_percent": 99.91381, "total_functions": 141, "matched_functions": 138, "matched_functions_percent": 97.87234, "total_units": 1}}
{"event": "declsearch", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "output": "declaration block:\n Base::KeyState* state;\n u32 flags;\nstart (0, 8)\nbest (0, 8) after 2 builds; source restored; best order was:\n Base::KeyState* state;\n u32 flags;\n"}
{"event": "restored", "unit": "src/keyboard/tiPcKeyboard", "function": "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv", "instructions": [39, 39, 8]}
{"event": "begin", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "origin": "f4795462112db607d64efb2a3f78bdb33beffee9", "remote_source_identical": true, "diagnosis": "Direct period division removes operand mismatch; remaining 16 differences involve gradient/phase conversion scheduling and zero versus conversion-result GPR allocation. Try named compound phase calculation before independent gradient conversion.", "initial": [126, 126, 56], "fuzzy": 69.9127}
{"event": "pool", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "output": "POOL IDENTICAL up to 0 (mine=0 base=0)\n"}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "named compound phase quotient and retained depth quotient", "compiled": true, "instructions": [126, 126, 19], "fuzzy": 96.666664, "regressions": [], "measures": {"fuzzy_match_percent": 96.32638, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "attempt", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "label": "split phase and traversal declarations before allocation search", "compiled": true, "instructions": [126, 126, 19], "fuzzy": 96.666664, "regressions": [], "measures": {"fuzzy_match_percent": 96.32638, "total_code": "2684", "matched_code": "1920", "matched_code_percent": 71.53502, "total_data": "48", "matched_data": "48", "matched_data_percent": 100.0, "total_functions": 7, "matched_functions": 5, "matched_functions_percent": 71.42857, "total_units": 1}}
{"event": "declsearch", "function": "__InitParams", "output": "declaration block:\n f32 delay;\n f32 depth;\n f32 step;\n f32 phaseRate;\n u32 channel;\n u32 sample;\nstart (5, 19)\nbest (5, 19) after 36 builds; source restored; best order was:\n f32 delay;\n f32 depth;\n f32 step;\n f32 phaseRate;\n u32 channel;\n u32 sample;\n"}
{"event": "restored", "unit": "libs/RVL_SDK/src/axfx/AXFXChorusExp", "function": "__InitParams", "instructions": [126, 126, 56]}
{"event": "final_full_gate", "output": "full build: ok\nmain.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d\n[src/keyboard/tiPcKeyboard] pool: IDENTICAL\n[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0\n[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141\n[src/keyboard/tiPcKeyboard] section .bss size 16 match None\n[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0\n[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0\n[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0\n[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0\n[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0\n[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332\n[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762\n[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635\n[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615\n[src/keyboard/tiPcKeyboard] baseline: code 27712/28484 data 18548 functions 138 fuzzy 99.9733\n[libs/RVL_SDK/src/fa/pdm_partition] pool: IDENTICAL\n[libs/RVL_SDK/src/fa/pdm_partition] objdiff: code 2276/3716 data None/None functions 18/20 fuzzy 93.5985 linked code 0\n[libs/RVL_SDK/src/fa/pdm_partition] instruction-exact functions: 18/20\n[libs/RVL_SDK/src/fa/pdm_partition] section .text size 3716 match 93.598495\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_is_master_boot_sector 86.5\n[libs/RVL_SDK/src/fa/pdm_partition] below 100: pdm_part_get_start_sector 82.56159\n[libs/RVL_SDK/src/fa/pdm_partition] baseline: code 2072/3716 data None functions 17 fuzzy 93.4801\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846\n[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 1920/2684 data 48 functions 5 fuzzy 91.3025\n[libs/RevoEX/src/net/aes] pool: IDENTICAL\n[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0\n[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9\n[libs/RevoEX/src/net/aes] section .data size 200 match 100.0\n[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0\n[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0\n[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482\n[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103\n[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004\n[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148\n[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148\nregressions vs baseline: 0\nglobal matched_code_percent: 88.09116 -> 88.09798\nglobal fuzzy_match_percent: 99.38004 -> 99.38019\nglobal complete_code_percent: 62.52416 -> 62.52416\nglobal matched_data_percent: 92.11517 -> 92.11517\nforbidden patterns added (net, per file): 0\nreadability warnings (net, per file; must be 0 in the final result): 0\nGATE PASS\n", "compiled_attempts": 85, "attempt_counts": {"setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode": 3, "onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb": 10, "onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv": 10, "pdm_part_is_master_boot_sector": 4, "pdm_part_get_start_sector": 3, "pdm_part_chg_ltop": 13, "__InitParams": 24, "__CalcLFO": 9, "AESiEncryptBlock": 3, "AESiDecryptBlock": 3, "NETAESCreateEx": 3}, "source_commit": "92c886dd"}

View File

@@ -1,97 +0,0 @@
# Four-unit matching result, 2026-10-02
Source commit: 92c886dd, match partition sector conversion.
| Unit | Instruction-exact functions before -> after | Objdiff matched code bytes before -> after | Objdiff matched data bytes before -> after |
| --- | --- | --- | --- |
| src/keyboard/tiPcKeyboard | 138/141 -> 138/141 | 27712/28484 -> 27712/28484 | 18548/18564 -> 18548/18564 |
| libs/RVL_SDK/src/fa/pdm_partition | 17/20 -> 18/20 | 2072/3716 -> 2276/3716 | absent -> absent |
| libs/RVL_SDK/src/axfx/AXFXChorusExp | 5/7 -> 5/7 | 1920/2684 -> 1920/2684 | 48/48 -> 48/48 |
| libs/RevoEX/src/net/aes | 6/9 -> 6/9 | 684/2752 -> 684/2752 | 2800/2800 -> 2800/2800 |
## Accepted change
pdm_part_chg_ltop: 100.0% objdiff, 51/51 instructions, ctxdiff diffs 0. Extracted the unchanged conversion into an inline implementation and kept the public function out of line with NO_INLINE, matching the calls in the target's logical read/write functions. A wrapper without NO_INLINE matched conversion but expanded both callers from 57 to 87 instructions, so that candidate was rejected. Final logical read/write remain exact. Full clean gate has identical pools, zero regressions, zero forbidden patterns, zero readability warnings and the required DOL hash.
## Remaining functions
setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode, 99.04762%: 106/105 instructions; defined invalid-enum fallback adds mr r31,r30. Target default appears uninitialized. No undefined fallback introduced.
onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb, 99.081635%: 49/49 instructions; flags and owner exchange r4/r6, eight positional differences. Getter/setter boundaries and final explicit declaration search did not resolve allocation.
onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv, 98.84615%: 39/39 instructions; flags and owner exchange r4/r6, eight positional differences. Getter/setter boundaries and final explicit declaration search did not resolve allocation.
pdm_part_is_master_boot_sector, 86.5%: 86/84 instructions; extra saved register enlarges frame from target 0x30 to 0x40. Endian load scheduling and pointer allocation differ. Helper reduced frame and count, but remained non-exact.
pdm_part_get_start_sector, 82.56159%: 276/276 instructions; endian operand association, byte-load scheduling and retained traversal registers differ. Array and success-exit variants remained non-exact.
__InitParams, 69.9127%: 126/126 instructions; comparison operand order and floating/state-store scheduling differ. History-loop repair plus direct period division reached 97.81746%, 16 positional differences, but remained non-exact and was restored.
__CalcLFO, 68.53846%: 51/65 instructions; missing full signed 64-bit sample/gradient lifetime and CTR loop. Independent compound wide products reached 65/65 instructions, but retained 26 scheduling/allocation differences and were restored.
AESiEncryptBlock, 60.348103%: 158/158 instructions; initial state lifetime, table lookup scheduling and XOR associations differ. Three compiled helper/expression/declaration trials remained non-exact.
AESiDecryptBlock, 61.49004%: 249/251 instructions; target retains schedule base separately and different inverse MixColumns intermediate lifetimes. Base-pointer trial reached 251/251 but remained non-exact; restored.
NETAESCreateEx, 88.98148%: 107/108 instructions; quotient reuse prevents separate key-word recomputation, and substituted-byte association differs. Context initialization boundary reached 92.73148% but remained non-exact; restored.
## Attempt audit
85 compiled source attempts across all 11 initially open functions. Every remaining function has at least three distinct compiled source attempts. Declaration-search results and origin/main checks are recorded in sol-high-four-oct2.attempts.jsonl. Every function start fetched origin and compared current source with origin/main. Initial owned sources matched origin/main; subsequent differences were inspected owned experiments. No push, PR, worktree change, shared header change, or configure.py matching-status change.
## Files changed
- libs/RVL_SDK/src/fa/pdm_partition.c, committed in 92c886dd.
- tools/decomp-assist/sol-high-four-oct2.attempts.jsonl, attempt and validation evidence.
- tools/decomp-assist/sol-high-four-oct2.report.md, this report.
## Uncertainty
The intended invalid-enum fallback and the exact original LFO/compiler allocation boundaries remain unresolved. No uncertain source experiment was retained.
## Final full gate, copied verbatim
```text
full build: ok
main.dol sha1: 26116613f624061ba99c8d1a299aaa6efa85670d
[src/keyboard/tiPcKeyboard] pool: IDENTICAL
[src/keyboard/tiPcKeyboard] objdiff: code 27712/28484 data 18548/18564 functions 138/141 fuzzy 99.9733 linked code 0
[src/keyboard/tiPcKeyboard] instruction-exact functions: 138/141
[src/keyboard/tiPcKeyboard] section .bss size 16 match None
[src/keyboard/tiPcKeyboard] section .ctors size 4 match 100.0
[src/keyboard/tiPcKeyboard] section .data size 12576 match 100.0
[src/keyboard/tiPcKeyboard] section .rodata size 5816 match 100.0
[src/keyboard/tiPcKeyboard] section .sbss size 8 match 100.0
[src/keyboard/tiPcKeyboard] section .sdata size 136 match 100.0
[src/keyboard/tiPcKeyboard] section .sdata2 size 8 match 100.0
[src/keyboard/tiPcKeyboard] section .text size 28484 match 99.97332
[src/keyboard/tiPcKeyboard] below 100: setTranslateMode__Q49textinput8keyboard6pctype4BaseFQ59textinput8keyboard6pctype4Base13TranslateMode 99.04762
[src/keyboard/tiPcKeyboard] below 100: onPressedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFb 99.081635
[src/keyboard/tiPcKeyboard] below 100: onReleasedShift__Q49textinput8keyboard6pctype12LayoutByNW4RFv 98.84615
[src/keyboard/tiPcKeyboard] baseline: code 27712/28484 data 18548 functions 138 fuzzy 99.9733
[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 2072/3716 data None functions 17 fuzzy 93.4801
[libs/RVL_SDK/src/axfx/AXFXChorusExp] pool: IDENTICAL
[libs/RVL_SDK/src/axfx/AXFXChorusExp] objdiff: code 1920/2684 data 48/48 functions 5/7 fuzzy 91.3025 linked code 0
[libs/RVL_SDK/src/axfx/AXFXChorusExp] instruction-exact functions: 5/7
[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .sdata2 size 48 match 100.0
[libs/RVL_SDK/src/axfx/AXFXChorusExp] section .text size 2684 match 91.302536
[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __InitParams 69.9127
[libs/RVL_SDK/src/axfx/AXFXChorusExp] below 100: __CalcLFO 68.53846
[libs/RVL_SDK/src/axfx/AXFXChorusExp] baseline: code 1920/2684 data 48 functions 5 fuzzy 91.3025
[libs/RevoEX/src/net/aes] pool: IDENTICAL
[libs/RevoEX/src/net/aes] objdiff: code 684/2752 data 2800/2800 functions 6/9 fuzzy 75.1148 linked code 0
[libs/RevoEX/src/net/aes] instruction-exact functions: 6/9
[libs/RevoEX/src/net/aes] section .data size 200 match 100.0
[libs/RevoEX/src/net/aes] section .rodata size 2592 match 100.0
[libs/RevoEX/src/net/aes] section .sdata2 size 8 match 100.0
[libs/RevoEX/src/net/aes] section .text size 2752 match 75.11482
[libs/RevoEX/src/net/aes] below 100: AESiEncryptBlock 60.348103
[libs/RevoEX/src/net/aes] below 100: AESiDecryptBlock 61.49004
[libs/RevoEX/src/net/aes] below 100: NETAESCreateEx 88.98148
[libs/RevoEX/src/net/aes] baseline: code 684/2752 data 2800 functions 6 fuzzy 75.1148
regressions vs baseline: 0
global matched_code_percent: 88.09116 -> 88.09798
global fuzzy_match_percent: 99.38004 -> 99.38019
global complete_code_percent: 62.52416 -> 62.52416
global matched_data_percent: 92.11517 -> 92.11517
forbidden patterns added (net, per file): 0
readability warnings (net, per file; must be 0 in the final result): 0
GATE PASS
```

View File

@@ -144,55 +144,6 @@ class JumpTableTests(unittest.TestCase):
with self.assertRaisesRegex(ValueError, "does not target"):
tool.reference_tables(reference, reference.symbol("dispatch"), "jumptable_test")
def test_discovers_compiler_and_custom_names(self):
for name in ("@123", "scCharacterDispatch"):
reference = fixture()
reference.symbols[1] = replace(reference.symbols[1], name=name)
tables = tool.reference_tables(reference, reference.symbol("dispatch"))
self.assertEqual([(t.name, entries) for t, entries in tables],
[(name, [0x10, 0x20, 0x30])])
def test_custom_table_can_include_function_entry(self):
reference = fixture((0, 0x10, 0x20), source=True)
tables = tool.reference_tables(reference, reference.symbol("dispatch"))
self.assertEqual(tables[0][1], [0, 0x10, 0x20])
def test_function_entry_callback_array_is_not_auto_selected(self):
reference = fixture((0, 0, 0), source=True)
fn = reference.symbol("dispatch")
self.assertEqual(tool.reference_tables(reference, fn), [])
self.assertEqual(tool.reference_tables(reference, fn, "@123")[0][1],
[0, 0, 0])
def test_single_pointer_requires_explicit_name(self):
reference = fixture((0x10,), source=True)
fn = reference.symbol("dispatch")
self.assertEqual(tool.reference_tables(reference, fn), [])
self.assertEqual(tool.reference_tables(reference, fn, "@123")[0][1], [0x10])
def test_custom_table_requires_data_object(self):
reference = fixture(source=True)
reference.symbols[1] = replace(reference.symbols[1], kind="STT_NOTYPE")
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
reference.symbols[1] = replace(reference.symbols[1], kind="STT_OBJECT")
reference.sections[2] = (".text", 0x1000)
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
def test_custom_table_with_missing_or_external_entry_is_not_selected(self):
for entries in ((0x10, 0x20, 0x80), (0x10, 0x20, 0x30)):
reference = fixture(entries, source=True)
if entries[-1] == 0x30:
del reference.relocations[2][0x48]
self.assertEqual(tool.reference_tables(reference, reference.symbol("dispatch")), [])
def test_auto_custom_table_still_detects_swapped_entries(self):
reference = fixture(source=True)
source = fixture((0x20, 0x10, 0x30), source=True, table_offset=0x90)
with patch.object(tool, "read_object", side_effect=[source, reference]):
with contextlib.redirect_stdout(io.StringIO()) as output:
self.assertEqual(tool.main(["unused", "dispatch"]), 1)
self.assertIn("@123: 1/3 entries match", output.getvalue())
def test_cli_exit_codes(self):
for source, expected_status in [(fixture(source=True), 0),
(fixture((0x20, 0x10, 0x30), source=True), 1)]: