diff --git a/data/dynos_bin_gfx.cpp b/data/dynos_bin_gfx.cpp index 7b2e997d7..07da2f1e5 100644 --- a/data/dynos_bin_gfx.cpp +++ b/data/dynos_bin_gfx.cpp @@ -23,6 +23,14 @@ s64 DynOS_Gfx_ParseGfxConstants(const String& _Arg, bool* found) { gfx_constant(NULL); gfx_constant(G_ON); gfx_constant(G_OFF); + gfx_constant(LIGHT_1); + gfx_constant(LIGHT_2); + gfx_constant(LIGHT_3); + gfx_constant(LIGHT_4); + gfx_constant(LIGHT_5); + gfx_constant(LIGHT_6); + gfx_constant(LIGHT_7); + gfx_constant(LIGHT_8); // Combine modes gfx_constant(G_CCMUX_COMBINED); @@ -1028,6 +1036,41 @@ static void ParseGfxSymbol(GfxData* aGfxData, DataNode* aNode, Gfx*& aHead, gDPSetTileSize(aHead++, G_TX_RENDERTILE, 0, 0, (((u64)_Arg2) - 1) << G_TEXTURE_IMAGE_FRAC, (((u64)_Arg3) - 1) << G_TEXTURE_IMAGE_FRAC); return; } + if (_Symbol == "gsSPLightColor") { + s64 _Arg0 = ParseGfxSymbolArg(aGfxData, aNode, &aTokenIndex, ""); + s64 _Arg1 = ParseGfxSymbolArg(aGfxData, aNode, &aTokenIndex, ""); + // due to the function taking in the variable name instead of the actual value + // as a parameter, we need to do this. LIGHT_1 to LIGHT_8 go from actual 1-8 + // where as G_MWO_a*/G_MWO_b* are hex numbers without a linear pattern of + // progression, meaning there isn't a simple one line solution for this afaik + switch(_Arg0) { + case LIGHT_1: + gSPLightColor(aHead++, LIGHT_1, _Arg1); + break; + case LIGHT_2: + gSPLightColor(aHead++, LIGHT_2, _Arg1); + break; + case LIGHT_3: + gSPLightColor(aHead++, LIGHT_3, _Arg1); + break; + case LIGHT_4: + gSPLightColor(aHead++, LIGHT_4, _Arg1); + break; + case LIGHT_5: + gSPLightColor(aHead++, LIGHT_5, _Arg1); + break; + case LIGHT_6: + gSPLightColor(aHead++, LIGHT_6, _Arg1); + break; + case LIGHT_7: + gSPLightColor(aHead++, LIGHT_7, _Arg1); + break; + case LIGHT_8: + gSPLightColor(aHead++, LIGHT_8, _Arg1); + break; + } + return; + } // Unknown PrintDataError(" ERROR: Unknown gfx symbol: %s", _Symbol.begin()); diff --git a/include/gfx_symbols.h b/include/gfx_symbols.h index caca581ae..aca8c1e7a 100644 --- a/include/gfx_symbols.h +++ b/include/gfx_symbols.h @@ -25,22 +25,20 @@ define_gfx_symbol(gsDPSetFogColor, 4); \ define_gfx_symbol(gsSPFogPosition, 2, false); \ define_gfx_symbol(gsDPSetAlphaCompare, 1, false); \ define_gfx_symbol(gsDPSetTextureFilter, 1, false); \ +define_gfx_symbol(gsDPSetTexturePersp, 1, false); \ +define_gfx_symbol(gsDPSetTextureLOD, 1, false); \ +define_gfx_symbol(gsDPSetTextureConvert, 1, false); \ define_gfx_symbol(gsSPCullDisplayList, 2, false); \ define_gfx_symbol(gsDPSetAlphaDither, 1, false); \ define_gfx_symbol(gsDPSetCombineKey, 1, false); \ -define_gfx_symbol(gsDPSetTextureConvert, 1, false); \ -define_gfx_symbol(gsDPSetCombineKey, 1, false); \ -define_gfx_symbol(gsDPSetTextureConvert, 1, false); \ define_gfx_symbol(gsDPPipelineMode, 1, false); \ define_gfx_symbol(gsSPSetOtherMode, 4); \ define_gfx_symbol(gsDPSetTextureDetail, 1, false); \ define_gfx_symbol(gsDPSetColorDither, 1, false); \ define_gfx_symbol(gsDPSetPrimDepth, 2, false); \ define_gfx_symbol(gsDPSetBlendColor, 4); \ - \ define_gfx_symbol(gsSPCopyLightEXT, 2, false); \ define_gfx_symbol(gsSPCopyLightsPlayerPart, 1, false); \ define_gfx_symbol(gsSPFogFactor, 2, false); \ -define_gfx_symbol(gsDPSetTextureLOD, 1, false); \ define_gfx_symbol(gsMoveWd, 3, false); \ define_gfx_symbol(gsSPVertexNonGlobal, 3, true);