From 0766801142a25efcad59e98b77bca43b1c02bae0 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 28 Mar 2025 10:23:57 +0100 Subject: [PATCH] Link AnalizeDL with a fakematch (?) --- configure.py | 2 +- src/egg/gfx/eggAnalizeDL.cpp | 22 ++++++++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/configure.py b/configure.py index 2f70eac1..c8b73a79 100644 --- a/configure.py +++ b/configure.py @@ -868,7 +868,7 @@ config.libs = [ Object(Matching, "egg/gfx/eggCamera.cpp"), Object(Matching, "egg/gfx/eggPalette.cpp"), Object(Matching, "egg/gfx/eggTexture.cpp"), - Object(NonMatching, "egg/gfx/eggAnalizeDL.cpp"), + Object(Matching, "egg/gfx/eggAnalizeDL.cpp"), Object(Matching, "egg/gfx/eggCapTexture.cpp"), Object(NonMatching, "egg/gfx/eggCpuTexture.cpp"), Object(NonMatching, "egg/gfx/eggDrawGX.cpp"), diff --git a/src/egg/gfx/eggAnalizeDL.cpp b/src/egg/gfx/eggAnalizeDL.cpp index 018897fe..e8febe68 100644 --- a/src/egg/gfx/eggAnalizeDL.cpp +++ b/src/egg/gfx/eggAnalizeDL.cpp @@ -149,22 +149,18 @@ static const s8 sArr1[] = {0, -1, 1, 2}; static const u8 sArr2[] = {1, 1, 2, 2, 4, 0}; void AnalizeDL::init() { - // TODO - int k = 0; - const u8 *pArr2 = sArr2; - const s8 *pArr1 = sArr1; - - for (int i = 0; mVtxDescList[i].attr != GX_VA_NULL; i++) { - int x = pArr1[mVtxDescList[i].type]; - pArr1++; + for (int k = 0, i = 0; mVtxDescList[i].attr != GX_VA_NULL; k++, i++) { + // Likely a fakematch + int x = sArr1[mVtxDescList[i++, --i].type]; if (x == -1) { if (k >= 0 && k <= 8) { x = 1; + } else { + int j = -1; + while (k != mAttrFmtList[++j].attr) {} + + x = sArr2[mAttrFmtList[j].compType]; } - } else { - int j = 1; - for (; k != mAttrFmtList[j].attr; j++) {} - x = pArr2[mAttrFmtList[j - 1].compType]; } if (k == 9) { @@ -175,8 +171,6 @@ void AnalizeDL::init() { if (x != 0) { field_0x010 |= (1 << k); } - - k++; } }