Compare commits

...

2 Commits

Author SHA1 Message Date
Devin AI
0f55efc6f7 decomp(memoryCard): _create_icon unnamed IconState (17 remaining reg-alloc ops)
Removes the named memorycard::IconState* local so icons[slot][file] member
reads materialize per-use, matching the base's first web chain. Residual is
the remat-vs-pin tie: base remats &mFileCell[slot][file].icon/iconTlut sums
at each use into scratch r3; MWCC pins them in callee regs here.

Co-Authored-By: wch <usernamecole7@gmail.com>
2026-10-08 22:08:29 +00:00
coah
9321a926cf fix: account for AOSSData in strict completion unit count (#1269) 2026-10-08 16:18:19 -05:00
3 changed files with 39 additions and 13 deletions

View File

@@ -367,13 +367,12 @@ GXTexObj* MemoryCardManager::_create_icon(u8 slot, s16 file, long start) {
return NULL;
}
CardIcons* icons = reinterpret_cast<CardIcons*>(memorycard::getIconStateArray());
memorycard::IconState* icon = &icons[slot][file];
if ((int)icon->iconFmt[start] == GX_TF_RGB5A3) {
GXInitTexObj(&mFileCell[slot][file].icon, reinterpret_cast<u8*>(icon) + icon->iconOffset[start], CARD_ICON_WIDTH, CARD_ICON_HEIGHT, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE);
if ((int)icons[slot][file].iconFmt[start] == GX_TF_RGB5A3) {
GXInitTexObj(&mFileCell[slot][file].icon, reinterpret_cast<u8*>(&icons[slot][file]) + icons[slot][file].iconOffset[start], CARD_ICON_WIDTH, CARD_ICON_HEIGHT, GX_TF_RGB5A3, GX_CLAMP, GX_CLAMP, GX_FALSE);
GXLoadTexObj(&mFileCell[slot][file].icon, GX_TEXMAP0);
} else if ((int)icon->iconFmt[start] == GX_TF_C8) {
GXInitTexObjCI(&mFileCell[slot][file].icon, reinterpret_cast<u8*>(icon) + icon->iconOffset[start], CARD_ICON_WIDTH, CARD_ICON_HEIGHT, GX_TF_C8, GX_CLAMP, GX_CLAMP, GX_FALSE, GX_TLUT0);
GXInitTlutObj(&mFileCell[slot][file].iconTlut, reinterpret_cast<u8*>(icon) + icons[slot][file].iconTlutOffset, GX_TL_RGB5A3, 0x100);
} else if ((int)icons[slot][file].iconFmt[start] == GX_TF_C8) {
GXInitTexObjCI(&mFileCell[slot][file].icon, reinterpret_cast<u8*>(&icons[slot][file]) + icons[slot][file].iconOffset[start], CARD_ICON_WIDTH, CARD_ICON_HEIGHT, GX_TF_C8, GX_CLAMP, GX_CLAMP, GX_FALSE, GX_TLUT0);
GXInitTlutObj(&mFileCell[slot][file].iconTlut, reinterpret_cast<u8*>(&icons[slot][file]) + icons[slot][file].iconTlutOffset, GX_TL_RGB5A3, 0x100);
GXLoadTlut(&mFileCell[slot][file].iconTlut, GX_TLUT0);
GXLoadTexObj(&mFileCell[slot][file].icon, GX_TEXMAP0);
} else {

View File

@@ -9,7 +9,7 @@ from pathlib import Path
EXPECTED_DOL_SHA1 = "26116613f624061ba99c8d1a299aaa6efa85670d"
EXPECTED_TOTAL_UNITS = 1027
EXPECTED_TOTAL_UNITS = 1028
EXPECTED_TOTAL_CODE = 2995176
EXPECTED_TOTAL_DATA = 1832684
EXPECTED_TOTAL_FUNCTIONS = 12563

View File

@@ -182,12 +182,10 @@ class WorkflowGuardTests(unittest.TestCase):
failures = check_report(report)
self.assertFalse(any("enc_dummy section .sbss" in failure for failure in failures))
@unittest.skipUnless(
(Path(__file__).resolve().parents[1] / "build/43U/report.json").is_file(),
"generated 43U report is not available",
)
def test_complete_report_schema_passes(self):
def complete_report(self):
report_path = Path(__file__).resolve().parents[1] / "build/43U/report.json"
if not report_path.is_file():
self.skipTest("generated 43U report is not available")
report = copy.deepcopy(json.loads(report_path.read_text(encoding="utf-8")))
def fill(measures):
@@ -230,7 +228,36 @@ class WorkflowGuardTests(unittest.TestCase):
function["fuzzy_match_percent"] = 100.0
for category in report["categories"]:
fill(category["measures"])
self.assertEqual(check_report(report), [])
return report
def test_complete_report_schema_passes(self):
self.assertEqual(check_report(self.complete_report()), [])
def test_missing_or_extra_unit_fails(self):
for total_units in (1027, 1029):
with self.subTest(total_units=total_units):
report = self.complete_report()
if total_units == 1027:
report["units"].pop()
else:
extra = copy.deepcopy(report["units"][-1])
extra["name"] += "/extra"
report["units"].append(extra)
failures = check_report(report)
self.assertIn(f"unit report length: {total_units}", failures)
self.assertIn(f"unit aggregate total_units: {total_units} != 1028", failures)
def test_wrong_unit_totals_fail(self):
for total_units in (1027, 1029):
with self.subTest(total_units=total_units):
report = self.complete_report()
delta = total_units - 1028
for field in ("total_units", "complete_units"):
report["measures"][field] = total_units
report["categories"][0]["measures"][field] += delta
failures = check_report(report)
self.assertIn(f"overall total_units: {total_units} != 1028", failures)
self.assertIn(f"category total_units: {total_units} != 1028", failures)
@unittest.skipUnless(
(Path(__file__).resolve().parents[1] / "build/43U/report.json").is_file(),