From 69d1d372628e006caea4e19e8891bf18c558e78b Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Fri, 10 Jul 2026 14:58:19 -0600 Subject: [PATCH] =?UTF-8?q?feat(phase-25):=20T7=20F-band=20wave=203=20?= =?UTF-8?q?=E2=80=94=20func=5F80164930=20cracked=20+=20swept=20=C3=97134?= =?UTF-8?q?=20(read-global=20fix);=20fleet=2073.85->73.89%,=20R22=20136/13?= =?UTF-8?q?6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - func_80164930 (81 ins) CRACKED + swept x134 = 134 fns (133/0 siblings, family_sweep --reconcile). The crack = the read-global fix: flip the file-scope decl s16->u16 (byte-neutral to the store-only caller func_801647A4) + reference the global directly, so the read lowers to direct-addressed `lhu`. - TWO DURABLE FINDINGS (cookbook §42b): (1) THE STALE-OBJECT GATE TRAP: a piped `make build >/dev/null` that FAILS leaves a stale .o, and `asm-differ -o` then reports a phantom score-0. This invalidated wave-2's "iso-drift" labels -- a rigorous re-check (rm .o + build exit-code + real whole-binary SHA) shows all 4 remaining iso-drift drafts NOCOMPILE (unreconciled callee externs vs the TU canonical-sig layer). Every gate MUST rm the split .o + check the exit code (compounds the §42a --out gotcha). (2) canon_sig_reconcile `*(T*)&D_sym` READ-global drift: &sym forces the address into a held register (kills direct %hi/%lo -> schedule drift); write-only globals unaffected. Fix = file-scope exact-type decl + direct ref (a block-scoped `extern u16` vs ambient s16 is a hard cc1 conflicting-types error). - Frontier reassessed: the 9 remaining wave-3 targets each need real-TU reconcile-cracking (NOT gating the broken wave-2 drafts); each cracks -> ~134 fns (all x134 families). ~1,200 fleet potential. - R22 clean-fleet 136/136 BYTE-IDENTICAL from a fully clean tree; NON_MATCHING 7 (0 in default build, G4). --- docs/matching-cookbook.md | 39 ++++ docs/progress.fleet.md | 274 ++++++++++++++-------------- phase-ends/CURRENT_PHASE.md | 26 ++- src/ov_SC01_000/ov_SC01_000_after.c | 54 +++++- src/ov_SC01_001/ov_SC01_001_after.c | 54 +++++- src/ov_SC01_004/ov_SC01_004_after.c | 54 +++++- src/ov_SC01_005/ov_SC01_005_after.c | 54 +++++- src/ov_SC01_006/ov_SC01_006_after.c | 54 +++++- src/ov_SC01_008/ov_SC01_008_after.c | 54 +++++- src/ov_SC01_009/ov_SC01_009_after.c | 54 +++++- src/ov_SC01_074/ov_SC01_074_after.c | 54 +++++- src/ov_SC01_077/ov_SC01_077_after.c | 54 +++++- src/ov_SC01_080/ov_SC01_080_after.c | 54 +++++- src/ov_SC01_084/ov_SC01_084_after.c | 54 +++++- src/ov_SC02_000/ov_SC02_000_after.c | 54 +++++- src/ov_SC02_003/ov_SC02_003_after.c | 54 +++++- src/ov_SC02_004/ov_SC02_004_after.c | 54 +++++- src/ov_SC02_005/ov_SC02_005_after.c | 54 +++++- src/ov_SC02_011/ov_SC02_011_after.c | 54 +++++- src/ov_SC02_015/ov_SC02_015_after.c | 54 +++++- src/ov_SC02_016/ov_SC02_016_after.c | 54 +++++- src/ov_SC02_017/ov_SC02_017_after.c | 54 +++++- src/ov_SC02_021/ov_SC02_021_after.c | 54 +++++- src/ov_SC02_026/ov_SC02_026_after.c | 54 +++++- src/ov_SC02_027/ov_SC02_027_after.c | 54 +++++- src/ov_SC02_028/ov_SC02_028_after.c | 54 +++++- src/ov_SC02_031/ov_SC02_031_after.c | 54 +++++- src/ov_SC02_035/ov_SC02_035_after.c | 54 +++++- src/ov_SC02_039/ov_SC02_039_after.c | 54 +++++- src/ov_SC02_041/ov_SC02_041_after.c | 54 +++++- src/ov_SC03_001/ov_SC03_001_after.c | 54 +++++- src/ov_SC03_002/ov_SC03_002_after.c | 54 +++++- src/ov_SC03_003/ov_SC03_003_after.c | 54 +++++- src/ov_SC03_006/ov_SC03_006_after.c | 54 +++++- src/ov_SC03_007/ov_SC03_007_after.c | 54 +++++- src/ov_SC03_010/ov_SC03_010_after.c | 54 +++++- src/ov_SC03_011/ov_SC03_011_after.c | 54 +++++- src/ov_SC03_012/ov_SC03_012_after.c | 54 +++++- src/ov_SC03_013/ov_SC03_013_after.c | 54 +++++- src/ov_SC03_014/ov_SC03_014_after.c | 54 +++++- src/ov_SC03_015/ov_SC03_015_after.c | 54 +++++- src/ov_SC03_023/ov_SC03_023_after.c | 54 +++++- src/ov_SC03_024/ov_SC03_024_after.c | 54 +++++- src/ov_SC03_028/ov_SC03_028_after.c | 54 +++++- src/ov_SC03_029/ov_SC03_029_after.c | 54 +++++- src/ov_SC03_030/ov_SC03_030_after.c | 54 +++++- src/ov_SC03_031/ov_SC03_031_after.c | 54 +++++- src/ov_SC03_089/ov_SC03_089_after.c | 54 +++++- src/ov_SC03_090/ov_SC03_090_after.c | 54 +++++- src/ov_SC03_091/ov_SC03_091_after.c | 54 +++++- src/ov_SC03_092/ov_SC03_092_after.c | 54 +++++- src/ov_SC03_093/ov_SC03_093_after.c | 54 +++++- src/ov_SC03_094/ov_SC03_094_after.c | 54 +++++- src/ov_SC03_095/ov_SC03_095_after.c | 54 +++++- src/ov_SC03_096/ov_SC03_096_after.c | 54 +++++- src/ov_SC03_097/ov_SC03_097_after.c | 54 +++++- src/ov_SC03_098/ov_SC03_098_after.c | 54 +++++- src/ov_SC03_099/ov_SC03_099_after.c | 54 +++++- src/ov_SC03_100/ov_SC03_100_after.c | 54 +++++- src/ov_SC03_101/ov_SC03_101_after.c | 54 +++++- src/ov_SC03_102/ov_SC03_102_after.c | 54 +++++- src/ov_SC03_103/ov_SC03_103_after.c | 54 +++++- src/ov_SC03_104/ov_SC03_104_after.c | 54 +++++- src/ov_SC03_105/ov_SC03_105_after.c | 54 +++++- src/ov_SC03_108/ov_SC03_108_after.c | 54 +++++- src/ov_SC03_109/ov_SC03_109_after.c | 54 +++++- src/ov_SC03_110/ov_SC03_110_after.c | 54 +++++- src/ov_SC03_111/ov_SC03_111_after.c | 54 +++++- src/ov_SC03_112/ov_SC03_112_after.c | 54 +++++- src/ov_SC03_113/ov_SC03_113_after.c | 54 +++++- src/ov_SC03_114/ov_SC03_114_after.c | 54 +++++- src/ov_SC03_115/ov_SC03_115_after.c | 54 +++++- src/ov_SC03_116/ov_SC03_116_after.c | 54 +++++- src/ov_SC03_117/ov_SC03_117_after.c | 54 +++++- src/ov_SC03_118/ov_SC03_118_after.c | 54 +++++- src/ov_SC03_119/ov_SC03_119_after.c | 54 +++++- src/ov_SC03_121/ov_SC03_121_after.c | 54 +++++- src/ov_SC03_124/ov_SC03_124_after.c | 54 +++++- src/ov_SC03_125/ov_SC03_125_after.c | 54 +++++- src/ov_SC03_126/ov_SC03_126_after.c | 54 +++++- src/ov_SC04_000/ov_SC04_000_after.c | 54 +++++- src/ov_SC04_002/ov_SC04_002_after.c | 54 +++++- src/ov_SC04_003/ov_SC04_003_after.c | 54 +++++- src/ov_SC04_004/ov_SC04_004_after.c | 54 +++++- src/ov_SC04_005/ov_SC04_005_after.c | 54 +++++- src/ov_SC04_006/ov_SC04_006_after.c | 54 +++++- src/ov_SC04_007/ov_SC04_007_after.c | 54 +++++- src/ov_SC04_008/ov_SC04_008_after.c | 54 +++++- src/ov_SC04_009/ov_SC04_009_after.c | 54 +++++- src/ov_SC04_010/ov_SC04_010_after.c | 54 +++++- src/ov_SC04_011/ov_SC04_011_after.c | 54 +++++- src/ov_SC04_012/ov_SC04_012_after.c | 54 +++++- src/ov_SC04_015/ov_SC04_015_after.c | 54 +++++- src/ov_SC04_016/ov_SC04_016_after.c | 54 +++++- src/ov_SC04_018/ov_SC04_018_after.c | 54 +++++- src/ov_SC04_019/ov_SC04_019_after.c | 54 +++++- src/ov_SC04_020/ov_SC04_020_after.c | 54 +++++- src/ov_SC04_021/ov_SC04_021_after.c | 54 +++++- src/ov_SC05_000/ov_SC05_000_after.c | 54 +++++- src/ov_SC05_001/ov_SC05_001_after.c | 54 +++++- src/ov_SC05_002/ov_SC05_002_after.c | 54 +++++- src/ov_SC05_003/ov_SC05_003_after.c | 54 +++++- src/ov_SC05_004/ov_SC05_004_after.c | 54 +++++- src/ov_SC05_005/ov_SC05_005_after.c | 54 +++++- src/ov_SC05_006/ov_SC05_006_after.c | 54 +++++- src/ov_SC05_007/ov_SC05_007_after.c | 54 +++++- src/ov_SC05_008/ov_SC05_008_after.c | 54 +++++- src/ov_SC05_009/ov_SC05_009_after.c | 54 +++++- src/ov_SC05_010/ov_SC05_010_after.c | 54 +++++- src/ov_SC05_011/ov_SC05_011_after.c | 54 +++++- src/ov_SC05_017/ov_SC05_017_after.c | 54 +++++- src/ov_SC05_018/ov_SC05_018_after.c | 54 +++++- src/ov_SC05_019/ov_SC05_019_after.c | 54 +++++- src/ov_SC06_000/ov_SC06_000_after.c | 54 +++++- src/ov_SC06_006/ov_SC06_006_after.c | 54 +++++- src/ov_SC06_008/ov_SC06_008_after.c | 54 +++++- src/ov_SC06_010/ov_SC06_010_after.c | 54 +++++- src/ov_SC06_011/ov_SC06_011_after.c | 54 +++++- src/ov_SC06_013/ov_SC06_013_after.c | 54 +++++- src/ov_SC06_014/ov_SC06_014_after.c | 54 +++++- src/ov_SC06_015/ov_SC06_015_after.c | 54 +++++- src/ov_SC06_016/ov_SC06_016_after.c | 54 +++++- src/ov_SC06_018/ov_SC06_018_after.c | 54 +++++- src/ov_SC06_020/ov_SC06_020_after.c | 54 +++++- src/ov_SC06_022/ov_SC06_022_after.c | 54 +++++- src/ov_SC06_024/ov_SC06_024_after.c | 54 +++++- src/ov_SC06_025/ov_SC06_025_after.c | 54 +++++- src/ov_SC06_027/ov_SC06_027_after.c | 54 +++++- src/ov_SC06_029/ov_SC06_029_after.c | 54 +++++- src/ov_SC06_030/ov_SC06_030_after.c | 54 +++++- src/ov_SC06_032/ov_SC06_032_after.c | 54 +++++- src/ov_SC06_033/ov_SC06_033_after.c | 54 +++++- src/ov_SC07_000/ov_SC07_000_after.c | 54 +++++- src/ov_SC07_001/ov_SC07_001_after.c | 54 +++++- src/ov_SC07_002/ov_SC07_002_after.c | 54 +++++- src/ov_SC07_008/ov_SC07_008_after.c | 54 +++++- src/ov_SC07_009/ov_SC07_009_after.c | 54 +++++- 137 files changed, 7302 insertions(+), 273 deletions(-) diff --git a/docs/matching-cookbook.md b/docs/matching-cookbook.md index cc6742558..fdd784e55 100644 --- a/docs/matching-cookbook.md +++ b/docs/matching-cookbook.md @@ -2571,3 +2571,42 @@ Verify with `cc1 -fno-builtin`: struct-assign still emits lwl/lwr; the memcpy dr LOWER than wave 1 (real-TU attrition), fixable by the real-TU-verify rule above. The 5 nears (func_80134A74 71→16, func_80133AB0 →28 aligned, func_8012FCC4 beqz/jal delay-swap, func_80185BA4 65, func_801670E4 70 "irreducible") are permuter-ILS fuel / G4 candidates. + +### §42b addendum — wave 3 (Max, 2026-07-10c): THE STALE-OBJECT GATE TRAP + the read-global `&`-cast drift + fix + +**THE #1 METHODOLOGY BUG (invalidated wave-2's "iso-drift" labels; fix ALL gates).** A per-function real-TU +check that does `make build BINARY= >/dev/null 2>&1` and then runs `asm-differ -o ` **without checking +the build exit code and without removing the split `.o` first** will diff a **STALE object** whenever the build +FAILS — reporting a phantom **score 0 / "MATCH"** for a draft that never compiled. Measured this wave: three +wave-2 "iso-drift" fns (func_8016C188, func_80168828, func_80136824) read as score-0 on the first pass, then +**NOCOMPILE** on a forced-clean pass (`rm build/src//.o` + exit-code check). Root cause of the false +score: the stale `.o` from a prior good build survives the failed compile, and `asm-differ -o` happily diffs it. +**This is almost certainly why wave 2 mis-classified 5 fns as "iso-MATCH → drift"** — several likely never +compiled in the real TU at all. **MANDATORY gate shape (now in `.run/crack3/diff.sh`):** `git checkout ` → +splice → `rm build/src//.o` → `make build BINARY=` and **assert exit 0** → `sha1sum` the built +binary vs `config/check..sha` (the real whole-binary arbiter) → only THEN `asm-differ -o` for the diff view. +Never trust a piped `make build` you didn't exit-check. (Compounds with the §42a `--out` gotcha — both produce +false PASS/FAIL on overlays.) + +**The `*(T*)&D_sym` read-global drift (a `canon_sig_reconcile` defect) + the fix — byte-proven on func_80164930.** +`canon_sig_reconcile` rewrites an ambient-conflicting global access as `*(u16*)&D_sym` (cast-at-use, to dodge a +type conflict). For a **write-only** global this is byte-neutral (`lui at,%hi; sh v,%lo(at)` — direct addressing). +For a **read** (esp. read-modify-write) global it **DRIFTS**: `&D_sym` forces gcc to materialize the FULL address +into a held register (`lui a0,%hi; addiu a0,a0,%lo; lhu v0,0(a0)`) instead of the target's direct +`lui v0,%hi; lhu v0,%lo(D_sym)(v0)` — and it reuses that held reg for the store, shifting the whole schedule. +**The wall:** the target read needs `lhu` (u16) but the ambient TU decl is `s16`; a block-scoped +`extern unsigned short D_sym` inside the fn is a **hard `conflicting types` ERROR** in gcc-2.7.2 (cc1 exit 33, +NOT a warning — signed/unsigned short mismatch). **The fix:** flip the **file-scope** decl to the exact type +(`extern s16 D_8018971C;` → `extern u16 D_8018971C;`) — byte-neutral when the only other referencer is store-only +(func_801647A4 stores `= 0x80` → `sh` either way) — and reference the global **directly** (no `*(T*)&`). Result: +whole-overlay `d19c9580` BYTE-IDENTICAL, func_801647A4 unaffected. **General rule for drafters/reconcile:** a +read global that needs a specific load width (`lhu`/`lh`) must be a **direct-typed lvalue at file scope**, never +`*(T*)&sym`; align the whole TU on one type rather than casting at use. **Sweep caveat:** the file-scope-decl +flip is per-TU, so `family_sweep --reconcile` must also flip each sibling's decl (or the sibling's caller must be +an unmatched stub with no conflicting decl) — else siblings NOCOMPILE like the frame-pad class (§42 lever 3). + +**Wave-3 consequence:** the wave-2 `uc2_gate_*` drafts are **not** reliable seeds — several NOCOMPILE (unreconciled +callee externs conflicting with the TU canonical-sig layer, e.g. `conflicting types for func_80015954`) and the +"iso-MATCH" labels were stale-object phantoms. Wave-3 targets must be **re-reconciled + rigorously rebuilt** per fn +(the `.run/crack3/` harness), not gated from the wave-2 artifacts. Confirmed banks this wave: **func_80164930** +(the read-global fix above). diff --git a/docs/progress.fleet.md b/docs/progress.fleet.md index b713ee699..b14dd0ee5 100644 --- a/docs/progress.fleet.md +++ b/docs/progress.fleet.md @@ -3,148 +3,148 @@ # source-derived (committed src/*.c + config/dedup.us.yaml). Live byte gate: `make check-all`; # cross-binary collapsible-byte leverage: docs/duplicates.cross.md. -FLEET REAL substantive : 252745 (of which dedup-shared 223275 via 1813 groups / 223725 instances) +FLEET REAL substantive : 252879 (of which dedup-shared 223275 via 1813 groups / 223725 instances) FLEET LINKED PsyQ objs : 959 -FLEET byte-identical : 254274 / 344306 = 73.85% (REAL+LINKED+empties) +FLEET byte-identical : 254408 / 344306 = 73.89% (REAL+LINKED+empties) FLEET NON_MATCHING : 7 (0 in any default build — G4) -FLEET INCLUDE_ASM stubs : 90025 +FLEET INCLUDE_ASM stubs : 89891 FLEET matchable : 344306 | binary | REAL | shared | LINKED | byte-ident | matchable | byte-ident % | |---|---:|---:|---:|---:|---:|---:| | main | 54 | 2 | 959 | 1055 | 2096 | 50.3% | | resident | 123 | 0 | 0 | 125 | 146 | 85.6% | -| ov_SC01_000 | 1879 | 1669 | 0 | 1879 | 2407 | 78.1% | -| ov_SC01_001 | 1876 | 1669 | 0 | 1878 | 2471 | 76.0% | -| ov_SC01_004 | 1869 | 1660 | 0 | 1870 | 2418 | 77.3% | -| ov_SC01_005 | 1893 | 1682 | 0 | 1893 | 2508 | 75.5% | -| ov_SC01_006 | 1892 | 1682 | 0 | 1892 | 2508 | 75.4% | -| ov_SC01_008 | 1870 | 1660 | 0 | 1872 | 2430 | 77.0% | -| ov_SC01_009 | 1890 | 1661 | 0 | 1891 | 2512 | 75.3% | -| ov_SC01_074 | 1870 | 1661 | 0 | 1872 | 2429 | 77.1% | -| ov_SC01_077 | 2270 | 1624 | 0 | 2272 | 2586 | 87.9% | -| ov_SC01_080 | 1888 | 1664 | 0 | 1888 | 2517 | 75.0% | -| ov_SC01_084 | 1891 | 1664 | 0 | 1896 | 2583 | 73.4% | -| ov_SC02_000 | 1908 | 1699 | 0 | 1908 | 2688 | 71.0% | -| ov_SC02_003 | 1908 | 1699 | 0 | 1908 | 2688 | 71.0% | -| ov_SC02_004 | 1874 | 1664 | 0 | 1874 | 2405 | 77.9% | -| ov_SC02_005 | 1933 | 1660 | 0 | 1943 | 2932 | 66.3% | -| ov_SC02_011 | 1914 | 1667 | 0 | 1925 | 2898 | 66.4% | -| ov_SC02_015 | 1875 | 1666 | 0 | 1875 | 2418 | 77.5% | -| ov_SC02_016 | 1879 | 1666 | 0 | 1882 | 2550 | 73.8% | -| ov_SC02_017 | 1898 | 1666 | 0 | 1906 | 2737 | 69.6% | -| ov_SC02_021 | 1878 | 1666 | 0 | 1878 | 2441 | 76.9% | -| ov_SC02_026 | 1882 | 1664 | 0 | 1888 | 2577 | 73.3% | -| ov_SC02_027 | 1891 | 1664 | 0 | 1900 | 2697 | 70.4% | -| ov_SC02_028 | 1899 | 1664 | 0 | 1909 | 2706 | 70.5% | -| ov_SC02_031 | 1889 | 1665 | 0 | 1894 | 2567 | 73.8% | -| ov_SC02_035 | 1880 | 1664 | 0 | 1883 | 2525 | 74.6% | -| ov_SC02_039 | 1871 | 1664 | 0 | 1871 | 2420 | 77.3% | -| ov_SC02_041 | 1878 | 1664 | 0 | 1881 | 2565 | 73.3% | -| ov_SC03_001 | 1931 | 1665 | 0 | 1948 | 2874 | 67.8% | -| ov_SC03_002 | 1897 | 1669 | 0 | 1912 | 2636 | 72.5% | -| ov_SC03_003 | 1869 | 1664 | 0 | 1870 | 2427 | 77.0% | -| ov_SC03_006 | 1910 | 1670 | 0 | 1919 | 2772 | 69.2% | -| ov_SC03_007 | 1885 | 1664 | 0 | 1889 | 2628 | 71.9% | -| ov_SC03_010 | 1879 | 1664 | 0 | 1879 | 2474 | 75.9% | -| ov_SC03_011 | 1875 | 1664 | 0 | 1881 | 2532 | 74.3% | -| ov_SC03_012 | 1870 | 1664 | 0 | 1871 | 2410 | 77.6% | -| ov_SC03_013 | 1878 | 1664 | 0 | 1878 | 2497 | 75.2% | -| ov_SC03_014 | 1900 | 1689 | 0 | 1900 | 2690 | 70.6% | -| ov_SC03_015 | 1906 | 1689 | 0 | 1906 | 2690 | 70.9% | -| ov_SC03_023 | 1872 | 1664 | 0 | 1873 | 2439 | 76.8% | -| ov_SC03_024 | 1902 | 1669 | 0 | 1909 | 2646 | 72.1% | -| ov_SC03_028 | 1893 | 1664 | 0 | 1897 | 2669 | 71.1% | -| ov_SC03_029 | 1879 | 1666 | 0 | 1889 | 2649 | 71.3% | -| ov_SC03_030 | 1880 | 1668 | 0 | 1882 | 2500 | 75.3% | -| ov_SC03_031 | 1874 | 1664 | 0 | 1878 | 2519 | 74.6% | -| ov_SC03_089 | 1884 | 1664 | 0 | 1891 | 2586 | 73.1% | -| ov_SC03_090 | 1885 | 1664 | 0 | 1893 | 2630 | 72.0% | -| ov_SC03_091 | 1884 | 1664 | 0 | 1892 | 2645 | 71.5% | -| ov_SC03_092 | 1884 | 1664 | 0 | 1896 | 2592 | 73.1% | -| ov_SC03_093 | 1881 | 1664 | 0 | 1885 | 2568 | 73.4% | -| ov_SC03_094 | 1875 | 1664 | 0 | 1881 | 2581 | 72.9% | -| ov_SC03_095 | 1873 | 1664 | 0 | 1876 | 2479 | 75.7% | -| ov_SC03_096 | 1876 | 1664 | 0 | 1879 | 2470 | 76.1% | -| ov_SC03_097 | 1880 | 1664 | 0 | 1887 | 2608 | 72.4% | -| ov_SC03_098 | 1876 | 1664 | 0 | 1879 | 2546 | 73.8% | -| ov_SC03_099 | 1873 | 1664 | 0 | 1876 | 2509 | 74.8% | -| ov_SC03_100 | 1875 | 1664 | 0 | 1879 | 2544 | 73.9% | -| ov_SC03_101 | 1877 | 1664 | 0 | 1881 | 2533 | 74.3% | -| ov_SC03_102 | 1877 | 1664 | 0 | 1880 | 2497 | 75.3% | -| ov_SC03_103 | 1876 | 1666 | 0 | 1879 | 2515 | 74.7% | -| ov_SC03_104 | 1887 | 1664 | 0 | 1894 | 2621 | 72.3% | -| ov_SC03_105 | 1881 | 1664 | 0 | 1888 | 2602 | 72.6% | -| ov_SC03_108 | 1869 | 1664 | 0 | 1869 | 2448 | 76.3% | -| ov_SC03_109 | 1870 | 1664 | 0 | 1872 | 2428 | 77.1% | -| ov_SC03_110 | 1872 | 1664 | 0 | 1872 | 2473 | 75.7% | -| ov_SC03_111 | 1877 | 1664 | 0 | 1880 | 2515 | 74.8% | -| ov_SC03_112 | 1875 | 1666 | 0 | 1877 | 2531 | 74.2% | -| ov_SC03_113 | 1872 | 1666 | 0 | 1875 | 2473 | 75.8% | -| ov_SC03_114 | 1868 | 1664 | 0 | 1870 | 2419 | 77.3% | -| ov_SC03_115 | 1876 | 1664 | 0 | 1878 | 2477 | 75.8% | -| ov_SC03_116 | 1874 | 1664 | 0 | 1877 | 2443 | 76.8% | -| ov_SC03_117 | 1874 | 1664 | 0 | 1880 | 2562 | 73.4% | -| ov_SC03_118 | 1902 | 1688 | 0 | 1903 | 2690 | 70.7% | -| ov_SC03_119 | 1897 | 1688 | 0 | 1898 | 2690 | 70.6% | -| ov_SC03_121 | 1874 | 1664 | 0 | 1877 | 2464 | 76.2% | -| ov_SC03_124 | 1898 | 1660 | 0 | 1918 | 2746 | 69.8% | -| ov_SC03_125 | 1880 | 1664 | 0 | 1892 | 2593 | 73.0% | -| ov_SC03_126 | 1871 | 1666 | 0 | 1871 | 2427 | 77.1% | -| ov_SC04_000 | 1880 | 1668 | 0 | 1889 | 2551 | 74.0% | -| ov_SC04_002 | 1884 | 1664 | 0 | 1888 | 2641 | 71.5% | -| ov_SC04_003 | 1872 | 1664 | 0 | 1876 | 2507 | 74.8% | -| ov_SC04_004 | 1879 | 1664 | 0 | 1881 | 2563 | 73.4% | -| ov_SC04_005 | 1881 | 1664 | 0 | 1887 | 2617 | 72.1% | -| ov_SC04_006 | 1870 | 1664 | 0 | 1872 | 2458 | 76.2% | -| ov_SC04_007 | 1880 | 1664 | 0 | 1884 | 2574 | 73.2% | -| ov_SC04_008 | 1870 | 1664 | 0 | 1870 | 2419 | 77.3% | -| ov_SC04_009 | 1873 | 1664 | 0 | 1876 | 2445 | 76.7% | -| ov_SC04_010 | 1873 | 1664 | 0 | 1874 | 2423 | 77.3% | -| ov_SC04_011 | 1896 | 1664 | 0 | 1902 | 2808 | 67.7% | -| ov_SC04_012 | 1870 | 1664 | 0 | 1871 | 2424 | 77.2% | -| ov_SC04_015 | 1890 | 1665 | 0 | 1901 | 2616 | 72.7% | -| ov_SC04_016 | 1868 | 1664 | 0 | 1870 | 2444 | 76.5% | -| ov_SC04_018 | 1916 | 1699 | 0 | 1916 | 2862 | 66.9% | -| ov_SC04_019 | 1921 | 1699 | 0 | 1921 | 2862 | 67.1% | -| ov_SC04_020 | 1883 | 1664 | 0 | 1895 | 2572 | 73.7% | -| ov_SC04_021 | 1869 | 1666 | 0 | 1869 | 2427 | 77.0% | -| ov_SC05_000 | 1873 | 1668 | 0 | 1876 | 2426 | 77.3% | -| ov_SC05_001 | 1873 | 1664 | 0 | 1878 | 2579 | 72.8% | -| ov_SC05_002 | 1870 | 1664 | 0 | 1873 | 2447 | 76.5% | -| ov_SC05_003 | 1871 | 1664 | 0 | 1872 | 2486 | 75.3% | -| ov_SC05_004 | 1871 | 1664 | 0 | 1873 | 2469 | 75.9% | -| ov_SC05_005 | 1872 | 1664 | 0 | 1873 | 2496 | 75.0% | -| ov_SC05_006 | 1869 | 1664 | 0 | 1869 | 2434 | 76.8% | -| ov_SC05_007 | 1874 | 1664 | 0 | 1879 | 2487 | 75.6% | -| ov_SC05_008 | 1894 | 1664 | 0 | 1896 | 2548 | 74.4% | -| ov_SC05_009 | 1874 | 1664 | 0 | 1878 | 2442 | 76.9% | -| ov_SC05_010 | 1882 | 1664 | 0 | 1886 | 2593 | 72.7% | -| ov_SC05_011 | 1869 | 1664 | 0 | 1870 | 2413 | 77.5% | -| ov_SC05_017 | 1901 | 1661 | 0 | 1912 | 2847 | 67.2% | -| ov_SC05_018 | 1892 | 1664 | 0 | 1905 | 2678 | 71.1% | -| ov_SC05_019 | 1870 | 1666 | 0 | 1870 | 2427 | 77.0% | -| ov_SC06_000 | 1904 | 1673 | 0 | 1907 | 2696 | 70.7% | -| ov_SC06_006 | 1877 | 1664 | 0 | 1878 | 2516 | 74.6% | -| ov_SC06_008 | 1882 | 1666 | 0 | 1888 | 2546 | 74.2% | -| ov_SC06_010 | 1881 | 1664 | 0 | 1886 | 2522 | 74.8% | -| ov_SC06_011 | 1873 | 1664 | 0 | 1877 | 2473 | 75.9% | -| ov_SC06_013 | 1872 | 1664 | 0 | 1873 | 2429 | 77.1% | -| ov_SC06_014 | 1874 | 1664 | 0 | 1876 | 2457 | 76.4% | -| ov_SC06_015 | 1871 | 1664 | 0 | 1871 | 2425 | 77.2% | -| ov_SC06_016 | 1882 | 1664 | 0 | 1884 | 2554 | 73.8% | -| ov_SC06_018 | 1881 | 1667 | 0 | 1888 | 2670 | 70.7% | -| ov_SC06_020 | 1875 | 1666 | 0 | 1876 | 2523 | 74.4% | -| ov_SC06_022 | 1881 | 1664 | 0 | 1889 | 2647 | 71.4% | -| ov_SC06_024 | 1886 | 1664 | 0 | 1892 | 2672 | 70.8% | -| ov_SC06_025 | 1879 | 1664 | 0 | 1884 | 2577 | 73.1% | -| ov_SC06_027 | 1867 | 1664 | 0 | 1868 | 2412 | 77.4% | -| ov_SC06_029 | 1895 | 1664 | 0 | 1907 | 2667 | 71.5% | -| ov_SC06_030 | 1873 | 1664 | 0 | 1873 | 2461 | 76.1% | -| ov_SC06_032 | 1874 | 1665 | 0 | 1881 | 2663 | 70.6% | -| ov_SC06_033 | 1882 | 1665 | 0 | 1889 | 2636 | 71.7% | -| ov_SC07_000 | 1885 | 1668 | 0 | 1887 | 2526 | 74.7% | -| ov_SC07_001 | 1874 | 1664 | 0 | 1876 | 2459 | 76.3% | -| ov_SC07_002 | 1888 | 1664 | 0 | 1892 | 2584 | 73.2% | -| ov_SC07_008 | 1868 | 1664 | 0 | 1868 | 2390 | 78.2% | -| ov_SC07_009 | 1876 | 1664 | 0 | 1878 | 2434 | 77.2% | +| ov_SC01_000 | 1880 | 1669 | 0 | 1880 | 2407 | 78.1% | +| ov_SC01_001 | 1877 | 1669 | 0 | 1879 | 2471 | 76.0% | +| ov_SC01_004 | 1870 | 1660 | 0 | 1871 | 2418 | 77.4% | +| ov_SC01_005 | 1894 | 1682 | 0 | 1894 | 2508 | 75.5% | +| ov_SC01_006 | 1893 | 1682 | 0 | 1893 | 2508 | 75.5% | +| ov_SC01_008 | 1871 | 1660 | 0 | 1873 | 2430 | 77.1% | +| ov_SC01_009 | 1891 | 1661 | 0 | 1892 | 2512 | 75.3% | +| ov_SC01_074 | 1871 | 1661 | 0 | 1873 | 2429 | 77.1% | +| ov_SC01_077 | 2271 | 1624 | 0 | 2273 | 2586 | 87.9% | +| ov_SC01_080 | 1889 | 1664 | 0 | 1889 | 2517 | 75.0% | +| ov_SC01_084 | 1892 | 1664 | 0 | 1897 | 2583 | 73.4% | +| ov_SC02_000 | 1909 | 1699 | 0 | 1909 | 2688 | 71.0% | +| ov_SC02_003 | 1909 | 1699 | 0 | 1909 | 2688 | 71.0% | +| ov_SC02_004 | 1875 | 1664 | 0 | 1875 | 2405 | 78.0% | +| ov_SC02_005 | 1934 | 1660 | 0 | 1944 | 2932 | 66.3% | +| ov_SC02_011 | 1915 | 1667 | 0 | 1926 | 2898 | 66.5% | +| ov_SC02_015 | 1876 | 1666 | 0 | 1876 | 2418 | 77.6% | +| ov_SC02_016 | 1880 | 1666 | 0 | 1883 | 2550 | 73.8% | +| ov_SC02_017 | 1899 | 1666 | 0 | 1907 | 2737 | 69.7% | +| ov_SC02_021 | 1879 | 1666 | 0 | 1879 | 2441 | 77.0% | +| ov_SC02_026 | 1883 | 1664 | 0 | 1889 | 2577 | 73.3% | +| ov_SC02_027 | 1892 | 1664 | 0 | 1901 | 2697 | 70.5% | +| ov_SC02_028 | 1900 | 1664 | 0 | 1910 | 2706 | 70.6% | +| ov_SC02_031 | 1890 | 1665 | 0 | 1895 | 2567 | 73.8% | +| ov_SC02_035 | 1881 | 1664 | 0 | 1884 | 2525 | 74.6% | +| ov_SC02_039 | 1872 | 1664 | 0 | 1872 | 2420 | 77.4% | +| ov_SC02_041 | 1879 | 1664 | 0 | 1882 | 2565 | 73.4% | +| ov_SC03_001 | 1932 | 1665 | 0 | 1949 | 2874 | 67.8% | +| ov_SC03_002 | 1898 | 1669 | 0 | 1913 | 2636 | 72.6% | +| ov_SC03_003 | 1870 | 1664 | 0 | 1871 | 2427 | 77.1% | +| ov_SC03_006 | 1911 | 1670 | 0 | 1920 | 2772 | 69.3% | +| ov_SC03_007 | 1886 | 1664 | 0 | 1890 | 2628 | 71.9% | +| ov_SC03_010 | 1880 | 1664 | 0 | 1880 | 2474 | 76.0% | +| ov_SC03_011 | 1876 | 1664 | 0 | 1882 | 2532 | 74.3% | +| ov_SC03_012 | 1871 | 1664 | 0 | 1872 | 2410 | 77.7% | +| ov_SC03_013 | 1879 | 1664 | 0 | 1879 | 2497 | 75.3% | +| ov_SC03_014 | 1901 | 1689 | 0 | 1901 | 2690 | 70.7% | +| ov_SC03_015 | 1907 | 1689 | 0 | 1907 | 2690 | 70.9% | +| ov_SC03_023 | 1873 | 1664 | 0 | 1874 | 2439 | 76.8% | +| ov_SC03_024 | 1903 | 1669 | 0 | 1910 | 2646 | 72.2% | +| ov_SC03_028 | 1894 | 1664 | 0 | 1898 | 2669 | 71.1% | +| ov_SC03_029 | 1880 | 1666 | 0 | 1890 | 2649 | 71.3% | +| ov_SC03_030 | 1881 | 1668 | 0 | 1883 | 2500 | 75.3% | +| ov_SC03_031 | 1875 | 1664 | 0 | 1879 | 2519 | 74.6% | +| ov_SC03_089 | 1885 | 1664 | 0 | 1892 | 2586 | 73.2% | +| ov_SC03_090 | 1886 | 1664 | 0 | 1894 | 2630 | 72.0% | +| ov_SC03_091 | 1885 | 1664 | 0 | 1893 | 2645 | 71.6% | +| ov_SC03_092 | 1885 | 1664 | 0 | 1897 | 2592 | 73.2% | +| ov_SC03_093 | 1882 | 1664 | 0 | 1886 | 2568 | 73.4% | +| ov_SC03_094 | 1876 | 1664 | 0 | 1882 | 2581 | 72.9% | +| ov_SC03_095 | 1874 | 1664 | 0 | 1877 | 2479 | 75.7% | +| ov_SC03_096 | 1877 | 1664 | 0 | 1880 | 2470 | 76.1% | +| ov_SC03_097 | 1881 | 1664 | 0 | 1888 | 2608 | 72.4% | +| ov_SC03_098 | 1877 | 1664 | 0 | 1880 | 2546 | 73.8% | +| ov_SC03_099 | 1874 | 1664 | 0 | 1877 | 2509 | 74.8% | +| ov_SC03_100 | 1876 | 1664 | 0 | 1880 | 2544 | 73.9% | +| ov_SC03_101 | 1878 | 1664 | 0 | 1882 | 2533 | 74.3% | +| ov_SC03_102 | 1878 | 1664 | 0 | 1881 | 2497 | 75.3% | +| ov_SC03_103 | 1877 | 1666 | 0 | 1880 | 2515 | 74.8% | +| ov_SC03_104 | 1888 | 1664 | 0 | 1895 | 2621 | 72.3% | +| ov_SC03_105 | 1882 | 1664 | 0 | 1889 | 2602 | 72.6% | +| ov_SC03_108 | 1870 | 1664 | 0 | 1870 | 2448 | 76.4% | +| ov_SC03_109 | 1871 | 1664 | 0 | 1873 | 2428 | 77.1% | +| ov_SC03_110 | 1873 | 1664 | 0 | 1873 | 2473 | 75.7% | +| ov_SC03_111 | 1878 | 1664 | 0 | 1881 | 2515 | 74.8% | +| ov_SC03_112 | 1876 | 1666 | 0 | 1878 | 2531 | 74.2% | +| ov_SC03_113 | 1873 | 1666 | 0 | 1876 | 2473 | 75.9% | +| ov_SC03_114 | 1869 | 1664 | 0 | 1871 | 2419 | 77.3% | +| ov_SC03_115 | 1877 | 1664 | 0 | 1879 | 2477 | 75.9% | +| ov_SC03_116 | 1875 | 1664 | 0 | 1878 | 2443 | 76.9% | +| ov_SC03_117 | 1875 | 1664 | 0 | 1881 | 2562 | 73.4% | +| ov_SC03_118 | 1903 | 1688 | 0 | 1904 | 2690 | 70.8% | +| ov_SC03_119 | 1898 | 1688 | 0 | 1899 | 2690 | 70.6% | +| ov_SC03_121 | 1875 | 1664 | 0 | 1878 | 2464 | 76.2% | +| ov_SC03_124 | 1899 | 1660 | 0 | 1919 | 2746 | 69.9% | +| ov_SC03_125 | 1881 | 1664 | 0 | 1893 | 2593 | 73.0% | +| ov_SC03_126 | 1872 | 1666 | 0 | 1872 | 2427 | 77.1% | +| ov_SC04_000 | 1881 | 1668 | 0 | 1890 | 2551 | 74.1% | +| ov_SC04_002 | 1885 | 1664 | 0 | 1889 | 2641 | 71.5% | +| ov_SC04_003 | 1873 | 1664 | 0 | 1877 | 2507 | 74.9% | +| ov_SC04_004 | 1880 | 1664 | 0 | 1882 | 2563 | 73.4% | +| ov_SC04_005 | 1882 | 1664 | 0 | 1888 | 2617 | 72.1% | +| ov_SC04_006 | 1871 | 1664 | 0 | 1873 | 2458 | 76.2% | +| ov_SC04_007 | 1881 | 1664 | 0 | 1885 | 2574 | 73.2% | +| ov_SC04_008 | 1871 | 1664 | 0 | 1871 | 2419 | 77.3% | +| ov_SC04_009 | 1874 | 1664 | 0 | 1877 | 2445 | 76.8% | +| ov_SC04_010 | 1874 | 1664 | 0 | 1875 | 2423 | 77.4% | +| ov_SC04_011 | 1897 | 1664 | 0 | 1903 | 2808 | 67.8% | +| ov_SC04_012 | 1871 | 1664 | 0 | 1872 | 2424 | 77.2% | +| ov_SC04_015 | 1891 | 1665 | 0 | 1902 | 2616 | 72.7% | +| ov_SC04_016 | 1869 | 1664 | 0 | 1871 | 2444 | 76.6% | +| ov_SC04_018 | 1917 | 1699 | 0 | 1917 | 2862 | 67.0% | +| ov_SC04_019 | 1922 | 1699 | 0 | 1922 | 2862 | 67.2% | +| ov_SC04_020 | 1884 | 1664 | 0 | 1896 | 2572 | 73.7% | +| ov_SC04_021 | 1870 | 1666 | 0 | 1870 | 2427 | 77.0% | +| ov_SC05_000 | 1874 | 1668 | 0 | 1877 | 2426 | 77.4% | +| ov_SC05_001 | 1874 | 1664 | 0 | 1879 | 2579 | 72.9% | +| ov_SC05_002 | 1871 | 1664 | 0 | 1874 | 2447 | 76.6% | +| ov_SC05_003 | 1872 | 1664 | 0 | 1873 | 2486 | 75.3% | +| ov_SC05_004 | 1872 | 1664 | 0 | 1874 | 2469 | 75.9% | +| ov_SC05_005 | 1873 | 1664 | 0 | 1874 | 2496 | 75.1% | +| ov_SC05_006 | 1870 | 1664 | 0 | 1870 | 2434 | 76.8% | +| ov_SC05_007 | 1875 | 1664 | 0 | 1880 | 2487 | 75.6% | +| ov_SC05_008 | 1895 | 1664 | 0 | 1897 | 2548 | 74.5% | +| ov_SC05_009 | 1875 | 1664 | 0 | 1879 | 2442 | 76.9% | +| ov_SC05_010 | 1883 | 1664 | 0 | 1887 | 2593 | 72.8% | +| ov_SC05_011 | 1870 | 1664 | 0 | 1871 | 2413 | 77.5% | +| ov_SC05_017 | 1902 | 1661 | 0 | 1913 | 2847 | 67.2% | +| ov_SC05_018 | 1893 | 1664 | 0 | 1906 | 2678 | 71.2% | +| ov_SC05_019 | 1871 | 1666 | 0 | 1871 | 2427 | 77.1% | +| ov_SC06_000 | 1905 | 1673 | 0 | 1908 | 2696 | 70.8% | +| ov_SC06_006 | 1878 | 1664 | 0 | 1879 | 2516 | 74.7% | +| ov_SC06_008 | 1883 | 1666 | 0 | 1889 | 2546 | 74.2% | +| ov_SC06_010 | 1882 | 1664 | 0 | 1887 | 2522 | 74.8% | +| ov_SC06_011 | 1874 | 1664 | 0 | 1878 | 2473 | 75.9% | +| ov_SC06_013 | 1873 | 1664 | 0 | 1874 | 2429 | 77.2% | +| ov_SC06_014 | 1875 | 1664 | 0 | 1877 | 2457 | 76.4% | +| ov_SC06_015 | 1872 | 1664 | 0 | 1872 | 2425 | 77.2% | +| ov_SC06_016 | 1883 | 1664 | 0 | 1885 | 2554 | 73.8% | +| ov_SC06_018 | 1882 | 1667 | 0 | 1889 | 2670 | 70.7% | +| ov_SC06_020 | 1876 | 1666 | 0 | 1877 | 2523 | 74.4% | +| ov_SC06_022 | 1882 | 1664 | 0 | 1890 | 2647 | 71.4% | +| ov_SC06_024 | 1887 | 1664 | 0 | 1893 | 2672 | 70.8% | +| ov_SC06_025 | 1880 | 1664 | 0 | 1885 | 2577 | 73.1% | +| ov_SC06_027 | 1868 | 1664 | 0 | 1869 | 2412 | 77.5% | +| ov_SC06_029 | 1896 | 1664 | 0 | 1908 | 2667 | 71.5% | +| ov_SC06_030 | 1874 | 1664 | 0 | 1874 | 2461 | 76.1% | +| ov_SC06_032 | 1875 | 1665 | 0 | 1882 | 2663 | 70.7% | +| ov_SC06_033 | 1883 | 1665 | 0 | 1890 | 2636 | 71.7% | +| ov_SC07_000 | 1886 | 1668 | 0 | 1888 | 2526 | 74.7% | +| ov_SC07_001 | 1875 | 1664 | 0 | 1877 | 2459 | 76.3% | +| ov_SC07_002 | 1889 | 1664 | 0 | 1893 | 2584 | 73.3% | +| ov_SC07_008 | 1869 | 1664 | 0 | 1869 | 2390 | 78.2% | +| ov_SC07_009 | 1877 | 1664 | 0 | 1879 | 2434 | 77.2% | diff --git a/phase-ends/CURRENT_PHASE.md b/phase-ends/CURRENT_PHASE.md index c807f0f75..241e960b5 100644 --- a/phase-ends/CURRENT_PHASE.md +++ b/phase-ends/CURRENT_PHASE.md @@ -37,7 +37,31 @@ idiom curriculum → sweep one exemplar per family (curriculum-ordered), each cr deferred mechanical tail (M4 8, F-jumptable 4, M-linkwall 3, M3-residue 4, F-perturb 4, draft 2). - [ ] Close — clean-fleet verify · PhaseEnd synthesis · plain-English recap (R25) · Phase-26 backlog *(NOT yet — phase open)* -## FRESH SESSION — RESUME HERE (**NEXT = the F-band frontier + the deferred mechanical tail**; the T7 mechanical tiers M1/M2/M3 are DONE — fleet **73.66%**, committed `commit:0497`; phase OPEN, do NOT close) +## FRESH SESSION — RESUME HERE (**NEXT = the remaining wave-3 F-band frontier — real-TU reconcile-crack, NOT gating the wave-2 artifacts**; fleet **73.89%**; phase OPEN, do NOT close) +> **WAVE 3 (2026-07-10c, Opus-Max — surgical single-fn crack, NOT a fan-out) — COMMITTED, R22 clean-fleet 136/136 GREEN, fleet 73.85% → 73.89%:** +> **func_80164930 (81) CRACKED + swept ×134 = 134 fns** (133/0 siblings). The crack = the read-global fix below. +> **TWO DURABLE FINDINGS (cookbook §42b):** +> (1) **THE STALE-OBJECT GATE TRAP** — a piped `make build >/dev/null` that FAILS leaves a stale `.o`; `asm-differ -o` +> then reports a phantom **score 0**. This INVALIDATED wave-2's "iso-drift" labels: a rigorous re-check +> (`rm` the split `.o` + build exit-code + real whole-binary SHA) shows **ALL 4 remaining iso-drift drafts +> NOCOMPILE** (unreconciled callee externs conflicting with the TU canonical-sig layer). Every gate MUST rm the +> `.o` + check the build exit code — never trust a piped `make build` + asm-differ alone (compounds §42a `--out`). +> (2) **`canon_sig_reconcile` `*(T*)&D_sym` READ-global drift** — `&sym` forces the address into a HELD register +> (`lui;addiu;lhu 0(reg)` — kills the target's direct `lui;lhu %lo` → schedule drift); write-only globals are +> unaffected (direct `lui at;sh %lo(at)`). **FIX (byte-proven on func_80164930):** flip the file-scope decl to +> the exact type (`extern s16 D_8018971C;`→`u16`, byte-neutral to store-only callers) + reference the global +> DIRECTLY (no cast). A block-scoped `extern u16` vs ambient `s16` is a hard cc1 `conflicting types` ERROR +> (exit 33, NOT a warning), so the fix must be at file scope. Rigorous crack harness at `.run/crack3/` (gitignored). +> **THE WAVE-3 FRONTIER IS HEAVIER THAN THE HANDOFF** (each remaining fn needs real-TU reconcile-crack, NOT gating +> the broken wave-2 drafts; EACH cracks → ~134 fns since all are ×134 families → ~9 fns ≈ **~1,200 fleet potential**): +> - **4 iso-drift (NOCOMPILE, need decl-reconcile):** func_80136824 (156, _a, pointer-vs-array type-model drift), +> func_8014DD8C / func_8016C188 / func_80168828 (_after; func_80168828 self-doc c=8 schedule near). +> - **5 nears (residual closure, worker drafts in `.run/uc_crack2/`):** func_80134A74 (107), func_80133AB0 (137, +> first 37 ins exact ~c91), func_8012FCC4 (57, c=3 "irreducible" reorg thread-steal → G4 candidate), +> func_80185BA4 (177, c=79 structurally matched), func_801670E4 (279, 94→70). +> **NEXT (Drew's call, R27): (A) corrected FAN-OUT [prompt `/effort ultracode`] — workers use the `.run/crack3` +> rigorous gate (rm .o + exit + SHA) + real-TU reconcile-first; RELIABLE now the stale-object trap is fixed; +> scales to the phase tail — RECOMMENDED. (B) continued Max serial (me) — highest per-fn quality, doesn't scale.** > **IN-FLIGHT (2026-07-10b, Opus-Max→Ultracode) — T7 F-band ≤28 crack wave RUNNING (nothing banked/committed yet):** > Re-triaged the ≤28 band (R14, all vs bytes): it's **regalloc-order-DOMINATED** (§17 `register __asm__` pin territory) — > the permuter PLATEAUS on it (func_80134C20 regalloc stuck@3 even with regalloc-directed weights; func_8017EF50 diff --git a/src/ov_SC01_000/ov_SC01_000_after.c b/src/ov_SC01_000/ov_SC01_000_after.c index 7a6c93417..c7b1ca7a7 100644 --- a/src/ov_SC01_000/ov_SC01_000_after.c +++ b/src/ov_SC01_000/ov_SC01_000_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_000/nonmatchings/ov_SC01_000_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181808 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181808` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181808 - 8; + D_80181808 = nv; + D_80181806 = nv; + D_80181804 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_001/ov_SC01_001_after.c b/src/ov_SC01_001/ov_SC01_001_after.c index 422c3925a..e74efad96 100644 --- a/src/ov_SC01_001/ov_SC01_001_after.c +++ b/src/ov_SC01_001/ov_SC01_001_after.c @@ -4406,7 +4406,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_001/nonmatchings/ov_SC01_001_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80186458 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80186458` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80186458 - 8; + D_80186458 = nv; + D_80186456 = nv; + D_80186454 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_004/ov_SC01_004_after.c b/src/ov_SC01_004/ov_SC01_004_after.c index 64fffc3b3..7a417e050 100644 --- a/src/ov_SC01_004/ov_SC01_004_after.c +++ b/src/ov_SC01_004/ov_SC01_004_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_004/nonmatchings/ov_SC01_004_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181E1C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181E1C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181E1C - 8; + D_80181E1C = nv; + D_80181E1A = nv; + D_80181E18 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_005/ov_SC01_005_after.c b/src/ov_SC01_005/ov_SC01_005_after.c index 4a8ab051c..a07f639ae 100644 --- a/src/ov_SC01_005/ov_SC01_005_after.c +++ b/src/ov_SC01_005/ov_SC01_005_after.c @@ -4409,7 +4409,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_005/nonmatchings/ov_SC01_005_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184FB0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184FB0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184FB0 - 8; + D_80184FB0 = nv; + D_80184FAE = nv; + D_80184FAC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_006/ov_SC01_006_after.c b/src/ov_SC01_006/ov_SC01_006_after.c index e1b6238d9..108e528e8 100644 --- a/src/ov_SC01_006/ov_SC01_006_after.c +++ b/src/ov_SC01_006/ov_SC01_006_after.c @@ -4409,7 +4409,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_006/nonmatchings/ov_SC01_006_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184FB0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184FB0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184FB0 - 8; + D_80184FB0 = nv; + D_80184FAE = nv; + D_80184FAC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_008/ov_SC01_008_after.c b/src/ov_SC01_008/ov_SC01_008_after.c index 3bf990632..40b2082be 100644 --- a/src/ov_SC01_008/ov_SC01_008_after.c +++ b/src/ov_SC01_008/ov_SC01_008_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_008/nonmatchings/ov_SC01_008_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80182390 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80182390` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80182390 - 8; + D_80182390 = nv; + D_8018238E = nv; + D_8018238C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_009/ov_SC01_009_after.c b/src/ov_SC01_009/ov_SC01_009_after.c index 5e857c808..dbbe4af24 100644 --- a/src/ov_SC01_009/ov_SC01_009_after.c +++ b/src/ov_SC01_009/ov_SC01_009_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_009/nonmatchings/ov_SC01_009_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80185578 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80185578` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80185578 - 8; + D_80185578 = nv; + D_80185576 = nv; + D_80185574 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_074/ov_SC01_074_after.c b/src/ov_SC01_074/ov_SC01_074_after.c index 0b2e75369..c7820fdef 100644 --- a/src/ov_SC01_074/ov_SC01_074_after.c +++ b/src/ov_SC01_074/ov_SC01_074_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_074/nonmatchings/ov_SC01_074_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801811F8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801811F8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801811F8 - 8; + D_801811F8 = nv; + D_801811F6 = nv; + D_801811F4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_077/ov_SC01_077_after.c b/src/ov_SC01_077/ov_SC01_077_after.c index 8431fd3a0..61a3bf0ba 100644 --- a/src/ov_SC01_077/ov_SC01_077_after.c +++ b/src/ov_SC01_077/ov_SC01_077_after.c @@ -5799,7 +5799,7 @@ extern void func_80164930(s32 a); extern u16 D_800DF2E0; extern s32 D_801896E8; -extern s16 D_8018971C; +extern u16 D_8018971C; extern s16 D_8018971A; extern s16 D_80189718; @@ -5828,7 +5828,57 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_077/nonmatchings/ov_SC01_077_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018971C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018971C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018971C - 8; + D_8018971C = nv; + D_8018971A = nv; + D_80189718 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930 *))func_80162CCC)((Ent_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_080/ov_SC01_080_after.c b/src/ov_SC01_080/ov_SC01_080_after.c index b81bd1f28..db5aad637 100644 --- a/src/ov_SC01_080/ov_SC01_080_after.c +++ b/src/ov_SC01_080/ov_SC01_080_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_080/nonmatchings/ov_SC01_080_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80186158 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80186158` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80186158 - 8; + D_80186158 = nv; + D_80186156 = nv; + D_80186154 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC01_084/ov_SC01_084_after.c b/src/ov_SC01_084/ov_SC01_084_after.c index 22843aad2..b5a806f47 100644 --- a/src/ov_SC01_084/ov_SC01_084_after.c +++ b/src/ov_SC01_084/ov_SC01_084_after.c @@ -4414,7 +4414,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_084/nonmatchings/ov_SC01_084_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018944C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018944C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018944C - 8; + D_8018944C = nv; + D_8018944A = nv; + D_80189448 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_000/ov_SC02_000_after.c b/src/ov_SC02_000/ov_SC02_000_after.c index 9868a42cf..ab2bbaf39 100644 --- a/src/ov_SC02_000/ov_SC02_000_after.c +++ b/src/ov_SC02_000/ov_SC02_000_after.c @@ -4400,7 +4400,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_000/nonmatchings/ov_SC02_000_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018D7FC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018D7FC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018D7FC - 8; + D_8018D7FC = nv; + D_8018D7FA = nv; + D_8018D7F8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_003/ov_SC02_003_after.c b/src/ov_SC02_003/ov_SC02_003_after.c index 436a813c4..a94027311 100644 --- a/src/ov_SC02_003/ov_SC02_003_after.c +++ b/src/ov_SC02_003/ov_SC02_003_after.c @@ -4400,7 +4400,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_003/nonmatchings/ov_SC02_003_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018D7FC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018D7FC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018D7FC - 8; + D_8018D7FC = nv; + D_8018D7FA = nv; + D_8018D7F8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_004/ov_SC02_004_after.c b/src/ov_SC02_004/ov_SC02_004_after.c index 1cff0fc95..a23010af4 100644 --- a/src/ov_SC02_004/ov_SC02_004_after.c +++ b/src/ov_SC02_004/ov_SC02_004_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_004/nonmatchings/ov_SC02_004_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801808DC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801808DC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801808DC - 8; + D_801808DC = nv; + D_801808DA = nv; + D_801808D8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_005/ov_SC02_005_after.c b/src/ov_SC02_005/ov_SC02_005_after.c index d1c143fee..668afc94d 100644 --- a/src/ov_SC02_005/ov_SC02_005_after.c +++ b/src/ov_SC02_005/ov_SC02_005_after.c @@ -4434,7 +4434,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_005/nonmatchings/ov_SC02_005_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801934E0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801934E0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801934E0 - 8; + D_801934E0 = nv; + D_801934DE = nv; + D_801934DC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_011/ov_SC02_011_after.c b/src/ov_SC02_011/ov_SC02_011_after.c index 6264206d1..e7bfdaf9d 100644 --- a/src/ov_SC02_011/ov_SC02_011_after.c +++ b/src/ov_SC02_011/ov_SC02_011_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_011/nonmatchings/ov_SC02_011_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80193930 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80193930` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80193930 - 8; + D_80193930 = nv; + D_8019392E = nv; + D_8019392C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_015/ov_SC02_015_after.c b/src/ov_SC02_015/ov_SC02_015_after.c index 50bf7b809..6267b54d0 100644 --- a/src/ov_SC02_015/ov_SC02_015_after.c +++ b/src/ov_SC02_015/ov_SC02_015_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_015/nonmatchings/ov_SC02_015_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180E44 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180E44` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180E44 - 8; + D_80180E44 = nv; + D_80180E42 = nv; + D_80180E40 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_016/ov_SC02_016_after.c b/src/ov_SC02_016/ov_SC02_016_after.c index 981e6ee30..f55dcfc1c 100644 --- a/src/ov_SC02_016/ov_SC02_016_after.c +++ b/src/ov_SC02_016/ov_SC02_016_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_016/nonmatchings/ov_SC02_016_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018707C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018707C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018707C - 8; + D_8018707C = nv; + D_8018707A = nv; + D_80187078 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_017/ov_SC02_017_after.c b/src/ov_SC02_017/ov_SC02_017_after.c index 482c21edd..f678b598f 100644 --- a/src/ov_SC02_017/ov_SC02_017_after.c +++ b/src/ov_SC02_017/ov_SC02_017_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_017/nonmatchings/ov_SC02_017_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018D0D4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018D0D4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018D0D4 - 8; + D_8018D0D4 = nv; + D_8018D0D2 = nv; + D_8018D0D0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_021/ov_SC02_021_after.c b/src/ov_SC02_021/ov_SC02_021_after.c index 7614b9cbb..80e661a09 100644 --- a/src/ov_SC02_021/ov_SC02_021_after.c +++ b/src/ov_SC02_021/ov_SC02_021_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_021/nonmatchings/ov_SC02_021_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801826C8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801826C8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801826C8 - 8; + D_801826C8 = nv; + D_801826C6 = nv; + D_801826C4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_026/ov_SC02_026_after.c b/src/ov_SC02_026/ov_SC02_026_after.c index fcbbaa6fb..1d816e407 100644 --- a/src/ov_SC02_026/ov_SC02_026_after.c +++ b/src/ov_SC02_026/ov_SC02_026_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_026/nonmatchings/ov_SC02_026_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188D1C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188D1C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188D1C - 8; + D_80188D1C = nv; + D_80188D1A = nv; + D_80188D18 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_027/ov_SC02_027_after.c b/src/ov_SC02_027/ov_SC02_027_after.c index 985a0ca29..aa6df5451 100644 --- a/src/ov_SC02_027/ov_SC02_027_after.c +++ b/src/ov_SC02_027/ov_SC02_027_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_027/nonmatchings/ov_SC02_027_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018DE40 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018DE40` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018DE40 - 8; + D_8018DE40 = nv; + D_8018DE3E = nv; + D_8018DE3C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_028/ov_SC02_028_after.c b/src/ov_SC02_028/ov_SC02_028_after.c index dfeba9ef7..1b0701844 100644 --- a/src/ov_SC02_028/ov_SC02_028_after.c +++ b/src/ov_SC02_028/ov_SC02_028_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_028/nonmatchings/ov_SC02_028_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018E044 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018E044` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018E044 - 8; + D_8018E044 = nv; + D_8018E042 = nv; + D_8018E040 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_031/ov_SC02_031_after.c b/src/ov_SC02_031/ov_SC02_031_after.c index 9ae295797..857cd06e7 100644 --- a/src/ov_SC02_031/ov_SC02_031_after.c +++ b/src/ov_SC02_031/ov_SC02_031_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_031/nonmatchings/ov_SC02_031_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187870 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187870` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187870 - 8; + D_80187870 = nv; + D_8018786E = nv; + D_8018786C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_035/ov_SC02_035_after.c b/src/ov_SC02_035/ov_SC02_035_after.c index bf6b545db..bf3b5a9ec 100644 --- a/src/ov_SC02_035/ov_SC02_035_after.c +++ b/src/ov_SC02_035/ov_SC02_035_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_035/nonmatchings/ov_SC02_035_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801870D0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801870D0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801870D0 - 8; + D_801870D0 = nv; + D_801870CE = nv; + D_801870CC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_039/ov_SC02_039_after.c b/src/ov_SC02_039/ov_SC02_039_after.c index 7b456fd38..773c7f52b 100644 --- a/src/ov_SC02_039/ov_SC02_039_after.c +++ b/src/ov_SC02_039/ov_SC02_039_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_039/nonmatchings/ov_SC02_039_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181CFC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181CFC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181CFC - 8; + D_80181CFC = nv; + D_80181CFA = nv; + D_80181CF8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC02_041/ov_SC02_041_after.c b/src/ov_SC02_041/ov_SC02_041_after.c index ac1418f34..6ac72f090 100644 --- a/src/ov_SC02_041/ov_SC02_041_after.c +++ b/src/ov_SC02_041/ov_SC02_041_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_041/nonmatchings/ov_SC02_041_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801879CC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801879CC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801879CC - 8; + D_801879CC = nv; + D_801879CA = nv; + D_801879C8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_001/ov_SC03_001_after.c b/src/ov_SC03_001/ov_SC03_001_after.c index ba0f6e9a1..1360f5430 100644 --- a/src/ov_SC03_001/ov_SC03_001_after.c +++ b/src/ov_SC03_001/ov_SC03_001_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_001/nonmatchings/ov_SC03_001_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8019010C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8019010C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8019010C - 8; + D_8019010C = nv; + D_8019010A = nv; + D_80190108 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_002/ov_SC03_002_after.c b/src/ov_SC03_002/ov_SC03_002_after.c index f757eec2e..60f3da093 100644 --- a/src/ov_SC03_002/ov_SC03_002_after.c +++ b/src/ov_SC03_002/ov_SC03_002_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_002/nonmatchings/ov_SC03_002_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801880FC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801880FC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801880FC - 8; + D_801880FC = nv; + D_801880FA = nv; + D_801880F8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_003/ov_SC03_003_after.c b/src/ov_SC03_003/ov_SC03_003_after.c index a93f72311..ee37bc71f 100644 --- a/src/ov_SC03_003/ov_SC03_003_after.c +++ b/src/ov_SC03_003/ov_SC03_003_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_003/nonmatchings/ov_SC03_003_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181EC4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181EC4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181EC4 - 8; + D_80181EC4 = nv; + D_80181EC2 = nv; + D_80181EC0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_006/ov_SC03_006_after.c b/src/ov_SC03_006/ov_SC03_006_after.c index efa9c15d8..770bbb6d9 100644 --- a/src/ov_SC03_006/ov_SC03_006_after.c +++ b/src/ov_SC03_006/ov_SC03_006_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_006/nonmatchings/ov_SC03_006_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018F1E0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018F1E0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018F1E0 - 8; + D_8018F1E0 = nv; + D_8018F1DE = nv; + D_8018F1DC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_007/ov_SC03_007_after.c b/src/ov_SC03_007/ov_SC03_007_after.c index 061552673..cee66d398 100644 --- a/src/ov_SC03_007/ov_SC03_007_after.c +++ b/src/ov_SC03_007/ov_SC03_007_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_007/nonmatchings/ov_SC03_007_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80189FD8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80189FD8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80189FD8 - 8; + D_80189FD8 = nv; + D_80189FD6 = nv; + D_80189FD4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_010/ov_SC03_010_after.c b/src/ov_SC03_010/ov_SC03_010_after.c index d1d90c616..6855f7056 100644 --- a/src/ov_SC03_010/ov_SC03_010_after.c +++ b/src/ov_SC03_010/ov_SC03_010_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_010/nonmatchings/ov_SC03_010_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80182AF8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80182AF8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80182AF8 - 8; + D_80182AF8 = nv; + D_80182AF6 = nv; + D_80182AF4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_011/ov_SC03_011_after.c b/src/ov_SC03_011/ov_SC03_011_after.c index bb7e78ab6..0fba0ffda 100644 --- a/src/ov_SC03_011/ov_SC03_011_after.c +++ b/src/ov_SC03_011/ov_SC03_011_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_011/nonmatchings/ov_SC03_011_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80183E68 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80183E68` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80183E68 - 8; + D_80183E68 = nv; + D_80183E66 = nv; + D_80183E64 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_012/ov_SC03_012_after.c b/src/ov_SC03_012/ov_SC03_012_after.c index cb7d5f598..bc245e169 100644 --- a/src/ov_SC03_012/ov_SC03_012_after.c +++ b/src/ov_SC03_012/ov_SC03_012_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_012/nonmatchings/ov_SC03_012_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180D48 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180D48` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180D48 - 8; + D_80180D48 = nv; + D_80180D46 = nv; + D_80180D44 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_013/ov_SC03_013_after.c b/src/ov_SC03_013/ov_SC03_013_after.c index 33a8f328a..1098c246f 100644 --- a/src/ov_SC03_013/ov_SC03_013_after.c +++ b/src/ov_SC03_013/ov_SC03_013_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_013/nonmatchings/ov_SC03_013_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80183B30 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80183B30` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80183B30 - 8; + D_80183B30 = nv; + D_80183B2E = nv; + D_80183B2C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_014/ov_SC03_014_after.c b/src/ov_SC03_014/ov_SC03_014_after.c index 04ffed8b6..070ddb2db 100644 --- a/src/ov_SC03_014/ov_SC03_014_after.c +++ b/src/ov_SC03_014/ov_SC03_014_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_014/nonmatchings/ov_SC03_014_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018E16C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018E16C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018E16C - 8; + D_8018E16C = nv; + D_8018E16A = nv; + D_8018E168 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_015/ov_SC03_015_after.c b/src/ov_SC03_015/ov_SC03_015_after.c index 3ea66bfb6..5f7541478 100644 --- a/src/ov_SC03_015/ov_SC03_015_after.c +++ b/src/ov_SC03_015/ov_SC03_015_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_015/nonmatchings/ov_SC03_015_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018E16C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018E16C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018E16C - 8; + D_8018E16C = nv; + D_8018E16A = nv; + D_8018E168 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_023/ov_SC03_023_after.c b/src/ov_SC03_023/ov_SC03_023_after.c index f8a4a48da..8bb9f4dfd 100644 --- a/src/ov_SC03_023/ov_SC03_023_after.c +++ b/src/ov_SC03_023/ov_SC03_023_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_023/nonmatchings/ov_SC03_023_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181AE8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181AE8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181AE8 - 8; + D_80181AE8 = nv; + D_80181AE6 = nv; + D_80181AE4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_024/ov_SC03_024_after.c b/src/ov_SC03_024/ov_SC03_024_after.c index 632bb4acd..d8a70eaae 100644 --- a/src/ov_SC03_024/ov_SC03_024_after.c +++ b/src/ov_SC03_024/ov_SC03_024_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_024/nonmatchings/ov_SC03_024_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80189B0C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80189B0C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80189B0C - 8; + D_80189B0C = nv; + D_80189B0A = nv; + D_80189B08 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_028/ov_SC03_028_after.c b/src/ov_SC03_028/ov_SC03_028_after.c index 8495c34de..0850e3e56 100644 --- a/src/ov_SC03_028/ov_SC03_028_after.c +++ b/src/ov_SC03_028/ov_SC03_028_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_028/nonmatchings/ov_SC03_028_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018E5D8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018E5D8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018E5D8 - 8; + D_8018E5D8 = nv; + D_8018E5D6 = nv; + D_8018E5D4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_029/ov_SC03_029_after.c b/src/ov_SC03_029/ov_SC03_029_after.c index 0bea149e3..14114901e 100644 --- a/src/ov_SC03_029/ov_SC03_029_after.c +++ b/src/ov_SC03_029/ov_SC03_029_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_029/nonmatchings/ov_SC03_029_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018A410 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018A410` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018A410 - 8; + D_8018A410 = nv; + D_8018A40E = nv; + D_8018A40C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_030/ov_SC03_030_after.c b/src/ov_SC03_030/ov_SC03_030_after.c index 5361d83bf..573e38c4a 100644 --- a/src/ov_SC03_030/ov_SC03_030_after.c +++ b/src/ov_SC03_030/ov_SC03_030_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_030/nonmatchings/ov_SC03_030_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184A4C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184A4C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184A4C - 8; + D_80184A4C = nv; + D_80184A4A = nv; + D_80184A48 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_031/ov_SC03_031_after.c b/src/ov_SC03_031/ov_SC03_031_after.c index 5fa93d7a0..6afca5c23 100644 --- a/src/ov_SC03_031/ov_SC03_031_after.c +++ b/src/ov_SC03_031/ov_SC03_031_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_031/nonmatchings/ov_SC03_031_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184F68 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184F68` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184F68 - 8; + D_80184F68 = nv; + D_80184F66 = nv; + D_80184F64 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_089/ov_SC03_089_after.c b/src/ov_SC03_089/ov_SC03_089_after.c index 58a3ba21a..4ad1c4c34 100644 --- a/src/ov_SC03_089/ov_SC03_089_after.c +++ b/src/ov_SC03_089/ov_SC03_089_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_089/nonmatchings/ov_SC03_089_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018C264 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018C264` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018C264 - 8; + D_8018C264 = nv; + D_8018C262 = nv; + D_8018C260 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_090/ov_SC03_090_after.c b/src/ov_SC03_090/ov_SC03_090_after.c index 1a1dbcf49..00ed81d50 100644 --- a/src/ov_SC03_090/ov_SC03_090_after.c +++ b/src/ov_SC03_090/ov_SC03_090_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_090/nonmatchings/ov_SC03_090_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018E688 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018E688` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018E688 - 8; + D_8018E688 = nv; + D_8018E686 = nv; + D_8018E684 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_091/ov_SC03_091_after.c b/src/ov_SC03_091/ov_SC03_091_after.c index 4dabd5d5c..4e9c75a8b 100644 --- a/src/ov_SC03_091/ov_SC03_091_after.c +++ b/src/ov_SC03_091/ov_SC03_091_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_091/nonmatchings/ov_SC03_091_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018F530 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018F530` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018F530 - 8; + D_8018F530 = nv; + D_8018F52E = nv; + D_8018F52C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_092/ov_SC03_092_after.c b/src/ov_SC03_092/ov_SC03_092_after.c index a1dc57377..149d047c4 100644 --- a/src/ov_SC03_092/ov_SC03_092_after.c +++ b/src/ov_SC03_092/ov_SC03_092_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_092/nonmatchings/ov_SC03_092_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187900 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187900` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187900 - 8; + D_80187900 = nv; + D_801878FE = nv; + D_801878FC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_093/ov_SC03_093_after.c b/src/ov_SC03_093/ov_SC03_093_after.c index f3d377b9d..64a1cce83 100644 --- a/src/ov_SC03_093/ov_SC03_093_after.c +++ b/src/ov_SC03_093/ov_SC03_093_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_093/nonmatchings/ov_SC03_093_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188AD8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188AD8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188AD8 - 8; + D_80188AD8 = nv; + D_80188AD6 = nv; + D_80188AD4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_094/ov_SC03_094_after.c b/src/ov_SC03_094/ov_SC03_094_after.c index e20cf8660..5b0b26c30 100644 --- a/src/ov_SC03_094/ov_SC03_094_after.c +++ b/src/ov_SC03_094/ov_SC03_094_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_094/nonmatchings/ov_SC03_094_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018A4D4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018A4D4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018A4D4 - 8; + D_8018A4D4 = nv; + D_8018A4D2 = nv; + D_8018A4D0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_095/ov_SC03_095_after.c b/src/ov_SC03_095/ov_SC03_095_after.c index 4e4986d90..e13db7103 100644 --- a/src/ov_SC03_095/ov_SC03_095_after.c +++ b/src/ov_SC03_095/ov_SC03_095_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_095/nonmatchings/ov_SC03_095_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80183B34 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80183B34` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80183B34 - 8; + D_80183B34 = nv; + D_80183B32 = nv; + D_80183B30 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_096/ov_SC03_096_after.c b/src/ov_SC03_096/ov_SC03_096_after.c index 880feb40d..0d0a89029 100644 --- a/src/ov_SC03_096/ov_SC03_096_after.c +++ b/src/ov_SC03_096/ov_SC03_096_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_096/nonmatchings/ov_SC03_096_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801836B4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801836B4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801836B4 - 8; + D_801836B4 = nv; + D_801836B2 = nv; + D_801836B0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_097/ov_SC03_097_after.c b/src/ov_SC03_097/ov_SC03_097_after.c index debb0305b..16ec1dcc2 100644 --- a/src/ov_SC03_097/ov_SC03_097_after.c +++ b/src/ov_SC03_097/ov_SC03_097_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_097/nonmatchings/ov_SC03_097_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188A94 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188A94` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188A94 - 8; + D_80188A94 = nv; + D_80188A92 = nv; + D_80188A90 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_098/ov_SC03_098_after.c b/src/ov_SC03_098/ov_SC03_098_after.c index 02a06ceff..9b3631dad 100644 --- a/src/ov_SC03_098/ov_SC03_098_after.c +++ b/src/ov_SC03_098/ov_SC03_098_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_098/nonmatchings/ov_SC03_098_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187F20 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187F20` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187F20 - 8; + D_80187F20 = nv; + D_80187F1E = nv; + D_80187F1C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_099/ov_SC03_099_after.c b/src/ov_SC03_099/ov_SC03_099_after.c index f5d4d208e..ec602e0cc 100644 --- a/src/ov_SC03_099/ov_SC03_099_after.c +++ b/src/ov_SC03_099/ov_SC03_099_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_099/nonmatchings/ov_SC03_099_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80186020 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80186020` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80186020 - 8; + D_80186020 = nv; + D_8018601E = nv; + D_8018601C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_100/ov_SC03_100_after.c b/src/ov_SC03_100/ov_SC03_100_after.c index 8d11d1542..c438d2244 100644 --- a/src/ov_SC03_100/ov_SC03_100_after.c +++ b/src/ov_SC03_100/ov_SC03_100_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_100/nonmatchings/ov_SC03_100_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801874EC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801874EC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801874EC - 8; + D_801874EC = nv; + D_801874EA = nv; + D_801874E8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_101/ov_SC03_101_after.c b/src/ov_SC03_101/ov_SC03_101_after.c index d2eb8465f..eb630d415 100644 --- a/src/ov_SC03_101/ov_SC03_101_after.c +++ b/src/ov_SC03_101/ov_SC03_101_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_101/nonmatchings/ov_SC03_101_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801864C8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801864C8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801864C8 - 8; + D_801864C8 = nv; + D_801864C6 = nv; + D_801864C4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_102/ov_SC03_102_after.c b/src/ov_SC03_102/ov_SC03_102_after.c index 6cf25ea11..87c6dd34b 100644 --- a/src/ov_SC03_102/ov_SC03_102_after.c +++ b/src/ov_SC03_102/ov_SC03_102_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_102/nonmatchings/ov_SC03_102_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188D80 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188D80` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188D80 - 8; + D_80188D80 = nv; + D_80188D7E = nv; + D_80188D7C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_103/ov_SC03_103_after.c b/src/ov_SC03_103/ov_SC03_103_after.c index bbbbe383d..13af54056 100644 --- a/src/ov_SC03_103/ov_SC03_103_after.c +++ b/src/ov_SC03_103/ov_SC03_103_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_103/nonmatchings/ov_SC03_103_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80186D30 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80186D30` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80186D30 - 8; + D_80186D30 = nv; + D_80186D2E = nv; + D_80186D2C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_104/ov_SC03_104_after.c b/src/ov_SC03_104/ov_SC03_104_after.c index 193586606..bdbdaf508 100644 --- a/src/ov_SC03_104/ov_SC03_104_after.c +++ b/src/ov_SC03_104/ov_SC03_104_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_104/nonmatchings/ov_SC03_104_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018D8C0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018D8C0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018D8C0 - 8; + D_8018D8C0 = nv; + D_8018D8BE = nv; + D_8018D8BC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_105/ov_SC03_105_after.c b/src/ov_SC03_105/ov_SC03_105_after.c index a65baab70..cb3567245 100644 --- a/src/ov_SC03_105/ov_SC03_105_after.c +++ b/src/ov_SC03_105/ov_SC03_105_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_105/nonmatchings/ov_SC03_105_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018CF48 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018CF48` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018CF48 - 8; + D_8018CF48 = nv; + D_8018CF46 = nv; + D_8018CF44 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_108/ov_SC03_108_after.c b/src/ov_SC03_108/ov_SC03_108_after.c index c03079c5b..62f72b03e 100644 --- a/src/ov_SC03_108/ov_SC03_108_after.c +++ b/src/ov_SC03_108/ov_SC03_108_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_108/nonmatchings/ov_SC03_108_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801838A0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801838A0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801838A0 - 8; + D_801838A0 = nv; + D_8018389E = nv; + D_8018389C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_109/ov_SC03_109_after.c b/src/ov_SC03_109/ov_SC03_109_after.c index bdd40670a..9df428950 100644 --- a/src/ov_SC03_109/ov_SC03_109_after.c +++ b/src/ov_SC03_109/ov_SC03_109_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_109/nonmatchings/ov_SC03_109_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180F4C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180F4C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180F4C - 8; + D_80180F4C = nv; + D_80180F4A = nv; + D_80180F48 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_110/ov_SC03_110_after.c b/src/ov_SC03_110/ov_SC03_110_after.c index 640a71a32..a91db0857 100644 --- a/src/ov_SC03_110/ov_SC03_110_after.c +++ b/src/ov_SC03_110/ov_SC03_110_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_110/nonmatchings/ov_SC03_110_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018496C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018496C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018496C - 8; + D_8018496C = nv; + D_8018496A = nv; + D_80184968 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_111/ov_SC03_111_after.c b/src/ov_SC03_111/ov_SC03_111_after.c index f17405e4d..79f567772 100644 --- a/src/ov_SC03_111/ov_SC03_111_after.c +++ b/src/ov_SC03_111/ov_SC03_111_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_111/nonmatchings/ov_SC03_111_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187520 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187520` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187520 - 8; + D_80187520 = nv; + D_8018751E = nv; + D_8018751C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_112/ov_SC03_112_after.c b/src/ov_SC03_112/ov_SC03_112_after.c index 108bbd7e6..b192e1308 100644 --- a/src/ov_SC03_112/ov_SC03_112_after.c +++ b/src/ov_SC03_112/ov_SC03_112_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_112/nonmatchings/ov_SC03_112_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188328 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188328` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188328 - 8; + D_80188328 = nv; + D_80188326 = nv; + D_80188324 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_113/ov_SC03_113_after.c b/src/ov_SC03_113/ov_SC03_113_after.c index e13241c4a..1a1b89731 100644 --- a/src/ov_SC03_113/ov_SC03_113_after.c +++ b/src/ov_SC03_113/ov_SC03_113_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_113/nonmatchings/ov_SC03_113_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801859D8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801859D8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801859D8 - 8; + D_801859D8 = nv; + D_801859D6 = nv; + D_801859D4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_114/ov_SC03_114_after.c b/src/ov_SC03_114/ov_SC03_114_after.c index 36862d32d..2c855900b 100644 --- a/src/ov_SC03_114/ov_SC03_114_after.c +++ b/src/ov_SC03_114/ov_SC03_114_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_114/nonmatchings/ov_SC03_114_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181640 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181640` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181640 - 8; + D_80181640 = nv; + D_8018163E = nv; + D_8018163C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_115/ov_SC03_115_after.c b/src/ov_SC03_115/ov_SC03_115_after.c index 58bcbedb2..cc2faa181 100644 --- a/src/ov_SC03_115/ov_SC03_115_after.c +++ b/src/ov_SC03_115/ov_SC03_115_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_115/nonmatchings/ov_SC03_115_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801830AC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801830AC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801830AC - 8; + D_801830AC = nv; + D_801830AA = nv; + D_801830A8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_116/ov_SC03_116_after.c b/src/ov_SC03_116/ov_SC03_116_after.c index 88e9126c2..a2bc95d9f 100644 --- a/src/ov_SC03_116/ov_SC03_116_after.c +++ b/src/ov_SC03_116/ov_SC03_116_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_116/nonmatchings/ov_SC03_116_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801854B0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801854B0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801854B0 - 8; + D_801854B0 = nv; + D_801854AE = nv; + D_801854AC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_117/ov_SC03_117_after.c b/src/ov_SC03_117/ov_SC03_117_after.c index 42763e3e1..f819d4e4e 100644 --- a/src/ov_SC03_117/ov_SC03_117_after.c +++ b/src/ov_SC03_117/ov_SC03_117_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_117/nonmatchings/ov_SC03_117_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801874BC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801874BC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801874BC - 8; + D_801874BC = nv; + D_801874BA = nv; + D_801874B8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_118/ov_SC03_118_after.c b/src/ov_SC03_118/ov_SC03_118_after.c index 92469324a..3e10291a9 100644 --- a/src/ov_SC03_118/ov_SC03_118_after.c +++ b/src/ov_SC03_118/ov_SC03_118_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_118/nonmatchings/ov_SC03_118_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018C568 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018C568` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018C568 - 8; + D_8018C568 = nv; + D_8018C566 = nv; + D_8018C564 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_119/ov_SC03_119_after.c b/src/ov_SC03_119/ov_SC03_119_after.c index 0c83942e0..71304b1db 100644 --- a/src/ov_SC03_119/ov_SC03_119_after.c +++ b/src/ov_SC03_119/ov_SC03_119_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_119/nonmatchings/ov_SC03_119_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018C568 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018C568` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018C568 - 8; + D_8018C568 = nv; + D_8018C566 = nv; + D_8018C564 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_121/ov_SC03_121_after.c b/src/ov_SC03_121/ov_SC03_121_after.c index 287dd1c94..ce34dcdf8 100644 --- a/src/ov_SC03_121/ov_SC03_121_after.c +++ b/src/ov_SC03_121/ov_SC03_121_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_121/nonmatchings/ov_SC03_121_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184D84 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184D84` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184D84 - 8; + D_80184D84 = nv; + D_80184D82 = nv; + D_80184D80 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_124/ov_SC03_124_after.c b/src/ov_SC03_124/ov_SC03_124_after.c index 1f4c5f920..bd5f1e5c6 100644 --- a/src/ov_SC03_124/ov_SC03_124_after.c +++ b/src/ov_SC03_124/ov_SC03_124_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_124/nonmatchings/ov_SC03_124_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018D7B0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018D7B0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018D7B0 - 8; + D_8018D7B0 = nv; + D_8018D7AE = nv; + D_8018D7AC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_125/ov_SC03_125_after.c b/src/ov_SC03_125/ov_SC03_125_after.c index 3a1388243..a9c2d7d22 100644 --- a/src/ov_SC03_125/ov_SC03_125_after.c +++ b/src/ov_SC03_125/ov_SC03_125_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_125/nonmatchings/ov_SC03_125_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80186980 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80186980` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80186980 - 8; + D_80186980 = nv; + D_8018697E = nv; + D_8018697C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC03_126/ov_SC03_126_after.c b/src/ov_SC03_126/ov_SC03_126_after.c index 3a188429a..e61334865 100644 --- a/src/ov_SC03_126/ov_SC03_126_after.c +++ b/src/ov_SC03_126/ov_SC03_126_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_126/nonmatchings/ov_SC03_126_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181E78 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181E78` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181E78 - 8; + D_80181E78 = nv; + D_80181E76 = nv; + D_80181E74 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_000/ov_SC04_000_after.c b/src/ov_SC04_000/ov_SC04_000_after.c index 84eb165fa..b01609921 100644 --- a/src/ov_SC04_000/ov_SC04_000_after.c +++ b/src/ov_SC04_000/ov_SC04_000_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_000/nonmatchings/ov_SC04_000_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80185E84 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80185E84` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80185E84 - 8; + D_80185E84 = nv; + D_80185E82 = nv; + D_80185E80 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_002/ov_SC04_002_after.c b/src/ov_SC04_002/ov_SC04_002_after.c index 4d68ccc4b..65657574e 100644 --- a/src/ov_SC04_002/ov_SC04_002_after.c +++ b/src/ov_SC04_002/ov_SC04_002_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_002/nonmatchings/ov_SC04_002_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018AFF0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018AFF0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018AFF0 - 8; + D_8018AFF0 = nv; + D_8018AFEE = nv; + D_8018AFEC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_003/ov_SC04_003_after.c b/src/ov_SC04_003/ov_SC04_003_after.c index 90d0683af..9a20fbb17 100644 --- a/src/ov_SC04_003/ov_SC04_003_after.c +++ b/src/ov_SC04_003/ov_SC04_003_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_003/nonmatchings/ov_SC04_003_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184D8C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184D8C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184D8C - 8; + D_80184D8C = nv; + D_80184D8A = nv; + D_80184D88 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_004/ov_SC04_004_after.c b/src/ov_SC04_004/ov_SC04_004_after.c index e28063642..efe042dd8 100644 --- a/src/ov_SC04_004/ov_SC04_004_after.c +++ b/src/ov_SC04_004/ov_SC04_004_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_004/nonmatchings/ov_SC04_004_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801872C0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801872C0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801872C0 - 8; + D_801872C0 = nv; + D_801872BE = nv; + D_801872BC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_005/ov_SC04_005_after.c b/src/ov_SC04_005/ov_SC04_005_after.c index 81932a0c2..fe3c417d7 100644 --- a/src/ov_SC04_005/ov_SC04_005_after.c +++ b/src/ov_SC04_005/ov_SC04_005_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_005/nonmatchings/ov_SC04_005_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018A6F4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018A6F4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018A6F4 - 8; + D_8018A6F4 = nv; + D_8018A6F2 = nv; + D_8018A6F0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_006/ov_SC04_006_after.c b/src/ov_SC04_006/ov_SC04_006_after.c index ba803907c..0e43ab747 100644 --- a/src/ov_SC04_006/ov_SC04_006_after.c +++ b/src/ov_SC04_006/ov_SC04_006_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_006/nonmatchings/ov_SC04_006_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801827D4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801827D4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801827D4 - 8; + D_801827D4 = nv; + D_801827D2 = nv; + D_801827D0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_007/ov_SC04_007_after.c b/src/ov_SC04_007/ov_SC04_007_after.c index 3e1e33ca8..35baef37c 100644 --- a/src/ov_SC04_007/ov_SC04_007_after.c +++ b/src/ov_SC04_007/ov_SC04_007_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_007/nonmatchings/ov_SC04_007_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018878C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018878C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018878C - 8; + D_8018878C = nv; + D_8018878A = nv; + D_80188788 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_008/ov_SC04_008_after.c b/src/ov_SC04_008/ov_SC04_008_after.c index eff4bc626..30fcc9268 100644 --- a/src/ov_SC04_008/ov_SC04_008_after.c +++ b/src/ov_SC04_008/ov_SC04_008_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_008/nonmatchings/ov_SC04_008_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801816C4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801816C4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801816C4 - 8; + D_801816C4 = nv; + D_801816C2 = nv; + D_801816C0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_009/ov_SC04_009_after.c b/src/ov_SC04_009/ov_SC04_009_after.c index 527934c19..b51c8d4b1 100644 --- a/src/ov_SC04_009/ov_SC04_009_after.c +++ b/src/ov_SC04_009/ov_SC04_009_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_009/nonmatchings/ov_SC04_009_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801816F0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801816F0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801816F0 - 8; + D_801816F0 = nv; + D_801816EE = nv; + D_801816EC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_010/ov_SC04_010_after.c b/src/ov_SC04_010/ov_SC04_010_after.c index 4d4dc2420..ef81ced43 100644 --- a/src/ov_SC04_010/ov_SC04_010_after.c +++ b/src/ov_SC04_010/ov_SC04_010_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_010/nonmatchings/ov_SC04_010_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180D9C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180D9C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180D9C - 8; + D_80180D9C = nv; + D_80180D9A = nv; + D_80180D98 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_011/ov_SC04_011_after.c b/src/ov_SC04_011/ov_SC04_011_after.c index 3bf84243d..e68417cf1 100644 --- a/src/ov_SC04_011/ov_SC04_011_after.c +++ b/src/ov_SC04_011/ov_SC04_011_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_011/nonmatchings/ov_SC04_011_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8019302C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8019302C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8019302C - 8; + D_8019302C = nv; + D_8019302A = nv; + D_80193028 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_012/ov_SC04_012_after.c b/src/ov_SC04_012/ov_SC04_012_after.c index 45ae09577..85274d482 100644 --- a/src/ov_SC04_012/ov_SC04_012_after.c +++ b/src/ov_SC04_012/ov_SC04_012_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_012/nonmatchings/ov_SC04_012_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181200 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181200` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181200 - 8; + D_80181200 = nv; + D_801811FE = nv; + D_801811FC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_015/ov_SC04_015_after.c b/src/ov_SC04_015/ov_SC04_015_after.c index 25a8c897c..2360817c0 100644 --- a/src/ov_SC04_015/ov_SC04_015_after.c +++ b/src/ov_SC04_015/ov_SC04_015_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_015/nonmatchings/ov_SC04_015_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187138 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187138` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187138 - 8; + D_80187138 = nv; + D_80187136 = nv; + D_80187134 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_016/ov_SC04_016_after.c b/src/ov_SC04_016/ov_SC04_016_after.c index fde9af2f7..77a1c64bd 100644 --- a/src/ov_SC04_016/ov_SC04_016_after.c +++ b/src/ov_SC04_016/ov_SC04_016_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_016/nonmatchings/ov_SC04_016_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80182BFC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80182BFC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80182BFC - 8; + D_80182BFC = nv; + D_80182BFA = nv; + D_80182BF8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_018/ov_SC04_018_after.c b/src/ov_SC04_018/ov_SC04_018_after.c index 70254384b..9b4ebdec6 100644 --- a/src/ov_SC04_018/ov_SC04_018_after.c +++ b/src/ov_SC04_018/ov_SC04_018_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018FE14 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018FE14` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018FE14 - 8; + D_8018FE14 = nv; + D_8018FE12 = nv; + D_8018FE10 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_019/ov_SC04_019_after.c b/src/ov_SC04_019/ov_SC04_019_after.c index 88ffcde4f..5c146ad1a 100644 --- a/src/ov_SC04_019/ov_SC04_019_after.c +++ b/src/ov_SC04_019/ov_SC04_019_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_019/nonmatchings/ov_SC04_019_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018FE14 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018FE14` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018FE14 - 8; + D_8018FE14 = nv; + D_8018FE12 = nv; + D_8018FE10 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_020/ov_SC04_020_after.c b/src/ov_SC04_020/ov_SC04_020_after.c index e8e7d5682..4f0408c12 100644 --- a/src/ov_SC04_020/ov_SC04_020_after.c +++ b/src/ov_SC04_020/ov_SC04_020_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_020/nonmatchings/ov_SC04_020_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80185F4C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80185F4C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80185F4C - 8; + D_80185F4C = nv; + D_80185F4A = nv; + D_80185F48 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC04_021/ov_SC04_021_after.c b/src/ov_SC04_021/ov_SC04_021_after.c index 0a3d647df..2a5e74e88 100644 --- a/src/ov_SC04_021/ov_SC04_021_after.c +++ b/src/ov_SC04_021/ov_SC04_021_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_021/nonmatchings/ov_SC04_021_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181E78 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181E78` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181E78 - 8; + D_80181E78 = nv; + D_80181E76 = nv; + D_80181E74 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_000/ov_SC05_000_after.c b/src/ov_SC05_000/ov_SC05_000_after.c index a46892ae2..174fd8504 100644 --- a/src/ov_SC05_000/ov_SC05_000_after.c +++ b/src/ov_SC05_000/ov_SC05_000_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_000/nonmatchings/ov_SC05_000_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180E8C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180E8C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180E8C - 8; + D_80180E8C = nv; + D_80180E8A = nv; + D_80180E88 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_001/ov_SC05_001_after.c b/src/ov_SC05_001/ov_SC05_001_after.c index 8a9785f33..c66b1eb28 100644 --- a/src/ov_SC05_001/ov_SC05_001_after.c +++ b/src/ov_SC05_001/ov_SC05_001_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_001/nonmatchings/ov_SC05_001_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188668 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188668` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188668 - 8; + D_80188668 = nv; + D_80188666 = nv; + D_80188664 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_002/ov_SC05_002_after.c b/src/ov_SC05_002/ov_SC05_002_after.c index 38992874d..898a16974 100644 --- a/src/ov_SC05_002/ov_SC05_002_after.c +++ b/src/ov_SC05_002/ov_SC05_002_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_002/nonmatchings/ov_SC05_002_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80182E28 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80182E28` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80182E28 - 8; + D_80182E28 = nv; + D_80182E26 = nv; + D_80182E24 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_003/ov_SC05_003_after.c b/src/ov_SC05_003/ov_SC05_003_after.c index ba3ea256f..dc314a49a 100644 --- a/src/ov_SC05_003/ov_SC05_003_after.c +++ b/src/ov_SC05_003/ov_SC05_003_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_003/nonmatchings/ov_SC05_003_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80185160 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80185160` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80185160 - 8; + D_80185160 = nv; + D_8018515E = nv; + D_8018515C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_004/ov_SC05_004_after.c b/src/ov_SC05_004/ov_SC05_004_after.c index c7103540a..2e924d0f9 100644 --- a/src/ov_SC05_004/ov_SC05_004_after.c +++ b/src/ov_SC05_004/ov_SC05_004_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_004/nonmatchings/ov_SC05_004_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018426C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018426C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018426C - 8; + D_8018426C = nv; + D_8018426A = nv; + D_80184268 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_005/ov_SC05_005_after.c b/src/ov_SC05_005/ov_SC05_005_after.c index 26ea51800..5d0df08dd 100644 --- a/src/ov_SC05_005/ov_SC05_005_after.c +++ b/src/ov_SC05_005/ov_SC05_005_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_005/nonmatchings/ov_SC05_005_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80185040 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80185040` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80185040 - 8; + D_80185040 = nv; + D_8018503E = nv; + D_8018503C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_006/ov_SC05_006_after.c b/src/ov_SC05_006/ov_SC05_006_after.c index ff5f66eac..dce945f71 100644 --- a/src/ov_SC05_006/ov_SC05_006_after.c +++ b/src/ov_SC05_006/ov_SC05_006_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_006/nonmatchings/ov_SC05_006_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80182060 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80182060` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80182060 - 8; + D_80182060 = nv; + D_8018205E = nv; + D_8018205C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_007/ov_SC05_007_after.c b/src/ov_SC05_007/ov_SC05_007_after.c index d51ddfff5..878774744 100644 --- a/src/ov_SC05_007/ov_SC05_007_after.c +++ b/src/ov_SC05_007/ov_SC05_007_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_007/nonmatchings/ov_SC05_007_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018365C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018365C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018365C - 8; + D_8018365C = nv; + D_8018365A = nv; + D_80183658 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_008/ov_SC05_008_after.c b/src/ov_SC05_008/ov_SC05_008_after.c index 00b4db903..bc66a67e2 100644 --- a/src/ov_SC05_008/ov_SC05_008_after.c +++ b/src/ov_SC05_008/ov_SC05_008_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_008/nonmatchings/ov_SC05_008_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801855B4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801855B4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801855B4 - 8; + D_801855B4 = nv; + D_801855B2 = nv; + D_801855B0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_009/ov_SC05_009_after.c b/src/ov_SC05_009/ov_SC05_009_after.c index f41f2f19a..b153724a5 100644 --- a/src/ov_SC05_009/ov_SC05_009_after.c +++ b/src/ov_SC05_009/ov_SC05_009_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_009/nonmatchings/ov_SC05_009_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801816C4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801816C4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801816C4 - 8; + D_801816C4 = nv; + D_801816C2 = nv; + D_801816C0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_010/ov_SC05_010_after.c b/src/ov_SC05_010/ov_SC05_010_after.c index b49acae3f..915b45a13 100644 --- a/src/ov_SC05_010/ov_SC05_010_after.c +++ b/src/ov_SC05_010/ov_SC05_010_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_010/nonmatchings/ov_SC05_010_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018B5A0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018B5A0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018B5A0 - 8; + D_8018B5A0 = nv; + D_8018B59E = nv; + D_8018B59C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_011/ov_SC05_011_after.c b/src/ov_SC05_011/ov_SC05_011_after.c index 8e1247354..6f7fd9f25 100644 --- a/src/ov_SC05_011/ov_SC05_011_after.c +++ b/src/ov_SC05_011/ov_SC05_011_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_011/nonmatchings/ov_SC05_011_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180918 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180918` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180918 - 8; + D_80180918 = nv; + D_80180916 = nv; + D_80180914 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_017/ov_SC05_017_after.c b/src/ov_SC05_017/ov_SC05_017_after.c index 000c64606..9a9b18961 100644 --- a/src/ov_SC05_017/ov_SC05_017_after.c +++ b/src/ov_SC05_017/ov_SC05_017_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_017/nonmatchings/ov_SC05_017_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018FDD8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018FDD8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018FDD8 - 8; + D_8018FDD8 = nv; + D_8018FDD6 = nv; + D_8018FDD4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_018/ov_SC05_018_after.c b/src/ov_SC05_018/ov_SC05_018_after.c index 0ce1a47ab..bd684d629 100644 --- a/src/ov_SC05_018/ov_SC05_018_after.c +++ b/src/ov_SC05_018/ov_SC05_018_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_018/nonmatchings/ov_SC05_018_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80189534 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80189534` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80189534 - 8; + D_80189534 = nv; + D_80189532 = nv; + D_80189530 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC05_019/ov_SC05_019_after.c b/src/ov_SC05_019/ov_SC05_019_after.c index db5651625..767f5a336 100644 --- a/src/ov_SC05_019/ov_SC05_019_after.c +++ b/src/ov_SC05_019/ov_SC05_019_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_019/nonmatchings/ov_SC05_019_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181E78 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181E78` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181E78 - 8; + D_80181E78 = nv; + D_80181E76 = nv; + D_80181E74 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_000/ov_SC06_000_after.c b/src/ov_SC06_000/ov_SC06_000_after.c index 3c198142a..f031758d7 100644 --- a/src/ov_SC06_000/ov_SC06_000_after.c +++ b/src/ov_SC06_000/ov_SC06_000_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_000/nonmatchings/ov_SC06_000_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018AE88 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018AE88` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018AE88 - 8; + D_8018AE88 = nv; + D_8018AE86 = nv; + D_8018AE84 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_006/ov_SC06_006_after.c b/src/ov_SC06_006/ov_SC06_006_after.c index 2625867ae..d62eab204 100644 --- a/src/ov_SC06_006/ov_SC06_006_after.c +++ b/src/ov_SC06_006/ov_SC06_006_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_006/nonmatchings/ov_SC06_006_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801849AC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801849AC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801849AC - 8; + D_801849AC = nv; + D_801849AA = nv; + D_801849A8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_008/ov_SC06_008_after.c b/src/ov_SC06_008/ov_SC06_008_after.c index bad70390d..7e381cfb1 100644 --- a/src/ov_SC06_008/ov_SC06_008_after.c +++ b/src/ov_SC06_008/ov_SC06_008_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_008/nonmatchings/ov_SC06_008_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80188414 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80188414` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80188414 - 8; + D_80188414 = nv; + D_80188412 = nv; + D_80188410 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_010/ov_SC06_010_after.c b/src/ov_SC06_010/ov_SC06_010_after.c index 9653320d7..720ebc762 100644 --- a/src/ov_SC06_010/ov_SC06_010_after.c +++ b/src/ov_SC06_010/ov_SC06_010_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_010/nonmatchings/ov_SC06_010_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801895F0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801895F0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801895F0 - 8; + D_801895F0 = nv; + D_801895EE = nv; + D_801895EC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_011/ov_SC06_011_after.c b/src/ov_SC06_011/ov_SC06_011_after.c index d4ad27512..2ea64ab3e 100644 --- a/src/ov_SC06_011/ov_SC06_011_after.c +++ b/src/ov_SC06_011/ov_SC06_011_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_011/nonmatchings/ov_SC06_011_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80183050 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80183050` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80183050 - 8; + D_80183050 = nv; + D_8018304E = nv; + D_8018304C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_013/ov_SC06_013_after.c b/src/ov_SC06_013/ov_SC06_013_after.c index e4b8f3514..b4d02b305 100644 --- a/src/ov_SC06_013/ov_SC06_013_after.c +++ b/src/ov_SC06_013/ov_SC06_013_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_013/nonmatchings/ov_SC06_013_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801817CC read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801817CC` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801817CC - 8; + D_801817CC = nv; + D_801817CA = nv; + D_801817C8 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_014/ov_SC06_014_after.c b/src/ov_SC06_014/ov_SC06_014_after.c index c951af813..37d50e87b 100644 --- a/src/ov_SC06_014/ov_SC06_014_after.c +++ b/src/ov_SC06_014/ov_SC06_014_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_014/nonmatchings/ov_SC06_014_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80182B30 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80182B30` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80182B30 - 8; + D_80182B30 = nv; + D_80182B2E = nv; + D_80182B2C = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_015/ov_SC06_015_after.c b/src/ov_SC06_015/ov_SC06_015_after.c index 675ff12cd..8ff3191d3 100644 --- a/src/ov_SC06_015/ov_SC06_015_after.c +++ b/src/ov_SC06_015/ov_SC06_015_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_015/nonmatchings/ov_SC06_015_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80181688 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80181688` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80181688 - 8; + D_80181688 = nv; + D_80181686 = nv; + D_80181684 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_016/ov_SC06_016_after.c b/src/ov_SC06_016/ov_SC06_016_after.c index 30947d21a..3ac9b3512 100644 --- a/src/ov_SC06_016/ov_SC06_016_after.c +++ b/src/ov_SC06_016/ov_SC06_016_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_016/nonmatchings/ov_SC06_016_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187A98 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187A98` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187A98 - 8; + D_80187A98 = nv; + D_80187A96 = nv; + D_80187A94 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_018/ov_SC06_018_after.c b/src/ov_SC06_018/ov_SC06_018_after.c index bdcce894e..4d0558b7e 100644 --- a/src/ov_SC06_018/ov_SC06_018_after.c +++ b/src/ov_SC06_018/ov_SC06_018_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_018/nonmatchings/ov_SC06_018_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801961D4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801961D4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801961D4 - 8; + D_801961D4 = nv; + D_801961D2 = nv; + D_801961D0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_020/ov_SC06_020_after.c b/src/ov_SC06_020/ov_SC06_020_after.c index c1ecf53e4..2c6eb4b41 100644 --- a/src/ov_SC06_020/ov_SC06_020_after.c +++ b/src/ov_SC06_020/ov_SC06_020_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_020/nonmatchings/ov_SC06_020_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187C5C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187C5C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187C5C - 8; + D_80187C5C = nv; + D_80187C5A = nv; + D_80187C58 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_022/ov_SC06_022_after.c b/src/ov_SC06_022/ov_SC06_022_after.c index 44de02817..459bde0ce 100644 --- a/src/ov_SC06_022/ov_SC06_022_after.c +++ b/src/ov_SC06_022/ov_SC06_022_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_022/nonmatchings/ov_SC06_022_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018FF18 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018FF18` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018FF18 - 8; + D_8018FF18 = nv; + D_8018FF16 = nv; + D_8018FF14 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_024/ov_SC06_024_after.c b/src/ov_SC06_024/ov_SC06_024_after.c index 0a7787fb9..c60bb39e2 100644 --- a/src/ov_SC06_024/ov_SC06_024_after.c +++ b/src/ov_SC06_024/ov_SC06_024_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_024/nonmatchings/ov_SC06_024_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801923F0 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801923F0` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801923F0 - 8; + D_801923F0 = nv; + D_801923EE = nv; + D_801923EC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_025/ov_SC06_025_after.c b/src/ov_SC06_025/ov_SC06_025_after.c index 147c83077..32b415d8e 100644 --- a/src/ov_SC06_025/ov_SC06_025_after.c +++ b/src/ov_SC06_025/ov_SC06_025_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_025/nonmatchings/ov_SC06_025_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80187894 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80187894` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80187894 - 8; + D_80187894 = nv; + D_80187892 = nv; + D_80187890 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_027/ov_SC06_027_after.c b/src/ov_SC06_027/ov_SC06_027_after.c index cc173757b..7bb0b9b41 100644 --- a/src/ov_SC06_027/ov_SC06_027_after.c +++ b/src/ov_SC06_027/ov_SC06_027_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_027/nonmatchings/ov_SC06_027_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80180BD4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80180BD4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80180BD4 - 8; + D_80180BD4 = nv; + D_80180BD2 = nv; + D_80180BD0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_029/ov_SC06_029_after.c b/src/ov_SC06_029/ov_SC06_029_after.c index 6c88549e5..e50582cd3 100644 --- a/src/ov_SC06_029/ov_SC06_029_after.c +++ b/src/ov_SC06_029/ov_SC06_029_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_029/nonmatchings/ov_SC06_029_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018F168 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018F168` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018F168 - 8; + D_8018F168 = nv; + D_8018F166 = nv; + D_8018F164 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_030/ov_SC06_030_after.c b/src/ov_SC06_030/ov_SC06_030_after.c index b579f9a45..2c0e1ede5 100644 --- a/src/ov_SC06_030/ov_SC06_030_after.c +++ b/src/ov_SC06_030/ov_SC06_030_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_030/nonmatchings/ov_SC06_030_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80184A58 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80184A58` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80184A58 - 8; + D_80184A58 = nv; + D_80184A56 = nv; + D_80184A54 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_032/ov_SC06_032_after.c b/src/ov_SC06_032/ov_SC06_032_after.c index db02d67ee..5d9728082 100644 --- a/src/ov_SC06_032/ov_SC06_032_after.c +++ b/src/ov_SC06_032/ov_SC06_032_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_032/nonmatchings/ov_SC06_032_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80195F24 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80195F24` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80195F24 - 8; + D_80195F24 = nv; + D_80195F22 = nv; + D_80195F20 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC06_033/ov_SC06_033_after.c b/src/ov_SC06_033/ov_SC06_033_after.c index 81bf57e5e..e15611311 100644 --- a/src/ov_SC06_033/ov_SC06_033_after.c +++ b/src/ov_SC06_033/ov_SC06_033_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_80194434 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_80194434` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_80194434 - 8; + D_80194434 = nv; + D_80194432 = nv; + D_80194430 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC07_000/ov_SC07_000_after.c b/src/ov_SC07_000/ov_SC07_000_after.c index 441c9b1d0..d57fc9ccd 100644 --- a/src/ov_SC07_000/ov_SC07_000_after.c +++ b/src/ov_SC07_000/ov_SC07_000_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_000/nonmatchings/ov_SC07_000_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018527C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018527C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018527C - 8; + D_8018527C = nv; + D_8018527A = nv; + D_80185278 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC07_001/ov_SC07_001_after.c b/src/ov_SC07_001/ov_SC07_001_after.c index 0644eaef3..b368c047a 100644 --- a/src/ov_SC07_001/ov_SC07_001_after.c +++ b/src/ov_SC07_001/ov_SC07_001_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_001/nonmatchings/ov_SC07_001_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8018412C read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8018412C` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8018412C - 8; + D_8018412C = nv; + D_8018412A = nv; + D_80184128 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC07_002/ov_SC07_002_after.c b/src/ov_SC07_002/ov_SC07_002_after.c index 5378560b3..cf2eb71ec 100644 --- a/src/ov_SC07_002/ov_SC07_002_after.c +++ b/src/ov_SC07_002/ov_SC07_002_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_002/nonmatchings/ov_SC07_002_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801893E8 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801893E8` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801893E8 - 8; + D_801893E8 = nv; + D_801893E6 = nv; + D_801893E4 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC07_008/ov_SC07_008_after.c b/src/ov_SC07_008/ov_SC07_008_after.c index 310c9bda3..57b38b69e 100644 --- a/src/ov_SC07_008/ov_SC07_008_after.c +++ b/src/ov_SC07_008/ov_SC07_008_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_008/nonmatchings/ov_SC07_008_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_8017FF00 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_8017FF00` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_8017FF00 - 8; + D_8017FF00 = nv; + D_8017FEFE = nv; + D_8017FEFC = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */ diff --git a/src/ov_SC07_009/ov_SC07_009_after.c b/src/ov_SC07_009/ov_SC07_009_after.c index 99b34cadc..93a79eaef 100644 --- a/src/ov_SC07_009/ov_SC07_009_after.c +++ b/src/ov_SC07_009/ov_SC07_009_after.c @@ -4408,7 +4408,59 @@ void func_801647A4(int param_1) { DEFINE_func_80164864() /* dedup: shared engine-core @0x80164864 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_009/nonmatchings/ov_SC07_009_after", func_80164930); +// @class: regalloc-order — wave-3 real-TU crack (§42a); cracked at Max. +// Fix: D_801809A4 read needs direct-addressed `lhu` (u16). Cannot use `*(u16*)&D_801809A4` +// (forces &sym into a held reg -> drift) NOR a block-scoped `extern u16` (conflicting-types +// ERROR vs the ambient s16, cc1 exit 33). Solution: flip the file-scope decl (5802) to u16 — +// byte-neutral to the only other user (func_801647A4 store-only) — and reference directly. +typedef struct { + u16 f0; + u8 pad0[0x4e]; + int f50; + u8 pad1[0x14]; +} Ent_80164930_80164930; + + +void func_80164930(s32 param_1) { + int iVar3 = *(int *)(((int)param_1) + 0x20); + if (*(int *)(((int)param_1) + 0x50) == 0) { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x100; + short nv; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) + 0x71; + nv = D_801809A4 - 8; + D_801809A4 = nv; + D_801809A2 = nv; + D_801809A0 = nv; + if (nv < -0x80) { + int i, lim; + Ent_80164930_80164930 *p; + for (i = 0, lim = 0x19, p = ((Ent_80164930_80164930 *)&D_8011F9D0); i < 0x14; i++) { + if (p->f0 == lim && p->f50 != 0) { + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)(p); + } + p++; + } + ((void(*)(Ent_80164930_80164930 *))func_80162CCC)((Ent_80164930_80164930 *)((int)param_1)); + } else { + ((void(*)(int))func_80164ACC)(((int)param_1)); + } + } else { + short sVar1 = *(u16 *)(iVar3 + 0x1c) + 0x40; + u16 uVar2; + *(short *)(iVar3 + 0x1c) = sVar1; + *(short *)(iVar3 + 0x18) = sVar1; + uVar2 = *(u16 *)(iVar3 + 0x1a) - 0x200; + *(u16 *)(iVar3 + 0x1a) = uVar2; + if ((int)((unsigned)uVar2 << 0x10) < 0) { + *(short *)(iVar3 + 0x1a) = 0; + } + *(short *)(iVar3 + 0x12) = *(u16 *)(iVar3 + 0x12) - 0x71; + } +} + + DEFINE_func_80164A74() /* dedup: shared engine-core @0x80164A74 (src/shared) */