From 6182c0aedd28dc8f335c98c0ce9acd795a0fb90c Mon Sep 17 00:00:00 2001 From: inspectredc <78732756+inspectredc@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:08:26 +0100 Subject: [PATCH] Fix Branching DisplayLists (#18) Co-authored by: Nicholas Estelami --- OTRExporter/DisplayListExporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OTRExporter/DisplayListExporter.cpp b/OTRExporter/DisplayListExporter.cpp index fc06e3d..b309fd0 100644 --- a/OTRExporter/DisplayListExporter.cpp +++ b/OTRExporter/DisplayListExporter.cpp @@ -344,7 +344,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina uint32_t z = (data & 0x00000000FFFFFFFF) >> 0; uint32_t h = (data & 0xFFFFFFFF); - auto data2 = dList->instructions[dataIdx - 1]; + auto data2 = dList->instructions[dataIdx + 1]; uint32_t dListPtr = GETSEGOFFSET(data2); Declaration* dListDecl = dList->parent->GetDeclaration(dListPtr); @@ -445,7 +445,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina if ((int)opF3D == G_BRANCH_Z) { - auto data2 = dList->instructions[dataIdx - 1]; + auto data2 = dList->instructions[dataIdx + 1]; dListPtr = GETSEGOFFSET(data2); } else