diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2024-06-10 22:03:09 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-10 22:03:09 -0600 |
| commit | fe1ce26c02e615d6ecf2a761003ace76c6fdbd96 (patch) | |
| tree | a6d998a09a145198c45381fe3590fc5db4eb96c9 /src/factories/DisplayListFactory.cpp | |
| parent | 2929503ee3445e596e722c404f143e777e6498c9 (diff) | |
Add option to process DLs with indexes instead of offsets (#131)
* Update DisplayListFactory.cpp
* Update gbi-otr.h
* Update gbi-otr.h
* Update DisplayListFactory.cpp
* Update gbi-otr.h
* Update DisplayListFactory.cpp
* Update gbi-otr.h
* Update gbi-otr.h
* Update DisplayListFactory.cpp
* Update gbi-otr.h
* Update DisplayListFactory.cpp
Diffstat (limited to 'src/factories/DisplayListFactory.cpp')
| -rw-r--r-- | src/factories/DisplayListFactory.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp index dfc3fb8..5fc8902 100644 --- a/src/factories/DisplayListFactory.cpp +++ b/src/factories/DisplayListFactory.cpp @@ -296,9 +296,23 @@ ExportResult DListBinaryExporter::Export(std::ostream &write, std::shared_ptr<IP auto dec = Companion::Instance->GetNodeByAddr(ptr); auto branch = (w0 >> 16) & G_DL_NO_PUSH; - value = gsSPDisplayListOTRHash(ptr); - w0 = value.words.w0; - w1 = value.words.w1; + Gfx value; + if (node["otr_mode"]) { + auto str = node["otr_mode"].as<std::string>(); + // Too lower case + std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::tolower(c); }); + if (str == "index") { + value = gsSPDisplayListOTRIndex(w1); + } else { + value = gsSPDisplayListOTRHash(ptr); + } + w0 = value.words.w0; + w1 = value.words.w1; + } else { + value = gsSPDisplayListOTRHash(ptr); + w0 = value.words.w0; + w1 = value.words.w1; + } writer.Write(w0); writer.Write(w1); |
