From 24633ebd7cc6866da3e3d06fddc6f0f49a741f1d Mon Sep 17 00:00:00 2001 From: MegaMech Date: Sat, 6 Apr 2024 15:36:03 -0600 Subject: Introduce Metadata and ItemCurve Factories (#27) * Introduce metadata * Metadata works now * Cleanup * Fixes * Cleanup 2 * yaml improvement * Comment update * Rename tables to metadata * Update * Fix warnings * Implement ItemCurve * Remove unused enum * Replace static with const * Fix bug * Add const * More fixes * Fix quote bug in IncludeFactory * Fix header in ItemCurve * Fixes * Fix texture factory * updates * Clearer debug info * Fixes * Working ci8 png * Fix size output * Fix * Add gitignore for modding * Fix precision for mtx * Remove header exporter from metadata * Remove hardcoded enum * Remove tabs * Remove tabs * tlut temp fix --------- Co-authored-by: = <=> --- src/factories/DisplayListFactory.cpp | 39 +++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'src/factories/DisplayListFactory.cpp') diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp index b5d71dd..965645e 100644 --- a/src/factories/DisplayListFactory.cpp +++ b/src/factories/DisplayListFactory.cpp @@ -313,32 +313,35 @@ std::optional> DListFactory::parse(std::vector()) == SEGMENT_NUMBER(w1)) { - std::optional segment; + std::optional segment; - if ((w0 >> 16) & G_DL_NO_PUSH) { - SPDLOG_INFO("Branch List Command Found"); - processing = false; - } + if ((w0 >> 16) & G_DL_NO_PUSH) { + SPDLOG_INFO("Branch List Command Found"); + processing = false; + } - YAML::Node gfx; - gfx["type"] = "GFX"; - gfx["offset"] = w1; - Companion::Instance->AddAsset(gfx); + YAML::Node gfx; + gfx["type"] = "GFX"; + gfx["offset"] = w1; + + Companion::Instance->AddAsset(gfx); + } } - // This opcode is generally used as part of multiple macros such as gsSPSetLights1. - // We need to process gsSPLight which is a subcommand inside G_MOVEMEM (0x03). + // This opcode is generally used as part of multiple macros such as gsSPSetLights1. + // We need to process gsSPLight which is a subcommand inside G_MOVEMEM (0x03). if(opcode == GBI(G_MOVEMEM)) { - // 0x03860000 or 0x03880000 subcommand will contain 0x86/0x88 for G_MV_L0 and G_MV_L1. Other subcommands also exist. - uint8_t subcommand = (w0 >> 16) & 0xFF; + // 0x03860000 or 0x03880000 subcommand will contain 0x86/0x88 for G_MV_L0 and G_MV_L1. Other subcommands also exist. + uint8_t subcommand = (w0 >> 16) & 0xFF; uint8_t index = 0; uint8_t offset = 0; bool light = false; switch (Companion::Instance->GetGBIVersion()) { - // If needing light generation on G_MV_L0 then we'll need to walk the DL ptr forward/backward to check for 0xBC - // Otherwise mk64 will break. + // If needing light generation on G_MV_L0 then we'll need to walk the DL ptr forward/backward to check for 0xBC + // Otherwise mk64 will break. // PD: Mega, this works for sm64 too, why you didn't implement it? >:( // PD: Im jk, <3 case GBIVersion::f3d: @@ -347,9 +350,9 @@ std::optional> DListFactory::parse(std::vector