From 283937ed8eb2fb46cb1b616bb96b220137b3e51d Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:47:22 -0600 Subject: [PATCH] =?UTF-8?q?feat(phase-29):=20T70=20=E2=80=94=20byte-varian?= =?UTF-8?q?t=20families=20sweep=201=20of=2010=20(138=20banked,=20+130=20di?= =?UTF-8?q?stinct)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Item 5, first batch. Swept 10 byte-VARIANT non-jr non-O0 families (42,235 ins / 1,552 distinct projected): 138 BANKED / 1,346 failed — ONE family of ten (func_801627E8 137/137), plus 152 members skipped as "unresolved immediates (T2a)". THE FINDING: that is a ~10x worse rate than the byte-IDENTICAL families, which banked 137/137 apiece all session. It follows from what §111 established — a byte-variant member differs in more than relocations, so the template must adapt immediates too, and family_remap's T2a engine refuses what it cannot resolve. The distinct-code lever is real but it is NOT the same cheap sweep, and the projected "2,962 distinct across 36 families" should be discounted until the immediate-resolution rate is measured. That measurement is now item 1 of the next list, ahead of sweeping the other 26. §111 PASSED A SECOND PREDICTIVE TEST: projected +129 distinct for func_801627E8; observed +130 (the extra from an unrelated 2-member bank). GATES: R22 clean-fleet 140 passed, 0 failed of 140; tools-health OK; 0 NON_MATCHING (G4). METRICS: instr 86.5% -> 86.6% (+2,618 ins); fn-count 91.08% -> 91.12% (+138); distinct-code 68,066 -> 68,196 = +130 — the first real distinct-code movement of the session. --- docs/progress.fleet.md | 286 +++++++++++----------- phase-ends/CURRENT_PHASE.md | 54 ++++ src/ov_SC01_000/ov_SC01_000_jr_8015C32C.c | 38 ++- src/ov_SC01_001/ov_SC01_001_jr_8015C32C.c | 38 ++- src/ov_SC01_004/ov_SC01_004_jr_8015C32C.c | 38 ++- src/ov_SC01_005/ov_SC01_005_jr_8015C32C.c | 38 ++- src/ov_SC01_006/ov_SC01_006_jr_8015C32C.c | 38 ++- src/ov_SC01_008/ov_SC01_008_jr_8015C32C.c | 38 ++- src/ov_SC01_009/ov_SC01_009_jr_8015C32C.c | 38 ++- src/ov_SC01_074/ov_SC01_074_jr_8015C32C.c | 38 ++- src/ov_SC01_080/ov_SC01_080_jr_8015C32C.c | 38 ++- src/ov_SC01_084/ov_SC01_084_jr_8015C32C.c | 38 ++- src/ov_SC02_000/ov_SC02_000_jr_8015C32C.c | 38 ++- src/ov_SC02_003/ov_SC02_003_jr_8015C32C.c | 38 ++- src/ov_SC02_004/ov_SC02_004_jr_8015C32C.c | 38 ++- src/ov_SC02_005/ov_SC02_005_jr_8015C32C.c | 38 ++- src/ov_SC02_011/ov_SC02_011_jr_8015C32C.c | 38 ++- src/ov_SC02_015/ov_SC02_015_jr_8015C32C.c | 38 ++- src/ov_SC02_016/ov_SC02_016_jr_8015C32C.c | 38 ++- src/ov_SC02_017/ov_SC02_017_jr_8015C32C.c | 38 ++- src/ov_SC02_021/ov_SC02_021_jr_8015C32C.c | 38 ++- src/ov_SC02_026/ov_SC02_026_jr_8015C32C.c | 38 ++- src/ov_SC02_027/ov_SC02_027_jr_8015C32C.c | 38 ++- src/ov_SC02_028/ov_SC02_028_jr_8015C32C.c | 38 ++- src/ov_SC02_031/ov_SC02_031_jr_8015C32C.c | 38 ++- src/ov_SC02_035/ov_SC02_035_jr_8015C32C.c | 38 ++- src/ov_SC02_039/ov_SC02_039_jr_8015C32C.c | 38 ++- src/ov_SC02_041/ov_SC02_041_jr_8015C32C.c | 38 ++- src/ov_SC03_001/ov_SC03_001_jr_8015C32C.c | 38 ++- src/ov_SC03_002/ov_SC03_002_jr_8015C32C.c | 38 ++- src/ov_SC03_003/ov_SC03_003_jr_8015C32C.c | 38 ++- src/ov_SC03_006/ov_SC03_006_jr_8015C32C.c | 38 ++- src/ov_SC03_007/ov_SC03_007_jr_8015C32C.c | 38 ++- src/ov_SC03_010/ov_SC03_010_jr_8015C32C.c | 38 ++- src/ov_SC03_011/ov_SC03_011_jr_8015C32C.c | 38 ++- src/ov_SC03_012/ov_SC03_012_jr_8015C32C.c | 38 ++- src/ov_SC03_013/ov_SC03_013_jr_8015C32C.c | 38 ++- src/ov_SC03_014/ov_SC03_014_jr_8015C32C.c | 38 ++- src/ov_SC03_015/ov_SC03_015_jr_8015C32C.c | 38 ++- src/ov_SC03_023/ov_SC03_023_jr_8015C32C.c | 38 ++- src/ov_SC03_024/ov_SC03_024_jr_8015C32C.c | 38 ++- src/ov_SC03_028/ov_SC03_028_jr_8015C32C.c | 38 ++- src/ov_SC03_029/ov_SC03_029_jr_8015C32C.c | 38 ++- src/ov_SC03_030/ov_SC03_030_jr_8015C32C.c | 38 ++- src/ov_SC03_031/ov_SC03_031_jr_8015C32C.c | 38 ++- src/ov_SC03_089/ov_SC03_089_jr_8015C32C.c | 38 ++- src/ov_SC03_090/ov_SC03_090_jr_8015C32C.c | 38 ++- src/ov_SC03_091/ov_SC03_091_jr_8015C32C.c | 38 ++- src/ov_SC03_092/ov_SC03_092_jr_8015C32C.c | 38 ++- src/ov_SC03_093/ov_SC03_093_jr_8015C32C.c | 38 ++- src/ov_SC03_094/ov_SC03_094_jr_8015C32C.c | 38 ++- src/ov_SC03_095/ov_SC03_095_jr_8015C32C.c | 38 ++- src/ov_SC03_096/ov_SC03_096_jr_8015C32C.c | 38 ++- src/ov_SC03_097/ov_SC03_097_jr_8015C32C.c | 38 ++- src/ov_SC03_098/ov_SC03_098_jr_8015C32C.c | 38 ++- src/ov_SC03_099/ov_SC03_099_jr_8015C32C.c | 38 ++- src/ov_SC03_100/ov_SC03_100_jr_8015C32C.c | 38 ++- src/ov_SC03_101/ov_SC03_101_jr_8015C32C.c | 38 ++- src/ov_SC03_102/ov_SC03_102_jr_8015C32C.c | 38 ++- src/ov_SC03_103/ov_SC03_103_jr_8015C32C.c | 38 ++- src/ov_SC03_104/ov_SC03_104_jr_8015C32C.c | 38 ++- src/ov_SC03_105/ov_SC03_105_jr_8015C32C.c | 38 ++- src/ov_SC03_108/ov_SC03_108_jr_8015C32C.c | 38 ++- src/ov_SC03_109/ov_SC03_109_jr_8015C32C.c | 38 ++- src/ov_SC03_110/ov_SC03_110_jr_8015C32C.c | 38 ++- src/ov_SC03_111/ov_SC03_111_jr_8015C32C.c | 38 ++- src/ov_SC03_112/ov_SC03_112_jr_8015C32C.c | 38 ++- src/ov_SC03_113/ov_SC03_113_jr_8015C32C.c | 38 ++- src/ov_SC03_114/ov_SC03_114_jr_8015C32C.c | 38 ++- src/ov_SC03_115/ov_SC03_115_jr_8015C32C.c | 38 ++- src/ov_SC03_116/ov_SC03_116_jr_8015C32C.c | 38 ++- src/ov_SC03_117/ov_SC03_117_jr_8015C32C.c | 38 ++- src/ov_SC03_118/ov_SC03_118_jr_8015C32C.c | 38 ++- src/ov_SC03_119/ov_SC03_119_jr_8015C32C.c | 38 ++- src/ov_SC03_121/ov_SC03_121_jr_8015C32C.c | 38 ++- src/ov_SC03_124/ov_SC03_124_jr_8015C32C.c | 38 ++- src/ov_SC03_125/ov_SC03_125_jr_8015C32C.c | 38 ++- src/ov_SC03_126/ov_SC03_126_jr_8015C32C.c | 38 ++- src/ov_SC04_000/ov_SC04_000_jr_8015C32C.c | 38 ++- src/ov_SC04_002/ov_SC04_002_jr_8015C32C.c | 38 ++- src/ov_SC04_003/ov_SC04_003_jr_8015C32C.c | 38 ++- src/ov_SC04_004/ov_SC04_004_jr_8015C32C.c | 38 ++- src/ov_SC04_005/ov_SC04_005_jr_8015C32C.c | 38 ++- src/ov_SC04_006/ov_SC04_006_jr_8015C32C.c | 38 ++- src/ov_SC04_007/ov_SC04_007_jr_8015C32C.c | 38 ++- src/ov_SC04_008/ov_SC04_008_jr_8015C32C.c | 38 ++- src/ov_SC04_009/ov_SC04_009_jr_8015C32C.c | 38 ++- src/ov_SC04_010/ov_SC04_010_jr_8015C32C.c | 38 ++- src/ov_SC04_011/ov_SC04_011_jr_8015C32C.c | 38 ++- src/ov_SC04_012/ov_SC04_012_jr_8015C32C.c | 38 ++- src/ov_SC04_015/ov_SC04_015_jr_8015C32C.c | 38 ++- src/ov_SC04_016/ov_SC04_016_jr_8015C32C.c | 38 ++- src/ov_SC04_018/ov_SC04_018_jr_8015C32C.c | 38 ++- src/ov_SC04_019/ov_SC04_019_jr_8015C32C.c | 38 ++- src/ov_SC04_020/ov_SC04_020_jr_8015C32C.c | 38 ++- src/ov_SC04_021/ov_SC04_021_jr_8015C32C.c | 38 ++- src/ov_SC05_000/ov_SC05_000_jr_8015C32C.c | 38 ++- src/ov_SC05_001/ov_SC05_001_jr_8015C32C.c | 38 ++- src/ov_SC05_002/ov_SC05_002_jr_8015C32C.c | 38 ++- src/ov_SC05_003/ov_SC05_003_jr_8015C32C.c | 38 ++- src/ov_SC05_004/ov_SC05_004_jr_8015C32C.c | 38 ++- src/ov_SC05_005/ov_SC05_005_jr_8015C32C.c | 38 ++- src/ov_SC05_006/ov_SC05_006_jr_8015C32C.c | 38 ++- src/ov_SC05_007/ov_SC05_007_jr_8015C32C.c | 38 ++- src/ov_SC05_008/ov_SC05_008_jr_8015C32C.c | 38 ++- src/ov_SC05_009/ov_SC05_009_jr_8015C32C.c | 38 ++- src/ov_SC05_010/ov_SC05_010_jr_8015C32C.c | 38 ++- src/ov_SC05_011/ov_SC05_011_jr_8015C32C.c | 38 ++- src/ov_SC05_017/ov_SC05_017_jr_8015C32C.c | 38 ++- src/ov_SC05_018/ov_SC05_018_jr_8015C32C.c | 38 ++- src/ov_SC05_018/ov_SC05_018_jr_8017D604.c | 13 +- src/ov_SC05_019/ov_SC05_019_jr_8015C32C.c | 38 ++- src/ov_SC06_000/ov_SC06_000_jr_8015C32C.c | 38 ++- src/ov_SC06_006/ov_SC06_006_jr_8015C32C.c | 38 ++- src/ov_SC06_008/ov_SC06_008_jr_8015C32C.c | 38 ++- src/ov_SC06_010/ov_SC06_010_jr_8015C32C.c | 38 ++- src/ov_SC06_011/ov_SC06_011_jr_8015C32C.c | 38 ++- src/ov_SC06_013/ov_SC06_013_jr_8015C32C.c | 38 ++- src/ov_SC06_014/ov_SC06_014_jr_8015C32C.c | 38 ++- src/ov_SC06_015/ov_SC06_015_jr_8015C32C.c | 38 ++- src/ov_SC06_016/ov_SC06_016_jr_8015C32C.c | 38 ++- src/ov_SC06_018/ov_SC06_018_jr_8015C32C.c | 38 ++- src/ov_SC06_020/ov_SC06_020_jr_8015C32C.c | 38 ++- src/ov_SC06_022/ov_SC06_022_jr_8015C32C.c | 38 ++- src/ov_SC06_024/ov_SC06_024_jr_8015C32C.c | 38 ++- src/ov_SC06_025/ov_SC06_025_jr_8015C32C.c | 38 ++- src/ov_SC06_027/ov_SC06_027_jr_8015C32C.c | 38 ++- src/ov_SC06_029/ov_SC06_029_jr_8015C32C.c | 38 ++- src/ov_SC06_030/ov_SC06_030_jr_8015C32C.c | 38 ++- src/ov_SC06_032/ov_SC06_032_jr_8015C32C.c | 38 ++- src/ov_SC06_033/ov_SC06_033_jr_8015C32C.c | 38 ++- src/ov_SC07_000/ov_SC07_000_jr_8015C32C.c | 38 ++- src/ov_SC07_001/ov_SC07_001_jr_8015C32C.c | 38 ++- src/ov_SC07_002/ov_SC07_002_jr_8015C32C.c | 38 ++- src/ov_SC07_006/ov_SC07_006_jr_8015C32C.c | 38 ++- src/ov_SC07_007/ov_SC07_007_jr_8015C32C.c | 38 ++- src/ov_SC07_008/ov_SC07_008_jr_8015C32C.c | 38 ++- src/ov_SC07_009/ov_SC07_009_jr_8015C32C.c | 38 ++- src/ov_SC07_010/ov_SC07_010_jr_8015C32C.c | 38 ++- src/ov_SC07_011/ov_SC07_011_jr_8015C32C.c | 38 ++- 140 files changed, 5139 insertions(+), 420 deletions(-) diff --git a/docs/progress.fleet.md b/docs/progress.fleet.md index ec0370ebd..21e3052f6 100644 --- a/docs/progress.fleet.md +++ b/docs/progress.fleet.md @@ -4,157 +4,157 @@ # cross-binary collapsible-byte leverage: docs/duplicates.cross.md. # THREE progress metrics (all matter — see the labels): -FLEET fn-count byte-ident: 322157 / 353720 = 91.08% (REAL+LINKED+empties; FUNCTION-count, ×134-inflated — one crack counts per overlay) -FLEET instr-weighted : 11372304 / 13141652 = 86.5% (shipped .text across main + resident + 138 overlays; the decomp.dev-DISPLAY number) -FLEET distinct-code(uniq): 4332063 / 5634875 = 76.9% (68066/87459 unique fns; the DISTINCT-RE number) +FLEET fn-count byte-ident: 322295 / 353720 = 91.12% (REAL+LINKED+empties; FUNCTION-count, ×134-inflated — one crack counts per overlay) +FLEET instr-weighted : 11374922 / 13141652 = 86.6% (shipped .text across main + resident + 138 overlays; the decomp.dev-DISPLAY number) +FLEET distinct-code(uniq): 4334529 / 5634875 = 76.9% (68196/87459 unique fns; the DISTINCT-RE number) MAIN game-code weighted : 436 / 60201 = 0.7% (INCLUDED in the fleet numbers above since 2026-07-22 — roadmap §1 metrics contract; LINKED-excluding Ghidra sig dated 2026-06-14; caveat is R34: no independent second oracle for a PS-X EXE, NOT drift) - (fleet EXCLUDING main, for continuity with pre-2026-07-22 readings: 11371868 / 13081451 = 86.9%) + (fleet EXCLUDING main, for continuity with pre-2026-07-22 readings: 11374486 / 13081451 = 87.0%) -FLEET REAL substantive : 320302 (of which dedup-shared 239530 via 1886 groups / 239604 instances) +FLEET REAL substantive : 320440 (of which dedup-shared 239530 via 1886 groups / 239604 instances) FLEET LINKED PsyQ objs : 959 FLEET NON_MATCHING : 7 (0 in any default build — G4) -FLEET INCLUDE_ASM stubs : 31556 +FLEET INCLUDE_ASM stubs : 31418 FLEET matchable : 353720 | binary | REAL | shared | LINKED | byte-ident | matchable | byte-ident % | |---|---:|---:|---:|---:|---:|---:| | main | 54 | 2 | 959 | 1055 | 2096 | 50.3% | | resident | 129 | 0 | 0 | 131 | 145 | 90.3% | -| ov_SC01_000 | 2295 | 1742 | 0 | 2295 | 2403 | 95.5% | -| ov_SC01_001 | 2300 | 1743 | 0 | 2302 | 2466 | 93.3% | -| ov_SC01_004 | 2290 | 1734 | 0 | 2291 | 2414 | 94.9% | -| ov_SC01_005 | 2320 | 1757 | 0 | 2320 | 2503 | 92.7% | -| ov_SC01_006 | 2320 | 1757 | 0 | 2320 | 2503 | 92.7% | -| ov_SC01_008 | 2290 | 1734 | 0 | 2292 | 2426 | 94.5% | -| ov_SC01_009 | 2316 | 1735 | 0 | 2317 | 2507 | 92.4% | -| ov_SC01_074 | 2294 | 1735 | 0 | 2296 | 2425 | 94.7% | +| ov_SC01_000 | 2296 | 1742 | 0 | 2296 | 2403 | 95.5% | +| ov_SC01_001 | 2301 | 1743 | 0 | 2303 | 2466 | 93.4% | +| ov_SC01_004 | 2291 | 1734 | 0 | 2292 | 2414 | 94.9% | +| ov_SC01_005 | 2321 | 1757 | 0 | 2321 | 2503 | 92.7% | +| ov_SC01_006 | 2321 | 1757 | 0 | 2321 | 2503 | 92.7% | +| ov_SC01_008 | 2291 | 1734 | 0 | 2293 | 2426 | 94.5% | +| ov_SC01_009 | 2317 | 1735 | 0 | 2318 | 2507 | 92.5% | +| ov_SC01_074 | 2295 | 1735 | 0 | 2297 | 2425 | 94.7% | | ov_SC01_077 | 2472 | 1702 | 0 | 2474 | 2585 | 95.7% | -| ov_SC01_080 | 2332 | 1738 | 0 | 2332 | 2512 | 92.8% | -| ov_SC01_084 | 2339 | 1738 | 0 | 2344 | 2579 | 90.9% | -| ov_SC02_000 | 2392 | 1773 | 0 | 2392 | 2683 | 89.2% | -| ov_SC02_003 | 2392 | 1773 | 0 | 2392 | 2683 | 89.2% | -| ov_SC02_004 | 2298 | 1738 | 0 | 2298 | 2401 | 95.7% | -| ov_SC02_005 | 2406 | 1734 | 0 | 2416 | 2927 | 82.5% | -| ov_SC02_011 | 2419 | 1741 | 0 | 2430 | 2893 | 84.0% | -| ov_SC02_015 | 2300 | 1740 | 0 | 2300 | 2414 | 95.3% | -| ov_SC02_016 | 2334 | 1740 | 0 | 2337 | 2545 | 91.8% | -| ov_SC02_017 | 2378 | 1740 | 0 | 2386 | 2732 | 87.3% | -| ov_SC02_021 | 2306 | 1740 | 0 | 2306 | 2437 | 94.6% | -| ov_SC02_026 | 2321 | 1738 | 0 | 2327 | 2572 | 90.5% | -| ov_SC02_027 | 2344 | 1738 | 0 | 2353 | 2692 | 87.4% | -| ov_SC02_028 | 2346 | 1738 | 0 | 2356 | 2701 | 87.2% | -| ov_SC02_031 | 2332 | 1739 | 0 | 2337 | 2562 | 91.2% | -| ov_SC02_035 | 2307 | 1738 | 0 | 2310 | 2520 | 91.7% | -| ov_SC02_039 | 2291 | 1738 | 0 | 2291 | 2416 | 94.8% | -| ov_SC02_041 | 2329 | 1738 | 0 | 2332 | 2561 | 91.1% | -| ov_SC03_001 | 2426 | 1739 | 0 | 2443 | 2869 | 85.2% | -| ov_SC03_002 | 2352 | 1743 | 0 | 2367 | 2631 | 90.0% | -| ov_SC03_003 | 2301 | 1738 | 0 | 2302 | 2423 | 95.0% | -| ov_SC03_006 | 2369 | 1744 | 0 | 2378 | 2767 | 85.9% | -| ov_SC03_007 | 2346 | 1738 | 0 | 2350 | 2623 | 89.6% | -| ov_SC03_010 | 2309 | 1738 | 0 | 2309 | 2471 | 93.4% | -| ov_SC03_011 | 2315 | 1738 | 0 | 2321 | 2527 | 91.8% | -| ov_SC03_012 | 2293 | 1738 | 0 | 2294 | 2406 | 95.3% | -| ov_SC03_013 | 2314 | 1738 | 0 | 2314 | 2493 | 92.8% | -| ov_SC03_014 | 2372 | 1763 | 0 | 2372 | 2685 | 88.3% | -| ov_SC03_015 | 2372 | 1763 | 0 | 2372 | 2685 | 88.3% | -| ov_SC03_023 | 2300 | 1738 | 0 | 2301 | 2435 | 94.5% | -| ov_SC03_024 | 2360 | 1743 | 0 | 2367 | 2641 | 89.6% | -| ov_SC03_028 | 2340 | 1738 | 0 | 2344 | 2664 | 88.0% | -| ov_SC03_029 | 2342 | 1740 | 0 | 2352 | 2644 | 89.0% | -| ov_SC03_030 | 2315 | 1743 | 0 | 2317 | 2495 | 92.9% | -| ov_SC03_031 | 2311 | 1738 | 0 | 2314 | 2514 | 92.0% | -| ov_SC03_089 | 2328 | 1738 | 0 | 2335 | 2581 | 90.5% | -| ov_SC03_090 | 2329 | 1738 | 0 | 2337 | 2625 | 89.0% | -| ov_SC03_091 | 2332 | 1738 | 0 | 2340 | 2640 | 88.6% | -| ov_SC03_092 | 2342 | 1738 | 0 | 2354 | 2587 | 91.0% | -| ov_SC03_093 | 2318 | 1738 | 0 | 2322 | 2563 | 90.6% | -| ov_SC03_094 | 2313 | 1738 | 0 | 2319 | 2577 | 90.0% | -| ov_SC03_095 | 2303 | 1738 | 0 | 2306 | 2474 | 93.2% | -| ov_SC03_096 | 2303 | 1738 | 0 | 2306 | 2465 | 93.5% | -| ov_SC03_097 | 2333 | 1738 | 0 | 2340 | 2603 | 89.9% | -| ov_SC03_098 | 2311 | 1738 | 0 | 2314 | 2541 | 91.1% | -| ov_SC03_099 | 2304 | 1738 | 0 | 2307 | 2504 | 92.1% | -| ov_SC03_100 | 2314 | 1738 | 0 | 2318 | 2539 | 91.3% | -| ov_SC03_101 | 2314 | 1738 | 0 | 2318 | 2528 | 91.7% | -| ov_SC03_102 | 2307 | 1738 | 0 | 2310 | 2492 | 92.7% | -| ov_SC03_103 | 2310 | 1740 | 0 | 2313 | 2510 | 92.2% | -| ov_SC03_104 | 2336 | 1738 | 0 | 2343 | 2616 | 89.6% | -| ov_SC03_105 | 2327 | 1738 | 0 | 2334 | 2597 | 89.9% | -| ov_SC03_108 | 2294 | 1738 | 0 | 2294 | 2443 | 93.9% | -| ov_SC03_109 | 2298 | 1738 | 0 | 2300 | 2424 | 94.9% | -| ov_SC03_110 | 2302 | 1738 | 0 | 2302 | 2468 | 93.3% | -| ov_SC03_111 | 2313 | 1738 | 0 | 2316 | 2510 | 92.3% | -| ov_SC03_112 | 2309 | 1740 | 0 | 2311 | 2526 | 91.5% | -| ov_SC03_113 | 2302 | 1740 | 0 | 2305 | 2468 | 93.4% | -| ov_SC03_114 | 2291 | 1738 | 0 | 2293 | 2415 | 94.9% | -| ov_SC03_115 | 2308 | 1738 | 0 | 2310 | 2472 | 93.4% | -| ov_SC03_116 | 2299 | 1738 | 0 | 2302 | 2438 | 94.4% | -| ov_SC03_117 | 2326 | 1738 | 0 | 2332 | 2557 | 91.2% | -| ov_SC03_118 | 2372 | 1762 | 0 | 2373 | 2685 | 88.4% | -| ov_SC03_119 | 2371 | 1762 | 0 | 2372 | 2685 | 88.3% | -| ov_SC03_121 | 2306 | 1738 | 0 | 2309 | 2459 | 93.9% | -| ov_SC03_124 | 2384 | 1734 | 0 | 2404 | 2741 | 87.7% | -| ov_SC03_125 | 2340 | 1738 | 0 | 2352 | 2588 | 90.9% | -| ov_SC03_126 | 2303 | 1740 | 0 | 2303 | 2423 | 95.0% | -| ov_SC04_000 | 2319 | 1742 | 0 | 2328 | 2546 | 91.4% | -| ov_SC04_002 | 2338 | 1738 | 0 | 2342 | 2636 | 88.8% | -| ov_SC04_003 | 2314 | 1738 | 0 | 2318 | 2502 | 92.6% | -| ov_SC04_004 | 2323 | 1738 | 0 | 2325 | 2558 | 90.9% | -| ov_SC04_005 | 2333 | 1738 | 0 | 2339 | 2612 | 89.5% | -| ov_SC04_006 | 2303 | 1738 | 0 | 2305 | 2454 | 93.9% | -| ov_SC04_007 | 2327 | 1738 | 0 | 2331 | 2569 | 90.7% | -| ov_SC04_008 | 2295 | 1738 | 0 | 2295 | 2415 | 95.0% | -| ov_SC04_009 | 2310 | 1738 | 0 | 2313 | 2441 | 94.8% | -| ov_SC04_010 | 2300 | 1738 | 0 | 2301 | 2419 | 95.1% | -| ov_SC04_011 | 2358 | 1738 | 0 | 2364 | 2803 | 84.3% | -| ov_SC04_012 | 2297 | 1738 | 0 | 2298 | 2420 | 95.0% | -| ov_SC04_015 | 2362 | 1739 | 0 | 2373 | 2611 | 90.9% | -| ov_SC04_016 | 2300 | 1738 | 0 | 2302 | 2440 | 94.3% | -| ov_SC04_018 | 2410 | 1773 | 0 | 2410 | 2857 | 84.4% | -| ov_SC04_019 | 2416 | 1773 | 0 | 2416 | 2857 | 84.6% | -| ov_SC04_020 | 2327 | 1738 | 0 | 2339 | 2567 | 91.1% | -| ov_SC04_021 | 2304 | 1740 | 0 | 2304 | 2423 | 95.1% | -| ov_SC05_000 | 2301 | 1742 | 0 | 2304 | 2422 | 95.1% | -| ov_SC05_001 | 2323 | 1738 | 0 | 2328 | 2574 | 90.4% | -| ov_SC05_002 | 2306 | 1738 | 0 | 2309 | 2442 | 94.6% | -| ov_SC05_003 | 2303 | 1738 | 0 | 2304 | 2481 | 92.9% | -| ov_SC05_004 | 2299 | 1738 | 0 | 2301 | 2464 | 93.4% | -| ov_SC05_005 | 2304 | 1738 | 0 | 2305 | 2491 | 92.5% | -| ov_SC05_006 | 2297 | 1738 | 0 | 2297 | 2430 | 94.5% | -| ov_SC05_007 | 2307 | 1738 | 0 | 2312 | 2482 | 93.2% | -| ov_SC05_008 | 2324 | 1738 | 0 | 2326 | 2543 | 91.5% | -| ov_SC05_009 | 2303 | 1738 | 0 | 2307 | 2438 | 94.6% | -| ov_SC05_010 | 2330 | 1738 | 0 | 2334 | 2588 | 90.2% | -| ov_SC05_011 | 2299 | 1738 | 0 | 2300 | 2409 | 95.5% | -| ov_SC05_017 | 2406 | 1735 | 0 | 2417 | 2842 | 85.0% | -| ov_SC05_018 | 2353 | 1738 | 0 | 2366 | 2673 | 88.5% | -| ov_SC05_019 | 2304 | 1740 | 0 | 2304 | 2423 | 95.1% | -| ov_SC06_000 | 2368 | 1747 | 0 | 2371 | 2691 | 88.1% | -| ov_SC06_006 | 2320 | 1738 | 0 | 2321 | 2511 | 92.4% | -| ov_SC06_008 | 2340 | 1740 | 0 | 2346 | 2542 | 92.3% | -| ov_SC06_010 | 2320 | 1738 | 0 | 2325 | 2517 | 92.4% | -| ov_SC06_011 | 2308 | 1738 | 0 | 2312 | 2468 | 93.7% | -| ov_SC06_013 | 2302 | 1738 | 0 | 2303 | 2425 | 95.0% | -| ov_SC06_014 | 2308 | 1738 | 0 | 2310 | 2453 | 94.2% | -| ov_SC06_015 | 2305 | 1738 | 0 | 2305 | 2421 | 95.2% | -| ov_SC06_016 | 2323 | 1738 | 0 | 2325 | 2549 | 91.2% | -| ov_SC06_018 | 2332 | 1740 | 0 | 2339 | 2665 | 87.8% | -| ov_SC06_020 | 2312 | 1740 | 0 | 2313 | 2518 | 91.9% | -| ov_SC06_022 | 2331 | 1738 | 0 | 2339 | 2642 | 88.5% | -| ov_SC06_024 | 2341 | 1738 | 0 | 2347 | 2667 | 88.0% | -| ov_SC06_025 | 2325 | 1738 | 0 | 2330 | 2572 | 90.6% | -| ov_SC06_027 | 2290 | 1738 | 0 | 2291 | 2408 | 95.1% | -| ov_SC06_029 | 2351 | 1738 | 0 | 2363 | 2662 | 88.8% | -| ov_SC06_030 | 2304 | 1738 | 0 | 2304 | 2456 | 93.8% | -| ov_SC06_032 | 2326 | 1739 | 0 | 2333 | 2658 | 87.8% | -| ov_SC06_033 | 2328 | 1739 | 0 | 2335 | 2631 | 88.7% | -| ov_SC07_000 | 2319 | 1742 | 0 | 2321 | 2521 | 92.1% | -| ov_SC07_001 | 2303 | 1738 | 0 | 2305 | 2454 | 93.9% | -| ov_SC07_002 | 2331 | 1738 | 0 | 2335 | 2579 | 90.5% | -| ov_SC07_006 | 2092 | 1555 | 0 | 2172 | 2456 | 88.4% | -| ov_SC07_007 | 2095 | 1586 | 0 | 2179 | 2613 | 83.4% | -| ov_SC07_008 | 2288 | 1738 | 0 | 2288 | 2386 | 95.9% | -| ov_SC07_009 | 2297 | 1738 | 0 | 2299 | 2430 | 94.6% | -| ov_SC07_010 | 2128 | 1608 | 0 | 2211 | 2524 | 87.6% | -| ov_SC07_011 | 2095 | 1585 | 0 | 2175 | 2449 | 88.8% | +| ov_SC01_080 | 2333 | 1738 | 0 | 2333 | 2512 | 92.9% | +| ov_SC01_084 | 2340 | 1738 | 0 | 2345 | 2579 | 90.9% | +| ov_SC02_000 | 2393 | 1773 | 0 | 2393 | 2683 | 89.2% | +| ov_SC02_003 | 2393 | 1773 | 0 | 2393 | 2683 | 89.2% | +| ov_SC02_004 | 2299 | 1738 | 0 | 2299 | 2401 | 95.8% | +| ov_SC02_005 | 2407 | 1734 | 0 | 2417 | 2927 | 82.6% | +| ov_SC02_011 | 2420 | 1741 | 0 | 2431 | 2893 | 84.0% | +| ov_SC02_015 | 2301 | 1740 | 0 | 2301 | 2414 | 95.3% | +| ov_SC02_016 | 2335 | 1740 | 0 | 2338 | 2545 | 91.9% | +| ov_SC02_017 | 2379 | 1740 | 0 | 2387 | 2732 | 87.4% | +| ov_SC02_021 | 2307 | 1740 | 0 | 2307 | 2437 | 94.7% | +| ov_SC02_026 | 2322 | 1738 | 0 | 2328 | 2572 | 90.5% | +| ov_SC02_027 | 2345 | 1738 | 0 | 2354 | 2692 | 87.4% | +| ov_SC02_028 | 2347 | 1738 | 0 | 2357 | 2701 | 87.3% | +| ov_SC02_031 | 2333 | 1739 | 0 | 2338 | 2562 | 91.3% | +| ov_SC02_035 | 2308 | 1738 | 0 | 2311 | 2520 | 91.7% | +| ov_SC02_039 | 2292 | 1738 | 0 | 2292 | 2416 | 94.9% | +| ov_SC02_041 | 2330 | 1738 | 0 | 2333 | 2561 | 91.1% | +| ov_SC03_001 | 2427 | 1739 | 0 | 2444 | 2869 | 85.2% | +| ov_SC03_002 | 2353 | 1743 | 0 | 2368 | 2631 | 90.0% | +| ov_SC03_003 | 2302 | 1738 | 0 | 2303 | 2423 | 95.0% | +| ov_SC03_006 | 2370 | 1744 | 0 | 2379 | 2767 | 86.0% | +| ov_SC03_007 | 2347 | 1738 | 0 | 2351 | 2623 | 89.6% | +| ov_SC03_010 | 2310 | 1738 | 0 | 2310 | 2471 | 93.5% | +| ov_SC03_011 | 2316 | 1738 | 0 | 2322 | 2527 | 91.9% | +| ov_SC03_012 | 2294 | 1738 | 0 | 2295 | 2406 | 95.4% | +| ov_SC03_013 | 2315 | 1738 | 0 | 2315 | 2493 | 92.9% | +| ov_SC03_014 | 2373 | 1763 | 0 | 2373 | 2685 | 88.4% | +| ov_SC03_015 | 2373 | 1763 | 0 | 2373 | 2685 | 88.4% | +| ov_SC03_023 | 2301 | 1738 | 0 | 2302 | 2435 | 94.5% | +| ov_SC03_024 | 2361 | 1743 | 0 | 2368 | 2641 | 89.7% | +| ov_SC03_028 | 2341 | 1738 | 0 | 2345 | 2664 | 88.0% | +| ov_SC03_029 | 2343 | 1740 | 0 | 2353 | 2644 | 89.0% | +| ov_SC03_030 | 2316 | 1743 | 0 | 2318 | 2495 | 92.9% | +| ov_SC03_031 | 2312 | 1738 | 0 | 2315 | 2514 | 92.1% | +| ov_SC03_089 | 2329 | 1738 | 0 | 2336 | 2581 | 90.5% | +| ov_SC03_090 | 2330 | 1738 | 0 | 2338 | 2625 | 89.1% | +| ov_SC03_091 | 2333 | 1738 | 0 | 2341 | 2640 | 88.7% | +| ov_SC03_092 | 2343 | 1738 | 0 | 2355 | 2587 | 91.0% | +| ov_SC03_093 | 2319 | 1738 | 0 | 2323 | 2563 | 90.6% | +| ov_SC03_094 | 2314 | 1738 | 0 | 2320 | 2577 | 90.0% | +| ov_SC03_095 | 2304 | 1738 | 0 | 2307 | 2474 | 93.2% | +| ov_SC03_096 | 2304 | 1738 | 0 | 2307 | 2465 | 93.6% | +| ov_SC03_097 | 2334 | 1738 | 0 | 2341 | 2603 | 89.9% | +| ov_SC03_098 | 2312 | 1738 | 0 | 2315 | 2541 | 91.1% | +| ov_SC03_099 | 2305 | 1738 | 0 | 2308 | 2504 | 92.2% | +| ov_SC03_100 | 2315 | 1738 | 0 | 2319 | 2539 | 91.3% | +| ov_SC03_101 | 2315 | 1738 | 0 | 2319 | 2528 | 91.7% | +| ov_SC03_102 | 2308 | 1738 | 0 | 2311 | 2492 | 92.7% | +| ov_SC03_103 | 2311 | 1740 | 0 | 2314 | 2510 | 92.2% | +| ov_SC03_104 | 2337 | 1738 | 0 | 2344 | 2616 | 89.6% | +| ov_SC03_105 | 2328 | 1738 | 0 | 2335 | 2597 | 89.9% | +| ov_SC03_108 | 2295 | 1738 | 0 | 2295 | 2443 | 93.9% | +| ov_SC03_109 | 2299 | 1738 | 0 | 2301 | 2424 | 94.9% | +| ov_SC03_110 | 2303 | 1738 | 0 | 2303 | 2468 | 93.3% | +| ov_SC03_111 | 2314 | 1738 | 0 | 2317 | 2510 | 92.3% | +| ov_SC03_112 | 2310 | 1740 | 0 | 2312 | 2526 | 91.5% | +| ov_SC03_113 | 2303 | 1740 | 0 | 2306 | 2468 | 93.4% | +| ov_SC03_114 | 2292 | 1738 | 0 | 2294 | 2415 | 95.0% | +| ov_SC03_115 | 2309 | 1738 | 0 | 2311 | 2472 | 93.5% | +| ov_SC03_116 | 2300 | 1738 | 0 | 2303 | 2438 | 94.5% | +| ov_SC03_117 | 2327 | 1738 | 0 | 2333 | 2557 | 91.2% | +| ov_SC03_118 | 2373 | 1762 | 0 | 2374 | 2685 | 88.4% | +| ov_SC03_119 | 2372 | 1762 | 0 | 2373 | 2685 | 88.4% | +| ov_SC03_121 | 2307 | 1738 | 0 | 2310 | 2459 | 93.9% | +| ov_SC03_124 | 2385 | 1734 | 0 | 2405 | 2741 | 87.7% | +| ov_SC03_125 | 2341 | 1738 | 0 | 2353 | 2588 | 90.9% | +| ov_SC03_126 | 2304 | 1740 | 0 | 2304 | 2423 | 95.1% | +| ov_SC04_000 | 2320 | 1742 | 0 | 2329 | 2546 | 91.5% | +| ov_SC04_002 | 2339 | 1738 | 0 | 2343 | 2636 | 88.9% | +| ov_SC04_003 | 2315 | 1738 | 0 | 2319 | 2502 | 92.7% | +| ov_SC04_004 | 2324 | 1738 | 0 | 2326 | 2558 | 90.9% | +| ov_SC04_005 | 2334 | 1738 | 0 | 2340 | 2612 | 89.6% | +| ov_SC04_006 | 2304 | 1738 | 0 | 2306 | 2454 | 94.0% | +| ov_SC04_007 | 2328 | 1738 | 0 | 2332 | 2569 | 90.8% | +| ov_SC04_008 | 2296 | 1738 | 0 | 2296 | 2415 | 95.1% | +| ov_SC04_009 | 2311 | 1738 | 0 | 2314 | 2441 | 94.8% | +| ov_SC04_010 | 2301 | 1738 | 0 | 2302 | 2419 | 95.2% | +| ov_SC04_011 | 2359 | 1738 | 0 | 2365 | 2803 | 84.4% | +| ov_SC04_012 | 2298 | 1738 | 0 | 2299 | 2420 | 95.0% | +| ov_SC04_015 | 2363 | 1739 | 0 | 2374 | 2611 | 90.9% | +| ov_SC04_016 | 2301 | 1738 | 0 | 2303 | 2440 | 94.4% | +| ov_SC04_018 | 2411 | 1773 | 0 | 2411 | 2857 | 84.4% | +| ov_SC04_019 | 2417 | 1773 | 0 | 2417 | 2857 | 84.6% | +| ov_SC04_020 | 2328 | 1738 | 0 | 2340 | 2567 | 91.2% | +| ov_SC04_021 | 2305 | 1740 | 0 | 2305 | 2423 | 95.1% | +| ov_SC05_000 | 2302 | 1742 | 0 | 2305 | 2422 | 95.2% | +| ov_SC05_001 | 2324 | 1738 | 0 | 2329 | 2574 | 90.5% | +| ov_SC05_002 | 2307 | 1738 | 0 | 2310 | 2442 | 94.6% | +| ov_SC05_003 | 2304 | 1738 | 0 | 2305 | 2481 | 92.9% | +| ov_SC05_004 | 2300 | 1738 | 0 | 2302 | 2464 | 93.4% | +| ov_SC05_005 | 2305 | 1738 | 0 | 2306 | 2491 | 92.6% | +| ov_SC05_006 | 2298 | 1738 | 0 | 2298 | 2430 | 94.6% | +| ov_SC05_007 | 2308 | 1738 | 0 | 2313 | 2482 | 93.2% | +| ov_SC05_008 | 2325 | 1738 | 0 | 2327 | 2543 | 91.5% | +| ov_SC05_009 | 2304 | 1738 | 0 | 2308 | 2438 | 94.7% | +| ov_SC05_010 | 2331 | 1738 | 0 | 2335 | 2588 | 90.2% | +| ov_SC05_011 | 2300 | 1738 | 0 | 2301 | 2409 | 95.5% | +| ov_SC05_017 | 2407 | 1735 | 0 | 2418 | 2842 | 85.1% | +| ov_SC05_018 | 2355 | 1738 | 0 | 2368 | 2673 | 88.6% | +| ov_SC05_019 | 2305 | 1740 | 0 | 2305 | 2423 | 95.1% | +| ov_SC06_000 | 2369 | 1747 | 0 | 2372 | 2691 | 88.1% | +| ov_SC06_006 | 2321 | 1738 | 0 | 2322 | 2511 | 92.5% | +| ov_SC06_008 | 2341 | 1740 | 0 | 2347 | 2542 | 92.3% | +| ov_SC06_010 | 2321 | 1738 | 0 | 2326 | 2517 | 92.4% | +| ov_SC06_011 | 2309 | 1738 | 0 | 2313 | 2468 | 93.7% | +| ov_SC06_013 | 2303 | 1738 | 0 | 2304 | 2425 | 95.0% | +| ov_SC06_014 | 2309 | 1738 | 0 | 2311 | 2453 | 94.2% | +| ov_SC06_015 | 2306 | 1738 | 0 | 2306 | 2421 | 95.2% | +| ov_SC06_016 | 2324 | 1738 | 0 | 2326 | 2549 | 91.3% | +| ov_SC06_018 | 2333 | 1740 | 0 | 2340 | 2665 | 87.8% | +| ov_SC06_020 | 2313 | 1740 | 0 | 2314 | 2518 | 91.9% | +| ov_SC06_022 | 2332 | 1738 | 0 | 2340 | 2642 | 88.6% | +| ov_SC06_024 | 2342 | 1738 | 0 | 2348 | 2667 | 88.0% | +| ov_SC06_025 | 2326 | 1738 | 0 | 2331 | 2572 | 90.6% | +| ov_SC06_027 | 2291 | 1738 | 0 | 2292 | 2408 | 95.2% | +| ov_SC06_029 | 2352 | 1738 | 0 | 2364 | 2662 | 88.8% | +| ov_SC06_030 | 2305 | 1738 | 0 | 2305 | 2456 | 93.9% | +| ov_SC06_032 | 2327 | 1739 | 0 | 2334 | 2658 | 87.8% | +| ov_SC06_033 | 2329 | 1739 | 0 | 2336 | 2631 | 88.8% | +| ov_SC07_000 | 2320 | 1742 | 0 | 2322 | 2521 | 92.1% | +| ov_SC07_001 | 2304 | 1738 | 0 | 2306 | 2454 | 94.0% | +| ov_SC07_002 | 2332 | 1738 | 0 | 2336 | 2579 | 90.6% | +| ov_SC07_006 | 2093 | 1555 | 0 | 2173 | 2456 | 88.5% | +| ov_SC07_007 | 2096 | 1586 | 0 | 2180 | 2613 | 83.4% | +| ov_SC07_008 | 2289 | 1738 | 0 | 2289 | 2386 | 95.9% | +| ov_SC07_009 | 2298 | 1738 | 0 | 2300 | 2430 | 94.7% | +| ov_SC07_010 | 2129 | 1608 | 0 | 2212 | 2524 | 87.6% | +| ov_SC07_011 | 2096 | 1585 | 0 | 2176 | 2449 | 88.9% | diff --git a/phase-ends/CURRENT_PHASE.md b/phase-ends/CURRENT_PHASE.md index a7cf42c37..a595dec4a 100644 --- a/phase-ends/CURRENT_PHASE.md +++ b/phase-ends/CURRENT_PHASE.md @@ -8440,3 +8440,57 @@ banks · `tools-health` OK (corpus 0 PHANTOM + 0 TRUNCATED · cdecl · audit-bin 4. **`func_80146750`** (137) — the one family that failed after its header was corrected; diagnose. 5. **The 36 byte-VARIANT families** (114,331 ins · **2,962 distinct**) — the only lever left that moves distinct-code. Sweep these ahead of the 13 byte-identical ones. + +## ✅/📌 T69/T70 — the audit precondition validated; byte-VARIANT families sweep FAR worse (1 of 10) + +### T69 (item 1) — the precondition now COMPUTES the safe subset, and it took two wrong models +`audit_header_sigs.py` gained the ARITY and VISIBLE-COLLISION preconditions (§112). The second one +was wrong twice before it was right: +1. *"any disagreeing decl in `src/`"* — compares type **spellings**, so `s32` vs `int` counts. + Fixed with `cdecl.compatible` (type identity): findings **61 → 32**. +2. *"any INCOMPATIBLE decl"* — still wrong, and it **blocked all six corrections that had just + gated 140/140 and banked 685 members**. `func_80161774` has **1,063** TUs carrying the old + spelling and correcting it was byte-clean. + +**The right model measures the INTERSECTION, not the population:** a macro-body decl is only visible +where the macro is **instantiated**, so a collision needs a TU that does *both*. +**Validated against known outcomes** — the six that gated clean → **0** colliding TUs each; the one +that failed the gate (`func_80147364`) → **272**. Perfect discrimination. + +**Honest result: 13 SAFE, worth only 15 stubbed binaries.** The high-value targets are all blocked +(`func_80147364` 137 needs `conform_decls`; the arity trio ~410 needs §99). **The cheap header lever +is spent.** + +### T70 (item 5) — byte-VARIANT families are a different economics +Swept 10 byte-variant, non-jr, non-O0 families (42,235 ins · 1,552 distinct projected): +**138 banked / 1,346 failed — one family of ten** (`func_801627E8` 137/137), plus 152 members skipped +as "unresolved immediates (T2a)". + +**That is a ~10× worse rate than the byte-identical families**, which banked 137/137 apiece all +session. It follows from what §111 established: a byte-variant member differs in more than +relocations, so the template has to adapt immediates too — and `family_remap`'s T2a immediate engine +refuses what it cannot resolve. **The distinct-code lever is real but it is NOT the same cheap sweep**, +and the projected "2,962 distinct across 36 families" should be discounted accordingly until the +immediate-resolution rate is measured. + +**§111 passed a second predictive test:** it projected +129 distinct for `func_801627E8`; observed +**+130** (the extra from an unrelated 2-member bank). + +### GATES +R22 clean-fleet **140 passed, 0 failed of 140** · `tools-health` OK · **0 NON_MATCHING** (G4). + +### METRICS +| | before | after | delta | +|---|---|---|---| +| instr-weighted | 86.5% | **86.6%** | +2,618 ins | +| fn-count | 91.08% | **91.12%** | +138 | +| distinct-code | 76.9% | **76.9%** | 68,066 → 68,196 = **+130** (first real distinct movement) | + +## ▶ NEXT (ranked, re-measured) +1. **Measure the T2a immediate-resolution rate** on the 9 failed byte-variant families before + sweeping the other 26 — the 2,962-distinct projection assumes a bank rate the one data point + (1/10) contradicts. One diagnosis decides whether that lever is worth 26 more sweeps. +2. **`func_80147364`** (137) — `conform_decls` over 272 colliding TUs, then the header fix. +3. **The arity trio** (`func_80144B14`/`func_8013BD34`/`func_8014358C`, ~410 members) — §99. +4. **`func_80146750`** (137) — the family that failed after its header was corrected. +5. The 13 SAFE audit findings (15 binaries) — cheap, low value; batch them into some other gate. diff --git a/src/ov_SC01_000/ov_SC01_000_jr_8015C32C.c b/src/ov_SC01_000/ov_SC01_000_jr_8015C32C.c index 8af2ccce9..f2a0579da 100644 --- a/src/ov_SC01_000/ov_SC01_000_jr_8015C32C.c +++ b/src/ov_SC01_000/ov_SC01_000_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_000/nonmatchings/ov_SC01_000_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801817AC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801817AC[count-1]) +// keeps the array index/decrement separate so %lo(D_801817AC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801817AC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801817AC[idx](); + } +} + extern void (*D_801817B0[])(void); diff --git a/src/ov_SC01_001/ov_SC01_001_jr_8015C32C.c b/src/ov_SC01_001/ov_SC01_001_jr_8015C32C.c index ac61aa4f0..543ccf2f4 100644 --- a/src/ov_SC01_001/ov_SC01_001_jr_8015C32C.c +++ b/src/ov_SC01_001/ov_SC01_001_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3855,7 +3854,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_001/nonmatchings/ov_SC01_001_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801863FC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801863FC[count-1]) +// keeps the array index/decrement separate so %lo(D_801863FC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801863FC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801863FC[idx](); + } +} + extern void (*D_80186400[])(void); diff --git a/src/ov_SC01_004/ov_SC01_004_jr_8015C32C.c b/src/ov_SC01_004/ov_SC01_004_jr_8015C32C.c index f412b2a57..0ea6b2940 100644 --- a/src/ov_SC01_004/ov_SC01_004_jr_8015C32C.c +++ b/src/ov_SC01_004/ov_SC01_004_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_004/nonmatchings/ov_SC01_004_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181DC0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181DC0[count-1]) +// keeps the array index/decrement separate so %lo(D_80181DC0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181DC0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181DC0[idx](); + } +} + extern void (*D_80181DC4[])(void); diff --git a/src/ov_SC01_005/ov_SC01_005_jr_8015C32C.c b/src/ov_SC01_005/ov_SC01_005_jr_8015C32C.c index eed05354b..955e929de 100644 --- a/src/ov_SC01_005/ov_SC01_005_jr_8015C32C.c +++ b/src/ov_SC01_005/ov_SC01_005_jr_8015C32C.c @@ -122,7 +122,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3858,7 +3857,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_005/nonmatchings/ov_SC01_005_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184F54[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184F54[count-1]) +// keeps the array index/decrement separate so %lo(D_80184F54) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184F54[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184F54[idx](); + } +} + extern void (*D_80184F58[])(void); diff --git a/src/ov_SC01_006/ov_SC01_006_jr_8015C32C.c b/src/ov_SC01_006/ov_SC01_006_jr_8015C32C.c index 3499fbdf1..1a5b15e58 100644 --- a/src/ov_SC01_006/ov_SC01_006_jr_8015C32C.c +++ b/src/ov_SC01_006/ov_SC01_006_jr_8015C32C.c @@ -122,7 +122,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3858,7 +3857,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_006/nonmatchings/ov_SC01_006_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184F54[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184F54[count-1]) +// keeps the array index/decrement separate so %lo(D_80184F54) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184F54[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184F54[idx](); + } +} + extern void (*D_80184F58[])(void); diff --git a/src/ov_SC01_008/ov_SC01_008_jr_8015C32C.c b/src/ov_SC01_008/ov_SC01_008_jr_8015C32C.c index 80664c1fa..66b2f087d 100644 --- a/src/ov_SC01_008/ov_SC01_008_jr_8015C32C.c +++ b/src/ov_SC01_008/ov_SC01_008_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_008/nonmatchings/ov_SC01_008_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182334[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182334[count-1]) +// keeps the array index/decrement separate so %lo(D_80182334) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182334[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182334[idx](); + } +} + extern void (*D_80182338[])(void); diff --git a/src/ov_SC01_009/ov_SC01_009_jr_8015C32C.c b/src/ov_SC01_009/ov_SC01_009_jr_8015C32C.c index a77560fec..7fc894c1c 100644 --- a/src/ov_SC01_009/ov_SC01_009_jr_8015C32C.c +++ b/src/ov_SC01_009/ov_SC01_009_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_009/nonmatchings/ov_SC01_009_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018551C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018551C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018551C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018551C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018551C[idx](); + } +} + extern void (*D_80185520[])(void); diff --git a/src/ov_SC01_074/ov_SC01_074_jr_8015C32C.c b/src/ov_SC01_074/ov_SC01_074_jr_8015C32C.c index 0b8e312c8..998c73862 100644 --- a/src/ov_SC01_074/ov_SC01_074_jr_8015C32C.c +++ b/src/ov_SC01_074/ov_SC01_074_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_074/nonmatchings/ov_SC01_074_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018119C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018119C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018119C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018119C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018119C[idx](); + } +} + extern void (*D_801811A0[])(void); diff --git a/src/ov_SC01_080/ov_SC01_080_jr_8015C32C.c b/src/ov_SC01_080/ov_SC01_080_jr_8015C32C.c index 4176c033c..a29d1b102 100644 --- a/src/ov_SC01_080/ov_SC01_080_jr_8015C32C.c +++ b/src/ov_SC01_080/ov_SC01_080_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_080/nonmatchings/ov_SC01_080_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801860FC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801860FC[count-1]) +// keeps the array index/decrement separate so %lo(D_801860FC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801860FC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801860FC[idx](); + } +} + extern void (*D_80186100[])(void); diff --git a/src/ov_SC01_084/ov_SC01_084_jr_8015C32C.c b/src/ov_SC01_084/ov_SC01_084_jr_8015C32C.c index 2792880a4..496e80573 100644 --- a/src/ov_SC01_084/ov_SC01_084_jr_8015C32C.c +++ b/src/ov_SC01_084/ov_SC01_084_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC01_084/nonmatchings/ov_SC01_084_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801893F0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801893F0[count-1]) +// keeps the array index/decrement separate so %lo(D_801893F0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801893F0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801893F0[idx](); + } +} + extern void (*D_801893F4[])(void); diff --git a/src/ov_SC02_000/ov_SC02_000_jr_8015C32C.c b/src/ov_SC02_000/ov_SC02_000_jr_8015C32C.c index 25dc7d9f2..7308cd1ee 100644 --- a/src/ov_SC02_000/ov_SC02_000_jr_8015C32C.c +++ b/src/ov_SC02_000/ov_SC02_000_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3855,7 +3854,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_000/nonmatchings/ov_SC02_000_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018D7A0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018D7A0[count-1]) +// keeps the array index/decrement separate so %lo(D_8018D7A0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018D7A0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018D7A0[idx](); + } +} + extern void (*D_8018D7A4[])(void); diff --git a/src/ov_SC02_003/ov_SC02_003_jr_8015C32C.c b/src/ov_SC02_003/ov_SC02_003_jr_8015C32C.c index 31a4457b7..15c3c5cb4 100644 --- a/src/ov_SC02_003/ov_SC02_003_jr_8015C32C.c +++ b/src/ov_SC02_003/ov_SC02_003_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3855,7 +3854,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_003/nonmatchings/ov_SC02_003_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018D7A0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018D7A0[count-1]) +// keeps the array index/decrement separate so %lo(D_8018D7A0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018D7A0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018D7A0[idx](); + } +} + extern void (*D_8018D7A4[])(void); diff --git a/src/ov_SC02_004/ov_SC02_004_jr_8015C32C.c b/src/ov_SC02_004/ov_SC02_004_jr_8015C32C.c index 10f03d677..1e9ba5a5b 100644 --- a/src/ov_SC02_004/ov_SC02_004_jr_8015C32C.c +++ b/src/ov_SC02_004/ov_SC02_004_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_004/nonmatchings/ov_SC02_004_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180880[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180880[count-1]) +// keeps the array index/decrement separate so %lo(D_80180880) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180880[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180880[idx](); + } +} + extern void (*D_80180884[])(void); diff --git a/src/ov_SC02_005/ov_SC02_005_jr_8015C32C.c b/src/ov_SC02_005/ov_SC02_005_jr_8015C32C.c index 38d6c5000..4298ec2be 100644 --- a/src/ov_SC02_005/ov_SC02_005_jr_8015C32C.c +++ b/src/ov_SC02_005/ov_SC02_005_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3855,7 +3854,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_005/nonmatchings/ov_SC02_005_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80193484[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80193484[count-1]) +// keeps the array index/decrement separate so %lo(D_80193484) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80193484[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80193484[idx](); + } +} + extern void (*D_80193488[])(void); diff --git a/src/ov_SC02_011/ov_SC02_011_jr_8015C32C.c b/src/ov_SC02_011/ov_SC02_011_jr_8015C32C.c index 49041aab9..c945138ee 100644 --- a/src/ov_SC02_011/ov_SC02_011_jr_8015C32C.c +++ b/src/ov_SC02_011/ov_SC02_011_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_011/nonmatchings/ov_SC02_011_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801938D4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801938D4[count-1]) +// keeps the array index/decrement separate so %lo(D_801938D4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801938D4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801938D4[idx](); + } +} + extern void (*D_801938D8[])(void); diff --git a/src/ov_SC02_015/ov_SC02_015_jr_8015C32C.c b/src/ov_SC02_015/ov_SC02_015_jr_8015C32C.c index d10eb2a4f..3dc8a3de0 100644 --- a/src/ov_SC02_015/ov_SC02_015_jr_8015C32C.c +++ b/src/ov_SC02_015/ov_SC02_015_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3855,7 +3854,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_015/nonmatchings/ov_SC02_015_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180DE8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180DE8[count-1]) +// keeps the array index/decrement separate so %lo(D_80180DE8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180DE8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180DE8[idx](); + } +} + extern void (*D_80180DEC[])(void); diff --git a/src/ov_SC02_016/ov_SC02_016_jr_8015C32C.c b/src/ov_SC02_016/ov_SC02_016_jr_8015C32C.c index b086b227e..0944751a8 100644 --- a/src/ov_SC02_016/ov_SC02_016_jr_8015C32C.c +++ b/src/ov_SC02_016/ov_SC02_016_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_016/nonmatchings/ov_SC02_016_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187020[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187020[count-1]) +// keeps the array index/decrement separate so %lo(D_80187020) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187020[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187020[idx](); + } +} + extern void (*D_80187024[])(void); diff --git a/src/ov_SC02_017/ov_SC02_017_jr_8015C32C.c b/src/ov_SC02_017/ov_SC02_017_jr_8015C32C.c index 2d8af9c7b..88abbd8c3 100644 --- a/src/ov_SC02_017/ov_SC02_017_jr_8015C32C.c +++ b/src/ov_SC02_017/ov_SC02_017_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_017/nonmatchings/ov_SC02_017_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018D078[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018D078[count-1]) +// keeps the array index/decrement separate so %lo(D_8018D078) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018D078[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018D078[idx](); + } +} + extern void (*D_8018D07C[])(void); diff --git a/src/ov_SC02_021/ov_SC02_021_jr_8015C32C.c b/src/ov_SC02_021/ov_SC02_021_jr_8015C32C.c index 80c9d1f65..f99069246 100644 --- a/src/ov_SC02_021/ov_SC02_021_jr_8015C32C.c +++ b/src/ov_SC02_021/ov_SC02_021_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_021/nonmatchings/ov_SC02_021_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018266C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018266C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018266C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018266C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018266C[idx](); + } +} + extern void (*D_80182670[])(void); diff --git a/src/ov_SC02_026/ov_SC02_026_jr_8015C32C.c b/src/ov_SC02_026/ov_SC02_026_jr_8015C32C.c index 053c6a624..8e3cca011 100644 --- a/src/ov_SC02_026/ov_SC02_026_jr_8015C32C.c +++ b/src/ov_SC02_026/ov_SC02_026_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_026/nonmatchings/ov_SC02_026_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80188CC0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80188CC0[count-1]) +// keeps the array index/decrement separate so %lo(D_80188CC0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80188CC0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80188CC0[idx](); + } +} + extern void (*D_80188CC4[])(void); diff --git a/src/ov_SC02_027/ov_SC02_027_jr_8015C32C.c b/src/ov_SC02_027/ov_SC02_027_jr_8015C32C.c index 066e4f78f..50adebf94 100644 --- a/src/ov_SC02_027/ov_SC02_027_jr_8015C32C.c +++ b/src/ov_SC02_027/ov_SC02_027_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_027/nonmatchings/ov_SC02_027_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018DDE4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018DDE4[count-1]) +// keeps the array index/decrement separate so %lo(D_8018DDE4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018DDE4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018DDE4[idx](); + } +} + extern void (*D_8018DDE8[])(void); diff --git a/src/ov_SC02_028/ov_SC02_028_jr_8015C32C.c b/src/ov_SC02_028/ov_SC02_028_jr_8015C32C.c index af03203ec..81c66bca6 100644 --- a/src/ov_SC02_028/ov_SC02_028_jr_8015C32C.c +++ b/src/ov_SC02_028/ov_SC02_028_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_028/nonmatchings/ov_SC02_028_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018DFE8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018DFE8[count-1]) +// keeps the array index/decrement separate so %lo(D_8018DFE8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018DFE8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018DFE8[idx](); + } +} + extern void (*D_8018DFEC[])(void); diff --git a/src/ov_SC02_031/ov_SC02_031_jr_8015C32C.c b/src/ov_SC02_031/ov_SC02_031_jr_8015C32C.c index c710ee36c..b7d69d292 100644 --- a/src/ov_SC02_031/ov_SC02_031_jr_8015C32C.c +++ b/src/ov_SC02_031/ov_SC02_031_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_031/nonmatchings/ov_SC02_031_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187814[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187814[count-1]) +// keeps the array index/decrement separate so %lo(D_80187814) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187814[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187814[idx](); + } +} + extern void (*D_80187818[])(void); diff --git a/src/ov_SC02_035/ov_SC02_035_jr_8015C32C.c b/src/ov_SC02_035/ov_SC02_035_jr_8015C32C.c index 94b98248e..4c8bef34f 100644 --- a/src/ov_SC02_035/ov_SC02_035_jr_8015C32C.c +++ b/src/ov_SC02_035/ov_SC02_035_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_035/nonmatchings/ov_SC02_035_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187074[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187074[count-1]) +// keeps the array index/decrement separate so %lo(D_80187074) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187074[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187074[idx](); + } +} + extern void (*D_80187078[])(void); diff --git a/src/ov_SC02_039/ov_SC02_039_jr_8015C32C.c b/src/ov_SC02_039/ov_SC02_039_jr_8015C32C.c index d14ac33e1..81e84192a 100644 --- a/src/ov_SC02_039/ov_SC02_039_jr_8015C32C.c +++ b/src/ov_SC02_039/ov_SC02_039_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_039/nonmatchings/ov_SC02_039_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181CA0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181CA0[count-1]) +// keeps the array index/decrement separate so %lo(D_80181CA0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181CA0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181CA0[idx](); + } +} + extern void (*D_80181CA4[])(void); diff --git a/src/ov_SC02_041/ov_SC02_041_jr_8015C32C.c b/src/ov_SC02_041/ov_SC02_041_jr_8015C32C.c index 0ae586cf3..1755dc0a7 100644 --- a/src/ov_SC02_041/ov_SC02_041_jr_8015C32C.c +++ b/src/ov_SC02_041/ov_SC02_041_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC02_041/nonmatchings/ov_SC02_041_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187970[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187970[count-1]) +// keeps the array index/decrement separate so %lo(D_80187970) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187970[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187970[idx](); + } +} + extern void (*D_80187974[])(void); diff --git a/src/ov_SC03_001/ov_SC03_001_jr_8015C32C.c b/src/ov_SC03_001/ov_SC03_001_jr_8015C32C.c index 0a8aa54ef..961761634 100644 --- a/src/ov_SC03_001/ov_SC03_001_jr_8015C32C.c +++ b/src/ov_SC03_001/ov_SC03_001_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_001/nonmatchings/ov_SC03_001_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801900B0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801900B0[count-1]) +// keeps the array index/decrement separate so %lo(D_801900B0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801900B0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801900B0[idx](); + } +} + extern void (*D_801900B4[])(void); diff --git a/src/ov_SC03_002/ov_SC03_002_jr_8015C32C.c b/src/ov_SC03_002/ov_SC03_002_jr_8015C32C.c index ff64bfaaf..0d4d42e65 100644 --- a/src/ov_SC03_002/ov_SC03_002_jr_8015C32C.c +++ b/src/ov_SC03_002/ov_SC03_002_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_002/nonmatchings/ov_SC03_002_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801880A0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801880A0[count-1]) +// keeps the array index/decrement separate so %lo(D_801880A0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801880A0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801880A0[idx](); + } +} + extern void (*D_801880A4[])(void); diff --git a/src/ov_SC03_003/ov_SC03_003_jr_8015C32C.c b/src/ov_SC03_003/ov_SC03_003_jr_8015C32C.c index a649b909c..af2a7dea8 100644 --- a/src/ov_SC03_003/ov_SC03_003_jr_8015C32C.c +++ b/src/ov_SC03_003/ov_SC03_003_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_003/nonmatchings/ov_SC03_003_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181E68[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181E68[count-1]) +// keeps the array index/decrement separate so %lo(D_80181E68) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181E68[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181E68[idx](); + } +} + extern void (*D_80181E6C[])(void); diff --git a/src/ov_SC03_006/ov_SC03_006_jr_8015C32C.c b/src/ov_SC03_006/ov_SC03_006_jr_8015C32C.c index 72f042fb1..87b2bb904 100644 --- a/src/ov_SC03_006/ov_SC03_006_jr_8015C32C.c +++ b/src/ov_SC03_006/ov_SC03_006_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_006/nonmatchings/ov_SC03_006_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018F184[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018F184[count-1]) +// keeps the array index/decrement separate so %lo(D_8018F184) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018F184[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018F184[idx](); + } +} + extern void (*D_8018F188[])(void); diff --git a/src/ov_SC03_007/ov_SC03_007_jr_8015C32C.c b/src/ov_SC03_007/ov_SC03_007_jr_8015C32C.c index 9ba75ddd4..bb13aa36c 100644 --- a/src/ov_SC03_007/ov_SC03_007_jr_8015C32C.c +++ b/src/ov_SC03_007/ov_SC03_007_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_007/nonmatchings/ov_SC03_007_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80189F7C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80189F7C[count-1]) +// keeps the array index/decrement separate so %lo(D_80189F7C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80189F7C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80189F7C[idx](); + } +} + extern void (*D_80189F80[])(void); diff --git a/src/ov_SC03_010/ov_SC03_010_jr_8015C32C.c b/src/ov_SC03_010/ov_SC03_010_jr_8015C32C.c index bd5f4513a..56f4a5e00 100644 --- a/src/ov_SC03_010/ov_SC03_010_jr_8015C32C.c +++ b/src/ov_SC03_010/ov_SC03_010_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_010/nonmatchings/ov_SC03_010_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182A9C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182A9C[count-1]) +// keeps the array index/decrement separate so %lo(D_80182A9C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182A9C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182A9C[idx](); + } +} + extern void (*D_80182AA0[])(void); diff --git a/src/ov_SC03_011/ov_SC03_011_jr_8015C32C.c b/src/ov_SC03_011/ov_SC03_011_jr_8015C32C.c index b67ad91a3..abb86c5b1 100644 --- a/src/ov_SC03_011/ov_SC03_011_jr_8015C32C.c +++ b/src/ov_SC03_011/ov_SC03_011_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_011/nonmatchings/ov_SC03_011_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183E0C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183E0C[count-1]) +// keeps the array index/decrement separate so %lo(D_80183E0C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183E0C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183E0C[idx](); + } +} + extern void (*D_80183E10[])(void); diff --git a/src/ov_SC03_012/ov_SC03_012_jr_8015C32C.c b/src/ov_SC03_012/ov_SC03_012_jr_8015C32C.c index 0657be026..15e1042a1 100644 --- a/src/ov_SC03_012/ov_SC03_012_jr_8015C32C.c +++ b/src/ov_SC03_012/ov_SC03_012_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_012/nonmatchings/ov_SC03_012_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180CEC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180CEC[count-1]) +// keeps the array index/decrement separate so %lo(D_80180CEC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180CEC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180CEC[idx](); + } +} + extern void (*D_80180CF0[])(void); diff --git a/src/ov_SC03_013/ov_SC03_013_jr_8015C32C.c b/src/ov_SC03_013/ov_SC03_013_jr_8015C32C.c index a683843c0..823d896de 100644 --- a/src/ov_SC03_013/ov_SC03_013_jr_8015C32C.c +++ b/src/ov_SC03_013/ov_SC03_013_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_013/nonmatchings/ov_SC03_013_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183AD4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183AD4[count-1]) +// keeps the array index/decrement separate so %lo(D_80183AD4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183AD4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183AD4[idx](); + } +} + extern void (*D_80183AD8[])(void); diff --git a/src/ov_SC03_014/ov_SC03_014_jr_8015C32C.c b/src/ov_SC03_014/ov_SC03_014_jr_8015C32C.c index 8c645bdb7..798548f2d 100644 --- a/src/ov_SC03_014/ov_SC03_014_jr_8015C32C.c +++ b/src/ov_SC03_014/ov_SC03_014_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_014/nonmatchings/ov_SC03_014_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018E110[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018E110[count-1]) +// keeps the array index/decrement separate so %lo(D_8018E110) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018E110[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018E110[idx](); + } +} + extern void (*D_8018E114[])(void); diff --git a/src/ov_SC03_015/ov_SC03_015_jr_8015C32C.c b/src/ov_SC03_015/ov_SC03_015_jr_8015C32C.c index b6bd09fc3..cacd0b39f 100644 --- a/src/ov_SC03_015/ov_SC03_015_jr_8015C32C.c +++ b/src/ov_SC03_015/ov_SC03_015_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_015/nonmatchings/ov_SC03_015_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018E110[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018E110[count-1]) +// keeps the array index/decrement separate so %lo(D_8018E110) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018E110[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018E110[idx](); + } +} + extern void (*D_8018E114[])(void); diff --git a/src/ov_SC03_023/ov_SC03_023_jr_8015C32C.c b/src/ov_SC03_023/ov_SC03_023_jr_8015C32C.c index ddb70898b..7038a3420 100644 --- a/src/ov_SC03_023/ov_SC03_023_jr_8015C32C.c +++ b/src/ov_SC03_023/ov_SC03_023_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_023/nonmatchings/ov_SC03_023_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181A8C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181A8C[count-1]) +// keeps the array index/decrement separate so %lo(D_80181A8C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181A8C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181A8C[idx](); + } +} + extern void (*D_80181A90[])(void); diff --git a/src/ov_SC03_024/ov_SC03_024_jr_8015C32C.c b/src/ov_SC03_024/ov_SC03_024_jr_8015C32C.c index ac3d2e990..7f4339863 100644 --- a/src/ov_SC03_024/ov_SC03_024_jr_8015C32C.c +++ b/src/ov_SC03_024/ov_SC03_024_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_024/nonmatchings/ov_SC03_024_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80189AB0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80189AB0[count-1]) +// keeps the array index/decrement separate so %lo(D_80189AB0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80189AB0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80189AB0[idx](); + } +} + extern void (*D_80189AB4[])(void); diff --git a/src/ov_SC03_028/ov_SC03_028_jr_8015C32C.c b/src/ov_SC03_028/ov_SC03_028_jr_8015C32C.c index f095be678..ebb93c4da 100644 --- a/src/ov_SC03_028/ov_SC03_028_jr_8015C32C.c +++ b/src/ov_SC03_028/ov_SC03_028_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_028/nonmatchings/ov_SC03_028_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018E57C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018E57C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018E57C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018E57C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018E57C[idx](); + } +} + extern void (*D_8018E580[])(void); diff --git a/src/ov_SC03_029/ov_SC03_029_jr_8015C32C.c b/src/ov_SC03_029/ov_SC03_029_jr_8015C32C.c index a82e9080e..6cb61bdf7 100644 --- a/src/ov_SC03_029/ov_SC03_029_jr_8015C32C.c +++ b/src/ov_SC03_029/ov_SC03_029_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_029/nonmatchings/ov_SC03_029_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018A3B4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018A3B4[count-1]) +// keeps the array index/decrement separate so %lo(D_8018A3B4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018A3B4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018A3B4[idx](); + } +} + extern void (*D_8018A3B8[])(void); diff --git a/src/ov_SC03_030/ov_SC03_030_jr_8015C32C.c b/src/ov_SC03_030/ov_SC03_030_jr_8015C32C.c index a43a1c159..dbcc90c35 100644 --- a/src/ov_SC03_030/ov_SC03_030_jr_8015C32C.c +++ b/src/ov_SC03_030/ov_SC03_030_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_030/nonmatchings/ov_SC03_030_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801849F0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801849F0[count-1]) +// keeps the array index/decrement separate so %lo(D_801849F0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801849F0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801849F0[idx](); + } +} + extern void (*D_801849F4[])(void); diff --git a/src/ov_SC03_031/ov_SC03_031_jr_8015C32C.c b/src/ov_SC03_031/ov_SC03_031_jr_8015C32C.c index c7e48a1c5..19e98735c 100644 --- a/src/ov_SC03_031/ov_SC03_031_jr_8015C32C.c +++ b/src/ov_SC03_031/ov_SC03_031_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_031/nonmatchings/ov_SC03_031_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184F0C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184F0C[count-1]) +// keeps the array index/decrement separate so %lo(D_80184F0C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184F0C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184F0C[idx](); + } +} + extern void (*D_80184F10[])(void); diff --git a/src/ov_SC03_089/ov_SC03_089_jr_8015C32C.c b/src/ov_SC03_089/ov_SC03_089_jr_8015C32C.c index b6fe349b5..6c50ef400 100644 --- a/src/ov_SC03_089/ov_SC03_089_jr_8015C32C.c +++ b/src/ov_SC03_089/ov_SC03_089_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_089/nonmatchings/ov_SC03_089_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018C208[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018C208[count-1]) +// keeps the array index/decrement separate so %lo(D_8018C208) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018C208[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018C208[idx](); + } +} + extern void (*D_8018C20C[])(void); diff --git a/src/ov_SC03_090/ov_SC03_090_jr_8015C32C.c b/src/ov_SC03_090/ov_SC03_090_jr_8015C32C.c index c0bc47154..9e8e5a846 100644 --- a/src/ov_SC03_090/ov_SC03_090_jr_8015C32C.c +++ b/src/ov_SC03_090/ov_SC03_090_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_090/nonmatchings/ov_SC03_090_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018E62C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018E62C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018E62C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018E62C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018E62C[idx](); + } +} + extern void (*D_8018E630[])(void); diff --git a/src/ov_SC03_091/ov_SC03_091_jr_8015C32C.c b/src/ov_SC03_091/ov_SC03_091_jr_8015C32C.c index e9ea27532..3f5b971f5 100644 --- a/src/ov_SC03_091/ov_SC03_091_jr_8015C32C.c +++ b/src/ov_SC03_091/ov_SC03_091_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_091/nonmatchings/ov_SC03_091_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018F4D4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018F4D4[count-1]) +// keeps the array index/decrement separate so %lo(D_8018F4D4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018F4D4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018F4D4[idx](); + } +} + extern void (*D_8018F4D8[])(void); diff --git a/src/ov_SC03_092/ov_SC03_092_jr_8015C32C.c b/src/ov_SC03_092/ov_SC03_092_jr_8015C32C.c index 3960161eb..6bda22385 100644 --- a/src/ov_SC03_092/ov_SC03_092_jr_8015C32C.c +++ b/src/ov_SC03_092/ov_SC03_092_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_092/nonmatchings/ov_SC03_092_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801878A4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801878A4[count-1]) +// keeps the array index/decrement separate so %lo(D_801878A4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801878A4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801878A4[idx](); + } +} + extern void (*D_801878A8[])(void); diff --git a/src/ov_SC03_093/ov_SC03_093_jr_8015C32C.c b/src/ov_SC03_093/ov_SC03_093_jr_8015C32C.c index 7bb987726..d0ee532a5 100644 --- a/src/ov_SC03_093/ov_SC03_093_jr_8015C32C.c +++ b/src/ov_SC03_093/ov_SC03_093_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_093/nonmatchings/ov_SC03_093_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80188A7C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80188A7C[count-1]) +// keeps the array index/decrement separate so %lo(D_80188A7C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80188A7C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80188A7C[idx](); + } +} + extern void (*D_80188A80[])(void); diff --git a/src/ov_SC03_094/ov_SC03_094_jr_8015C32C.c b/src/ov_SC03_094/ov_SC03_094_jr_8015C32C.c index c33033b9b..357e66bf1 100644 --- a/src/ov_SC03_094/ov_SC03_094_jr_8015C32C.c +++ b/src/ov_SC03_094/ov_SC03_094_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_094/nonmatchings/ov_SC03_094_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018A478[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018A478[count-1]) +// keeps the array index/decrement separate so %lo(D_8018A478) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018A478[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018A478[idx](); + } +} + extern void (*D_8018A47C[])(void); diff --git a/src/ov_SC03_095/ov_SC03_095_jr_8015C32C.c b/src/ov_SC03_095/ov_SC03_095_jr_8015C32C.c index f3a3b0120..82fda1249 100644 --- a/src/ov_SC03_095/ov_SC03_095_jr_8015C32C.c +++ b/src/ov_SC03_095/ov_SC03_095_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_095/nonmatchings/ov_SC03_095_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183AD8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183AD8[count-1]) +// keeps the array index/decrement separate so %lo(D_80183AD8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183AD8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183AD8[idx](); + } +} + extern void (*D_80183ADC[])(void); diff --git a/src/ov_SC03_096/ov_SC03_096_jr_8015C32C.c b/src/ov_SC03_096/ov_SC03_096_jr_8015C32C.c index dafb60a8f..bafc22569 100644 --- a/src/ov_SC03_096/ov_SC03_096_jr_8015C32C.c +++ b/src/ov_SC03_096/ov_SC03_096_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_096/nonmatchings/ov_SC03_096_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183658[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183658[count-1]) +// keeps the array index/decrement separate so %lo(D_80183658) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183658[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183658[idx](); + } +} + extern void (*D_8018365C[])(void); diff --git a/src/ov_SC03_097/ov_SC03_097_jr_8015C32C.c b/src/ov_SC03_097/ov_SC03_097_jr_8015C32C.c index 68fd74de1..f60e4c1f9 100644 --- a/src/ov_SC03_097/ov_SC03_097_jr_8015C32C.c +++ b/src/ov_SC03_097/ov_SC03_097_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_097/nonmatchings/ov_SC03_097_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80188A38[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80188A38[count-1]) +// keeps the array index/decrement separate so %lo(D_80188A38) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80188A38[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80188A38[idx](); + } +} + extern void (*D_80188A3C[])(void); diff --git a/src/ov_SC03_098/ov_SC03_098_jr_8015C32C.c b/src/ov_SC03_098/ov_SC03_098_jr_8015C32C.c index 502b19b81..ea22e3ec8 100644 --- a/src/ov_SC03_098/ov_SC03_098_jr_8015C32C.c +++ b/src/ov_SC03_098/ov_SC03_098_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_098/nonmatchings/ov_SC03_098_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187EC4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187EC4[count-1]) +// keeps the array index/decrement separate so %lo(D_80187EC4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187EC4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187EC4[idx](); + } +} + extern void (*D_80187EC8[])(void); diff --git a/src/ov_SC03_099/ov_SC03_099_jr_8015C32C.c b/src/ov_SC03_099/ov_SC03_099_jr_8015C32C.c index 4f9813aca..61492ad5a 100644 --- a/src/ov_SC03_099/ov_SC03_099_jr_8015C32C.c +++ b/src/ov_SC03_099/ov_SC03_099_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_099/nonmatchings/ov_SC03_099_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185FC4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185FC4[count-1]) +// keeps the array index/decrement separate so %lo(D_80185FC4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185FC4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185FC4[idx](); + } +} + extern void (*D_80185FC8[])(void); diff --git a/src/ov_SC03_100/ov_SC03_100_jr_8015C32C.c b/src/ov_SC03_100/ov_SC03_100_jr_8015C32C.c index c71c53375..f3d2e6900 100644 --- a/src/ov_SC03_100/ov_SC03_100_jr_8015C32C.c +++ b/src/ov_SC03_100/ov_SC03_100_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_100/nonmatchings/ov_SC03_100_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187490[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187490[count-1]) +// keeps the array index/decrement separate so %lo(D_80187490) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187490[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187490[idx](); + } +} + extern void (*D_80187494[])(void); diff --git a/src/ov_SC03_101/ov_SC03_101_jr_8015C32C.c b/src/ov_SC03_101/ov_SC03_101_jr_8015C32C.c index 9084faaea..a2bc65e59 100644 --- a/src/ov_SC03_101/ov_SC03_101_jr_8015C32C.c +++ b/src/ov_SC03_101/ov_SC03_101_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_101/nonmatchings/ov_SC03_101_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018646C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018646C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018646C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018646C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018646C[idx](); + } +} + extern void (*D_80186470[])(void); diff --git a/src/ov_SC03_102/ov_SC03_102_jr_8015C32C.c b/src/ov_SC03_102/ov_SC03_102_jr_8015C32C.c index f240ca4e7..b5f7c145a 100644 --- a/src/ov_SC03_102/ov_SC03_102_jr_8015C32C.c +++ b/src/ov_SC03_102/ov_SC03_102_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_102/nonmatchings/ov_SC03_102_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80188D24[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80188D24[count-1]) +// keeps the array index/decrement separate so %lo(D_80188D24) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80188D24[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80188D24[idx](); + } +} + extern void (*D_80188D28[])(void); diff --git a/src/ov_SC03_103/ov_SC03_103_jr_8015C32C.c b/src/ov_SC03_103/ov_SC03_103_jr_8015C32C.c index e7a734a3c..cf4442d52 100644 --- a/src/ov_SC03_103/ov_SC03_103_jr_8015C32C.c +++ b/src/ov_SC03_103/ov_SC03_103_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_103/nonmatchings/ov_SC03_103_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80186CD4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80186CD4[count-1]) +// keeps the array index/decrement separate so %lo(D_80186CD4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80186CD4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80186CD4[idx](); + } +} + extern void (*D_80186CD8[])(void); diff --git a/src/ov_SC03_104/ov_SC03_104_jr_8015C32C.c b/src/ov_SC03_104/ov_SC03_104_jr_8015C32C.c index c8f03bd27..eede402e4 100644 --- a/src/ov_SC03_104/ov_SC03_104_jr_8015C32C.c +++ b/src/ov_SC03_104/ov_SC03_104_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_104/nonmatchings/ov_SC03_104_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018D864[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018D864[count-1]) +// keeps the array index/decrement separate so %lo(D_8018D864) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018D864[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018D864[idx](); + } +} + extern void (*D_8018D868[])(void); diff --git a/src/ov_SC03_105/ov_SC03_105_jr_8015C32C.c b/src/ov_SC03_105/ov_SC03_105_jr_8015C32C.c index 764321354..bce36175d 100644 --- a/src/ov_SC03_105/ov_SC03_105_jr_8015C32C.c +++ b/src/ov_SC03_105/ov_SC03_105_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_105/nonmatchings/ov_SC03_105_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018CEEC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018CEEC[count-1]) +// keeps the array index/decrement separate so %lo(D_8018CEEC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018CEEC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018CEEC[idx](); + } +} + extern void (*D_8018CEF0[])(void); diff --git a/src/ov_SC03_108/ov_SC03_108_jr_8015C32C.c b/src/ov_SC03_108/ov_SC03_108_jr_8015C32C.c index 918f57067..50574ba93 100644 --- a/src/ov_SC03_108/ov_SC03_108_jr_8015C32C.c +++ b/src/ov_SC03_108/ov_SC03_108_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_108/nonmatchings/ov_SC03_108_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183844[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183844[count-1]) +// keeps the array index/decrement separate so %lo(D_80183844) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183844[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183844[idx](); + } +} + extern void (*D_80183848[])(void); diff --git a/src/ov_SC03_109/ov_SC03_109_jr_8015C32C.c b/src/ov_SC03_109/ov_SC03_109_jr_8015C32C.c index f9890e2af..979438dd7 100644 --- a/src/ov_SC03_109/ov_SC03_109_jr_8015C32C.c +++ b/src/ov_SC03_109/ov_SC03_109_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_109/nonmatchings/ov_SC03_109_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180EF0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180EF0[count-1]) +// keeps the array index/decrement separate so %lo(D_80180EF0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180EF0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180EF0[idx](); + } +} + extern void (*D_80180EF4[])(void); diff --git a/src/ov_SC03_110/ov_SC03_110_jr_8015C32C.c b/src/ov_SC03_110/ov_SC03_110_jr_8015C32C.c index 8b1e974d1..b9fa867f0 100644 --- a/src/ov_SC03_110/ov_SC03_110_jr_8015C32C.c +++ b/src/ov_SC03_110/ov_SC03_110_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_110/nonmatchings/ov_SC03_110_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184910[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184910[count-1]) +// keeps the array index/decrement separate so %lo(D_80184910) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184910[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184910[idx](); + } +} + extern void (*D_80184914[])(void); diff --git a/src/ov_SC03_111/ov_SC03_111_jr_8015C32C.c b/src/ov_SC03_111/ov_SC03_111_jr_8015C32C.c index 306a3e44a..e585f340a 100644 --- a/src/ov_SC03_111/ov_SC03_111_jr_8015C32C.c +++ b/src/ov_SC03_111/ov_SC03_111_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3857,7 +3856,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_111/nonmatchings/ov_SC03_111_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801874C4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801874C4[count-1]) +// keeps the array index/decrement separate so %lo(D_801874C4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801874C4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801874C4[idx](); + } +} + extern void (*D_801874C8[])(void); diff --git a/src/ov_SC03_112/ov_SC03_112_jr_8015C32C.c b/src/ov_SC03_112/ov_SC03_112_jr_8015C32C.c index 0933a5add..7dc42a71e 100644 --- a/src/ov_SC03_112/ov_SC03_112_jr_8015C32C.c +++ b/src/ov_SC03_112/ov_SC03_112_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_112/nonmatchings/ov_SC03_112_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801882CC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801882CC[count-1]) +// keeps the array index/decrement separate so %lo(D_801882CC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801882CC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801882CC[idx](); + } +} + extern void (*D_801882D0[])(void); diff --git a/src/ov_SC03_113/ov_SC03_113_jr_8015C32C.c b/src/ov_SC03_113/ov_SC03_113_jr_8015C32C.c index 2e04f7841..cb5b55c45 100644 --- a/src/ov_SC03_113/ov_SC03_113_jr_8015C32C.c +++ b/src/ov_SC03_113/ov_SC03_113_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_113/nonmatchings/ov_SC03_113_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018597C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018597C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018597C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018597C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018597C[idx](); + } +} + extern void (*D_80185980[])(void); diff --git a/src/ov_SC03_114/ov_SC03_114_jr_8015C32C.c b/src/ov_SC03_114/ov_SC03_114_jr_8015C32C.c index 43d58c2e5..a578e07d3 100644 --- a/src/ov_SC03_114/ov_SC03_114_jr_8015C32C.c +++ b/src/ov_SC03_114/ov_SC03_114_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_114/nonmatchings/ov_SC03_114_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801815E4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801815E4[count-1]) +// keeps the array index/decrement separate so %lo(D_801815E4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801815E4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801815E4[idx](); + } +} + extern void (*D_801815E8[])(void); diff --git a/src/ov_SC03_115/ov_SC03_115_jr_8015C32C.c b/src/ov_SC03_115/ov_SC03_115_jr_8015C32C.c index c111b7506..0c09327d3 100644 --- a/src/ov_SC03_115/ov_SC03_115_jr_8015C32C.c +++ b/src/ov_SC03_115/ov_SC03_115_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_115/nonmatchings/ov_SC03_115_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183050[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183050[count-1]) +// keeps the array index/decrement separate so %lo(D_80183050) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183050[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183050[idx](); + } +} + extern void (*D_80183054[])(void); diff --git a/src/ov_SC03_116/ov_SC03_116_jr_8015C32C.c b/src/ov_SC03_116/ov_SC03_116_jr_8015C32C.c index 5ec738033..6536e880f 100644 --- a/src/ov_SC03_116/ov_SC03_116_jr_8015C32C.c +++ b/src/ov_SC03_116/ov_SC03_116_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_116/nonmatchings/ov_SC03_116_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185454[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185454[count-1]) +// keeps the array index/decrement separate so %lo(D_80185454) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185454[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185454[idx](); + } +} + extern void (*D_80185458[])(void); diff --git a/src/ov_SC03_117/ov_SC03_117_jr_8015C32C.c b/src/ov_SC03_117/ov_SC03_117_jr_8015C32C.c index 27ac6f12e..abf9e7690 100644 --- a/src/ov_SC03_117/ov_SC03_117_jr_8015C32C.c +++ b/src/ov_SC03_117/ov_SC03_117_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_117/nonmatchings/ov_SC03_117_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187460[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187460[count-1]) +// keeps the array index/decrement separate so %lo(D_80187460) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187460[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187460[idx](); + } +} + extern void (*D_80187464[])(void); diff --git a/src/ov_SC03_118/ov_SC03_118_jr_8015C32C.c b/src/ov_SC03_118/ov_SC03_118_jr_8015C32C.c index d200d13ff..5d5983eae 100644 --- a/src/ov_SC03_118/ov_SC03_118_jr_8015C32C.c +++ b/src/ov_SC03_118/ov_SC03_118_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_118/nonmatchings/ov_SC03_118_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018C50C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018C50C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018C50C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018C50C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018C50C[idx](); + } +} + extern void (*D_8018C510[])(void); diff --git a/src/ov_SC03_119/ov_SC03_119_jr_8015C32C.c b/src/ov_SC03_119/ov_SC03_119_jr_8015C32C.c index 0b2e81597..5ddf84f51 100644 --- a/src/ov_SC03_119/ov_SC03_119_jr_8015C32C.c +++ b/src/ov_SC03_119/ov_SC03_119_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_119/nonmatchings/ov_SC03_119_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018C50C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018C50C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018C50C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018C50C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018C50C[idx](); + } +} + extern void (*D_8018C510[])(void); diff --git a/src/ov_SC03_121/ov_SC03_121_jr_8015C32C.c b/src/ov_SC03_121/ov_SC03_121_jr_8015C32C.c index 38b347914..61c3588ff 100644 --- a/src/ov_SC03_121/ov_SC03_121_jr_8015C32C.c +++ b/src/ov_SC03_121/ov_SC03_121_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_121/nonmatchings/ov_SC03_121_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184D28[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184D28[count-1]) +// keeps the array index/decrement separate so %lo(D_80184D28) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184D28[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184D28[idx](); + } +} + extern void (*D_80184D2C[])(void); diff --git a/src/ov_SC03_124/ov_SC03_124_jr_8015C32C.c b/src/ov_SC03_124/ov_SC03_124_jr_8015C32C.c index c2dd654e5..1a8bf7996 100644 --- a/src/ov_SC03_124/ov_SC03_124_jr_8015C32C.c +++ b/src/ov_SC03_124/ov_SC03_124_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_124/nonmatchings/ov_SC03_124_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018D754[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018D754[count-1]) +// keeps the array index/decrement separate so %lo(D_8018D754) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018D754[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018D754[idx](); + } +} + extern void (*D_8018D758[])(void); diff --git a/src/ov_SC03_125/ov_SC03_125_jr_8015C32C.c b/src/ov_SC03_125/ov_SC03_125_jr_8015C32C.c index 86e39adb2..f9f73f964 100644 --- a/src/ov_SC03_125/ov_SC03_125_jr_8015C32C.c +++ b/src/ov_SC03_125/ov_SC03_125_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_125/nonmatchings/ov_SC03_125_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80186924[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80186924[count-1]) +// keeps the array index/decrement separate so %lo(D_80186924) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80186924[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80186924[idx](); + } +} + extern void (*D_80186928[])(void); diff --git a/src/ov_SC03_126/ov_SC03_126_jr_8015C32C.c b/src/ov_SC03_126/ov_SC03_126_jr_8015C32C.c index 34a82ce7b..d7cc87aeb 100644 --- a/src/ov_SC03_126/ov_SC03_126_jr_8015C32C.c +++ b/src/ov_SC03_126/ov_SC03_126_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC03_126/nonmatchings/ov_SC03_126_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181E1C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181E1C[count-1]) +// keeps the array index/decrement separate so %lo(D_80181E1C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181E1C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181E1C[idx](); + } +} + extern void (*D_80181E20[])(void); diff --git a/src/ov_SC04_000/ov_SC04_000_jr_8015C32C.c b/src/ov_SC04_000/ov_SC04_000_jr_8015C32C.c index 7f95b2353..729744df9 100644 --- a/src/ov_SC04_000/ov_SC04_000_jr_8015C32C.c +++ b/src/ov_SC04_000/ov_SC04_000_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_000/nonmatchings/ov_SC04_000_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185E28[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185E28[count-1]) +// keeps the array index/decrement separate so %lo(D_80185E28) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185E28[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185E28[idx](); + } +} + extern void (*D_80185E2C[])(void); diff --git a/src/ov_SC04_002/ov_SC04_002_jr_8015C32C.c b/src/ov_SC04_002/ov_SC04_002_jr_8015C32C.c index 146985676..73707b574 100644 --- a/src/ov_SC04_002/ov_SC04_002_jr_8015C32C.c +++ b/src/ov_SC04_002/ov_SC04_002_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_002/nonmatchings/ov_SC04_002_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018AF94[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018AF94[count-1]) +// keeps the array index/decrement separate so %lo(D_8018AF94) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018AF94[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018AF94[idx](); + } +} + extern void (*D_8018AF98[])(void); diff --git a/src/ov_SC04_003/ov_SC04_003_jr_8015C32C.c b/src/ov_SC04_003/ov_SC04_003_jr_8015C32C.c index afa057200..489af0385 100644 --- a/src/ov_SC04_003/ov_SC04_003_jr_8015C32C.c +++ b/src/ov_SC04_003/ov_SC04_003_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_003/nonmatchings/ov_SC04_003_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184D30[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184D30[count-1]) +// keeps the array index/decrement separate so %lo(D_80184D30) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184D30[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184D30[idx](); + } +} + extern void (*D_80184D34[])(void); diff --git a/src/ov_SC04_004/ov_SC04_004_jr_8015C32C.c b/src/ov_SC04_004/ov_SC04_004_jr_8015C32C.c index c6f269df5..aef608298 100644 --- a/src/ov_SC04_004/ov_SC04_004_jr_8015C32C.c +++ b/src/ov_SC04_004/ov_SC04_004_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_004/nonmatchings/ov_SC04_004_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187264[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187264[count-1]) +// keeps the array index/decrement separate so %lo(D_80187264) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187264[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187264[idx](); + } +} + extern void (*D_80187268[])(void); diff --git a/src/ov_SC04_005/ov_SC04_005_jr_8015C32C.c b/src/ov_SC04_005/ov_SC04_005_jr_8015C32C.c index dafce41db..2da2e26b8 100644 --- a/src/ov_SC04_005/ov_SC04_005_jr_8015C32C.c +++ b/src/ov_SC04_005/ov_SC04_005_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_005/nonmatchings/ov_SC04_005_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018A698[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018A698[count-1]) +// keeps the array index/decrement separate so %lo(D_8018A698) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018A698[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018A698[idx](); + } +} + extern void (*D_8018A69C[])(void); diff --git a/src/ov_SC04_006/ov_SC04_006_jr_8015C32C.c b/src/ov_SC04_006/ov_SC04_006_jr_8015C32C.c index ee3794fa4..d5148e3b3 100644 --- a/src/ov_SC04_006/ov_SC04_006_jr_8015C32C.c +++ b/src/ov_SC04_006/ov_SC04_006_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_006/nonmatchings/ov_SC04_006_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182778[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182778[count-1]) +// keeps the array index/decrement separate so %lo(D_80182778) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182778[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182778[idx](); + } +} + extern void (*D_8018277C[])(void); diff --git a/src/ov_SC04_007/ov_SC04_007_jr_8015C32C.c b/src/ov_SC04_007/ov_SC04_007_jr_8015C32C.c index 1c2756f77..9983a76a1 100644 --- a/src/ov_SC04_007/ov_SC04_007_jr_8015C32C.c +++ b/src/ov_SC04_007/ov_SC04_007_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_007/nonmatchings/ov_SC04_007_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80188730[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80188730[count-1]) +// keeps the array index/decrement separate so %lo(D_80188730) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80188730[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80188730[idx](); + } +} + extern void (*D_80188734[])(void); diff --git a/src/ov_SC04_008/ov_SC04_008_jr_8015C32C.c b/src/ov_SC04_008/ov_SC04_008_jr_8015C32C.c index ab07f7884..8a5f0f5f6 100644 --- a/src/ov_SC04_008/ov_SC04_008_jr_8015C32C.c +++ b/src/ov_SC04_008/ov_SC04_008_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_008/nonmatchings/ov_SC04_008_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181668[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181668[count-1]) +// keeps the array index/decrement separate so %lo(D_80181668) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181668[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181668[idx](); + } +} + extern void (*D_8018166C[])(void); diff --git a/src/ov_SC04_009/ov_SC04_009_jr_8015C32C.c b/src/ov_SC04_009/ov_SC04_009_jr_8015C32C.c index d07d9312b..cbb44b07e 100644 --- a/src/ov_SC04_009/ov_SC04_009_jr_8015C32C.c +++ b/src/ov_SC04_009/ov_SC04_009_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_009/nonmatchings/ov_SC04_009_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181694[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181694[count-1]) +// keeps the array index/decrement separate so %lo(D_80181694) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181694[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181694[idx](); + } +} + extern void (*D_80181698[])(void); diff --git a/src/ov_SC04_010/ov_SC04_010_jr_8015C32C.c b/src/ov_SC04_010/ov_SC04_010_jr_8015C32C.c index bbce141e7..d4b08c3e3 100644 --- a/src/ov_SC04_010/ov_SC04_010_jr_8015C32C.c +++ b/src/ov_SC04_010/ov_SC04_010_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_010/nonmatchings/ov_SC04_010_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180D40[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180D40[count-1]) +// keeps the array index/decrement separate so %lo(D_80180D40) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180D40[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180D40[idx](); + } +} + extern void (*D_80180D44[])(void); diff --git a/src/ov_SC04_011/ov_SC04_011_jr_8015C32C.c b/src/ov_SC04_011/ov_SC04_011_jr_8015C32C.c index 9ac2738e5..13e5cc1de 100644 --- a/src/ov_SC04_011/ov_SC04_011_jr_8015C32C.c +++ b/src/ov_SC04_011/ov_SC04_011_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_011/nonmatchings/ov_SC04_011_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80192FD0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80192FD0[count-1]) +// keeps the array index/decrement separate so %lo(D_80192FD0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80192FD0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80192FD0[idx](); + } +} + extern void (*D_80192FD4[])(void); diff --git a/src/ov_SC04_012/ov_SC04_012_jr_8015C32C.c b/src/ov_SC04_012/ov_SC04_012_jr_8015C32C.c index dacef4fd5..5dabd0f77 100644 --- a/src/ov_SC04_012/ov_SC04_012_jr_8015C32C.c +++ b/src/ov_SC04_012/ov_SC04_012_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_012/nonmatchings/ov_SC04_012_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801811A4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801811A4[count-1]) +// keeps the array index/decrement separate so %lo(D_801811A4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801811A4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801811A4[idx](); + } +} + extern void (*D_801811A8[])(void); diff --git a/src/ov_SC04_015/ov_SC04_015_jr_8015C32C.c b/src/ov_SC04_015/ov_SC04_015_jr_8015C32C.c index c8f0a986b..f013ec754 100644 --- a/src/ov_SC04_015/ov_SC04_015_jr_8015C32C.c +++ b/src/ov_SC04_015/ov_SC04_015_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_015/nonmatchings/ov_SC04_015_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801870DC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801870DC[count-1]) +// keeps the array index/decrement separate so %lo(D_801870DC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801870DC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801870DC[idx](); + } +} + extern void (*D_801870E0[])(void); diff --git a/src/ov_SC04_016/ov_SC04_016_jr_8015C32C.c b/src/ov_SC04_016/ov_SC04_016_jr_8015C32C.c index 594a99ceb..46fe935ae 100644 --- a/src/ov_SC04_016/ov_SC04_016_jr_8015C32C.c +++ b/src/ov_SC04_016/ov_SC04_016_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_016/nonmatchings/ov_SC04_016_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182BA0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182BA0[count-1]) +// keeps the array index/decrement separate so %lo(D_80182BA0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182BA0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182BA0[idx](); + } +} + extern void (*D_80182BA4[])(void); diff --git a/src/ov_SC04_018/ov_SC04_018_jr_8015C32C.c b/src/ov_SC04_018/ov_SC04_018_jr_8015C32C.c index ce2f7c247..784944453 100644 --- a/src/ov_SC04_018/ov_SC04_018_jr_8015C32C.c +++ b/src/ov_SC04_018/ov_SC04_018_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_018/nonmatchings/ov_SC04_018_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018FDB8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018FDB8[count-1]) +// keeps the array index/decrement separate so %lo(D_8018FDB8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018FDB8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018FDB8[idx](); + } +} + extern void (*D_8018FDBC[])(void); diff --git a/src/ov_SC04_019/ov_SC04_019_jr_8015C32C.c b/src/ov_SC04_019/ov_SC04_019_jr_8015C32C.c index f15ff5842..d28fa058e 100644 --- a/src/ov_SC04_019/ov_SC04_019_jr_8015C32C.c +++ b/src/ov_SC04_019/ov_SC04_019_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_019/nonmatchings/ov_SC04_019_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018FDB8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018FDB8[count-1]) +// keeps the array index/decrement separate so %lo(D_8018FDB8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018FDB8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018FDB8[idx](); + } +} + extern void (*D_8018FDBC[])(void); diff --git a/src/ov_SC04_020/ov_SC04_020_jr_8015C32C.c b/src/ov_SC04_020/ov_SC04_020_jr_8015C32C.c index b8c22e360..a1702e250 100644 --- a/src/ov_SC04_020/ov_SC04_020_jr_8015C32C.c +++ b/src/ov_SC04_020/ov_SC04_020_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_020/nonmatchings/ov_SC04_020_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185EF0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185EF0[count-1]) +// keeps the array index/decrement separate so %lo(D_80185EF0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185EF0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185EF0[idx](); + } +} + extern void (*D_80185EF4[])(void); diff --git a/src/ov_SC04_021/ov_SC04_021_jr_8015C32C.c b/src/ov_SC04_021/ov_SC04_021_jr_8015C32C.c index a00c7a83b..209dda2e3 100644 --- a/src/ov_SC04_021/ov_SC04_021_jr_8015C32C.c +++ b/src/ov_SC04_021/ov_SC04_021_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC04_021/nonmatchings/ov_SC04_021_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181E1C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181E1C[count-1]) +// keeps the array index/decrement separate so %lo(D_80181E1C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181E1C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181E1C[idx](); + } +} + extern void (*D_80181E20[])(void); diff --git a/src/ov_SC05_000/ov_SC05_000_jr_8015C32C.c b/src/ov_SC05_000/ov_SC05_000_jr_8015C32C.c index f4f1ef089..394e2cd7c 100644 --- a/src/ov_SC05_000/ov_SC05_000_jr_8015C32C.c +++ b/src/ov_SC05_000/ov_SC05_000_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3854,7 +3853,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_000/nonmatchings/ov_SC05_000_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180E30[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180E30[count-1]) +// keeps the array index/decrement separate so %lo(D_80180E30) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180E30[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180E30[idx](); + } +} + extern void (*D_80180E34[])(void); diff --git a/src/ov_SC05_001/ov_SC05_001_jr_8015C32C.c b/src/ov_SC05_001/ov_SC05_001_jr_8015C32C.c index 7f14b2f5e..cdcda8567 100644 --- a/src/ov_SC05_001/ov_SC05_001_jr_8015C32C.c +++ b/src/ov_SC05_001/ov_SC05_001_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_001/nonmatchings/ov_SC05_001_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018860C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018860C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018860C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018860C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018860C[idx](); + } +} + extern void (*D_80188610[])(void); diff --git a/src/ov_SC05_002/ov_SC05_002_jr_8015C32C.c b/src/ov_SC05_002/ov_SC05_002_jr_8015C32C.c index 81e07e32f..b017ab5e0 100644 --- a/src/ov_SC05_002/ov_SC05_002_jr_8015C32C.c +++ b/src/ov_SC05_002/ov_SC05_002_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_002/nonmatchings/ov_SC05_002_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182DCC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182DCC[count-1]) +// keeps the array index/decrement separate so %lo(D_80182DCC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182DCC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182DCC[idx](); + } +} + extern void (*D_80182DD0[])(void); diff --git a/src/ov_SC05_003/ov_SC05_003_jr_8015C32C.c b/src/ov_SC05_003/ov_SC05_003_jr_8015C32C.c index 3af38b4be..b69e5677a 100644 --- a/src/ov_SC05_003/ov_SC05_003_jr_8015C32C.c +++ b/src/ov_SC05_003/ov_SC05_003_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_003/nonmatchings/ov_SC05_003_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185104[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185104[count-1]) +// keeps the array index/decrement separate so %lo(D_80185104) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185104[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185104[idx](); + } +} + extern void (*D_80185108[])(void); diff --git a/src/ov_SC05_004/ov_SC05_004_jr_8015C32C.c b/src/ov_SC05_004/ov_SC05_004_jr_8015C32C.c index 85234ee96..401d88b29 100644 --- a/src/ov_SC05_004/ov_SC05_004_jr_8015C32C.c +++ b/src/ov_SC05_004/ov_SC05_004_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_004/nonmatchings/ov_SC05_004_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184210[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184210[count-1]) +// keeps the array index/decrement separate so %lo(D_80184210) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184210[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184210[idx](); + } +} + extern void (*D_80184214[])(void); diff --git a/src/ov_SC05_005/ov_SC05_005_jr_8015C32C.c b/src/ov_SC05_005/ov_SC05_005_jr_8015C32C.c index ae0abaf75..a4b2519ce 100644 --- a/src/ov_SC05_005/ov_SC05_005_jr_8015C32C.c +++ b/src/ov_SC05_005/ov_SC05_005_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_005/nonmatchings/ov_SC05_005_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184FE4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184FE4[count-1]) +// keeps the array index/decrement separate so %lo(D_80184FE4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184FE4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184FE4[idx](); + } +} + extern void (*D_80184FE8[])(void); diff --git a/src/ov_SC05_006/ov_SC05_006_jr_8015C32C.c b/src/ov_SC05_006/ov_SC05_006_jr_8015C32C.c index d4e30e90d..4233e3370 100644 --- a/src/ov_SC05_006/ov_SC05_006_jr_8015C32C.c +++ b/src/ov_SC05_006/ov_SC05_006_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_006/nonmatchings/ov_SC05_006_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182004[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182004[count-1]) +// keeps the array index/decrement separate so %lo(D_80182004) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182004[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182004[idx](); + } +} + extern void (*D_80182008[])(void); diff --git a/src/ov_SC05_007/ov_SC05_007_jr_8015C32C.c b/src/ov_SC05_007/ov_SC05_007_jr_8015C32C.c index 81cf89b59..4f0b1371e 100644 --- a/src/ov_SC05_007/ov_SC05_007_jr_8015C32C.c +++ b/src/ov_SC05_007/ov_SC05_007_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_007/nonmatchings/ov_SC05_007_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80183600[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80183600[count-1]) +// keeps the array index/decrement separate so %lo(D_80183600) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80183600[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80183600[idx](); + } +} + extern void (*D_80183604[])(void); diff --git a/src/ov_SC05_008/ov_SC05_008_jr_8015C32C.c b/src/ov_SC05_008/ov_SC05_008_jr_8015C32C.c index 5ed1ac321..00a58f055 100644 --- a/src/ov_SC05_008/ov_SC05_008_jr_8015C32C.c +++ b/src/ov_SC05_008/ov_SC05_008_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_008/nonmatchings/ov_SC05_008_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185558[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185558[count-1]) +// keeps the array index/decrement separate so %lo(D_80185558) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185558[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185558[idx](); + } +} + extern void (*D_8018555C[])(void); diff --git a/src/ov_SC05_009/ov_SC05_009_jr_8015C32C.c b/src/ov_SC05_009/ov_SC05_009_jr_8015C32C.c index 447c1e257..092770a98 100644 --- a/src/ov_SC05_009/ov_SC05_009_jr_8015C32C.c +++ b/src/ov_SC05_009/ov_SC05_009_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_009/nonmatchings/ov_SC05_009_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181668[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181668[count-1]) +// keeps the array index/decrement separate so %lo(D_80181668) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181668[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181668[idx](); + } +} + extern void (*D_8018166C[])(void); diff --git a/src/ov_SC05_010/ov_SC05_010_jr_8015C32C.c b/src/ov_SC05_010/ov_SC05_010_jr_8015C32C.c index e6b784990..031d35f3b 100644 --- a/src/ov_SC05_010/ov_SC05_010_jr_8015C32C.c +++ b/src/ov_SC05_010/ov_SC05_010_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_010/nonmatchings/ov_SC05_010_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018B544[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018B544[count-1]) +// keeps the array index/decrement separate so %lo(D_8018B544) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018B544[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018B544[idx](); + } +} + extern void (*D_8018B548[])(void); diff --git a/src/ov_SC05_011/ov_SC05_011_jr_8015C32C.c b/src/ov_SC05_011/ov_SC05_011_jr_8015C32C.c index ab70cca7d..a00f49baf 100644 --- a/src/ov_SC05_011/ov_SC05_011_jr_8015C32C.c +++ b/src/ov_SC05_011/ov_SC05_011_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_011/nonmatchings/ov_SC05_011_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801808BC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801808BC[count-1]) +// keeps the array index/decrement separate so %lo(D_801808BC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801808BC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801808BC[idx](); + } +} + extern void (*D_801808C0[])(void); diff --git a/src/ov_SC05_017/ov_SC05_017_jr_8015C32C.c b/src/ov_SC05_017/ov_SC05_017_jr_8015C32C.c index a16c6af89..85b4019d3 100644 --- a/src/ov_SC05_017/ov_SC05_017_jr_8015C32C.c +++ b/src/ov_SC05_017/ov_SC05_017_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_017/nonmatchings/ov_SC05_017_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018FD7C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018FD7C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018FD7C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018FD7C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018FD7C[idx](); + } +} + extern void (*D_8018FD80[])(void); diff --git a/src/ov_SC05_018/ov_SC05_018_jr_8015C32C.c b/src/ov_SC05_018/ov_SC05_018_jr_8015C32C.c index 6a2b5970b..6bf84bf8d 100644 --- a/src/ov_SC05_018/ov_SC05_018_jr_8015C32C.c +++ b/src/ov_SC05_018/ov_SC05_018_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_018/nonmatchings/ov_SC05_018_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801894D8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801894D8[count-1]) +// keeps the array index/decrement separate so %lo(D_801894D8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801894D8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801894D8[idx](); + } +} + extern void (*D_801894DC[])(void); diff --git a/src/ov_SC05_018/ov_SC05_018_jr_8017D604.c b/src/ov_SC05_018/ov_SC05_018_jr_8017D604.c index b4f82952f..054de64c5 100644 --- a/src/ov_SC05_018/ov_SC05_018_jr_8017D604.c +++ b/src/ov_SC05_018/ov_SC05_018_jr_8017D604.c @@ -3506,13 +3506,20 @@ INCLUDE_ASM("asm/ov_SC05_018/nonmatchings/ov_SC05_018_jr_8017D604", func_80180AC INCLUDE_ASM("asm/ov_SC05_018/nonmatchings/ov_SC05_018_jr_8017D604", func_80180BE0); -extern void func_80180D04(void); +extern void func_80180D04(void *a0); void func_80180CE4(void) { - func_80180D04(); + ((void (*)(void))func_80180D04)(); } -INCLUDE_ASM("asm/ov_SC05_018/nonmatchings/ov_SC05_018_jr_8017D604", func_80180D04); + + +void func_80180D04(void *a0) { + + extern void (*D_8018AA00[])(void); + D_8018AA00[*(u16 *)((s32)a0 + 0x2)](); +} + INCLUDE_ASM("asm/ov_SC05_018/nonmatchings/ov_SC05_018_jr_8017D604", func_80180D40); diff --git a/src/ov_SC05_019/ov_SC05_019_jr_8015C32C.c b/src/ov_SC05_019/ov_SC05_019_jr_8015C32C.c index 36a51e402..e08c14551 100644 --- a/src/ov_SC05_019/ov_SC05_019_jr_8015C32C.c +++ b/src/ov_SC05_019/ov_SC05_019_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC05_019/nonmatchings/ov_SC05_019_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181E1C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181E1C[count-1]) +// keeps the array index/decrement separate so %lo(D_80181E1C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181E1C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181E1C[idx](); + } +} + extern void (*D_80181E20[])(void); diff --git a/src/ov_SC06_000/ov_SC06_000_jr_8015C32C.c b/src/ov_SC06_000/ov_SC06_000_jr_8015C32C.c index f93447398..9752a2b05 100644 --- a/src/ov_SC06_000/ov_SC06_000_jr_8015C32C.c +++ b/src/ov_SC06_000/ov_SC06_000_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_000/nonmatchings/ov_SC06_000_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018AE2C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018AE2C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018AE2C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018AE2C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018AE2C[idx](); + } +} + extern void (*D_8018AE30[])(void); diff --git a/src/ov_SC06_006/ov_SC06_006_jr_8015C32C.c b/src/ov_SC06_006/ov_SC06_006_jr_8015C32C.c index d1243bbc4..57db0ea93 100644 --- a/src/ov_SC06_006/ov_SC06_006_jr_8015C32C.c +++ b/src/ov_SC06_006/ov_SC06_006_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_006/nonmatchings/ov_SC06_006_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184950[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184950[count-1]) +// keeps the array index/decrement separate so %lo(D_80184950) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184950[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184950[idx](); + } +} + extern void (*D_80184954[])(void); diff --git a/src/ov_SC06_008/ov_SC06_008_jr_8015C32C.c b/src/ov_SC06_008/ov_SC06_008_jr_8015C32C.c index 8511bc67e..5b34eab26 100644 --- a/src/ov_SC06_008/ov_SC06_008_jr_8015C32C.c +++ b/src/ov_SC06_008/ov_SC06_008_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_008/nonmatchings/ov_SC06_008_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801883B8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801883B8[count-1]) +// keeps the array index/decrement separate so %lo(D_801883B8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801883B8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801883B8[idx](); + } +} + extern void (*D_801883BC[])(void); diff --git a/src/ov_SC06_010/ov_SC06_010_jr_8015C32C.c b/src/ov_SC06_010/ov_SC06_010_jr_8015C32C.c index b20ce7941..abd1f7414 100644 --- a/src/ov_SC06_010/ov_SC06_010_jr_8015C32C.c +++ b/src/ov_SC06_010/ov_SC06_010_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_010/nonmatchings/ov_SC06_010_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80189594[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80189594[count-1]) +// keeps the array index/decrement separate so %lo(D_80189594) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80189594[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80189594[idx](); + } +} + extern void (*D_80189598[])(void); diff --git a/src/ov_SC06_011/ov_SC06_011_jr_8015C32C.c b/src/ov_SC06_011/ov_SC06_011_jr_8015C32C.c index 735bd8098..dc176be3d 100644 --- a/src/ov_SC06_011/ov_SC06_011_jr_8015C32C.c +++ b/src/ov_SC06_011/ov_SC06_011_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_011/nonmatchings/ov_SC06_011_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182FF4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182FF4[count-1]) +// keeps the array index/decrement separate so %lo(D_80182FF4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182FF4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182FF4[idx](); + } +} + extern void (*D_80182FF8[])(void); diff --git a/src/ov_SC06_013/ov_SC06_013_jr_8015C32C.c b/src/ov_SC06_013/ov_SC06_013_jr_8015C32C.c index 4df269c39..a51b4283d 100644 --- a/src/ov_SC06_013/ov_SC06_013_jr_8015C32C.c +++ b/src/ov_SC06_013/ov_SC06_013_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_013/nonmatchings/ov_SC06_013_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181770[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181770[count-1]) +// keeps the array index/decrement separate so %lo(D_80181770) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181770[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181770[idx](); + } +} + extern void (*D_80181774[])(void); diff --git a/src/ov_SC06_014/ov_SC06_014_jr_8015C32C.c b/src/ov_SC06_014/ov_SC06_014_jr_8015C32C.c index 744acdc70..5b8cf59f7 100644 --- a/src/ov_SC06_014/ov_SC06_014_jr_8015C32C.c +++ b/src/ov_SC06_014/ov_SC06_014_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_014/nonmatchings/ov_SC06_014_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80182AD4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80182AD4[count-1]) +// keeps the array index/decrement separate so %lo(D_80182AD4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80182AD4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80182AD4[idx](); + } +} + extern void (*D_80182AD8[])(void); diff --git a/src/ov_SC06_015/ov_SC06_015_jr_8015C32C.c b/src/ov_SC06_015/ov_SC06_015_jr_8015C32C.c index 7fb5a3523..0cafcdfe1 100644 --- a/src/ov_SC06_015/ov_SC06_015_jr_8015C32C.c +++ b/src/ov_SC06_015/ov_SC06_015_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_015/nonmatchings/ov_SC06_015_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018162C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018162C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018162C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018162C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018162C[idx](); + } +} + extern void (*D_80181630[])(void); diff --git a/src/ov_SC06_016/ov_SC06_016_jr_8015C32C.c b/src/ov_SC06_016/ov_SC06_016_jr_8015C32C.c index 4ed002bfb..36cb86744 100644 --- a/src/ov_SC06_016/ov_SC06_016_jr_8015C32C.c +++ b/src/ov_SC06_016/ov_SC06_016_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_016/nonmatchings/ov_SC06_016_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187A3C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187A3C[count-1]) +// keeps the array index/decrement separate so %lo(D_80187A3C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187A3C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187A3C[idx](); + } +} + extern void (*D_80187A40[])(void); diff --git a/src/ov_SC06_018/ov_SC06_018_jr_8015C32C.c b/src/ov_SC06_018/ov_SC06_018_jr_8015C32C.c index 46b4e2577..b6b029f6d 100644 --- a/src/ov_SC06_018/ov_SC06_018_jr_8015C32C.c +++ b/src/ov_SC06_018/ov_SC06_018_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_018/nonmatchings/ov_SC06_018_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80196178[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80196178[count-1]) +// keeps the array index/decrement separate so %lo(D_80196178) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80196178[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80196178[idx](); + } +} + extern void (*D_8019617C[])(void); diff --git a/src/ov_SC06_020/ov_SC06_020_jr_8015C32C.c b/src/ov_SC06_020/ov_SC06_020_jr_8015C32C.c index 01b746d2c..8fae6c4af 100644 --- a/src/ov_SC06_020/ov_SC06_020_jr_8015C32C.c +++ b/src/ov_SC06_020/ov_SC06_020_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_020/nonmatchings/ov_SC06_020_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187C00[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187C00[count-1]) +// keeps the array index/decrement separate so %lo(D_80187C00) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187C00[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187C00[idx](); + } +} + extern void (*D_80187C04[])(void); diff --git a/src/ov_SC06_022/ov_SC06_022_jr_8015C32C.c b/src/ov_SC06_022/ov_SC06_022_jr_8015C32C.c index d9a28f27e..3c2b2ba79 100644 --- a/src/ov_SC06_022/ov_SC06_022_jr_8015C32C.c +++ b/src/ov_SC06_022/ov_SC06_022_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_022/nonmatchings/ov_SC06_022_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018FEBC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018FEBC[count-1]) +// keeps the array index/decrement separate so %lo(D_8018FEBC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018FEBC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018FEBC[idx](); + } +} + extern void (*D_8018FEC0[])(void); diff --git a/src/ov_SC06_024/ov_SC06_024_jr_8015C32C.c b/src/ov_SC06_024/ov_SC06_024_jr_8015C32C.c index a29c6fd47..8605394b9 100644 --- a/src/ov_SC06_024/ov_SC06_024_jr_8015C32C.c +++ b/src/ov_SC06_024/ov_SC06_024_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_024/nonmatchings/ov_SC06_024_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80192394[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80192394[count-1]) +// keeps the array index/decrement separate so %lo(D_80192394) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80192394[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80192394[idx](); + } +} + extern void (*D_80192398[])(void); diff --git a/src/ov_SC06_025/ov_SC06_025_jr_8015C32C.c b/src/ov_SC06_025/ov_SC06_025_jr_8015C32C.c index 6790cb437..091570439 100644 --- a/src/ov_SC06_025/ov_SC06_025_jr_8015C32C.c +++ b/src/ov_SC06_025/ov_SC06_025_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_025/nonmatchings/ov_SC06_025_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80187838[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80187838[count-1]) +// keeps the array index/decrement separate so %lo(D_80187838) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80187838[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80187838[idx](); + } +} + extern void (*D_8018783C[])(void); diff --git a/src/ov_SC06_027/ov_SC06_027_jr_8015C32C.c b/src/ov_SC06_027/ov_SC06_027_jr_8015C32C.c index 5dbdbd86a..82cf433b5 100644 --- a/src/ov_SC06_027/ov_SC06_027_jr_8015C32C.c +++ b/src/ov_SC06_027/ov_SC06_027_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_027/nonmatchings/ov_SC06_027_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180B78[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180B78[count-1]) +// keeps the array index/decrement separate so %lo(D_80180B78) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180B78[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180B78[idx](); + } +} + extern void (*D_80180B7C[])(void); diff --git a/src/ov_SC06_029/ov_SC06_029_jr_8015C32C.c b/src/ov_SC06_029/ov_SC06_029_jr_8015C32C.c index 6af34d304..6e6dc72b1 100644 --- a/src/ov_SC06_029/ov_SC06_029_jr_8015C32C.c +++ b/src/ov_SC06_029/ov_SC06_029_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_029/nonmatchings/ov_SC06_029_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018F10C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018F10C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018F10C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018F10C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018F10C[idx](); + } +} + extern void (*D_8018F110[])(void); diff --git a/src/ov_SC06_030/ov_SC06_030_jr_8015C32C.c b/src/ov_SC06_030/ov_SC06_030_jr_8015C32C.c index 1399e8368..c6492b23c 100644 --- a/src/ov_SC06_030/ov_SC06_030_jr_8015C32C.c +++ b/src/ov_SC06_030/ov_SC06_030_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_030/nonmatchings/ov_SC06_030_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801849FC[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801849FC[count-1]) +// keeps the array index/decrement separate so %lo(D_801849FC) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801849FC[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801849FC[idx](); + } +} + extern void (*D_80184A00[])(void); diff --git a/src/ov_SC06_032/ov_SC06_032_jr_8015C32C.c b/src/ov_SC06_032/ov_SC06_032_jr_8015C32C.c index 33ef0ed99..fedd0ed33 100644 --- a/src/ov_SC06_032/ov_SC06_032_jr_8015C32C.c +++ b/src/ov_SC06_032/ov_SC06_032_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_032/nonmatchings/ov_SC06_032_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80195EC8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80195EC8[count-1]) +// keeps the array index/decrement separate so %lo(D_80195EC8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80195EC8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80195EC8[idx](); + } +} + extern void (*D_80195ECC[])(void); diff --git a/src/ov_SC06_033/ov_SC06_033_jr_8015C32C.c b/src/ov_SC06_033/ov_SC06_033_jr_8015C32C.c index 50b0b7789..0bfaf6670 100644 --- a/src/ov_SC06_033/ov_SC06_033_jr_8015C32C.c +++ b/src/ov_SC06_033/ov_SC06_033_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC06_033/nonmatchings/ov_SC06_033_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801943D8[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801943D8[count-1]) +// keeps the array index/decrement separate so %lo(D_801943D8) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801943D8[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801943D8[idx](); + } +} + extern void (*D_801943DC[])(void); diff --git a/src/ov_SC07_000/ov_SC07_000_jr_8015C32C.c b/src/ov_SC07_000/ov_SC07_000_jr_8015C32C.c index d56967ba6..58b02f60e 100644 --- a/src/ov_SC07_000/ov_SC07_000_jr_8015C32C.c +++ b/src/ov_SC07_000/ov_SC07_000_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_000/nonmatchings/ov_SC07_000_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185220[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185220[count-1]) +// keeps the array index/decrement separate so %lo(D_80185220) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185220[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185220[idx](); + } +} + extern void (*D_80185224[])(void); diff --git a/src/ov_SC07_001/ov_SC07_001_jr_8015C32C.c b/src/ov_SC07_001/ov_SC07_001_jr_8015C32C.c index 4005e82ed..9f933d3ca 100644 --- a/src/ov_SC07_001/ov_SC07_001_jr_8015C32C.c +++ b/src/ov_SC07_001/ov_SC07_001_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_001/nonmatchings/ov_SC07_001_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_801840D0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_801840D0[count-1]) +// keeps the array index/decrement separate so %lo(D_801840D0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_801840D0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_801840D0[idx](); + } +} + extern void (*D_801840D4[])(void); diff --git a/src/ov_SC07_002/ov_SC07_002_jr_8015C32C.c b/src/ov_SC07_002/ov_SC07_002_jr_8015C32C.c index 92747356d..868b0b50f 100644 --- a/src/ov_SC07_002/ov_SC07_002_jr_8015C32C.c +++ b/src/ov_SC07_002/ov_SC07_002_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_002/nonmatchings/ov_SC07_002_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018938C[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018938C[count-1]) +// keeps the array index/decrement separate so %lo(D_8018938C) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018938C[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018938C[idx](); + } +} + extern void (*D_80189390[])(void); diff --git a/src/ov_SC07_006/ov_SC07_006_jr_8015C32C.c b/src/ov_SC07_006/ov_SC07_006_jr_8015C32C.c index a22ec7342..3187350d1 100644 --- a/src/ov_SC07_006/ov_SC07_006_jr_8015C32C.c +++ b/src/ov_SC07_006/ov_SC07_006_jr_8015C32C.c @@ -1083,7 +1083,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -4802,7 +4801,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627c0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_006/nonmatchings/ov_SC07_006_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8018CFB0[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8018CFB0[count-1]) +// keeps the array index/decrement separate so %lo(D_8018CFB0) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8018CFB0[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8018CFB0[idx](); + } +} + diff --git a/src/ov_SC07_007/ov_SC07_007_jr_8015C32C.c b/src/ov_SC07_007/ov_SC07_007_jr_8015C32C.c index 6af67a005..fda856d1d 100644 --- a/src/ov_SC07_007/ov_SC07_007_jr_8015C32C.c +++ b/src/ov_SC07_007/ov_SC07_007_jr_8015C32C.c @@ -1083,7 +1083,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -4755,7 +4754,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627c0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_007/nonmatchings/ov_SC07_007_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80185AD4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80185AD4[count-1]) +// keeps the array index/decrement separate so %lo(D_80185AD4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80185AD4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80185AD4[idx](); + } +} + diff --git a/src/ov_SC07_008/ov_SC07_008_jr_8015C32C.c b/src/ov_SC07_008/ov_SC07_008_jr_8015C32C.c index 6716e8201..bf38cf851 100644 --- a/src/ov_SC07_008/ov_SC07_008_jr_8015C32C.c +++ b/src/ov_SC07_008/ov_SC07_008_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_008/nonmatchings/ov_SC07_008_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_8017FEA4[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_8017FEA4[count-1]) +// keeps the array index/decrement separate so %lo(D_8017FEA4) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_8017FEA4[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_8017FEA4[idx](); + } +} + extern void (*D_8017FEA8[])(void); diff --git a/src/ov_SC07_009/ov_SC07_009_jr_8015C32C.c b/src/ov_SC07_009/ov_SC07_009_jr_8015C32C.c index ce6684d74..4be0cc2c8 100644 --- a/src/ov_SC07_009/ov_SC07_009_jr_8015C32C.c +++ b/src/ov_SC07_009/ov_SC07_009_jr_8015C32C.c @@ -121,7 +121,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -3856,7 +3855,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627C0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_009/nonmatchings/ov_SC07_009_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80180948[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80180948[count-1]) +// keeps the array index/decrement separate so %lo(D_80180948) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80180948[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80180948[idx](); + } +} + extern void (*D_8018094C[])(void); diff --git a/src/ov_SC07_010/ov_SC07_010_jr_8015C32C.c b/src/ov_SC07_010/ov_SC07_010_jr_8015C32C.c index 75a6c5203..7400eef7f 100644 --- a/src/ov_SC07_010/ov_SC07_010_jr_8015C32C.c +++ b/src/ov_SC07_010/ov_SC07_010_jr_8015C32C.c @@ -483,7 +483,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -4175,7 +4174,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627c0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_010/nonmatchings/ov_SC07_010_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80184B64[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80184B64[count-1]) +// keeps the array index/decrement separate so %lo(D_80184B64) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80184B64[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80184B64[idx](); + } +} + diff --git a/src/ov_SC07_011/ov_SC07_011_jr_8015C32C.c b/src/ov_SC07_011/ov_SC07_011_jr_8015C32C.c index d58af9d77..e1c1a772b 100644 --- a/src/ov_SC07_011/ov_SC07_011_jr_8015C32C.c +++ b/src/ov_SC07_011/ov_SC07_011_jr_8015C32C.c @@ -1085,7 +1085,6 @@ extern void func_801466F0(s32 a0, s32 a1, s32 a2, s32 a3, s32 sp5, s32 sp6, s32 extern s32 D_8011F9D0; extern s32 func_80146608(s32 a0, s32 a1, s32 a2, s32 a3, s16 arg9, s32 arg10, s32 arg11, s32 arg12, s32 arg13); extern void func_801466B4(u16 a0, s32 a1, s32 a2, s32 a3, s32 arg5); -extern s32 D_8011F750; extern s32 D_8011F754; extern u8 * func_801468C8(s32 arg0, u8 arg1); extern s32 D_8011D030; @@ -4750,7 +4749,42 @@ void func_80162760(void) DEFINE_func_801627C0() /* dedup: shared engine-core @0x801627c0 (src/shared) */ -INCLUDE_ASM("asm/ov_SC07_011/nonmatchings/ov_SC07_011_jr_8015C32C", func_801627E8); + +// @class: struct +// @stuck: none — MATCH (19 ins, relocation-masked) +// +// Tiny dispatcher: byte count at D_8011F750 (offset 0 of a 0x58-byte ctl struct; +// cf. func_801627C0 which calls func_80016714(&D_8011F750, 0x58)). If nonzero, +// call D_80181224[count - 1]() through a word-stride fn-pointer table. +// +// Two idioms combined to match gcc-2.7.2 -O2: +// 1. The target MATERIALIZES &D_8011F750 (lui;addiu %lo) into $a0 before the lbu +// instead of folding %lo into the load. A direct global byte read always +// %lo-folds (lui;lbu %lo), so force the full-address materialization with the +// §21 re-tie barrier __asm__ __volatile__("":"=r"(p):"0"(p)) and pin the +// pointer to $a0 with register __asm__("$4") to get the exact register. +// 2. Writing `idx = idx - 1;` as its OWN statement (not inline D_80181224[count-1]) +// keeps the array index/decrement separate so %lo(D_80181224) folds into the +// dispatch load (lw %lo(...)($at)) — the inline form instead constant-folds the +// -1*4 into a -4 load offset and drops the %lo fold (1 ins short, schedule off). + + +void func_801627E8(void) +{ + + extern s32 D_8011F750; /* canonical: engine_core.h `extern s32 D_8011F750;` (read here as a byte) */ + extern void (*D_80181224[])(void); /* word-stride table of dispatch fn pointers */ + register u8 *p __asm__("$4") = (u8 *)&D_8011F750; + s32 idx; + + __asm__ __volatile__("" : "=r"(p) : "0"(p)); /* materialize &D_8011F750 into $a0 (defeat %lo-fold of the lbu) */ + idx = *p; + if (idx != 0) { + idx = idx - 1; + D_80181224[idx](); + } +} +